text
stringlengths
1
2.56M
id
stringlengths
40
40
metadata
dict
\section{Introduction} In speech communication people make use of two types of information to convey their intentions: \textit{what} is said (linguistic information) and \textit{how} it is said (paralinguistic information) \cite{mitra2019leveraging}. Paralinguistic information is expressed by suprasegmental features such as duration, intensity and pitch. Even with the same linguistic information, changes in these prosodic features can communicate different implications. One such implication involves emphasis. As the terminology can be ambiguous, we follow Kohler's \cite{kohler2006emphasis} distinctions of two kinds of emphasis: \textit{emphasis for focus}; which `singles out elements of discourse by making them more salient than others'; and \textit{emphasis for intensity}; which `intensifies the meaning contained in the elements.' The current work addresses the first category of emphasis: focus. In the literature of a semantic framework called Alternative Semantics \cite{rooth1985association, rooth1992theory}, focus is understood as the indication of `the presence of alternatives that are relevant for the interpretation of linguistic expressions' \cite{krifka2008basic}. Consider this example: \begin{enumerate}[label=(\arabic*)] \item \begin{enumerate}[label=\alph*.] \item \label{emotive_a} \textbf{John} bought the apple. \item \label{emotive_b} John \textbf{bought} the apple. \end{enumerate} \end{enumerate} \noindent In (1a), \textit{John} is focused, as indicated by bold typeface. The speaker implies that \textit{It was John who bought the apple}, indicating the presence of contextually possible alternatives such as \textit{Peter} or \textit{Mary}, and at the same time indirectly ruling out these agents for the person who \textit{bought the apple}. In contrast, in (1b), focus falls on \textit{bought}, by which the speaker indicates that \textit{What John did was not sell the apple, but buy the apple}. Although (1a) and (1b) give identical linguistic information, the differences in the focused words create different connotations. In English speech, focus is marked by sentence stress, the most prominent stress within a sentence \cite{wells2006english}. To avoid misunderstanding, interlocutors must correctly perceive the placement of sentence stress and understand the associated focused meaning. While this inherent skill is taken for granted among native English speakers, non-natives find it challenging \cite{derwing2012longitudinal}. Therefore, cross-lingual interactions demand an automated system that can output the implied meaning for non-natives. \\ \indent The idea of speech translation (ST), which automatically translates speech in a source language (SL) to text or speech in a target language (TL), might be helpful toward achieving such cross-lingual communication. In recent years, ST systems have made significant progress in translating linguistic information correctly. However, most of the ST systems developed so far have not attained the capability to consider paralinguistic information, including focus. Translation by these systems is based on the transcription produced by automatic speech recognition (ASR), which is designed to transcribe only the contents of an utterance, resulting in the loss of paralinguistic information. The current ST models translate (1a) and (1b) the same way, even though they convey different implications. Recently, however, as the importance of paralinguistic information has become more widely acknowledged, some studies have tackled the translation of paralinguistic information such as voice quality \cite{jia2019direct}, emotions \cite{aguero2006prosody, akagi2014emotional} and emphasis \cite{aguero2006prosody, kano2012method, kano2013generalizing, anumanchipalli2012intent, tsiartas2013toward, do2016transferring, do2016preserving, do2018sequence} by mapping the prosodic cues in the SL, such as intensity, duration and fundamental frequency, to speech in the TL. \begin{figure*} \centering \includegraphics[width=0.75\textwidth]{images/proposed_method.png} \caption{Example of focus translation through paraphrased text. Before translating, within the SL, focus expressed by prosodic device in the original speech is transformed into that expressed with lexical and grammatical devices in text.} \label{fig: proposed_method} \end{figure*} While such efforts have advanced the research on translation of paralinguistic cues, it cannot be assumed that the TL necessarily has a prosodic counterpart that plays the same role as that in the SL. For instance, for information focusing, languages make use of not only prosodic devices but also lexical and grammatical devices \cite{cruttenden1997intonation}. Although English speech often uses sentence stress rather than linguistic devices for focus \cite{cruttenden1997intonation}, the degree of reliance on such methods vary from language to language \cite{cruttenden1997intonation, downing2006prosody, hartmann2008focus}. This observation partially limits the efforts of an acoustic-to-acoustic way of paralinguistic translation. Instead, we argue the potential of the acoustic-to-linguistic mapping of paralinguistic information by paraphrasing the speech into the linguistic domain within the SL, with the help of lexical and grammatical devices, and then passing the paraphrases on to the translation module (Figure \ref{fig: proposed_method}). Such a method could return different translations depending on the focused items, even with the same linguistic information. The achievement of acoustic-to-linguistic focus transformation requires data for training such a model. However, to the best of our knowledge, no existing English corpus contains pairs of: speech having different items in focus; and text reflecting the relevant implications. In the most related work, an English corpus \cite{do2018toward} was built with text items that differ in the degree of \textit{emphasis for intensity}, e.g. (\textit{It is a little bit hot} / \textit{It is extremely hot}), and the corresponding speech, e.g. (\textit{It is \textbf{hot}} / \textit{It is \textbf{HOT}}) which was recorded so that it would represent the same degree of emphasis as that in the text. Since their focus was on the degree of emphasis such as weak/strong, every speech sample fixed its position of focus on an adjective. The data was later used for building a model of speech-to-text emphasis translation \cite{tokuyama2021transcribing}. A recent work in text-to-speech (TTS) \cite{latif2021controlling} added the elements of \textit{emphasis for focus} to the previous efforts. Speech items which differed in the placement of focus were collected, e.g. (\textit{\textbf{Sarah} closed the door}, \textit{Sarah \textbf{closed} the door}). However, since the purpose of the work was to achieve prosodic prominence in a TTS model from annotated text, the data did not involve the corresponding implications of speech. Also, while words in a closed-class, e.g. \textit{the, is}, can be focused \cite{greenbaum1990student}, such cases remain to be addressed. \\ \indent We also argue the importance of understanding the relationships of focus representations in speech and text, i.e. how focus expressed in speech is paraphrased or transformed into the linguistic domain. In the literature, some studies addressed patterns of general paraphrase alternations, i.e. how an original text item is paraphrased into another one which has approximately the same meanings \cite{boonthum2004istart, dolan2004unsupervised, vila2014paraphrase}, and others examined how linguistic items can convey focus \cite{taglicht1984message, rooth1985association}. However, it has not been clear the methods of mapping focus from the paralinguistic dimension to the linguistic one. To these ends, we present the creation of an English corpus containing speech that differs in the placement of focus, where words in a closed-class are also the targets of focus, and text reflecting the relevant implications. We also perform quantitative and qualitative analyses of the transformation of focus from the paralinguistic domain to the linguistic domain. \subsection{Focus in English} This section briefly summarises how the English language employs prosodic and linguistic devices to convey focus. \subsubsection{Prosodic device} As mentioned in the previous section, English speech uses sentence stress to convey focus. Native English speakers highlight certain information and draw a listener's attention using the following procedure \cite{wells2006english}. Depending on the intention, they first break spoken materials into smaller chunks called intonation phrases (IPs). Then, in each IP they select the most important word and put sentence stress on that word's stressed syllable, i.e. syllable that has lexical stress. \subsubsection{Lexical and grammatical devices} Prosody is not the only device to convey focus. Lexical and grammatical devices are also available \cite{cruttenden1997intonation}. As one type of the lexical devices, a group of words called focus particles can convey focus \cite{konig2002meaning}. For instance, \textit{only}, \textit{even}, and \textit{alone} can serve this purpose \cite{rooth1985association}. Consider the following example: \begin{enumerate}[label=(\arabic*)]\addtocounter{enumi}{1} \item \begin{enumerate}[label=\alph*: ] \item \label{lexical_a} John bought an apple. \item \label{lexical_b} John bought only an \underline{apple}. \end{enumerate} \end{enumerate} \noindent Compared to (2a), (2b) explicitly states what \textit{John bought} was neither \textit{an orange} nor \textit{a banana}, resulting in \textit{an apple} being highlighted, as indicated by the underline. Similarly, \textit{let alone} \cite{fillmore1988regularity}, reflexive pronouns such as \textit{himself}/\textit{herself} \cite{konig2006focused}, \textit{particularly, mainly}, and many more such words \cite{konig2002meaning} can be used as lexical items for focus. \\ \indent A grammatical device can also perform focus by changing the structure of a sentence. Grammatical items include constructions of cleft (\textit{It was \underline{Simon} who kicked the door.}), pseudo-cleft (\textit{What Mary bought was an \underline{apple}}), inversion (\textit{And then appears a \underline{bear}}), and passivization (\textit{I was bit by a \underline{dog}}) \cite{greenbaum1990student}. It should be noted that grammatical reconstructions often involve shifting the target of focus toward the end of the sentence, since English information structure is governed mainly by the principles \textit{Given-Before-New} and \textit{End Weight} \cite{aarts2011oxford}. \section{Corpus construction} \begin{figure*}[t] \centering \includegraphics[width=0.90\textwidth]{images/corpus_design_revised_20220927.png} \caption{Corpus Design} \label{fig:overview} \end{figure*} \subsection{Text design} We started the text construction from Flickr8k \cite{rashtchian2010collecting}, which consists of over 8000 images that depict actions relating to people or animals. Five text descriptions are given for each image, with over 40,000 annotations. To select optimal captions, we removed sentences that fell under one of the following conditions: including punctuation other than a period; corrected by GECToR \cite{omelianchuk2020gector}, a grammatical error correction model; a noun phrase; more than six words; identical to another caption. We left only one caption if an image had multiple captions. Regarding the sentence length, for simplicity, we wanted each speech to have only one sentence stress, meaning that an entire sentence is treated as a single IP. To determine an optimal sentence length for a single IP, we examined the London-Lund corpus of spoken English \cite{svartvik1990london}, which consists of half a million words and prosodic transcriptions, including tone units, or IPs. We calculated word length for each IP, and chose 6, which equaled the third quartile in the corpus, as the maximum sentence length. After the filtering, we had 1375 sentences and selected the first 196 captions as the source sentences for our corpus. The text items included \textit{A biker enjoys a coffee}, for instance (Figure \ref{fig:overview}). \subsection{Speech collection} We employed Amazon's Mechanical Turk (MTurk) for data collection, a crowdsourcing platform allowing researchers to create tasks called HITs (Human Intelligence Task) and anonymous users (Workers) to complete them for a small monetary fee. \subsubsection{Recording application} MTurk does not provide an interface for audio collection, so we created a web-based recording application that could capture a user's recordings interactively and store them in a back-end server. To encourage subjects to speak properly, we enabled Google speech-to-text API so that the system could give the instant feedback `Speak Clearly' if it did not recognise incoming speech as English words. Speakers could use basic functions such as start and stop of the recordings, and re-recording. As an additional feature, for each utterance, we recorded an extra two seconds at the end while the speech evaluation was in progress; this was done to capture the environment's sound, and during this time, users were instructed to remain silent. \subsubsection{Recording procedure} We attempted to collect a set of speech samples, each with different placement of focus, for each caption using three different speakers (Figure \ref{fig:overview}). For future use, normal readings without focus was also collected from the same speakers. We asked Workers located in the UK to participate in the tasks. In the recording HITs, Workers were instructed as follows: Look at the displayed written sentence, e.g. (\textit{Two \underline{men} are ice fishing}); Make a recording emphasising the underlined word if it does not sound unnatural, otherwise, skip this recording; If there is no underlined word, e.g. (\textit{Two men are ice fishing}), read the sentence in a normal way. \\ \indent When using a crowdsourcing service, taking measures to ensure the quality of data is crucial \cite{rashtchian2010collecting, kennedy2020shape}. We prepared a qualification test, in which Workers needed to fill out general information such as age, gender and accent after an agreement. Then they conducted the step described above for three captions. After manually checking the results, we allowed those who made recordings as instructed to proceed to the main recording HITs. The collection resulted in 3423 speech items (normal: 588, emphasised: 2835) by 9 British natives (4 male, 5 female, age range 22--60 years with a median of 37 years). We paid Workers \$1.20 for processing two captions, and \$2 for three, resulting in \$30.9 per hour on average, surpassing \$15, which is considered to be fair among Workers in MTurk \cite{whiting2019fair}. \subsection{Paraphrase collection} \begin{figure}[h] \centering \includegraphics[width=0.71\linewidth]{images/paraphrase_instructions.png} \caption{Instructions for paraphrase collection} \label{fig:paraphrase_instruction} \end{figure} Free-form tasks, including the paraphrase collection, need to make sure that participants are native speakers \cite{rashtchian2010collecting}. To select native English speakers, we published tasks for Workers residing in an English speaking country (US, CA, UK, AU, NZ) and asked them what their first language was. 600 Workers participated in the task; 550 answered English as their first language. We regarded the 550 Workers as native English speakers, and divide them in half into two groups: G1 and G2.\\ \indent Figure \ref{fig:paraphrase_instruction} shows a screenshot of the main instructions given for the paraphrase HITs. Workers were asked to listen to a set of focused speech samples for one caption, where each speech item was randomly selected from available recordings (Figure \ref{fig:overview}), and then told to come up with a written sentence for that speech item which clearly conveyed the implied meaning in the emphasised speech. We encouraged Workers to freely make changes in grammar and vocabulary but not to use capitalisation, an exclamation mark, or the addition of their own inferences or text providing situational context. We prepared a qualification test for the native speakers in G1, in which they needed to make a brief summary of the instructions in their own words as well as complete the paraphrasing tasks. After manually checking the results, we allowed those who completed the task as instructed to start the main paraphrase HITs. Two workers performed each HIT, obtaining two paraphrases for each emphasised speech sample. We paid \$0.15 for each paraphrasing, resulting in \$16.5 per hour on average. We obtained 2130 paraphrases from 16 Workers. \subsection{Filtering paraphrases} The quality of the paraphrases produced by the Workers will influence future research using the corpus. To evaluate the quality, we set subjective evaluation HITs. Workers were presented with emphasised speech and a paraphrase and asked to evaluate its quality from two perspectives on a scale from one to five: (A) how accurately the paraphrase conveyed the implied meaning in speech; (B) how well-formatted the paraphrase sentence is. We set a qualification task for the native speakers in G2 in the same way as the paraphrase collection and asked those who passed to join the main evaluation HITs (16 Workers). Three different Workers evaluated each paraphrase. We calculated median values for both perspectives (Figure \ref{fig:overview}), and samples with a value of 3 or less for perspective (A) and 2 or less for (B) were discarded. We collected the paraphrases again for those removed samples, and repeated the same procedure of evaluation and removing as above. We paid \$0.10 for evaluating each paraphrase, resulting in \$25.0 per hour on average. After the evaluation in MTurk, we filtered out paraphrases which fell one of the following conditions: paraphrases with relatively high variance of the accuracy evaluation scores ($\sigma^2$ $>$ 1.6), e.g. scores: 2, 5, 5); The tense changed from present to past, e.g. (\textit{The men are climbing.} / \textit{The men were climbing on something.}) After the filtering, we had 1697 paraphrases. Table \ref{tab:corpus_example} shows an example of speech and paraphrase pairs. \begin{table}[h] \caption{Example speech-paraphrase pairs in the corpus} \scriptsize \centering \begin{tabular}{c|c} Focused speech & Paraphrase \\ \hline \textbf{A} biker enjoys a coffee & One biker enjoys a coffee \\ \textbf{A} biker enjoys a coffee & There is one biker enjoying a coffee \\ A \textbf{biker} enjoys a coffee & It's a biker enjoying a coffee \\ A \textbf{biker} enjoys a coffee & The person enjoying a coffee is a biker \\ A biker \textbf{enjoys} a coffee & A biker drinking a coffee is enjoying it \\ A biker \textbf{enjoys} a coffee & The biker seems to enjoy a coffee \\ A biker enjoys \textbf{a} coffee & A biker enjoys one coffee \\ A biker enjoys \textbf{a} coffee & A biker has one coffee he enjoys \\ A biker enjoys a \textbf{coffee} & What the biker enjoys is a coffee \\ A biker enjoys a \textbf{coffee} & It is coffee the biker enjoys \\ \end{tabular} \label{tab:corpus_example} \end{table} \section{Analysis} To explore how focus in speech was mapped into the linguistic domain, we hand-examined the samples of speech-paraphrase pairs and made broad categorisations of the transformation patterns as follows; from lexical and grammatical perspectives (the patterns do not cover all the transformation methods). \begin{itemize}[leftmargin=*] \item Lexical transformations \begin{itemize}[leftmargin=15pt] \item \label{substitution} \textbf{Substitution}:~substitute the focused word with its synonyms, e.g. (\textit{\textbf{dog}} / \textit{canine}), (\textit{\textbf{on}} / \textit{on top of}). \item \label{modification} \textbf{Modification}:~modify the focused word or its phrase with modifiers such as adverbs or a clause, e.g. (\textit{\textbf{play}} / \textit{play actively}), (\textit{\textbf{is}} / \textit{is indeed}). \item \label{negation} \textbf{Negation}:~explicitly state an alternative of the focused word and negate it (\textit{A \textbf{man}} / \textit{A man, not a woman}). \end{itemize} \item Grammatical transformations \begin{itemize}[leftmargin=12pt] \item \label{leftward} \textbf{Leftward shift}:~move the focused word towards the beginning of the sentence. Grammatical constructions such as cleft, reversed-pseudo-cleft and inversion were used, e.g. (\textit{\textbf{People} sit .. } / \textit{It's people who sit ..}), (\textit{.. play \textbf{baseball}} / \textit{baseball is what .. play}). \item \label{rightward} \textbf{Rightward shift}:~move the focused word towards the end of the sentence. Grammatical constructions such as pseudo-cleft, inversion and other methods were used, e.g. (\textit{Children \textbf{play} ..} / \textit{what children do .. is play}), (\textit{ .. is \textbf{rock} climbing} / \textit{.. is climbing a rock} \item \textbf{Tense change}:~change the tense from simple to progressive or vice versa, e.g. (\textit{\textbf{is} walking} / \textit{walks}). \end{itemize} \end{itemize} Furthermore, we observed that a certain part-of-speech is more likely to use a certain transformation method. To quantify this tendency, following a method taken for analysis of paraphrase alternations \cite{dolan2004unsupervised}, we randomly sampled 50 paraphrases for each part-of-speech if it had more than 50 occurrences in the corpus and compared the frequency of each transformation method. We counted each phenomenon for each sentence. We restricted the counting only if the focused word or the phrase of the focused word undergoes transformations listed above. Consider this example: (\textit{a dog trots through \textbf{the} grass} / \textit{\underline{the only grassy area} is what a dog trots through}). In this case, not only the focused word \textit{the}, but also the noun phrase it involved, indicated by underline, was under investigation; \textit{only} was inserted (modification), and \textit{grass} was replaced with \textit{grassy area} (substitution). As a grammatical method, reversed-pseudo-cleft (leftward shift) was used. Table \ref{tab: phenometa} shows the average number of occurrences of each transformation in each focused part-of-speech. The pattern of the tense change was counted only when the focused word was verbs or auxiliary verbs. \begin{table}[h]\centering \caption{Mean occurrences of each transformation method per part-of-speech (N: Noun, V: Verb, Adj: Adjective, Num: Numeral, Aux: Auxiliary, P: Preposition, Det: Determiner)}\label{tab: phenometa} \tiny \begin{tabular}{llccccccc} \toprule &&N &V & Adj &Num & Aux & P & Det \\ \midrule \multirow{3}{*}{Lexical}&Substitution &0.28 & 0.12 & 0.10 & 0.18 & 0.08 & 0.42 & 0.72 \\ &Modification &0.00 & 0.02 & 0.12 & 0.06 & 0.60 & 0.18 & 0.50\\ &Negation &0.10 & 0.06 & 0.06 & 0.12 & 0.10 & 0.12 & 0.00 \\ \midrule \multirow{3}{*}{Grammatical}&Leftward &0.10 & 0.20 & 0.04 & 0.08 & 0.00 & 0.10 & 0.00 \\ &Rightward &0.46 & 0.44 & 0.70 & 0.52 & 0.08 & 0.26 & 0.02\\ &Tense &-& 0.28 & -&-&0.20 & -& - \\ \bottomrule \end{tabular} \label{tab:phenomena} \end{table} \section{Discussion and conclusion} This study set out to create a corpus containing focused speech, where each speech item differs in the placement of focus, and the corresponding text which paraphrases the speech together with its paralinguistically expressed implications. Through our data analysis, we show that the transformation of focus information from the paralinguistic domain to the linguistic domain makes use of a variety of lexical and grammatical devices, and reliance on these methods vary depending on the syntactic category of the focused word. Many of the transformation methods observed in data were the types that have been reported as such devices in the literature, e.g. cleft-constructions in the leftward shift and pseudo-clefting in the leftward shift and negation, which serves the exact purpose of focus defined earlier; indicating the presence of alternatives. On the other hand, we also found some interesting methods such as lexical substitution, e.g. (\textit{\textbf{man}} / \textit{male adult}). \\ \indent One of the limitations of the current study is lack of context; \textit{Why do I/they emphasise this word?} In regular paraphrasing tasks, paraphrases and their evaluations can vary depending on context \cite{barzilay2001extracting}. The importance of context would also be the case for the collection of focused speech and the corresponding text. In future work, we will consider presenting contextual information when collecting recordings and paraphrases. \\ \indent Despite the limitations, the current work added a new direction toward further improvement of paralinguistic translation; we demonstrated the possibility of mapping paralinguistic information into the linguistic domain. The corpus and insights from our analysis will lead us to construct a ST model which uses the paraphrased text to preserve paralinguistic information. \section{Acknowledgement} Part of this work is supported by JSPS KAKENHI Grant Number JP21H05054. \bibliographystyle{IEEEtran}
31aa3ef21366dcaadcb5aa0798634eb5b6d7cefc
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Automatic speech recognition (ASR) is the task of converting speech audio into its text transcripts. Early methodologies trained linguistic, acoustic, and lexicon modules separately \cite{intro1, intro2}; however, up until a decade ago, neural networks showed an improvement of performance while also being significantly easier to train, with all of the modules trained altogether in an end-to-end fashion \cite{e2e_asr1, e2e_asr2}. With the recent successful use of end-to-end models in ASR, many of these have become commercially available as products, bringing in many benefits and conveniences to humans by enabling the control of several devices through speech. With such conveniences, ASR has the potential to benefit many people; however, disabled patients, who would benefit the most from these devices, are hindered from using these owing to their loss of control of their speech organs \cite{pathological_speech}. One common speech pathology is dysarthria, which makes them speak at a slower rate and with a slurred characteristic. Another speech pathology could be due to laryngectomy, which is the replacement of the larynx with an electro-larynx to recreate its function, but results in robotic-like speech production. In both of these speech pathologies, communication becomes difficult, which causes the produced speech to be misunderstood by most commercial ASR devices \cite{inclusive_asr}. Knowing the benefits of ASR, much more research to make ASR accessible to speakers with speech pathologies should be carried out. Unfortunately, only having a small number of publicly available datasets, coupled with the huge data requirements to train networks, have made this a difficult task. One mainstream method to resolve minimally resourced ASR is by pretraining, which is training the network on a large dataset of healthy speech before fine-tuning on limited pathological speech datasets. Investigations such as those in \cite{google1} show drastic improvements in performance through a pretraining framework using a Recurrent Neural Network Transducer (RNN-T) pretrained on 1,000 hours of healthy speech data, even with only less than an hour of pathological speech in the fine-tuning stage. Building on this study, increasing pretraining data to roughly 162,000 hours in \cite{google2, google3} makes personalized RNN-T models become capable of outperforming human listeners on speech with low intelligibility rates and allow 90\% of speakers to reach 15\% word error rate even with only using less than 250 utterances in fine-tuning. In the aforementioned investigations, using a good pretraining strategy and more data proves that the network can adapt to the pathological speech features easily even when only fine-tuned on a small number of data. However, one limitation in the previously mentioned works is that the model is pretrained in a supervised fashion, which heavily relies on having a dataset that provides both the speech audio and its corresponding text labels to succeed. Although many speech data has been made publicly available, large-scale data labeling is still a very tedious task, making it not a sustainable pretraining method for use in the future. In this paper, we investigate a novel pretraining method called self-supervised learning, which provides flexibility in the training requirements by removing the need for labeled data to train the network. The general idea of this method is to make the model learn a universal representation of the data using joint embedding objective functions \cite{joint-emb, joint-emb2} to compare embedding representations of the data. For speech in particular, several frameworks have been proposed \cite{yang2021superb} such as generative modeling \cite{generative}, discriminative/contrastive modeling \cite{w2v-2,w2v-xlsr,wavlm}, and multitask learning \cite{multitask}. Research in \cite{analysis_dysasr} has shown contrastive-learning-based SSL pretraining capable of outperforming supervised pretraining on dysarthric speech; however, the research could still be further extended by using more SSL frameworks, while also using other supervised pretraining setups as baseline. We contribute the following points in this investigation: \begin{itemize} \item We investigate two self-supervised learning pretraining frameworks (contrastive and masked region prediction) for pathological speech recognition and compare them with supervised pretraining. \item We analyze two types of pathological speech, namely, electrolaryngeal and dysarthric. \item We show that although SSL pretraining has been successful on minimally resourced healthy speech, extensive experiments show that this is not exactly the case for pathological speech. \end{itemize} \begin{figure*}[t!] \centering \includegraphics[width=15cm]{img/ssl_archi2.png} \caption{Overview of SSL training. The SSL models wav2vec 2.0 \cite{w2v-2} (left) and WavLM \cite{wavlm} (middle) are first pretrained by a contrastive or masked region prediction framework. The SSL model is then fine-tuned by supervised training, treated similarly to an end-to-end model (right).} \label{fig:architecture} \end{figure*} \section{Using self-supervised learning pretraining frameworks for ASR} With the successful use of previous pretraining methods, we explore the effectiveness of a new pretraining framework called self-supervised learning (SSL). In this section, we present how SSL models learn speech representations and how they can be used for ASR tasks. An overview of using SSL models, which is divided into pretraining and fine-tuning stages, is shown in Figure~\ref{fig:architecture}. \subsection{Pretraining SSL models to learn speech representations} We investigate two self-supervised pretraining frameworks that are similar to the one used in \cite{analysis_dysasr}: contrastive loss \cite{w2v-2} and masked region prediction \cite{wavlm}. The first framework is wav2vec 2.0 \cite{w2v-2}, one of the most widely used SSL frameworks in speech data based on contrastive loss and proven to be successfully used in different minimally resourced speech recognition tasks \cite{ssl_ind, ssl_l2}. This framework uses a multilayer convolutional neural network (CNN) to encode speech into a latent space $z_{1:j}$ (Eq. \ref{cnn}). The latent space representations are then quantized as $q_{1:j}$ (Eq. \ref{quantizer}) and randomly masked before being passed onto the multihead self-attention layers of the Transformer encoder backbone (Eq. \ref{tf}). The model is optimized using a contrastive loss function by identifying a $q$ from $q_{1:j}$ among a set of distractors $q'$ given the masked context representation vector $h_{1:j}$ from the Transformer encoder. \begin{equation} z_{1:j} = \operatorname{CNN}(x_{1:i}) \label{cnn} \end{equation} \begin{equation} q_{1:j} = \operatorname{quantization}(z_{1:j}) \label{quantizer} \end{equation} \begin{equation} h_{1:j} = \operatorname{Transformer}(\operatorname{masking}(z_{1:j})) \label{tf} \end{equation} Next, we investigate a new SSL framework called WavLM \cite{wavlm} that instead uses masked region prediction to learn speech representations. WavLM does this through a denoising and prediction framework, mixing utterances by adding interfering speech and noise to the input speech, and making the model predict the original clean speech. Its architecture is similar to that of wav2vec 2.0, where the noisy input speech is passed onto a set of CNN layers to make $z_{1:j}$ and randomly masked before passing it onto the Transformer network, which then predicts the pseudo-labels of the masked regions $h_{1:j}$. The target pseudo-labels $k_{1:j}$ are generated by performing two iterations of k-means clustering: one on the MFCC of the original clean speech $x_{1:i}$ (Eq. \ref{kmeans1}) and another on the latent representations $z_{1:j}$ (Eq. \ref{kmeans2}). Moreover, a gated relative position bias is added to the Transformer backbone to better capture the sequence ordering of the noisy input speech. Training the model through this denoising framework proves to make the model robust to acoustic variations in the speech. \begin{equation} k_{1:j} = \operatorname{k-means}(\operatorname{MFCC}(x_{1:i})) \label{kmeans1} \end{equation} \begin{equation} k_{1:j} = \operatorname{k-means}(z_{1:j}) \label{kmeans2} \end{equation} \subsection{Fine-tuning SSL models for ASR tasks} After learning the speech representations, the SSL model is then fine-tuned to predict the text tokens by attaching a decoder, making it similar to a regular end-to-end framework, as seen in the rightmost portion of Figure ~\ref{fig:architecture}. Given an input speech sequence of \(x_{1:i}\), the SSL model maps these into a hidden latent space as \(h_{1:j}\) and is decoded into the text \(y_{1:k}\). Another encoder can also be optionally added after the SSL model to further preprocess \(h_{1:j}\) into \(h'_{1:j}\). Frameworks such as the Connectionist Temporal Classification (CTC) \cite{ctc} decode \(h_{1:j}\) by predicting a text token for each frame. Other popular frameworks predict the text using attention (ATTN) with decoders such as the Recurrent Neural Network \cite{las} or the Transformer \cite{transformer}. Combining CTC and attention (CTC-A) \cite{ctc-attn, ctc-attn2} through a weighted sum has also proven to be effective to decode the text. \section{Pretraining implementation of pathological speech recognition} In the following subsections, we describe how we implement the pretraining frameworks for this investigation. In general, we first pretrain a model on a large dataset to make it learn a general idea of speech and subsequently fine-tune it on the pathological dataset for adaptation. \subsection{Self-supervised pretraining setup} After pretraining the SSL model, we fine-tune it by attaching a decoder to its last layer. Two decoder setups for fine-tuning are compared. The first is using the original ASR setup in wav2vec 2.0 and WavLM, where a linear projection layer is attached and trained by CTC. Next, following the convention in \cite{analysis_dysasr}, we train by CTC-A by using a vanilla 2-layer 1024-unit LSTM decoder, as recommended in the ASR setup in \cite{yang2021superb}. As pathological speech is extremely acoustically different from healthy speech, we also investigate the effectiveness of adding an extra encoder to further pre-process the SSL features before passing it onto the decoder. Two additional encoders are compared with preprocessing the SSL representations, the Conformer \cite{conformer} and Transformer \cite{transformer}, owing to the strong ability of self-attention to learn representations. We use two attention heads and two layer blocks for both encoders. We then refer to using the SSL representations directly as using an Identity encoder. We find better performance when only the CNN layers of the SSL models are frozen during fine-tuning. The rest of the SSL model components, the encoder, and the decoder are fine-tuned. \subsection{Supervised pretraining baseline setup} We compare SSL pretraining with the following supervised pretraining setups. We use the Transformer \cite{transformer} and Conformer \cite{conformer} as the encoders, both of which have produced the lowest word error rate when using the Librispeech \cite{librispeech} dataset in supervised training\footnote{\url{https://github.com/syhw/wer_are_we}}. Both encoders have eight attention heads, although the Transformer has 18 layer blocks, while the Conformer only has 12 layer blocks. The decoder for both encoders is a Transformer composed of eight attention heads and eight layer blocks, and trained by CTC-A. The pretraining stage outputs and predicts byte-pair encoding (bpe) tokens \cite{bpe}; however, in the fine-tuning stage, we initialize a new output layer to decode English and Japanese character tokens instead. For UASpeech, we also compare our results with those obtained using end-to-end models found in \cite{cuhk} that predict the character tokens by using a CONV+BLSTM encoder trained using CTC and ATTN with mel-scale filter banks and pitch as inputs. \section{Experimental setup} \subsection{Datasets} To pretrain the supervised models, we use the 960 hours of Librispeech \cite{librispeech}. On the other hand, SSL pretraining varies per model, with wav2vec 2.0 pretrained on 60k hours of speech and WavLM pretrained on 94k hours of speech. In the fine-tuning stage, we use two pathological speech datasets, as summarized in Table \ref{tab:datasets}. We first investigate an in-house recorded dataset of Japanese electrolaryngeal speech, which we refer to as ELSpeech in this paper. The dataset is recorded by a laryngeal speaker by speaking 1000 different sentence utterances both with an electrolarynx and with their normal voice. We use 85\% of the data for the training set, and the rest for the test set. Both the healthy and electrolaryngeal speeches are used in the train and dev sets but only the electrolarygneal speech used in the test set. As the dataset is in Japanese, we use the character error rate (CER) as the evaluation metric. The next dataset we use is UASpeech \cite{UASpeech}, a dataset containing parallel English word utterances of 15 dysarthric speakers and 13 healthy speakers. We follow the recommendations in \cite{cuhk} and use both the dysarthric and healthy speakers to train the ASR system but only use the dysarthric speakers for the test set, and remove excessive silences at the start and end of each utterance using a GMM-HMM system\footnote{\url{https://github.com/ffxiong/uaspeech}}. The train and dev sets are from the B1 and B3 blocks, whereas the test set is from the B2 block. We follow the convention of the said paper and use the word error rate (WER) as our evaluation metric. \begin{table}[th] \centering \caption{Duration (in number of hours) of each split used in the experiment. UASpeech results are obtained after silence removal.} \footnotesize \label{tab:datasets} \begin{tabular}{cccccc} \toprule & \multicolumn{2}{c}{\textbf{Healthy}} & \multicolumn{2}{c}{\textbf{Pathological}} & \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} \textbf{Dataset} & \textbf{Train} & \textbf{Dev} & \textbf{Train} & \textbf{Dev} & \textbf{Test} \\ \midrule \midrule UASpeech \cite{UASpeech} & 2.38 & 0.45 & 3.60 & 0.68 & 2.09 \\ ELSpeech & 1.21 & 0.37 & 1.40 & 0.46 & 0.42 \\% 1.40 & 0.46 & 1.21 & 0.37 & 0.42 \\ \bottomrule \end{tabular} \end{table} \begin{table}[h!] \centering \caption{CER comparison between using different SSL features and raw features in ELSpeech. ** indicates end-to-end models pretrained with 960h Librispeech.} \label{tab:el1} \scriptsize \begin{tabular}{rllllc \toprule \multicolumn{1}{r}{\textbf{Sys.}} & \multicolumn{1}{l}{\textbf{Features}} & \multicolumn{1}{l}{\textbf{Encoder}} & \multicolumn{1}{l}{\textbf{Decoder}} & \multicolumn{1}{l}{\textbf{Loss}} & \multicolumn{1}{l}{\textbf{CER\%}} \\ \midrule \midrule 1 & \multirow{2}{*}{\makecell[l]{Raw\\waveform}} & \textbf{Conf.**} & \textbf{Transf.**} & \textbf{CTC-A} & \textbf{27.9} \\ 2 & & Transf.** & Transf.** & CTC-A & 61.5 \\ \midrule 3 & \multirow{4}{*}{\begin{tabular}[c]{@{}l@{}}wav2vec 2.0\\\end{tabular}} & Identity & Linear & CTC & 93.3 \\ 4 & & Identity & LSTM & CTC-A & 89.2 \\ 5 & & Conf. & LSTM & CTC-A & 54.1 \\ 6 & & Transf. & LSTM & CTC-A & 50.2 \\ \midrule 7 & \multirow{4}{*}{\begin{tabular}[c]{@{}l@{}}wav2vec 2.0\\ (XLSR)\end{tabular}} & Identity & Linear & CTC & 99.6 \\ 8 & & Identity & LSTM & CTC-A & 89.9 \\ 9 & & Conf. & LSTM & CTC-A & 90.2 \\ 10 & & Transf. & LSTM & CTC-A & 71.5 \\ \midrule 11 & \multirow{4}{*}{WavLM} & Identity & Linear & CTC & 54.9 \\ 12 & & \textbf{Identity} & \textbf{LSTM} & \textbf{CTC-A} & \textbf{41.8} \\ 13 & & Conf. & LSTM & CTC-A & 42.5 \\ 14 & & Transf. & LSTM & CTC-A & 46.0 \\ \midrule \end{tabular} \end{table} \subsection{Implementation} We use ESPnet \cite{espnet, espnet-2020} to implement the end-to-end ASR models and the s3prl frontend \cite{yang2021superb} to use the SSL models. Both toolkits are open-sourced. The SSL models we use are the wav2vec 2.0 Large and WavLM Large models, which are both available to the public. All networks in this investigation target predicting the character tokens. We fine-tune the networks' learning rate in steps of $10^{-n}$ where $n \in \{ 0, 1, 2, 3, 4, 5 \}$ and use the best results from each run. The language models used are based on the Transformer \cite{transformer} architecture and trained on each dataset's training set text. In Tables \ref{tab:el1} and \ref{tab:ua1}, we will refer to the Conformer architecture as "Conf." and the Transformer architecture as "Transf.". \section{Results} \begin{table*}[h!] \centering \caption{WER comparison between using different SSL features, mel-scale filter bank, and raw waveforms in UASpeech. ** indicates models pretrained with 960h Librispeech.} \scriptsize \label{tab:ua1} \begin{tabular}{rllllccccc} \toprule & & & & & \multicolumn{5}{c}{\textbf{WER\% of each intelligibility rating}} \\ \cmidrule(lr){6-10} \textbf{Sys.} & \textbf{Features} & \textbf{Encoder} & \textbf{Decoder} & \textbf{Loss} & \textbf{Overall} & \textbf{Very Low} & \textbf{Low} & \textbf{Mid} & \textbf{High} \\ \midrule \midrule 1 & \multirow{2}{*}{Mel-scale filter bank} & Conv+BLSTM \cite{cuhk} & Linear & CTC & 58.0 & 87.1 & 62.4 & 55.3 & 37.8 \\ 2 & & \textbf{Conv+BLSTM**} \cite{cuhk} & \textbf{LSTM**} & \textbf{ATTN} & \textbf{35.0} & \textbf{68.7} & \textbf{39.0} & \textbf{32.5} & \textbf{12.2} \\ \midrule 3 & \multirow{2}{*}{Raw waveform} & Conf.** & Transf.** & CTC-A & 67.2 & 90.6 & 73.6 & 64.1 & 46.6 \\ 4 & & Transf.** & Transf.** & CTC-A & 68.2 & 89.6 & 73.9 & 66.2 & 48.7 \\ \midrule 5 & \multirow{4}{*}{wav2vec 2.0} & Identity & Linear & CTC & 75.7 & 93.1 & 79.4 & 74.1 & 60.4 \\ 6 & & Identity & LSTM & CTC-A & 96.4 & 97.9 & 97.5 & 95.8 & 95.0 \\ 7 & & Conf. & LSTM & CTC-A & 71.7 & 92.3 & 74.6 & 68.7 & 55.3 \\ 8 & & Transf. & LSTM & CTC-A & 71.8 & 93.8 & 83.7 & 69.7 & 48.4 \\ \midrule 9 & \multirow{4}{*}{WavLM} & Identity & Linear & CTC & 91.5 & 97.3 & 92.3 & 90.5 & 87.1 \\ 10 & & \textbf{Identity} & \textbf{LSTM} & \textbf{CTC-A} & \textbf{51.8} & \textbf{71.5} & \textbf{50.0} & \textbf{46.0} & \textbf{40.6} \\ 11 & & Conf. & LSTM & CTC-A & 70.1 & 94.1 & 81.3 & 67.1 & 48.5 \\ 12 & & Transf. & LSTM & CTC-A & 77.2 & 94.5 & 83.9 & 75.3 & 60.3 \\ \midrule \end{tabular} \end{table*} \subsection{Comparison of SSL frameworks} First, we analyze the two SSL model frameworks. As seen in Sys. 12 in Table \ref{tab:el1} and Sys. 10 in Table \ref{tab:ua1}, using the WavLM model with an LSTM decoder outperforms all setups using wav2vec 2.0 in both datasets, as it produces the lowest CER (41.8\%) and WER (51.8\%), making it the best SSL setup. This performance can be attributed to the speech denoising framework used in masked region prediction, which makes the model more robust to acoustic variations in speech features found in pathological speech and the attention-based LSTM decoder, thereby improving the representation learning. A similar trend in both datasets is also seen when using an additional Conformer or Transformer encoder (Sys. 5, 6, 13, and 14 in Table \ref{tab:el1} and Sys. 7, 8, 11, and 12 in Table \ref{tab:ua1}) to preprocess the SSL features, where it degrades the performance with WavLM, but improves wav2vec 2.0. This shows that the wav2vec 2.0 features are not as strong in projecting the pathological speech into a latent space and needs further processing for it to properly work. Moreover, as the SSL models are trained in English and the ELSpeech dataset is in Japanese, we also test the performance of the multilingually pretrained wav2vec XLSR model \cite{w2v-xlsr}, which has been successfully used in decoding languages not included in the pretraining data. However, we do not find any success to this approach, as seen in Table \ref{tab:el1}, where we see a degradation in performance when using XLSR for all setups compared with its wav2vec 2.0 counterparts. \subsection{Comparison of SSL pretraining and supervised pretraining} We present two findings when comparing these two pretraining methods. First, we see a trend similar to that in \cite{analysis_dysasr}, where the best SSL setups in Sys. 12 in Table \ref{tab:el1} and Sys. 10 in Table \ref{tab:ua1} outperform the pretrained Transformer setups in Sys. 2 in Table \ref{tab:el1} and Sys. 4 in Table \ref{tab:ua1}, proving that SSL pretraining has the potential to outperform supervised pretraining. However, our second finding is that other supervised setups not used in \cite{analysis_dysasr} may still outperform SSL pretraining. As seen Sys. 1 in Table \ref{tab:el1}, using a pretrained Conformer-Transformer model produces the lowest CER (27.9\%) for ELSpeech, outperforming the best SSL setup by 13.9\%. On the other hand, although the Conformer-Transformer setup (Sys. 3 in Table \ref{tab:ua1}) did not perform very well in UASpeech, \cite{cuhk} showed that using a pretrained Conv+LSTM model with 40-dimensional mel-scale filter banks as inputs can still outperform our best SSL setup by 16.8\%, as seen in Sys. 2 in Table \ref{tab:ua1}. \subsection{Visualizing differences of dysarthric speech in the latent space} As seen in the results, SSL pretraining did not exactly outperform supervised pretraining in both pathological speech datasets. We attribute this to the stark acoustical differences in pathological speech, as similarly seen in previous research on automatically categorizing dysarthric speech intelligibility \cite{analysis_dyscategorization}, where supervised models outperformed the pretrained SSL model. We then try to visualize the high-dimensional extractions using mel-log filterbank and pitch, raw waveforms, and SSL features with the UASpeech dataset and flatten these on a 2D space using t-SNE \cite{t-sne}. Each point represents one frame in the utterance and is colored according to the speakers' intelligibility rating. We use the first 20 utterances in the B1 block from three speakers in each intelligibility rating. We see in Figure ~\ref{fig:tsne} that raw audio waveforms are projected similarly to the SSL features, proving that there is space to further improve SSL models on pathological speech and improve them at the same level as supervised pretraining. Furthermore, more of the lower intelligibility utterances (green and red) are pushed to the outside, whereas more of the higher intelligibility utterances (purple and blue) are clustered at the center. However, we also see that the mel-scale filter bank extractions seem to blend together the pathological and healthy utterances. One hypothesis we draw from this is that the model may not be able to differentiate the pathological features from the healthy features when using this input, which may have improved the performance. \begin{figure}[th] \centering \includegraphics[width=8cm]{img/tsne2.png} \caption{Pathological speech frame extractions visualized in 2D via t-SNE \cite{t-sne}. Illustrated left to right are mel-scale filter banks with pitch, raw waveforms, WavLM, and wav2vec 2.0} \label{fig:tsne} \end{figure} \section{Conclusions} With ASR providing several conveniences to pathological speech patients, more work should be done to make commercial ASR devices useful for them. We investigated two types of SSL-based pretraining frameworks, contrastive and masked region prediction, on two different pathological speech datasets and compared them with a supervised pretraining framework. Although SSL pretraining frameworks have shown success with minimally resourced healthy speech, this does not seem to be the case with pathological speech. Further investigations in improving the training strategy can be conducted to improve performance in SSL pretraining. Training speaker-dependent models, which has been recommended in several studies \cite{google1, google2, google3}, will be one of the primary targets in the future. \section{Acknowledgements} This work was partly supported by AMED under Grant Number JP21dk0310114, Japan, and JST CREST Grant Number JPMJCR19A3. \bibliographystyle{IEEEtran}
c2e6afc6f0ac2b8859a85e67c8ac91c931c98666
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Background} \label{sec:background} \subsection{Event logs} \label{ssec:log} An \emph{event log} consists of traces representing executions of a process (a.k.a.~a case). A trace is a sequence of \emph{events}, each referring to the execution of an activity (a.k.a.~an event class). Besides timestamps, indicating the time in which the event has occurred, events in a trace may have a data payload consisting of attributes, such as, the resource(s) involved in the execution of an activity, or other data recorded during the event. Some of these attributes do not change throughout the different events in the trace, i.e., they refer to the whole case (\emph{trace attributes}); for instance, the personal data (\attr{Birth date}) of a customer in a loan request process. Other attributes are specific of an event (\emph{event attributes}), for instance, the employee who creates an offer (\attr{resource}), which is specific of the activity \act{Create offer}. \subsection{Prescriptive Process Monitoring} \label{ssec:prescriptive} Prescriptive Process Monitoring~\cite{fahrenkrog2019fire,metzger2020triggering} is a branch of Process Mining that aims at suggesting activities or triggering interventions for a process execution for optimizing a desired Key Performance Indicator (KPI). Differently from Predictive Process Monitoring approaches, which aim at predicting the future of an ongoing execution trace, Prescriptive Process Monitoring techniques aim at recommending the best interventions for achieving a target business goal. For instance, a bank could be interested in minimizing the cost of granting a loan to a customer. In such a scenario, the KPI of interest for the bank is the cost of the activities carried out by the bank's personnel in order to reach an agreement with the customer. The best actions that the bank should carry out to achieve the business goal (reaching the agreement while minimizing the processing time) can be recommended to the bank. \subsection{Reinforcement Learning} \label{ssec:reinforcement} Reinforcement Learning (RL)~\cite{Sutton1998,junyanhu} refers to techniques providing an intelligent agent the capability to act in an environment, while maximizing the total amount of reward received by its actions. At each time step $t$, the agent chooses and executes an \emph{action} $a$ in response to the observation of the \emph{state} of the environment $s$. The action execution causes, at the next time step $t+1$, the environment to stochastically move to a new state $s'$, and gives the agent a \emph{reward} $r_{t+1}=\mathcal{R}(s,a,s')$ that indicates how well the agent has performed. The probability that, given the current state $s$ and the action $a$, the environment moves into the new state $s'$ is given by the state transition function $\mathcal{P}(s,a,s')$. The learning problem is therefore described as a discrete-time Markov Decision Process (MDP), which is formally defined by a tuple $M=(\mathcal{S}, \mathcal{A}, \mathcal{P},\mathcal{R}, \gamma)$: \begin{itemize}[label=$\bullet$] \item $\mathcal{S}$ is the set of states. \item $\mathcal{A}$ is the set of agent's actions. \item $\mathcal{P}:\mathcal{S} \times \mathcal{A} \times \mathcal{S} \rightarrow [0,1]$ is the transition probability function. $\mathcal{P}(s,a,s') = Pr(s_{t+1} = s' | s_t = s, a_t = a)$ is the probability of transition (at time $t$) from state $s$ to state $s'$ under action $a \in \mathcal{A}$. \item $\mathcal{R}: \mathcal{S} \times \mathcal{A} \times \mathcal{S} \rightarrow \mathbb{R}$ is the reward function. $\mathcal{R}(s,a,s')$ is the immediate reward obtained by the transition from state $s$ to $s'$ with action $a$. \item $\gamma \in [0,1]$ is a parameter that measures how much the future rewards are discounted with respect to the immediate reward. Values of $\gamma$ lower than 1 model a decision maker that discount the reward obtained in the more distant future.\footnote{In this paper we set $\gamma=1$, hence equally weighting the reward obtained at each action points of the target actor.} \end{itemize} An MDP satisfies the \emph{Markov Property}, that is, given $s_t$ and $a_t$, the next state $s_{t+1}$ is conditionally independent from all prior states and actions and it only depends on the current state, i.e., $Pr(s_{t+1}| s_t, a_t)=Pr(s_{t+1}|s_0, \cdots, s_t, a_0, \cdots, a_t)$. The goal of RL is computing a \emph{policy} that allows the agent to maximize the cumulative reward. A policy $\pi: \mathcal{S} \rightarrow \mathcal{A}$ is a mapping from each state $s \in \mathcal{S}$ to an action $a \in \mathcal{A}$, and the \emph{cumulative reward} is the (discounted) sum of the rewards obtained by the agent while acting at the various time points $t$. The value of taking the action $a$ in state $s$ and then continuing to use the policy $\pi$, is the expected discounted cumulative reward of the agent, and it is given by the \emph{state-action value function}: $Q^{\pi}(s,a) = \mathbb{E}_\p (\Sigma_{k=0}^\infty\gamma^k r_{k+t+1} |s=s_t,a=a_t )$, where $r_{t+1}$ is the reward obtained at time $t$. The \textit{optimal} policy $\pi^*$ dictates to a user in state $s$ to perform the action that maximises $Q(s,\cdot)$. Hence, the optimal policy $\pi^*$ maximises the cumulative reward that the user obtains by following the actions recommended by the policy $\pi^*$. Action-value functions can be estimated from experience, e.g., by averaging the actual returns for each state (action taken in that state), as with \emph{Monte Carlo methods}. Different algorithms can be used in RL~\cite{Sutton1998}. Among them we can find the \emph{value} and the \emph{policy iteration} approaches. In the former the optimal action-value function $Q^{*}(s,a)$ is obtained by iteratively updating the estimate $Q^{\pi}(s, a)$. In the latter, the starting point is an arbitrary policy $\pi$ that is iteratively evaluated (\emph{evaluation phase}) and improved (\emph{optimization phase}) until convergence. Monte Carlo methods are used in the policy evaluation phase for computing, given a policy $\pi$, for each state-action pair ${(s,a)}$, the action-value function $Q^{\pi}(s,a)$. The estimate of the value of a given state-action pair $(s,a)$ can be computed by averaging the sampled returns that originated from $(s,a)$ over time. Given sufficient time, this procedure can construct a precise estimate $Q$ of the action-value function $Q^{\pi}$. In the policy improvement step, the next policy is obtained by computing a greedy policy with respect to $Q$: given a state $s$, this new policy returns an action that maximizes $Q(s,\cdot)$. \section{Conclusion} \label{sec:conclusion} In this paper we have proposed the use of RL in the solution of the problem of computing next activity recommendations in Prescriptive Process Monitoring problems. Differently from other state-of-the-art works our model handles non deterministic processes, in which only part of the activities are actually actionable and the rest of them are, from the target actor point of view, stochastically selected by the system environment. This is a common situation in multi-actors processes. By taking the decision making perspective of one of the actors involved in a process (target actor), we first learn from past executions the behaviour of the environment and we then use RL to recommend the best activities to carry on in order to optimize a measure of interest. The obtained results show the goodness of the proposed approach in comparison to the policy used by the actor, i.e., without using recommendations. We plan to extend this approach by including in the MDP state the raw information related to the history of the process execution, so as to automate as much as possible the pre-processing phase of our computational pipeline. However, in that case the consequent increase of the state space dimension and its cardinality would require the usage of state generalisation techniques, such as, those implemented with Deep Reinforcement Learning or by applying smart clustering techniques. Moreover, we would like to explore the possibility to use declarative constraints for defining and enforcing domain knowledge constraints. \section{Evaluation of the Recommendation Policy} \label{sec:evaluation} We investigate the capability of the proposed approach to recommend the process activities that allow the target actor to maximize a KPI of interest, i.e., the optimal policy $\pi^*$, (i) when no activity has been executed yet, that is, the whole process execution is recommended; (ii) at different time steps of the process execution (i.e., at different prefix lengths), that is, when only a (remaining) part of the process execution is recommended. We hence explore the following research questions: \begin{enumerate}[label=\textbf{RQ\arabic*},leftmargin=2\parindent,topsep=1.5pt] \item\label{RQ1} How does the recommended sequence of activities (suggested by the optimal policy $\pi^*$) perform in terms of the KPI of interest when no activity has been executed yet? \item\label{RQ2} How does the recommended sequence of activities (suggested by the optimal policy $\pi^*$) perform in terms of the KPI of interest at a given point of the execution? \end{enumerate} Unfortunately, the complexity of evaluating recommendations in the Prescriptive Process Monitoring domain is well known~\cite{DBLP:conf/bpm/Dumas21}. It relates to the difficulty to estimate the performance of recommendations that have possibly not been followed in practice. In order to answer our research questions, we therefore approximate the value of the KPI of interest (i) by leveraging a simulator (simulation evaluation\xspace); (ii) by looking at similar executions in the actual event log (test log evaluation\xspace). In the next subsections we describe the dataset (Section~\ref{ssec:datasets}), we detail the experimental setting (Section~\ref{ssec:setting}), and we finally report the evaluation results (Section~\ref{ssec:results}). \subsection{Datasets} \label{ssec:datasets} We have used two real-world publicly-available datasets that, describing the behaviour of more than one actor, allow us to take the perspective of one of them (target): the BPI Challenge 2012 event log~\cite{vandongen_2012} (\textsc{BPI2012}) and the Road Traffic Fine Management event log~\cite{deleoni_mannhardt_2015} (\textsc{Fines2015}). The BPI Challenge 2012 dataset relates to a Dutch Financial Institute. The process executions reported in the event log refer to an application process for personal loan (see the \emph{Loans}{} scenario in Section~\ref{sec:running}). In this scenario we want to optimize the profit of the bank (\emph{agent}), i.e., to minimize the cost $C$ of granting a loan to a customer (\emph{environment}) while maximizing the interest $I$ of the bank granting the loan. To this aim, we define the KPI of interest for a given execution $e$ as the difference between the amount of interest (if the bank offer is accepted and signed by the customer, namely if the activity \act{Offer accepted} occurs in the trace) and the cost of the employees working time, that is, the value of the KPI for the execution $e$ is $\text{KPI}_{\textsc{BPI2012}}(e) = I(e) - C(e)$. The amount of interest depends on the amount class of the loan request: low ($ \text{amount} \le 6000$), medium ($6000 < \text{amount} \le 15000$) and high ($\text{amount} > 15000$). For the low class, the average interest rate is 16\%, for the medium class, the average interest rate is 18\%, while for the high class is 20\% \footnote{The information on the average interest rate is extracted from the BPI2017~\cite{vandongen_2017} dataset which contains data from the same financial institution.} The cost of the employees' working time is computed assuming an average salary of $18$ euros/h.\footnote{We estimate the average salary of a bank employed in the Netherlands from https://www.salaryexpert.com/salary/job/banking-disbursement-clerk/netherlands.} \begin{table}[t] \centering \scalebox{0.8}{% \begin{tabular} {l@{\hskip 0.2in}c@{\hskip 0.2in}c@{\hskip 0.2in}c@{\hskip 0.2in}c@{\hskip 0.2in}c} \toprule \textbf{Dataset} & \textbf{Trace \#} & \textbf{Variant \#} & \textbf{Event \#} & \textbf{Event class \#} & \textbf{Avg.~trace length}\\ \hline \textsc{BPI2012} & 13087 & 4366 & 262200 & 36 & 20\\ \textsc{Fines2015} & 150370 & 231 & 561470 & 11 & 5\\ \bottomrule \end{tabular} } \vspace{0.3cm} \caption{Dataset Description} \vspace{-1 cm} \label{tab:dataset} \end{table} The second dataset collects data related to an information system of the Italian police. The information system deals with the management of road traffic fines procedures, starting from the fine creation, up to the potential offender's appeal to the judge or to the prefecture (see the \emph{Fines}{} scenario described in Section~\ref{sec:running}). Here, we want to maximize the credits received by the police department (\emph{agent}) based on the fine payments received by the offender (\emph{environment}). The department receives $3$, $2$ or $1$ credits if the fines are fully paid within 6, within 12 months, or after 12 months respectively; it does not receive any credits if the fine is not fully paid, while it receives a discredit if the offender appeals to a judge or to the prefecture and wins, since these cases correspond to a money waste of the police authority. The KPI value for the execution $e$ is KPI$_{\textsc{Fines2015}}(e)$, corresponding to the number of credits received for the execution. Table~\ref{tab:dataset} shows the number of traces, variants, events, event classes and average trace length of the considered datasets. Table~\ref{tab:scenarios} illustrates the MDP components for the two scenarios: the main MDP \emph{actions}; the main MDP \emph{state}{} components, i.e., the last activity (\textsc{LA}), the historical features (\textsc{HF}) and the environment features (\textsc{EF}); as well as the \emph{reward}{}, including the main attributes used for its computation.\footnote{The complete MDP description is available at \url{tinyurl.com/2p8aytrb}.} For example, Table~\ref{tab:preprocessing} shows how a trace related to the \emph{Fines}{} scenario is preprocessed and transformed into an annotated trace, and then into MDP actions, states and rewards. The trace activities are annotated according to whether they have been carried out either by the \emph{agent} or by the \emph{environment}, and the attributes \attr{2months} (the bimester since the fine creation), \attr{amClass} (the fine amount class) and \attr{payType} (type of payment performed) are computed. In the MDP construction step, the agent's activities (with the bimester interval \footnote{\label{note1}The MDP actions in this scenario take into account, besides the activity name, also the 2-month interval (since the creation of the fine) in which the activity has been carried out (\attr{2months}).}) are used as actions, while the state is built by leveraging the last executed activity (\textsc{LA}), the \attr{2months} and the \attr{amClass} attributes. The reward is not null when the payment is finally received and since in this trace the full payment is received after $6$ months, $2$ credits are awarded. Once the log is enriched it is passed to the MDP generation step. We build two MDPs: the MDP$_{\textsc{BPI2012}}$ for the \emph{Loan request handling}\xspace scenario (with 982 states and 15 actions) and the MDP$_{\textsc{Fines2015}}$ for the \emph{Traffic fine management}\xspace scenario (with 215 sates and 70 actions). \input{MDP_table} \begin{table}[t] \centering \scalebox{0.7}{% \begin{tabular}{l@{\hskip 0.1in} c@{\hskip 0.1in} c@{\hskip 0.3in} c@{\hskip 0.1in} c@{\hskip 0.1in} c@{\hskip 0.1in} c@{\hskip 0.3in} l@{\hskip 0.1in} l@{\hskip 0.1in} c} \toprule \multicolumn{3}{l}{\textbf{Trace}} & \multicolumn{4}{l}{\textbf{Enriched trace}} & \multicolumn{3}{l}{\textbf{MDP}} \\ \textbf{activity} & \textbf{timestamp} & \attr{amount} & \attr{2months} & \attr{amClass} & actor & \attr{payType} & \emph{action} & next \emph{state} & \emph{reward} \\ \hline \act{Create fine} & 13/1/21 & 40 & 0 & low & agent & - & \act{Create fine-0} & $\langle \text{\act{Create fine}, 0, low} \rangle$ & 0 \\ \act{Send fine} & 24/1/21 & 40 & 0 & low & agent & - & \act{Send fine-0} & $\langle \text{\act{Send fine}, 0, low} \rangle$ & 0\\ \act{Add penalty} & 18/3/21 & 60 & 1 & high & agent & - & \act{Add penalty-1} & - & -\\ \act{Payment} & 25/7/21 & 60 & 3 & high & env. & full & - & $\langle \text{\act{Payment}, 3, high} \rangle$ & 2 \\ \bottomrule \end{tabular} } \vspace{0.3cm} \caption{Example of the transformation of a trace in the corresponding MDP components. \vspace{-1cm} \label{tab:preprocessing} \end{table} \subsection{Experimental Setting} \label{ssec:setting} In order to answer our research questions, the two event logs have been split in a training part, which is used in in the \emph{RL phase}, and a test part, which is used for the evaluation of the learned policy. For evaluating the computed policies, since in this setting both training and test set size can impact the evaluation results, we use two different splitting criteria (defining the percentage of event log used for the training and the test set): (i) 60\%-40\%{} (60\% of the traces for the training set and 40\% for the test set) and (ii) 80\%-20\%{} (80\% for the training and 20\% for the testing). For the evaluation of the optimal policy obtained by RL and for answering our two research questions, two different evaluations have been carried out: a simulation evaluation\xspace and a test log evaluation\xspace. The simulation evaluation\xspace uses a Monte Carlo simulation similar to the one used in the training phase, but, differently from the training phase, where the MDP is obtained from the training log, here a test MDP, obtained from the test log, is leveraged to simulate the environment response. In this simulation, the optimal policy obtained from the RL approach is compared, in terms of the KPI of interest, against a random policy and against a policy corresponding to the most frequent decisions made by the actor in the actual traces. The value of the reward for each of the simulated policy is computed as the average over 100.000 simulated cases. This evaluation provides a preliminary answer to the first research question \ref{RQ1}. The test log evaluation\xspace aims at comparing the optimal policy obtained from RL with the actual policies used in the process. It is used for answering both our research questions. For \ref{RQ1}, we focus on the policy recommended when no activity has been executed yet. In this setting, we compare the value of the KPI of interest for the traces in the test event log that follow the optimal policy (from the first activity) (i) with the value of the KPI of interest of all the traces in the event log, and (ii) with the value of the KPI of interest of the traces in the event log that do not follow the recommended optimal policy. For \ref{RQ2}, we focus on the policy recommended for ongoing executions, i.e., when some activity has already been executed. We hence consider, for each trace in the test event log, all its prefixes and separately analyze each of them, as a potential ongoing execution. For each prefix $p$ of a trace $t$ in the test event log we compare the value of the KPI of interest of the trace $t$ once completed against an estimation of the value of the KPI obtained following the optimal policy from that execution point forward. The estimation is obtained by averaging the KPI values of the traces in the log that have the same prefix as the reference prefix $p$ and follow the optimal policy from there on. \subsection{Results} \label{ssec:results} In this section we report the results of the two scenarios related to the event logs described in Section~\ref{ssec:datasets}. For both scenarios, as described in Section~\ref{ssec:setting}, we show (i) the results related to the evaluation of the complete optimal policy (\ref{RQ1}) by reporting first the simulation evaluation\xspace and then the test log evaluation\xspace; and (ii) the results related to the evaluation of the optimal policy on the test log assuming that some events have already been executed (\ref{RQ2}). \vspace{0.15cm} \noindent \emph{Research Question \ref{RQ1}.} Table~\ref{tab:simulator} reports the results related to the simulation evaluation\xspace for both the \emph{Loan request handling}\xspace and the \emph{Traffic fine management}\xspace scenarios. For both splitting criterion (60\%-40\%{} and 80\%-20\%) and for each policy analysed, the average KPI value is displayed together with the percentage of executions for which the bank offer has been accepted by the customer (or the fines have been fully paid by the offender). The policies analysed are: the random policy (\textsc{Random}\xspace), the policy selecting the most frequent action in the log for each state (\textsc{Customary}\xspace) and the optimal (\textsc{Optimal}\xspace) policy. \begin{table}[t] \centering \scalebox{0.8}{% \begin{tabular}{l@{\hskip 0.2in} l@{\hskip 0.2in} l@{\hskip 0.2in} c@{\hskip 0.2in} c} \toprule \multirow{2}{*}{\textbf{Scenario}} & \textbf{Splitting} & \multirow{2}{*}{\textbf{Policy}} & \multirow{2}{*}{\textbf{avg. KPI}} & \textbf{\act{Offer accepted} / }\\ & \textbf{criterion} & & & \textbf{full \act{Payment} }\\\hline \multirow{6}{*}{\emph{Loans}} & \multirow{3}{*}{60\%-40\%} & \textsc{Random}\xspace & $36.8$ & $1.4\%$ \\ & & \textsc{Customary}\xspace & $1497.5$ & $38.9\%$ \\ & & \textsc{Optimal}\xspace & $1727$ & $53.7\%$ \\ \cline{2-5} & \multirow{3}{*}{80\%-20\%} & \textsc{Random}\xspace & $35.7$ & $1.5\%$ \\ & & \textsc{Customary}\xspace & $1710.5$ & $43.5\%$ \\ & & \textsc{Optimal}\xspace & $1965.1$ & $61.7\%$ \\ \hline \multirow{6}{*}{\emph{Fines}} & \multirow{3}{*}{60\%-40\%} & \textsc{Random}\xspace & $1.02$ & $36.9\%$ \\ & & \textsc{Customary}\xspace & $1.12$ & $41.7\%$ \\ & &\textsc{Optimal}\xspace & $1.17$ & $42.3\%$ \\ \cline{2-5} & \multirow{3}{*}{80\%-20\%} & \textsc{Random}\xspace & $0.84$ & $30.0\%$ \\ & & \textsc{Customary}\xspace & $0.97$ & $35.0\%$ \\ & & \textsc{Optimal}\xspace & $1.05$ & $37.1\%$ \\ \bottomrule \end{tabular} } \vspace{0.3cm} \caption{Results of the simulation evaluation\xspace for the \emph{Loan request handling}\xspace and the \emph{Traffic fine management}\xspace scenarios.} \vspace{-1cm} \label{tab:simulator} \end{table} The rows related to the \emph{Loan request handling}\xspace scenario (\emph{Loans}) show that for both splitting criteria, the optimal policy (\textsc{Optimal}\xspace) generates an average KPI value much higher than the one obtained with a random policy (\textsc{Random}\xspace), but also higher than the one obtained with a policy characterized by frequently taken actions (\textsc{Customary}\xspace). This result confirms that the proposed \textsc{Optimal}\xspace policy actually outperforms the policy that is frequently taken in the actual traces, which is considered to be an ``optimal'' policy by the target agent. Different optimal (and \textsc{Customary}\xspace) policies are returned with different splitting criteria. When learning with a larger training set and simulating on a smaller test set, the average KPI value increases, for the \textsc{Optimal}\xspace and the \textsc{Customary}\xspace policy, while slightly decreases for the \textsc{Random}\xspace policy. Moreover, the table also shows the percentage of traces that, based on the policy simulations, are finally accepted by the customer. By changing the data splitting criteria, the effect is similar to that observed for the average KPI value for the \textsc{Optimal}\xspace and the \textsc{Customary}\xspace policy, with a percentage of accepted offers raising from around $39\%$ to $43\%$ for the \textsc{Customary}\xspace policy and from around $53\%$ to more than $60\%$ with the \textsc{Optimal}\xspace policy. An almost null increase is observed instead for the \textsc{Random}\xspace policy. The results related to the \emph{Traffic fine management}\xspace scenario are similar to the results of the loan scenario, as shown in the row \emph{Fines}{} of Table~\ref{tab:simulator}. As for the loan scenario, also in this case, for both splitting criteria, the optimal policy returns higher average KPI values (and hence lower money waste) and produces a higher percentage of traces with fully paid fines than the \textsc{Random}\xspace and the \textsc{Customary}\xspace policies. Also in this case, the difference between the \textsc{Optimal}\xspace and the \textsc{Customary}\xspace policy confirms that the proposed recommendation policy improves the policy actually used in practice. In this scenario, however, the difference in terms of percentage of traces for which fines have fully been paid between the optimal and the random policy is lower than for the \emph{Loan request handling}\xspace case. This is possibly due to the overall higher percentage of traces in the \textsc{Fines2015}{} event log for which the fines have been fully paid (40\%) with respect to the percentage of traces in the \textsc{BPI2012}{} log for which the loan offer has been accepted by the customer (17\%), as well as to the higher number of actions of MDP$_{\textsc{Fines2015}}$ with respect to the number of actions of MDP$_{\textsc{BPI2012}}$. Moreover, differently from the \emph{Loan request handling}\xspace{} scenario, there is an overall decrease in terms of average KPI value and of traces with fully paid fines when using a larger training set and a smaller test set (80\%-20\%{} splitting criterion). Table~\ref{tab:log_analysis} shows the results related to the test log evaluation\xspace. For each of the two scenarios and for each splitting criterion, we report the number of traces, the average KPI value, as well as the percentage of traces for which the offer has been accepted (or the fines have been fully paid) for (i) all traces in the test set (\textsc{All}\xspace), (ii) the traces in the test set that follow the optimal policy (\textsc{Optimal P.}\xspace); (iii) the traces in the test set that do not follow the optimal policy (\textsc{Non-Optimal P.}\xspace). \begin{table}[t] \centering \scalebox{0.75}{% \begin{tabular}{l@{\hskip 0.2in} l@{\hskip 0.2in} l@{\hskip 0.2in} c@{\hskip 0.2in} c@{\hskip 0.2in} c} \toprule \multirow{2}{*}{\textbf{Scenario}} & \textbf{Splitting} & \multirow{2}{*}{\textbf{traces}} & \multirow{2}{*}{\textbf{trace \#}} & \textbf{avg} & \textbf{\act{Offer accepted} / } \\ & \textbf{criterion} & & & \textbf{KPI} & \textbf{full \act{Payment} }\\ \hline \multirow{6}{*}{\emph{Loans}} & \multirow{3}{*}{60\%-40\%} & \textsc{All}\xspace & $5197$ & $583.3$ & $16.1\%$ \\ & & \textsc{Optimal P.}\xspace & $1384$ ($26.6\%$) & $1249.7$ & $34.4\%$ \\ & & \textsc{Non-Optimal P.}\xspace & $3813$ ($73.4\%$) & $341.5$ & $9.4\%$ \\ \cline{2-6} & \multirow{3}{*}{80\%-20\%} & \textsc{All}\xspace & $2600$ & $537.2$ & $14.3\%$ \\ & & \textsc{Optimal P.}\xspace & $753$ ($29\%$) & $1082.2$ & $30.4\%$ \\ & & \textsc{Non-Optimal P.}\xspace & $1847$ ($71\%$) & $315.1$ & $7.7\%$ \\ \hline \multirow{6}{*}{\emph{Fines}} & \multirow{3}{*}{60\%-40\%} & \textsc{All}\xspace & $59946$ & $1.11$ & $40.5\%$ \\ & & \textsc{Optimal P.}\xspace & $22665$ ($37.8\%$) & $2.68$ & $90.9\%$ \\ & & \textsc{Non-Optimal P.}\xspace & $37281$ ($62.2\%$) & $0.15$ & $9.9\%$ \\ \cline{2-6} & \multirow{3}{*}{80\%-20\%} & \textsc{All}\xspace & $29973$ & $0.96$ & $34.7\%$ \\ & & \textsc{Optimal P.}\xspace & $9243$ ($30.8\%$) & $2.76$ & $92.7\%$ \\ & & \textsc{Non-Optimal P.}\xspace & $20730$ ($69.2\%$) & $0.16$ & $8.9\%$ \\ \bottomrule \end{tabular} } \vspace{0.3cm} \caption{Results related to the test log evaluation\xspace for the \emph{Loan request handling}\xspace and the \emph{Traffic fine management}\xspace scenario.} \vspace{-1cm} \label{tab:log_analysis} \end{table} The results of the test log evaluation\xspace for the \emph{Loan request handling}\xspace scenario \emph{Loans}) confirm the results obtained with the simulation evaluation\xspace. For both splitting criteria, indeed, the average KPI value of the traces following the optimal policy (\textsc{Optimal P.}\xspace) is higher than the average KPI value of all the traces (\textsc{All}\xspace), which in turn is higher than the average KPI value of the traces that do not follow the optimal policy (\textsc{Non-Optimal P.}\xspace). The traces following the optimal policy generate an average bank profit of more than 500 euros higher than the average bank profit of all the traces in the event log, as well as of more than 750 euros higher than the average bank profit of the traces that do not follow the optimal policy. The same ranking is obtained if the compared approaches are ordered by the percentage of traces for which the offer by the bank has been accepted by the customer: around 30\% for the traces following the optimal policy, around 15\% for all traces, and less than 10\% for the traces not following the optimal policy. No major differences can be observed between the two splitting criteria, except for a small decrease of the average KPI value and of the percentage of accepted offers Similarly to the \emph{Loan request handling}\xspace scenario, also in the \emph{Traffic fine management}\xspace scenario (rows \emph{Fines}{} in Table~\ref{tab:log_analysis}) the results of the test log evaluation\xspace confirm the findings of the simulation evaluation\xspace. Indeed, for both splitting criteria, the traces following the optimal policy (\textsc{Optimal P.}\xspace) obtain an average KPI value higher than the average KPI value of all the traces (\textsc{All}\xspace), which in turn is higher than the average KPI value of the traces that do not follow the optimal policy (\textsc{Non-Optimal P.}\xspace). The traces following the optimal policy can produce an average credit value of more than 1 credit higher than the average credit value of all the traces in the event log, as well as of more than 2 credits higher than the average credit value of the traces that do not follow the optimal policy. The trend is also similar for the percentage of traces for which the fine is fully paid. Around 90\% of the traces that follow the optimal policy are able to get fully paid fines for both the splitting criteria. While, as in the \emph{Loan request handling}\xspace, the percentage of traces with a fully paid fine decreases from the 40\% test event log to the 20\% event log for the \textsc{All}\xspace and \textsc{Non-Optimal P.}\xspace policies, for \textsc{Optimal P.}\xspace the percentage of traces for which the full payment is received is higher for the 20\% than for the 40\% test event log. The above results of the two scenarios clearly show that, when no activity has been executed before the target agent starts following the recommendations, the sequence of next activities suggested by the optimal policy generates an average value for the KPI of interest higher than a random policy and than a policy following the most frequently taken actions and, on average, higher than the average KPI value obtained by the actual executions in the test event log (\ref{RQ1}). No clear trends can be observed for different splitting criteria. \begin{figure}[t] \centering \subfloat[average delta KPI value]{\label{sublabel:avg_loan} \includegraphics[width=0.5\textwidth]{figures/loan_avg_delta_reward_scaled3_big.png}} \subfloat[number of traces for each prefix]{\label{sublabel:tot_loan} \includegraphics[width=0.5\textwidth]{figures/loan_count_prefix_big.png}} \caption{Prefix analysis for the \emph{Loan request handling}\xspace scenario.} \vspace{-0.5cm} \label{fig:loan_prefix} \end{figure} \vspace{0.15cm} \noindent \emph{Research Question \ref{RQ2}.} As described in Section~\ref{ssec:setting}, we also evaluate the optimal policies at different prefix lengths, that is, by assuming that a part of the execution has already been carried out, before the target agent starts adopting the optimal policy. \figurename~\ref{fig:loan_prefix} and \figurename~\ref{fig:fine_prefix} show the average delta KPI value for each prefix length, as well as the prefix occurrence per prefix length. The delta KPI value for each trace and prefix length is computed as the difference between the KPI value obtained by following the optimal policy from that prefix on and the KPI value of the complete trace related to that prefix. The plot corresponding to the \emph{Loan request handling}\xspace scenario (\figurename~\ref{sublabel:avg_loan}) shows that for both splitting criteria and for prefix lengths up to $18$ there is an average positive delta KPI value, while for longer prefixes a negative or almost null average KPI values are observed. These results can be explained by the low number of traces with length higher than $18$ in the test event logs, as it is shown in \figurename~\ref{sublabel:tot_loan}. \begin{figure}[t] \centering \subfloat[average delta KPI value]{\label{sublabel:avg_fines} \includegraphics[width=0.5\textwidth]{figures/fine_avg_delta_reward_big.png}} \subfloat[number of traces for each prefix]{\label{sublabel:tot_fines} \includegraphics[width=0.5\textwidth]{figures/fine_count_prefix_big.png}} \caption{Prefix analysis for the \emph{Traffic fine management}\xspace scenario.} \vspace{-0.5cm} \label{fig:fine_prefix} \end{figure} In the \emph{Traffic fine management}\xspace scenario, the plot in \figurename~\ref{sublabel:avg_fines} shows a relatively high delta average KPI value for short prefixes (prefixes of length 1 and 2), while the average delta KPI value starts decreasing for traces of prefix length 3. Also in this case, as for the other scenario, the decrease in terms of delta KPI value is mainly due to an overall decrease of the number of traces after prefix $3$ (see \figurename~\ref{sublabel:tot_fines}). Differently from the \emph{Loan request handling}\xspace scenario, as already observed during the discussion of \ref{RQ1}, the average delta KPI value obtained with the 80\%-20\%{} splitting criterion is higher than the one obtained with the 60\%-40\%{} splitting criterion, except that for prefix length $3$. In conclusion, these results confirm that even when considering ongoing executions, the recommended sequence of next activities suggested by the proposed optimal policy generates higher average KPI values than the ones obtained by actual executions in the test event log (\ref{RQ2}). Beyond the performance perspective, we briefly comment here on the plausibility of the optimal policies obtained. The major contributions of the policies for the two cases are clear and reasonable. In the \emph{Loan request handling}\xspace scenario the policy advises to accept more loan applications, so as to increase the number of possible accepted loans. Moreover, it advises to increase the interaction between the bank and the customer, with the creation of multiple offers and the subsequent call to the customer. In the \emph{Traffic fine management}\xspace scenario the policy advises to send the fine early to the offender, so as to raise the probability that he/she pays the fine on time. \section{Introduction} \label{sec:intro} In the last few years, a number of works have proposed approaches, solutions and benchmarks in the field of Predictive Process Monitoring~\cite{DBLP:conf/caise/MaggiFDG14,DBLP:conf/bpm/Francescomarino18}. Predictive Process Monitoring leverages the analysis of historical execution traces in order to predict the unrolling of a process instance that has been only partially executed. However, most of these efforts have not used the predictions to explicitly support user with recommendations, i.e., with a concrete usage of these predictions. In fact, there is a clear need of \emph{actionable} process management systems~\cite{DBLP:journals/corr/abs-2201-12855} able to support the users with recommendations about the best actions to take The overall goal of this paper is therefore moving a step forward, towards the implementation of a \emph{learning to act} system, in line with the ideas of Prescriptive Process Monitoring~\cite{fahrenkrog2019fire,metzger2020triggering}. Given an ongoing business process execution, Prescriptive Process Monitoring aims at recommending activities or interventions with the goal of optimizing a target measure of interest or Key Performance Indicator (KPI). State-of-the-art works have introduced methods for raising alarms or triggering interventions, to prevent or mitigate undesired outcomes, as well as for recommending the best resource allocation. Only few of them have targeted the generation of recommendations of the next activity(ies) to optimize a certain KPI of interest~\cite{weinzierl2020predictive,groger2014prescriptive,de2020design}, such as, the cycle time of the process execution. Moreover, none of them explicitly considers the process execution in the context of a complex environment that depends upon exogenous factors, including how the other process actors behave. In this setting, identifying the best strategy to follow for a target actor, is not straightforward. In this paper, we take the perspective of one target actor and we propose a solution based on Reinforcement Learning (RL): to recommend to the actor what to do next in order to optimize a given KPI of interest for this actor. To this aim, we first learn, from past executions, the response of the environment (actions taken by other actors) to the target actor's actions, and we then leverage RL to recommend the best activities/actions to carry on to optimize the KPI. In the remainder of the paper after introducing some background concepts (Section~\ref{sec:background}), we present two concrete Prescriptive Process Monitoring problems that we have targeted (Section~\ref{sec:running}). Section~\ref{sec:problem} shows how a Prescriptive Process Monitoring problem can be mapped into RL, while Section~\ref{sec:evaluation} applies the proposed RL approach to the considered problems and evaluates its effectiveness. Finally, Section~\ref{sec:related} and Section~\ref{sec:conclusion} present related works and conclusions, respectively. \subsubsection{Acknowledgements} Please place your acknowledgments at the end of the paper, preceded by an unnumbered run-in heading (i.e. 3rd-level heading). \bibliographystyle{splncs04} \section{Two Motivating Scenarios} \label{sec:running} We introduce here the considered problem by showcasing two real processes that involve one target actor, whose reward is to be maximised, and some more actors, contributing to determine the outcome of the process (environment) \paragraph{Loan request handling} (\emph{Loans}). In a financial institute handling loan requests, customers send loan request applications and the bank decide either to decline an application, or to request further details to the customer, or to make an offer and start a negotiation with the customer. During the negotiation phase, the bank can contact the customer and possibly change its offer to encourage the customer to finally accept the bank's offer. The bank aims at maximizing its payoff by trying to sign agreements with the customer, while reducing the costs of the negotiation phase, i.e., stopping negotiations that will not end up with an agreement. The bank is therefore interested to implement the best strategy to follow (actions) in order to maximize its interest. \paragraph{Traffic fine management} (\emph{Fines}). In a police department in charge to collect road traffic fines, as in the scenario presented in~\cite{DBLP:journals/computing/MannhardtLRA16}, fines can be paid (partly or fully) either immediately after the fine has been issued, or after the fine notification is sent by the police to the offender’s place of residence, or when the notification is received by the offender. If the entire amount is paid, the fine management process is closed. After being notified by post, the offender can appeal against the fine through a judge and/or the prefecture. If the appeal is successful, the case ends. In such a setting, the police department aims at collecting the payment of the invoice by the offender as soon as possible, so as to avoid money wastes due to delays in payments or the involvement of the prefecture/judge. The department indeed receives credits for fast payments, no credits for payments never received and discredits for incorrect fines. The department is therefore interested to receive best action recommendations to maximize the received credits. \section{Mapping PPM to RL} \label{sec:problem} We would like to support a target actor of interest in a process, such as, the financial institute or the police department (see Section~\ref{sec:running}), by providing them with recommendations for the best activities to execute in order to maximize their profit and their credits, respectively. To this aim, we leverage RL, by transforming the PPM problem of recommending the next activities to optimize a given KPI, into an RL problem, where the \emph{agent} is the actor we are supporting in the decision making (e.g., the bank or the police department), and the \emph{environment} is represented by the external factors---especially the activities carried out by the other actors involved in the process execution (e.g., the customer or the offender). We define our MDP so that: \begin{itemize}[label=$\bullet$,topsep=0.3pt] \item an \emph{action}, to be recommended, is an activity of the actor of interest (\emph{agent}) (e.g., the bank activity \act{Create offer}); \item a \emph{state} is defined by taking into account the following variables: \begin{itemize}[label=$-$] \item the last activity executed by the actor of interest (e.g., the creation of a new offer by the bank) or by the other actors defining the stochastic response of the environment (e.g., the bank offer acceptance by the customer); \item some relevant information about the history of the execution (e.g., the number of phone calls between the bank and the customer); \item other aspects defining the stochastic response of the environment (e.g., the amount of the requested loan) \end{itemize} A \emph{state}{} is hence represented by a tuple $\langle \textsc{LA}, \textsc{HF}, \textsc{EF} \rangle$, where \textsc{LA}{} is the last activity executed by the actor of interest or by one of the other actors involved in the process, \textsc{HF}{} is a vector of features describing some relevant information of the process execution history and \textsc{EF}{} is a vector of features further describing the environment response to the actions of the actor of interest. \item the \emph{reward function} is a numerical value that transforms the KPI of interest, computed on the complete execution, in a utility function at the level of single action. \end{itemize} Actions, states and reward function can be defined for each specific problem by leveraging the information contained in the event log and some domain knowledge. The activities we are interested to recommend and those describing the stochastic response of the environment can be extracted from the event log. The relevant information about the history of the process execution can also be extracted from the event log, with some domain-specific pre-processing (e.g., counting the number of phone calls between the bank and the customer). The stochastic responses of the environment to the actor's actions can also be mined from the event log through trace attributes (e.g., the amount of the requested loan). Finally, information contained in event logs can be used to estimate the reward function for each state transition and action (e.g., in case the reward function is related to the process/event cycle time, the average duration of events of a certain type can be used to estimate the reward of a given state). \section{Related Work} \label{sec:related} The state-of-the-art works related to this paper pertain to two fields: Prescriptive Process Monitoring and Reinforcement Learning. The section is hence structured by first presenting Prescriptive Process Monitoring related works and then Reinforcement Learning state-of-the-art works, applied to process mining problems. Several Prescriptive Process Monitoring techniques have been recently proposed in the literature. Focusing on the type of interventions that the approaches recommend~\cite{DBLP:journals/corr/abs-2112-01769}, we can roughly classify existing work in Prescriptive Process Monitoring in three main groups: (i) those that recommend different types of interventions to prevent or mitigate the occurrence of an undesired outcome~\cite{Teinemaaetal2018,fahrenkrog2019fire,metzger2019proactive,metzger2020triggering,DBLP:journals/corr/abs-2109-02894}; (ii) those that take a resource perspective and recommend a resource allocation~\cite{10.1007/978-3-319-39696-5_35,DBLP:conf/icpm/ParkS19}; (iii) those that provide recommendations related to the next activity to optimize a given KPI~\cite{weinzierl2020predictive,groger2014prescriptive,de2020design}. The approach presented in this paper falls under this third family of prescriptive process monitoring approaches. Only a small amount of research has been done in this third group of works. Weinzierl et al. in~\cite{weinzierl2020predictive} discuss how the most likely behavior does not guarantee to achieve the desired business goal. As a solution to this problem, they propose and evaluate a prescriptive business process monitoring technique that recommends next best actions to optimize a specific KPI, i.e., the time. Gröger et al. in~\cite{groger2014prescriptive} present a data-mining driven concept of recommendation-based business process optimization supporting adaptive and continuously optimized business processes. De Leoni et al. in~\cite{de2020design} discuss Process-aware Recommender (PAR) systems, in which a prescriptive-analytics component, in case of executions with a negative outcome prediction, recommends the next activities that minimize the risk to complete the process execution with a negative outcome. Differently from these state-of-the-art works, however, in this work we take the perspective of one of the actors of the process and we aim at optimizing a domain-specific KPI of interest for this actor by leveraging an RL approach. In the literature, only few RL approaches have been proposed for facing problems in the process mining field. Silvander proposes using Q-Learning with function approximation via a deep neural network (DQN) for the optimization of business processes~\cite{silvander2019business}. He suggests defining a so called decay rate to reduce the amount of exploration over time. Huang et al. employ RL for the dynamic optimization of resource allocation in business process executions~\cite{huang2011reinforcement}. Metzger et al. propose an alarm-based approach to prevent and mitigate an undesired outcome~\cite{metzger2020triggering}. They use online RL to learn when to trigger proactive process adaptations based on the reliability of predictions. Although all these works use RL in the process mining field, none of them use it for recommending the next actions to perform in order to optimize a certain KPI of interest, as in this work. Finally, some works have applied RL and Inverse Reinforcement Learning (IRL) approaches to recommend the next actions on temporal data~\cite{DBLP:conf/recsys/Massimo018} or on data constrained by temporal constraints~\cite{DBLP:conf/aips/GiacomoIFP19} \section{First Section} \subsection{A Subsection Sample} Please note that the first paragraph of a section or subsection is not indented. The first paragraph that follows a table, figure, equation etc. does not need an indent, either. Subsequent paragraphs, however, are indented. \subsubsection{Sample Heading (Third Level)} Only two levels of headings should be numbered. Lower level headings remain unnumbered; they are formatted as run-in headings. \paragraph{Sample Heading (Fourth Level)} The contribution should contain no more than four levels of headings. Table~\ref{tab1} gives a summary of all heading levels. \begin{table} \caption{Table captions should be placed above the tables.}\label{tab1} \begin{tabular}{|l|l|l|} \hline Heading level & Example & Font size and style\\ \hline Title (centered) & {\Large\bfseries Lecture Notes} & 14 point, bold\\ 1st-level heading & {\large\bfseries 1 Introduction} & 12 point, bold\\ 2nd-level heading & {\bfseries 2.1 Printing Area} & 10 point, bold\\ 3rd-level heading & {\bfseries Run-in Heading in Bold.} Text follows & 10 point, bold\\ 4th-level heading & {\itshape Lowest Level Heading.} Text follows & 10 point, italic\\ \hline \end{tabular} \end{table} \noindent Displayed equations are centered and set on a separate line. \begin{equation} x + y = z \end{equation} Please try to avoid rasterized images for line-art diagrams and schemas. Whenever possible, use vector graphics instead (see Fig.~\ref{fig1}). \begin{figure} \includegraphics[width=\textwidth]{fig1.eps} \caption{A figure caption is always placed below the illustration. Please note that short captions are centered, while long ones are justified by the macro package automatically.} \label{fig1} \end{figure} \begin{theorem} This is a sample theorem. The run-in heading is set in bold, while the following text appears in italics. Definitions, lemmas, propositions, and corollaries are styled the same way. \end{theorem} \begin{proof} Proofs, examples, and remarks have the initial word in italics, while the following text appears in normal font. \end{proof} For citations of references, we prefer the use of square brackets and consecutive numbers. Citations using labels or the author/year convention are also acceptable. The following bibliography provides a sample reference list with entries for journal articles~\cite{ref_article1}, an LNCS chapter~\cite{ref_lncs1}, a book~\cite{ref_book1}, proceedings without editors~\cite{ref_proc1}, and a homepage~\cite{ref_url1}. Multiple citations are grouped \cite{ref_article1,ref_lncs1,ref_book1}, \cite{ref_article1,ref_book1,ref_proc1,ref_url1}. \subsubsection{Acknowledgements} Please place your acknowledgments at the end of the paper, preceded by an unnumbered run-in heading (i.e. 3rd-level heading). \section{A RL Solution} Figure~\ref{fig:architecture} shows the architecture of the RL-based solution designed to solve the problem of recommending the next best activities to optimize a certain KPI. \begin{figure}[t] \centering \includegraphics[width=\textwidth]{figures/architecture.png} \caption{Architecture of the RL solution} \vspace{-0.5cm} \label{fig:architecture} \end{figure} The input is an event log containing historical traces related to the execution of a process, and some domain knowledge, specifying the KPI of interest and the information that allows for the identification of actions, states and of the reward function. There are three main processing phases: \begin{itemize}[label=$\bullet$,topsep=0.3pt] \item \emph{preprocessing phase:} the event log is preprocessed in order to learn a representation of the environment (i.e., the MDP). First, the event log is cleansed and the domain knowledge leveraged in order to annotate it. In detail, the event log is (i) filtered in order to remove low-frequency variants (with occurrence frequency lower than 10\%) and activities that are not relevant for the decision making problem; (ii) enriched with attributes obtained by aggregating and preprocessing information related to the execution; (iii) annotated by specifying the agent's activities to be considered as actions; attributes and environment activities to be used for the state definition; attributes to be used for the computation of the reward function. Once the event log has been enriched and annotated, it can be used for building the MDP that defines the RL problem. To this aim, we start from the scenario-specific definition of action and state and, by replaying the traces in the event log, we build a directed graph, where each node corresponds to a state and each edge is labelled with the activity allowing to move from one node state to the other. Moreover, for each edge, the probability of reaching the target node (computed based on the number of traces in the event log that reach the corresponding state) and the value of the reward function are computed. Each edge is hence mapped to the tuple $(s, a, s', \mathcal{P}(s'|s,a), \mathcal{R})$ where $s$ is the state corresponding to the source node of the edge, $a$ is the action used for labelling the edge, $s'$ is the state corresponding to the target node of the edge, $\mathcal{P}(s'|s,a)$ is computed as the percentage of the traces that reach the state $s'$ among the traces that reach state $s$ and execute $a$, and $\mathcal{R}$ is the value of the reward function. \item \emph{RL phase:} the RL algorithm is actually applied to compute the optimal policy $\pi^\ast$; in this paper we used policy iteration with Monte Carlo methods. \item \emph{runtime phase:} given an empty or ongoing execution trace, the policy is queried by the recommender system to return the best activities to be executed next. \end{itemize}
578760edfca0f9304414300e01006b6119e5218e
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{se:Introduction} Topological solitons are particlelike excitations in continuum field theory~\cite{Sutcliffe_2004}, which can also be found in magnetic systems~\cite{Nagaosa_NNANO2013,Mochizuki_Review,Finocchio_JPD2016,Wiesendanger_Review2016,Fert_NATREVMAT2017,Zhang_JPCM2020,Gobel_PP2021,Reichhardt_2021,Zhou_NSR2018,Li_MH2021,Tokura_CR2021,Yu_JMMM2021,Marrows_APL2021}. For example, the magnetic skyrmion is a representative topological soliton in magnetic materials with chiral or frustrated exchange interactions, which has been extensively studied in the past decade~\cite{Nagaosa_NNANO2013,Mochizuki_Review,Finocchio_JPD2016,Wiesendanger_Review2016,Fert_NATREVMAT2017,Zhang_JPCM2020,Gobel_PP2021,Reichhardt_2021,Zhou_NSR2018,Bogdanov_1989,Roszler_NATURE2006,Li_MH2021,Tokura_CR2021,Yu_JMMM2021,Marrows_APL2021}. Magnetic skyrmions are versatile objects that can be used for different types of spintronic applications~\cite{Nagaosa_NNANO2013,Mochizuki_Review,Finocchio_JPD2016,Wiesendanger_Review2016,Fert_NATREVMAT2017,Zhang_JPCM2020,Gobel_PP2021,Reichhardt_2021,Zhou_NSR2018,Li_MH2021,Tokura_CR2021,Yu_JMMM2021,Marrows_APL2021}, mainly including information storage and logic computing~\cite{Sampaio_NN2013,Tomasello_SREP2014,Xichao_SREP2015B,Luo_APLM2021,Vakili_JAP2021,Li_SB2022}. A recent research further suggests the possibility of using skyrmions for quantum computing, where information is stored in the quantum degree of helicity~\cite{Psaroudaki_PRL2021}. However, the helicity of a skyrmion stabilized by the Dzyaloshinskii-Moriya interaction (DMI) is usually fixed~\cite{Xichao_NCOMMS2017}. Namely, the skyrmion stabilized by the bulk-type DMI shows a Bloch-type helicity structure~\cite{Muhlbauer_SCIENCE2009,Yu_Nature2010}, while the one stabilized by the interface-induced DMI shows a N{\'e}el-type helicity~\cite{Wanjun_SCIENCE2015,Woo_NM2016,ML_NN2016,Boulle_NN2016,Soumyanarayanan_NM2017,Wanjun_NPHYS2017,Litzius_NPHYS2017}. On the other hand, the skyrmion in a frustrated magnet without DMI do have the helicity degree of freedom provided that the magnetic dipole-dipole interaction (DDI) is weak~\cite{Leonov_NCOMMS2015,Lin_PRB2016A,Batista_2016,Diep_Entropy2019,Xichao_NCOMMS2017}. The presence of DDI may lead to the Bloch-type helicity of a frustrated skyrmion~\cite{Xichao_NCOMMS2017,Kurumaji_SCIENCE2019}. Most recently, three-dimensional (3D) skyrmion strings attract great attention from the field~\cite{Sutcliffe_2017,Kagawa_2017,Yokouchi_2018,Sohn_2019,Koshibae_2019,Seki_2020,Koshibae_2020,Yu_2020,Birch_NC2021,Kravchuk_2020,Xing_2020,Tang_2021,Zheng_2021,Seki_2021,Xia_2021,Zhang_2021,Marrows_2021}, which are materialized in layered magnets and thick magnetic bulks. Therefore, it is an interesting problem to study the helicity dynamics of a 3D skyrmion string in frustrated magnetic system without DMI. Meanwhile, topological insulators are also among the hottest topics in condensed-matter physics. They are mainly studied in the linear theory. Recently, they are generalized to nonlinear systems including photonic~\cite{Ley,Zhou,MacZ,HadadB,Smi,Tulo,Kruk,NLPhoto,Kirch,TopoLaser}, mechanical~\cite{Snee,PWLo,MechaRot}, and electric circuit~\cite{Hadad,Sone,TopoToda} systems. The quench dynamics under the initial condition with only edge site being excited is a powerful method to differentiate the topological and trivial phases~\cite{TopoToda,NLPhoto,MechaRot}. A finite standing wave is excited in the topological phase but not in the trivial phase. There are some reports on a topological phase in magnetic systems with low-energy magnon excitations~\cite{Shindo,Chis,Kim,Ruk,LChen}. Spin-wave dynamics has been studied in dimerized spin-torque oscillator arrays by using the Holstein-Primakoff transformation~\cite{Freb}. It simulates the Su-Schrieffer-Heeger (SSH) model in magnetic systems, where the bonding is dimerized. The SSH model is a typical model of a topological insulator. Nonlinear dynamics of the non-Hermitian SSH model has also been studied in the same system~\cite{Gunn}. In this work, we study the dynamics of the helicity wave along a 3D skyrmion string in a layered frustrated magnet, where the interlayer couplings are alternating. An effective model is described by the dynamical $XY$ model with dimerization, which is a nonlinear model. We study the quench dynamics, where only the helicity at the bottommost magnetic layer is rotated at the initial time. The nonlinearity is controlled by the rotation angle. When the rotation angle is small, the system is approximated by a linear model, and the dynamical $XY$ model is reduced to a kind of the dynamical SSH model. We find that the distinction between the topological and trivial phases remains even in the nonlinear regime. \section{Helicity dynamics in frustrated skyrmion string} A rigid nanoscale skyrmion is a centrosymmetric swirling spin texture, whose collective coordinates are the skyrmion center and the helicity $\eta$ ($0\leq \eta <2\pi $). The spin texture located at the coordinate center is parametrized as \begin{equation} \mathbf{m}\left( \mathbf{r}\right) =\left( \sin \theta \cos \phi ,\sin \theta \sin \phi ,\cos \theta \right) , \label{mr} \end{equation wit \begin{equation} \phi =Q\varphi +\eta +\pi /2, \label{Varphi} \end{equation where $\varphi $ is the azimuthal angle ($0\leq \varphi <2\pi $) satisyfing \begin{equation} x=r \cos \varphi ,\quad y=r \sin \varphi , \end{equation with $r=\sqrt{x^{2}+y^{2}}$, and \begin{equation} Q\equiv -\frac{1}{4\pi }\int \mathbf{m}\left( \mathbf{r}\right) \cdot \left( \partial _{x}\mathbf{m}\left( \mathbf{r}\right) \times \partial _{y}\mathbf{m}\left( \mathbf{r}\right) \right) d^{2}\mathbf{r} \end{equation is the skyrmion number counting how many times $\mathbf{m}\left( \mathbf{r}\right) $ wraps $S^{2}$ as the coordinate $\left( x,y\right) $ spans the whole planar space~\cite{Nagaosa_NNANO2013,Zhang_JPCM2020}. Typically, there are two types of skyrmions differentiated by the helicity $\eta $. They are the Bloch-type skyrmion [Fig.~\ref{FigIllust}(a)] for $\eta =0$ and $\pi $, and the N{\'e}el-type skyrmion [Fig.~\ref{FigIllust}(b)] for $\eta =\pi /2$ and $3\pi /2$ in the present convention in Eq.~(\ref{Varphi}), which is different from the conventional definition by the presence of the factor $\pi /2$. The helicity $\eta$ is locked in a skyrmion stabilized by the DMI in such a way that the Bloch-type~\cite{Muhlbauer_SCIENCE2009,Yu_Nature2010} (N{\'e}el-type~\cite{Wanjun_SCIENCE2015,Woo_NM2016,ML_NN2016,Boulle_NN2016,Soumyanarayanan_NM2017,Wanjun_NPHYS2017,Litzius_NPHYS2017}) structure is realized by the bulk (interface-induced) DMI. We first discuss a skyrmion in a frustrated magnet, where the DMI is absent. The skyrmion energy depends on the helicity $\eta $ in the presence of the magnetic DDI as~\cite{Xichao_NCOMMS2017 \begin{equation} H_{\text{DDI}}=-V\cos 2\eta , \label{DDI} \end{equation where $V$ is the magnitude of the potential. Hence, it weakly favors the Bloch order ($\eta =0$ and $\pi$). \begin{figure}[t] \centerline{\includegraphics[width=0.48\textwidth]{Illust}} \caption (a) Schematic of a Bloch-type skyrmion. (b) Schematic of a N{\'e}el-type skyrmion. (c) Illustration of a layered frustrated magnet. The alternating thicknesses of spacers are assumed to materialize alternating interlayer exchange couplings. A heavy-metal layer is underneath the layered frustrated magnet, in which a vertical spin current could be generated to drive the helicity dynamics of the skyrmion in the bottommost magnetic layer. (d) Illustration of a 3D Bloch-type skyrmion string. } \label{FigIllust} \end{figure} In the present work, we consider a layered structure of frustrated skyrmions, where all magnetic layers are insulated by spacers between them, as depicted in Fig.~\ref{FigIllust}(c). We focus on a skyrmion string in Fig.~\ref{FigIllust}(d), where the dynamical degrees of freedom are given by the collective coordinates of each skyrmion. They are the skyrmion center and the helicity. However, we analyze only the dynamics of the helicity by neglecting the motion of the center in the present work. Namely, our system is a straight skyrmion string, where the magnetic DDI energy i \begin{equation} H_{\text{DDI}}=-V\sum_{i}\cos 2\eta _{i}, \end{equation where $i$ is the layer index. The interlayer coupling of the helicity between adjacent layers is described by the XY model \begin{equation} H_{\text{inter}}=-\sum_{i}J_{i}\left( S_{i}^{x}S_{i+1}^{x}+S_{i}^{y}S_{i+1}^{y}\right) , \end{equation because $S_{i}^{z}=0$. By inserting Eq.~(\ref{mr}) into this equation with $\theta =\pi /2$, we obtai \begin{equation} H_{\text{inter}}=-\sum_{i}J_{i}\cos \left( \eta _{i}-\eta _{i+1}\right) . \end{equation The kinetic term is given by~\cite{Leon \begin{equation} H_{\text{kine}}=m\sum_{i}\frac{\eta _{i}^{2}}{2}, \label{Kine} \end{equation where $m$ is the effective mass of the helicity given by $m=J/v^{2}$ with $v$ the velocity of the helicity wave along the skyrmion string for $V=0$; see Eq.~(\ref{SpinVelo}). The total Hamiltonian is given b \begin{equation} H=H_{\text{kine}}+H_{\text{inter}}+H_{\text{DDI}}, \end{equation from which the equations of motion are derived \begin{align} m\eta _{i} &=-\sum_{i}\left[ J_{i}\sin \left( \eta _{i}-\eta _{i+1}\right) +J_{i-1}\sin \left( \eta _{i}-\eta _{i-1}\right) \right] \notag \\ &-2V\sum_{i}\sin 2\eta _{i}. \end{align We may choose the alternating interlayer coupling \begin{equation} J_{i}=J\left( 1+\lambda \left( -1\right) ^{i}\right) , \end{equation or $J_{i}=J_{A}$ for even $i$ and $J_{i}=J_{B}$ for odd $i$ wit \begin{equation} J_{A}=J\left( 1+\lambda \right) ,\qquad J_{B}=J\left( 1-\lambda \right) . \end{equation The exchange coupling can be controlled by modulating the thickness of the spacer between adjacent magnetic layers. In this way, the skyrmion string is made a dimerized system. The equations of motion read \begin{align} m\frac{d^{2}\eta _{2n-1}}{dt^{2}}=& J_{A}\sin \left( \eta _{2n}-\eta _{2n-1}\right) \notag \\ & +J_{B}\sin \left( \eta _{2n-2}-\eta _{2n-1}\right) -2V\sin 2\eta _{2n-1}, \\ m\frac{d^{2}\eta _{2n}}{dt^{2}}=& J_{B}\sin \left( \eta _{2n+1}-\eta _{2n}\right) \notag \\ & +J_{A}\sin \left( \eta _{2n-1}-\eta _{2n}\right) -2V\sin 2\eta _{2n}. \end{align We analyze the system under the initial condition \begin{equation} \eta _{i}(t)=\xi \pi \delta _{i,1},\qquad \eta _{i}(t)=0\quad \text{at}\quad t=0. \label{IniCon} \end{equation Namely, we rotate the helicity of the bottommost layer initially, and investigate how a helicity wave propagates along the skyrmion string as time evolves. We note that the helicity of skyrmion can be controlled by applying a spin current~\cite{Xichao_NCOMMS2017}. As shown in Fig.~\ref{FigIllust}, we assume that the layered frustrated magnet is placed upon a heavy-metal substrate, which may be fabricated experimentally in a bottom-up fashion. If we apply a charge current in the heavy-metal substrate, a vertical spin current will be generated and injected into the bottommost magnetic layer due to the spin Hall effect, which only drives the rotation of the skyrmion helicity in the bottommost magnetic layer. In addition to the rotation of the helicity, the center of the skyrmion also rotates~\cite{Xichao_NCOMMS2017}. \begin{figure}[t] \centerline{\includegraphics[width=0.48\textwidth]{SSHIllust}} \caption{Illustration of a skyrmion string, where blue disks represent skyrmions, while red and green bonds represent the couplings $J_A$ and $J_B$. (a) Isolated limit $\protect\lambda =1$, (b) intermediate state $|\protect\lambda |<1$ and (c) dimer limit $\protect\lambda =1$. } \label{FigSSHIllust} \end{figure} \section{Linear theory} \subsection{SSH model} We first investigate the system where the initial helicity rotation $\xi \pi $ is tiny, $\left\vert \xi \right\vert \ll 1$, which we call the linear regime. Indeed, the equations of motion are linearized and given b \begin{equation} m\eta _{i}=-\left[ J_{i}\left( \eta _{i}-\eta _{i+1}\right) +J_{i-1}\left( \eta _{i}-\eta _{i-1}\right) \right] -4V\eta _{i}, \label{LinearEq} \end{equation since we may assume $\left\vert \eta _{i}-\eta _{i+1}\right\vert \ll 1$ and $\left\vert \eta _{i}\right\vert \ll 1$. They are summarized a \begin{equation} m\eta _{i}=\sum_{j}H_{ij}^{\text{Linear}}\eta _{j}, \end{equation wher \begin{equation} H_{ij}^{\text{Linear}}=H_{ij}^{\text{SSH}}-\left( J_{A}+J_{B}+4V\right) \delta _{ij}, \label{SSH1} \end{equation with \begin{equation} H_{ij}^{\text{SSH}}=J_{A}\left( \delta _{2i,2j-1}+\delta _{2j,2i-1}\right) +J_{B}\left( \delta _{2i,2j+1}+\delta _{2j,2i+1}\right) . \label{SSH2} \end{equation This is the SSH model. It is expressed as \begin{equation} H^{\text{SSH}}\left( k\right) =\left( \begin{array}{cc} 0 & J_{A}+J_{B}e^{-ik} \\ J_{A}+J_{B}e^{ik} & \end{array \right) , \end{equation in the momentum space. The SSH model (\ref{SSH2}) is illustrated in Fig.~\ref{FigSSHIllust}, where blue disks stand for skyrmions located in the layer $i$, while red and blue lines indicate the couplings $J_{A}$ and $J_{B}$, respectively. There are two special limits, that is, the system has two isolated edges at $i=1$ and $L$ for $\lambda =-1$ as in Fig.~\ref{FigSSHIllust}(a), while all of the states are dimerized for $\lambda =1$ as in Fig.~\ref{FigSSHIllust}(c). \begin{figure}[t] \centerline{\includegraphics[width=0.48\textwidth]{SSH}} \caption{(a) The energy spectrum of the SSH model as a function of $\protect\lambda $. Topological edge states are marked in red, while the bulk states are marked in cyan. The vertical axis is energy in units of $J$. (b) The spatial profile of the edge states $|\protect\psi^{\text{b}} _{n}|^{2}+|\protect\psi^{\text{t}} _{n}|^{2}$ as a function of $\protect\lambda $. (c) $|\protect\psi^{\text{b}} _{1}|^{2}+|\protect\psi^{\text{t}} _{L}|^{2}$ as a function of $\protect\lambda $. Red disk at $\protect\lambda =1 $ show the peak amplitude owing to the dimer state. We have used a finite chain with length $L=50.$} \label{FigSSH} \end{figure} \begin{figure}[t] \centerline{\includegraphics[width=0.48\textwidth]{Dynamics}} \caption{Time evolution of $\sin\protect\phi_i$ for $0\leq t\leq 50$. (a1), (a2), (c1) and (c2) topological phase with $\protect\lambda =-0.5$. (b1), (b2), (d1) and (d2) trivial with $\protect\lambda =0.5$. (a1), (a2), (b1) and (b2) Weak nonlinearity with $\protect\xi =0.1$. (c1), (c2), (d1) and (d2) strong nonlinearity with $\protect\xi =0.5$. We have set $m=1$, $J=1$ and $V=0.1$. We have used a finite chain with length $L=50$.} \label{FigDynamics} \end{figure} \begin{figure*}[t] \centerline{\includegraphics[width=0.98\textwidth]{DistributionB}} \caption{Phase indicator $\Phi $ as a function of the dimerization $\protect\lambda $. (a) $\protect\xi =0.1$, (b) $\protect\xi =0.5$, $\protect\xi =0.75 $ and $\protect\xi =1$. Black curves indicate $V=0$, magenta curves indicate $V=0.1$ and cyan curves indicate $V=0.2$. We have set $V=0$, $m=1$, $J=1$, $L=50$ and $T=100$.} \label{FigDistribution} \end{figure*} \subsection{Topological number} The SSH Hamiltonian $H^{\text{SSH}}$ describes a topological system. The topological number is the Berry phase defined b \begin{equation} \Gamma =\frac{1}{2\pi }\int_{0}^{2\pi }A\left( k\right) dk, \label{TopoNum} \end{equation where $A\left( k\right) =-i\left\langle \psi (k)\right\vert \partial_{k}\left\vert \psi (k)\right\rangle $ is the Berry connection with $\psi(k)$ the eigenfunction of $H^{\text{SSH}}\left( k\right) $. It is also the topological number of the model $H^{\text{Linear}}$ because the diagonal term in Eq.~(\ref{SSH1}) does not contribute to it. We obtain $\Gamma =1$ for $\lambda <0$ and $\Gamma =0$\ for $\lambda >0$. Hence, the linear system is topological for $\lambda <0$\ and trivial for $\lambda >0$. The topological structure of the SSH Hamiltonian $H^{\text{SSH}}$ becomes manifest in terms of the energy spectrum in the coordinate space as a function of $\lambda $. It is shown in Fig.~\ref{FigSSH}(a), where topological edge states are clearly observed at zero energy as marked in red for $-1\leq \lambda <0$. There are two degenerate eigenfunctions $\psi _{n}^{\text{b}}$ and $\psi _{n}^{\text{t}}$ localized at the bottom edge $(n=1)$ and the top edge ($n=L)$ of the skyrmion string. They correspond to the two isolated disks in Fig.~\ref{FigSSHIllust}(a). We show $|\psi _{n}^{\text{b}}|^{2}+|\psi _{n}^{\text{t}}|^{2}$ in Fig.~\ref{FigSSH}(b). It has sharp peaks at the edges $n=1$ and $L$ for $-1\leq \lambda <0$, but none for $0\leq \lambda <1$. The exception occurs at $\lambda =1$, where there are peaks at $n=1,2,L-1$ and $L$. They correspond to the two dimers at the edges in Fig.~\ref{FigSSHIllust}(c), about which we discuss later: see Sec.~\ref{SecDimer}. The eigen function $\Psi\equiv |\psi _{1}^{\text{b}}|^{2}+|\psi _{L}^{\text{t}}|^{2}$ is plotted in Fig.~\ref{FigSSH}(c), demonstrating the topological and trivial phases: $\Psi=2$ at $\lambda =-1$, and it decreases monotonically and becomes $\Psi =0$ for $0<\lambda <1$. Furthermore, it suddenly becomes $\Psi =1$ at $\lambda=1 $ owing to the formation of the dimer state. \subsection{Helicity wave} We consider the homogeneous system with $\lambda =0$, where the equations of motion are simply given b \begin{equation} m\eta _{i}=J\sum_{i}\left[ \eta _{i+1}+\eta _{i-1}-2\eta _{i}\right] -4V\eta _{i}. \end{equation The continuum limit read \begin{equation} m\eta \left( x\right) =J\frac{\partial ^{2}\eta }{\partial x^{2}}-4V\eta , \label{WaveEq} \end{equation which is the wave equation. By inserting the linear wave ansat \begin{equation} \eta =\exp \left[ i\left( kx-\omega t\right) \right] \end{equation into Eq.~(\ref{WaveEq}), we obtain the velocity of the helicity wave a \begin{equation} v=\frac{\omega }{k}=\sqrt{\frac{J-4V/k^{2}}{m}}. \label{SpinVelo} \end{equation The effective mass $m$ is determined in terms of the velocity of the helicity wave along the skyrmion string. \section{Nonlinear theory} We proceed to analyze the system where the initial helicity rotation $\xi\pi $ is not tiny, which we call the nonlinear regime. \subsection{Dimer system\label{SecDimer}} We have noticed the emergence of an isolated point at $\lambda =1$ in the energy spectrum of the linear theory as in Fig.~\ref{FigSSH}(c). We explore the physics of this point at $\lambda =1$, where the system is perfectly dimerized as in Fig.~\ref{FigSSHIllust}(c). We set $V=0$ in order to obtain analytic solution. In this case, the equations of motion are simply given b \begin{align} m\eta _{1} &=-J\sin \left( \eta _{1}-\eta _{2}\right) , \\ m\eta _{2} &=-J\sin \left( \eta _{2}-\eta _{1}\right) , \end{align which are equivalent t \begin{align} m\left( \eta _{1}+\eta _{2}\right) &=0, \\ m\left( \eta _{1}-\eta _{2}\right) &=-2J\sin \left( \eta _{1}-\eta_{2}\right) . \end{align The solution is given b \begin{equation} \eta _{1}(t)=-\eta _{2}+c_{3}=\text{am}\left[ \frac{\sqrt{\left( 4J+c_{1}\right) \left( t+c_{2}\right) ^{2}}}{2},\frac{8J}{4J+c_{1}}\right] , \end{equation where $c_{1}$ $c_{2}$, and $c_{3}$ are determined from the initial condition, or by solving $\eta _{1}(0)=\xi \pi $. This solution indicates that there is an oscillation in the two layers at the bottom edge at $\lambda =1$, and hence we call it a dimer state. Numerical analysis shows the emergence of the dimer state also at $\lambda \neq 1$, forming a dimer phase in the nonlinear regime, as we will discuss. \begin{figure}[t] \centerline{\includegraphics[width=0.48\textwidth]{Phase}} \caption{Phase indicator $\Phi $ in the $\protect\lambda $-$\protect\xi $ plane. (a) Bird's eye's view and (b) the top view. (c) The color palette indicates the amplitude in (a) and (b). We have set $V=0$, $m=1$, $J=1$, $L=50$ and $T=100$. (d) Schematic illustration of the phase diagram.} \label{FigPhase} \end{figure} \subsection{Quench dynamics of helicity wave} We analyze the quench dynamics of the system under the initial condition (\ref{IniCon}) numerically for $-1\leq \lambda \leq 1$ and for $0\leq \xi\leq 1$. The time evolution of $\sin \eta _{i}$ is shown in Fig.~\ref{FigDynamics}. There is a finite stationary oscillation at the site $i=1$ in the topological phase as shown in Fig.~\ref{FigDynamics}(a2), but this is not the case in the trivial phase as shown in Fig.~\ref{FigDynamics}(b2). This feature holds also for strong nonlinear regime as shown in Fig.~\ref{FigDynamics}(c2) and (d2). Figure~\ref{FigDynamics} indicates that the amplitude after long enough time is a good signal to detect whether the system is topological or trivial. To detect it quantitatively, we define an indicator with the use of the maximum value of $\sin \left\vert \eta _{1}\right\vert $ a \begin{equation} \Phi (\lambda ,\xi )=\max_{0.9T<t<T}\left[ \sin \left\vert \eta _{1}\right\vert \right] , \end{equation taking large enough $T$ so that the time evolution of $\eta _{1}$ becomes stationary. We show $\Phi (\lambda ,\xi )$ for $-1\leq \lambda \leq 1$ by taking typical values of $\xi $ in Fig.~\ref{FigDistribution}. In the weak nonlinear regime, $\Phi $ is finite in the topological phase while it is almost zero in the trivial phase, as shown in Fig.~\ref{FigDistribution}(a). As the increase of the nonlinearity ($\xi \rightarrow 1$), the finite region of $\Phi $ is expanded in the vicinity of $\lambda =1$, forming the dimer phase, as shown in Fig.~\ref{FigDistribution}(b)$\sim $(d). There is only slight difference in the indicator $\Phi $ for various $V$ in the topological phase as shown in Fig.~\ref{FigDistribution}. On the other hand, the peak value of $\Phi$ is identical between $\lambda =1$ and $\lambda =-1$ due to the energy conservation. \subsection{Phase diagram} The indicator\ $\Phi $ is shown in the $\lambda $-$\xi $ plane in Fig.~\ref{FigPhase}. We find three phases: the topological, trivial and dimer phases. In the isolated limit $\lambda =-1$, $\Phi =\sin \xi \pi $\ for $\xi \leq 1/2 $\ and $\Phi =1$\ for $1/2\leq \xi \leq 1$. The topological distinction is hard to see for $\xi \simeq 0$\ because $\sin \xi \pi $\ is very small. However, there is a clear distinction between the topological and trivial phase as shown in Fig.~\ref{FigDistribution}(a). The phase boundary between the topological and trivial phase is always $\lambda =0$ even in the nonlinear regime.\ On the other hand, the dimer phase emerges in the trivial phase when the nonlinearity exists. The region of the dimer phase consists of a point at $\xi =0$ but occupies a quite large area for $\xi \gtrsim 1/2$. \section{Discussion and Conclusion} \label{se:Conclusion} In conclusion, we have explored the helicity dynamics of a skyrmion string in a layered frustrated magnet, where the interlayer coupling is alternating. The topological physics of the SSH model well survives although the governing equation is nonlinear model. Our results show that an introduction of the interlayer degree of freedom may give us a rich physics in the dynamics of a skyrmion string. It is an interesting problem to use a skyrmion string as an information transmission channel. \begin{acknowledgments} M.E. is very much grateful to N. Nagaosa for helpful discussions on the subject. This work is supported by the Grants-in-Aid for Scientific Research from MEXT KAKENHI (Grants No. JP17K05490 and No. JP18H03676). This work is also supported by CREST, JST (JPMJCR16F1 and JPMJCR20T2). J.X. was an International Research Fellow of the Japan Society for the Promotion of Science (JSPS). X.Z. was a JSPS International Research Fellow. X.Z. was supported by JSPS KAKENHI (Grant No. JP20F20363). X.L. acknowledges support by the Grants-in-Aid for Scientific Research from JSPS KAKENHI (Grant Nos. JP20F20363, JP21H01364, and JP21K18872). Y.Z. acknowledges support by Guangdong Basic and Applied Basic Research Foundation (2021B1515120047), Guangdong Special Support Project (Grant No. 2019BT02X030), Shenzhen Fundamental Research Fund (Grant No. JCYJ20210324120213037), Shenzhen Peacock Group Plan (Grant No. KQTD20180413181702403), Pearl River Recruitment Program of Talents (Grant No. 2017GC010293), and National Natural Science Foundation of China (Grant Nos. 11974298, 12004320, and 61961136006). \end{acknowledgments}
04ae74ae70d206114f3d89fa755746e65fed0cfe
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Quantum computing is now widely considered as a new paradigm for solving computational problems, which are believed to be intractable for classical computing devices~\cite{Fedorov2022,OBrien2010,Monroe1998,Shor1994,Lloyd1996}. The idea behind quantum computing is to use quantum physics phenomena~\cite{OBrien2010}, such as superposition and entanglement. Specifically, in the quantum gate-based model, quantum algorithms are implemented as a sequence of logical operations under the qubits (quantum analogs of classical bits), which compose the corresponded quantum circuits terminating by qubit-selective measurements~\cite{Monroe1998}. Examples of the problems, for whose quantum speedups are expected to be exponential, are prime factorization~\cite{Shor1994} and simulating quantum systems~\cite{Lloyd1996}, for example, modelling complex molecules and chemical reactions~\cite{Aspuru-Guzik2020}. The amount of computing power for such applications is, however, greatly exceeds resources of currently available quantum computing devices. For example, factoring RSA-2048 bit key requires 20 million noisy qubits~\cite{Gidney2021}, whereas currently available noisy intermediate-scale quantum (NISQ) devices have about 50-100 qubits~\cite{Preskill2018}. Quantum computing can be also considered in the context of data processing~\cite{Lloyd2014} and machine learning applications~\cite{Dunjko2018}, where the required resources for solving practical problems are expected to be not so high. Still the caveats of quantum machine learning are related to the input/output problems~\cite{Biamonte2017}: Although quantum algorithms can provide sizable speedups for processing data, they do not provide advantages in reading classical input data. The cost of reading the input then may in some cases dominate over the advantage of quantum algorithms. One may note that various approaches have been suggested, specifically, amplitude encoding~\cite{Salomaa2005}, but the problem of the conversion of classical data into quantum data in the general case remains open~\cite{Biamonte2017}. The use of NISQ devices in the context of the quantum-classical (variational) model has emerged as a leading strategy for their use in the NISQ era~\cite{Babbush2021-4,Aspuru-Guzik2022}. In such a framework, a classical optimizer is used to train a parameterized quantum circuit~\cite{Babbush2021-4}. This helps to address constraints of the current NISQ devices, specifically, limited numbers of qubits and noise processes limiting circuit depths. An interesting link between quantum-classical (variational) model and architectures of artificial neural networks opens up prospects for the use of such an approach for machine learning problems~\cite{Lloyd2013,Dunjko2016,Melko2018,Lukin2019-3,Woerner2019,Woerner2021,Schuld2019,Schuld2019-2}. The workflow of variational quantum algorithms, where parameters of circuit are iteratively updated (optimized), resembles classical learning procedures~\cite{Woerner2019}. \begin{figure*}[] \includegraphics[width=0.85\linewidth]{learning-2.pdf} \vskip-4mm \caption{General structure of the proposed quantum neural network structure consisting of several steps: Preliminary scanning using $n$-qubit filters, pooling, and regular layers.} \label{fig:General} \end{figure*} A cornerstone problem of various machine-learning-based approaches is classification, that it why it has been widely considered from the view point of potential speedups using quantum computing. As it has been demonstrated in Refs.~\cite{Lloyd2014,Mengoni2019}, kernel-based quantum algorithms may provide efficient solutions for the classification problem. Specifically, the quantum version of the support vector machine~\cite{Lloyd2014} can be used as an optimized binary classifier with complexity logarithmic in the size of the vectors and the number of training examples. A distant-based quantum binary classification has been proposed in Ref.~\cite{Schuld2017}. Alternative versions of binary quantum classifiers have been considered in Refs.~\cite{Benedetti2018,Grant2018,Gambetta2019,Tacchino2019,Kerenidis2020} (for a review, see also Ref.~\cite{Li2021}). A natural next step is to consider the multiclass classification, which has been addressed recently in Ref.~\cite{Chalumuri2021} with the demonstration of the performance on the IBMQX quantum computing platform. This method uses single-qubit encoding and amplitude encoding with embedding of data, so the obtained results are of quite high accuracy for the 3-class classification task. Very recently, an approach based on quantum convolutional neural network (QCNN)~\cite{Hur2022} have been used for binary classification, albeit, a way to its extension to the multiclass classification case has been discussed. We also note that some of the proposed quantum machine learning algorithms have been tested in practically relevant settings, for example, analyzing NMR readings~\cite{Demler2020,Demler2021} with the trapped-ion quantum computer, learning for the classification of lung cancer patients~\cite{Jain2020} and classifying and ranking DNA to RNA transcription factors~\cite{Lidar2018-3} using a quantum annealer, weather forecasting~\cite{Rigetti2021} on the basis of the superconducting quantum computer, and many others~\cite{Perdomo-Ortiz2018}. In this work, we present a quantum multiclass classifier that is based on the QCNN architecture. The developed approach use a traditional utilization of convolutional neural networks, in which few fully connected layers are placed after several convolutional layers. The corresponding learning procedure is implemented via TensorFlowQuantum~\cite{Babbush2020} as a hybrid quantum-classical (variational) model, where quantum output results are fed to softmax cost function with subsequent minimization of it via optimization of parameters of quantum circuit. Then we discuss the modification of a quantum perceptron, which enables us to obtain highly accurate results using quantum circuits with relatively small number of parameters. The obtained results demonstrate successful solving the classification problem for the 4-classes of MNIST images. Our paper is organized as follows. In Sec.~\ref{sec:algorithm}, we present the general description of the proposed quantum algorithm that is used for multiclass classification. In Sec.~\ref{sec:layers}, we provide in-detail discussion of the layer of the proposed quantum machine learning algorithm. In Sec.~\ref{sec:results}, we demonstrate the results of the implementation of the proposed algorithm for multiclass image classification for hand-written digits from MNIST and clothes images from fashion MNIST datasets. We conclude in Sec.~\ref{sec:conclusion}. \section{General scheme}\label{sec:algorithm} \begin{figure*}[ht] \includegraphics[width=12cm,height=6cm]{filtres.pdf} \vskip4mm \caption{Quantum circuits for preliminary scanning: In {\bf a)} the 4-qubit filter with 4-qubit entanglement shown; in {\bf b)} the stack of 3-qubit filters with 4-qubit entanglement is presented; in {\bf c)} the 2-qubit filters with 4-qubit entanglement} demonstrated. \label{fig:filtres} \end{figure*} The core concept that we use here is the hybrid (variational or quantum-classical) approach (for a review, see Refs.~\cite{Babbush2021-4,Aspuru-Guzik2022}). This approach use parametrized (variational) quantum circuits, where the exact parameters of quantum gates within the circuit can be changed. The general structure of our variational circuit is represented on Fig.~\ref{fig:General}. Below we describe the proposed approach for multiclass classification based on the classical-quantum approach. At the first step, we realize an amplitude encoding of input data, in our case, MNIST images. In fact, due to the high cost of this step~\cite{Biamonte2017}, we generate a set of encoding circuits, and store their parameters and structure in a memory, thus, hereby making the quantum version of dataset. We consider MNIST images, which are rescaled from 28 by 28 to 16 by 16 pixels, and, thus, 8 qubits are needed. In terms of the corresponding qubit states, encoded images can be expressed as follows: \begin{equation} \Psi_{k} = \sum_{m=0}^{N}C_{m}^{k}|m\rangle, \end{equation} where $k$ is the index of image and $|m\rangle$ is a qubit register of 8 qubits, which encode index $m$, and $N=255$. Coefficients $C_{m}^{k}$ are equal to elements of normalized flatten vectors of images. In general, this approach enables us to pack vector of N double-precision numbers into log$_{2}$(N) qubits, and, thus, significantly reduce the size of processed data. It should be noted however that existing algorithms for amplitude encoding scales exponentially with N; further study is needed to overcome this problem. We first employ the amplitude encoding procedure~\cite{Salomaa2005}, where ancilla qubits are used for one-hot encoding of the class of target images. Preliminary analysis of encoded images is performed with 3 convolutional layers with the sizes of filters, equal to $4$, $3$, and $2$, respectively. Each such layer consists of $2$ sublayers that are needed to maintain translational invariance (at least, partially), and all the filters of the same size contain identical trainable parameters as it takes place the case for classical convolutional neural networks (CCNN). We note that for filters with the size of $3$ we need a virtual qubit, which is always set to zero; such a trick is needed to fit the filter into $8$ qubits in the translationally invariant manner. The convolutional layer with pooling is then placed after preliminary layers; at this step the first reduction of the required qubit number is realized. As in the classical setup, several fully connected layers are added after convolutional layers (9 layers in our case). The further reduction of qubit numbers is realized after regular layers and subsequent pooling are done (in the same way as it is done after convolutional filters). The final filter is needed for mixing the information from two parts of divided circuit. In the process of learning the output of final filter would contain the codes of classes: $|00\rangle$, $|01\rangle$, $|10\rangle$, and $|11\rangle$. Output cascade contains four Toffoli gates, which activate the corresponding ancilla qubit; at the end of the quantum circuit we have one-hot encoded by ancillas class of image. Measurement results of ancilla qubits are passed to the \textit{softmax} activation function. The categorial cross-entropy is then used as the cost function. The subsequent calculations of gradients of the cost function with respect to the parameters of gates are done using parameter shift rule New parameters of quantum gates obtained by the gradient descent step. The detailed structure of all layers is described below. \section{Structures of layers}\label{sec:layers} Here we present the detailed description of the layers that are used in our quantum machine learning algorithm. \subsection{Preliminary scanning using $n$-qubit filters} The structure of 4-qubit filters is presented in Fig.~\ref{fig:filtres}a. First of all, $\textsf{R}_Y(\Theta_{1})$, $\textsf{R}_Y(\Theta_{2})$, $\textsf{R}_Y(\Theta_{3})$ and $\textsf{R}_Y(\Theta_{4})$ rotations are added in order to rotate each of four qubit separately. We propose to use controlled parameterized rotations $\textsf{R}_Y(\Phi)$ for the entanglement, which is an essential new element in the structure of quantum perceptron. We note that in Ref.~\cite{Chalumuri2021} authors use the standard controlled $\textsf{X}$ gates for this purpose. Here, as we demonstrate, the parameterized entanglement scheme provide higher accuracy of image classification due to the more flexible learning algorithm. In classical machine learning, the linear perceptron is passed through a certain non-linear function, which is essential for the learning process. In the quantum case, instead of summations of neurons we use entanglement of qubits. The degree of entanglement is controlled by parameters $\Phi$, which makes learning process more flexible, and, thus, classification procedure may become more accurate. In fact, many classical activation functions like {\it sigmoid} or {\it tanh} behave akin to switches, so their values change from $0$ or from $-1$ to $1$ in a certain region. In quantum domain, we can switch from separable (non-entangled) to entangled state, what could play the role of non-linearities in classical learning. So far, individual rotations, which are followed by the parameterized entanglement, can be considered as an analog of the perceptron with the non-linearity. After 4-qubit scanning, smaller-scale filters are applied to analyze obtained quantum feature map in more details. The structure of layers with 3-qubit filters is presented in Fig.~\ref{fig:filtres}b. In order to rotate 3 individual qubits $\textsf{R}_Y(\Theta_{1})$, $\textsf{R}_Y(\Theta_{2})$ and $\textsf{R}_Y(\Theta_{3})$ gates are added. Similarly to the case of 4-qubit filters, individual rotations are performed by parameterized $\textsf{R}_Y$ gates. We note that even in the case of 3-qubit filters, we use the entanglement of 4 qubits. Even though, the entanglement of 3 qubits looks more intuitive in this case, as we show below, the 4-qubit one provide more accurate results on image recognition. More detailed scanning of images is performed by layer with 2-qubit filters; the corresponding circuit is given in Fig.~\ref{fig:filtres}c (also see Ref.~\cite{Hur2022}). As in all previous cases, we use 4-qubit entanglement and the filter consist of 4 individual rotations with additional entanglement by \textsf{CNOT\,} gates. The idea of using 4-qubit entanglement is inspired by classical CNN, where generation of new feature maps is done by summation of contracted with weights previous feature maps and subsequent application of non-linearity. \subsection{QCNN layer with pooling} After the preliminary scanning step, the obtained quantum state of 8 qubits contains encoding of feature maps. The role of the next layer (see Fig.~\ref{fig:layers}) is to analyze these maps in more detail and pick up the most important of them. The scheme of the layer is given in Fig.~\ref{fig:layers}b, where the convolutional filter is the same as in Fig.~\ref{fig:layers}a. We note that in the pooling circuit, controlled $\textsf{R}_Z$ rotation is activated if the first qubit is at state $1$, while the controlled $\textsf{R}_X$ gate is used when upper qubit at state $0$. This is conceptually similar to the structure proposed in Ref.~\cite{Hur2022}. \subsection{Regular layers} Similarly to the CCNN case, several regular layers are placed after convolutional layers. In our case we add 8 layers, as shown in Fig.~\ref{fig:layers}a. In order to get more accurate results, the double entanglement is added after individual rotations. The second reduction of qubit number in circuit is done by two pooling procedure as in the case of convolution layers. In order to obtain the required structure, we add a final filter at the end of the quantum circuit. As it is shown below, the use of the final filter is essential for obtaining more accurate results of image classifications. \subsection{Toffoli and controlled rotation gates} The practical realization of high-fidelity two-qubit operations on quantum hardware is still a challenging task. The situation is typically more difficult with for three-qubit gates, such as Toffoli gate. Thus, it is necessary to decompose these gates via single- and two-qubit gates, which can be practically performed. The general algorithm of $n$-controlled rotations is presented in Ref.~\cite{Salomaa2004} and for the case of single-controlled rotation it can be expressed as it is shown in Fig.~\ref{fig:decomposition}a. In order to implement the Toffoli gate, we consider the qubit inversion as a rotation operation around $X$ or $Y$ axes and in our case doubly-controlled $\textsf{R}_Y(\Theta)$ gate is used with the value of $\Theta=2\pi$. The circuit is presented in Fig.~\ref{fig:decomposition}b and it corresponds to the representation of sum of parameterized $n$-controlled rotations, which are considered in Ref.~\cite{Salomaa2004}. Toffoli gate, in fact, can be considered as a sum of such rotations with $n=2$, where $\Theta$ angles of all rotations, except the one that is controlled by 11th combination, are set to zero. The definition of $\alpha$ angles is realized along the lines of the procedure of Ref.~\cite{Salomaa2004}; they are obtained from $\Theta$ angles by simple matrix transformation. We note that multiqubit gate decomposition can be further improved using qudits, which are multilevel quantum systems. As it has been shown, the upper levels of qudits can be used instead of ancilla qubits in the decomposition~\cite{Kiktenko2020,Kwek2021,Nikolaeva2021,Nikolaeva2021-2,Chong2019}. \begin{figure}[t] \centering \includegraphics[width=9.5cm]{layers_new.pdf} \vskip4mm \caption{In {\bf a)} the convolutional layer with pooling is shown. In {\bf b)} the structure of regular layers is illustrated.} \label{fig:layers} \end{figure} \begin{figure}[t] \centering \includegraphics[width=6cm]{decomposition_new.pdf} \vskip 5mm \caption{{\bf a)} Single-controlled rotation gates in terms of rotations and $\textsf{CNOT\,}$ gates. {\bf b)} Decomposition of the Toffoli gate in terms of $\textsf{R}_Y$ rotations and $\textsf{CNOT\,}$ gates.} \label{fig:decomposition} \end{figure} \section{Classification results}\label{sec:results} We benchmark the proposed quantum machine learning algorithm with the use of hand-written digits from MNIST and clothes images from fashion MNIST datasets. Examples are presented in Fig.~\ref{fig:MNIST}. \begin{figure}[b] \centering \includegraphics[width=\columnwidth]{mnist.pdf} \caption{Examples of MNIST digits (top) and MNIST fashion (buttom) images used in experiments.} \label{fig:MNIST} \end{figure} All the simulations are performed using Cirq python library for the constructions of quantum circuits; TensorFlowQuantum library~\cite{Babbush2020} is used for the implementation of machine learning algorithm with parameterized quantum circuits. We use the Adam version of gradient descent with learning rate equal to $0.00005$, the overall number of trainable parameters in the QCNN circuit is equal to $149$. As a metric for the model performance, we simply use the accuracy of the recognition and for more detailed analysis two sets of experiments are done. In all the conducted experiments, parameterized quantum circuits are trained during 50 epochs. Within the first set training and classification is done for the case, when dataset consists of images, which has certain similarity and, thus, classification problem become more difficult. We use MNIST images of digits 3, 4, 5, and 6 for this part. Also, fashion MNIST images with labels 0, 1, 2, and 3 are used for this purpose. The second experimental set is focused on images, which are strongly differs from each other, thus, making recognition process easier; MNIST digits 0, 1, 2, and 3; fashion MNIST images with labels 1, 2, 8, and 9 are considered. Total number of considered images of each type is given in Table~\ref{bra:Tab1}. \begin{table}[h] \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|c|} \hline MNIST digits & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline Training & 5923 & 6742 & 5958 & 6132 & 5842 & 5421 & 5918 \\ Test & 980 & 1135 & 1032 & 1010 & 982 & 892 & 958 \\ \hline MNIST fashion & 0 & 1 & 2 & 3 & 8 & 9 & \\ \hline Training & 6000 & 6000 & 6000 & 6000 & 6000 & 6000 & \\ Test & 1000 & 1000 & 1000 & 1000 & 1000 & 1000 & \\ \hline \end{tabular} \caption{Number of images of each type.} \label{bra:Tab1} \end{center} \end{table} Each image vector is normalized to one since only such kind of vectors can be used by amplitude encoding algorithm. Results of image classification are given in Table \ref{bra:Tab2}. Quantum circuits for multiclass classification are considered in Ref ~\cite{Chalumuri2021}. QCNN examples, provided within documentation of TensorFlowQuantum~\cite{Babbush2020} also can be relatively simply generalized for the case of multiclass classification tasks. In the second column of Table \ref{bra:Tab2}, we provide results of experiments with circuits, similar to those of Ref~\cite{Chalumuri2021}. In order to obtain these results we replace all the $\textsf{R}_Y(\Theta)$ used at entanglement steps by CNOT gates. Also, we remove all the parts of circuit of Fig.~\ref{fig:General}, which are placed after regular layers, i.e. pooling layers, final layers and the part with Toffoli gates. Entanglement of ancilla qubits with regular layers is done via CNOT gates according to Fig. 2 of Ref~\cite{Chalumuri2021}. Third column of Table~\ref{bra:Tab2} contains results, which are obtained with the full circuit of Fig.~\ref{fig:General}. Significant improvement of the accuracy of classification results caused by two facts. First one is the usage of parameterized entanglement in our circuit. Secondly, an increase of the performance may be connected with the fact, that our circuit constructed in a similar way to classical neural networks, we use qubit reduction procedure in analogy with the reduction of number of layers outputs in classical case until the number of outputs become equal to the number of target classes. Note that in Fig. ~\ref{fig:General} ancilla qubits are used only at read-out step and no entanglement is needed between ancillas and other qubits during computational procedure, what can significantly simplify requirements to the corresponding quantum hardware. We also compare obtained quantum results with results of the CCNN with similar number of parameters, which is 188 in our case. The structure of the CCNN is presented in Table \ref{bra:Tab3}. Clearly, classical results are more accurate, what indicate on the fact that with similar number of parameters classical model is still more expressive. An analysis of possible quantum advantage in ML tasks is presented in Ref~\cite{Boxio}. In their study authors analyze ML models based on kernel functions and show that with enough data provided classical methods become more powerful then corresponding quantum algorithms. Thus, additional study is still needed to find ML tasks where quantum algorithms will outperform their classical analogs. \begin{table}[h] \begin{center} \begin{tabular}{|c|c|c|c|} \hline & Quantum & Quantum & Classical \\ & ref.~\cite{Chalumuri2021} - like & Fig.~\ref{fig:General} & \\ \hline MNIST digits (3456) & 71.44 & 85.14 & 94.25 \\ MNIST digits (0123) & 77.64 & 90.03 & 95.85 \\ MNIST fashion (0123) & 71.15 & 85.93 & 89.69 \\ MNIST fashion (1289) & 79.33 & 93.63 & 97.42 \\ \hline \end{tabular} \caption{Accuracies of classification for quantum and classical convolutional neural networks.} \label{bra:Tab2} \end{center} \end{table} \begin{table}[h] \begin{center} \begin{tabular}{|c|c|c|} \hline Layer type & Output shape & Number of parameters \\ \hline Conv2D & (None, 14, 14, 1) & 10 \\ Conv2D & (None, 12, 12, 1) & 10 \\ Pooling & (None, 6, 6, 1) & 0 \\ flatten & (None, 36) & 0 \\ Dense & (None, 4) & 148 \\ Dense & (None, 4) & 20 \\ \hline \end{tabular} \caption{Structure of the used classical convolutional neural network with 188 parameters.} \label{bra:Tab3} \end{center} \end{table} In overall, the QCNN can produce accuracy of multiclass classification that are qualitatively similar to the classical model if the number of parameters are comparable. We would like to mention that the similar level of the accuracy has been achieved in Ref.~\cite{Chalumuri2021} for the case of the 3-class classification problem. Here we have demonstrated this level of the accuracy for the 4-class classification tasks, which to the best of our knowledge is the first such demonstration. \section{Conclusion}\label{sec:conclusion} Here we have demonstrated the quantum multiclass classifier, which is based on the QCNN architecture. The main conceptual improvements that we have realized are the new model for quantum perceptron and the optimized structure of the quantum circuit. We have shown the use of the proposed approach for 4-class classification for the case of four MNIST. As we have presented, the results obtained with the QCNN are comparable with those of CCNN for the case if the number of parameters are comparable. We expect that further optimizations of the perceptron can be studied in the future in order to make this approach more efficient. Moreover, since the scheme require the use of multiqubit gates, the qudit processors, where multiqubit gate decompositions can be implemented in a more efficient manner, can be of interest for the realization of such algorithms. \newpage \section*{Acknowledgments} We thank A. Gircha for useful comments. A.S.M. and A.K.F. acknowledge the support of the Russian Science Foundation (19-71-10092). This work was also supported by the Russian Roadmap on Quantum Computing.
b03cf50273c1f25258a9a8b9d546a1149add656e
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\chapter{Other Information} \chapter*{Dédicace} \noindent À mon très cher père, De tous les pères, tu es le meilleur. Tu as été et tu seras toujours un exemple pour moi par tes qualités humaines, ta persévérance et perfectionnisme. En témoignage de brut d’années de sacrifices, de sollicitudes, d’encouragement de prières. Pourriez vous trouver dans ce travail le fruit de toutes vos peines et tous vos efforts. En ce jour, j’espère réaliser l’un de tes rêves. Aucune dédicace ne saurait exprimer mes respects, ma reconnaissance et mon profond amour. Puisse Dieu vous préserver et vous procurer santé et bonheur.\\ \noindent À ma très chère mère, Source inépuisable de tendresse et de patience et de sacrifice. Ta prière et ta bénédiction m’ont été d’un grand secours tout au long de ma vie. Quoique je puisse dire et écrire, je ne pourrais exprimer ma grande affection et ma profonde reconnaissance. J’espère ne jamais te décevoir, ni traiter ta confiance et tes sacrifices.Puisse Dieu tout puissant, te préserver et t’accorder santé, longue vie et bonheur.\\ \noindent À mes chers frères et sœur, Je vous dédie ce travail en témoignage à notre moments d’enfance passés et mon estime envers vous. Pour nos rêves partagés et notre lien fraternels.\\ \noindent À la mémoire de mes grands parents, Que vous reposiez dans le paradis du seigneur.\\ \noindent À toutes ma famille maternelle et paternelle, Aucun langage ne saurait exprimer mon respect et ma considération pour votre soutien et encouragements. \intotoc*{\cleardoublepage}{Remerciement \chapter*{Remerciement} Ce travail a été réalisé au sein de la structure de recherche \textbf{Équipe de Science de la Matière et du Rayonnement} sous la direction de Monsieur \textbf{Morad EL BAZ}, Professeur de l’Enseignement Supérieur à la Faculté des Sciences de Rabat, et le co-encadrement de Monsieur \textbf{Steve CAMPBELL}, Expert-Professeur à University College Dublin, Irlande. Je tiens à leur exprimer toute ma reconnaissance pour leur disponibilité et leurs grandes qualités humaines d’écoute et d’attention. Qu’ils sont aussi remerciés pour les nombreux encouragements qu'ils m’ont prodigués.\\ \noindent Je remercie Monsieur \textbf{Yassine HASSOUNI}, Professeur de l’Enseignement Supérieur à la Faculté des Sciences de Rabat, président du jury, de m’avoir honoré par sa présence en présidant le jury de soutenance de mon doctorat. J’en suis honorée et je lui exprime toute ma profonde reconnaissance. \\ \noindent Je remercie également Monsieur \textbf{Hamid EZ-ZAHRAOUY}, Professeur de l’Enseignement Supérieur à la Faculté des Sciences de Rabat, d’avoir accepté de rapporter et examiner cette thèse et de scruter de si près le contenu de ma thèse de doctorat. \\ \noindent Je remercie Monsieur \textbf{Mohamed AZZOUZ}, Professeur de l’Enseignement Supérieur à l’Université Al Akhawayn à Ifrane, d’avoir accepté de juger mon travail en étant un rapporteur et examinateur, et pour l’intérêt qu’il a porté à mon travail.\\ \noindent J’adresse tous mes remerciements à Monsieur \textbf{Adil BELHAJ}, Professeur Habilité à la Faculté des Sciences de Rabat, de l’honneur qu’il m’a fait en acceptant d’être rapporteur et examinteur de cette thèse. \\ \noindent J’exprime ma gratitude à Monsieur \textbf{Bartłomiej Gardas}, Expert-Professeur à Institute of Theoretical and Applied Informatics, Pologne, qui a bien voulu être accepté de participer à ce jury de thèse en qualité d’examinateur.\\ \noindent Je remercie Monsieur \textbf{Mustapha FAQIR}, Professeur de l’Enseignement Supérieur à l’Université International de Rabat, pour faire partie de ce jury en étant un examinateur. \intotoc*{\cleardoublepage}{\textbf{Résumé} \noindent Nous étudions théoriquement les caractéristiques critiques des systèmes quantiques à l'équilibre et hors équilibre, du point de vue de l'information quantique et de la thermodynamique quantique. En particulier, nous nous concentrons sur l'analyse des transitions de phase quantique à l'équilibre à l'aide de mesures théoriques de l'information quantique, telles que : l'intrication, la discorde quantique, la cohérence quantique et la fonction de Wigner. Nous montrons la relation entre eux et leur versalité en révélant les caractéristiques saillantes des systèmes quantiques critiques, tels que : le modèle de Heisenberg et la chaine XXZ. De plus, nous explorons les propriétés d’hors-équilibre des systèmes quantiques critiques, en utilisant l'approche des statistiques de travail de la thermodynamique quantique. Nous nous concentrons sur le modèle LMG où nous montrons comment le travail, l'entropie et l'information se comportent lors du franchissement d'une transition de phase quantique à l'état excité. \intotoc*{\cleardoublepage}{Abstract \begin{abstract} We theoretically study the critical characteristics of equilibrium and non-equilibrium quantum systems, from the point of view of quantum information and quantum thermodynamics. In particular, we focus on the analysis of equilibrium quantum phase transitions using quantum-information theoretic measures, such as: entanglement, quantum discord, quantum coherence and the Wigner function. We show the relationship between them and their versatility in revealing the salient features of critical quantum systems, such as: the Heisenberg model and the XXZ chain. Furthermore, we explore non-equilibrium properties of critical quantum systems, using the work statistics approach of quantum thermodynamics. We focus on the LMG model where we show how work, entropy and information behave when crossing an excited-state quantum phase transition. \end{abstract} \intotoc*{\cleardoublepage}{Résumé étendu} \chapter*{Résumé étendu} \noindent L'histoire de la vie, de l'humanité et de la société est marquée par des transitions importantes dans les formes de vie, les écosystèmes et la civilisation. L'évolution de l'univers depuis sa création jusqu'à sa forme actuelle serait passée par plusieurs transitions de phase, du plasma à haute température, dû au Big Bang, à la forme refroidie que nous connaissons aujourd'hui. Par conséquent, les transitions de phase sont une pierre angulaire de la nature et revêtent une grande importance quel que soit le domaine auquel on pourrait s'intéresser. En physique, les systèmes complexes présentent des transitions de phase macroscopiques en conséquence des interactions entre de nombreux composants microscopiques. Cela fait de la transition de phase un phénomène émergent, et tout au long de l'histoire, de nombreuses avancées ont été réalisées afin de saisir l'essence de la façon dont l'émergence des états de la matière se produit.\\ \noindent Nous analysons, dans cette thèse, les transitions de phase quantiques à l'équilibre et hors-équilibre présentes dans les modèles de spin-$\frac{1}{2}$ quantiques, du point de vue de l'information quantique et de la thermodynamique quantique. Nous donnons un aperçu de la littérature sur les transitions de phase classiques et quantiques. De plus, nous couvrons la théorie de l'information classique et quantique, afin de construire le contexte nécessaire pour étudier les propriétés d'équilibre des systèmes de spin quantiques critiques, en utilisant des mesures théoriques de l'information quantique. Nous appliquons ce formalisme au modèle critique de Heisenberg $XX$, où nous étudions le comportement à longue distance de l'intrication, la discorde quantique, et la cohérence quantique, vis-à-vis des perturbations magnétiques et thermiques. Nous montrons la faiblesse de l'intrication, la robustesse des formes générales de corrélations aux fluctuations thermiques, et la versatilité de ces mesures pour révéler la transition de phase quantique du second ordre. De plus, nous étendons l'étude vers la détection des transitions de phase quantiques d'équilibre dans l'espace des phases, à travers la fonction de Wigner. Tout d'abord, nous discutons la fonction de Wigner pour les systèmes de dimension infinie, avec un accent particulier sur le cas de dimension finie, où nous introduisons les constructions de Wootters et Stratonovich de la fonction de Wigner. Ensuite, nous appliquons ce formalisme pour détecter les caractéristiques critiques des modèles $XY$ et $XXZ$, où nous montrons une formule générale reliant la fonction de Wootters, la fonction de Wigner de Stratonovich et les quantités thermodynamiques des modèles de spin, qui peuvent être appliquées à des modèles simples, systèmes bipartites et multipartites. Cette approche nous permet d'introduire une nouvelle façon de représenter, de détecter et de distinguer les transitions de phase quantique du premier, du second et d'ordre infini. De plus, nous montrons que le phénomène de factorisation dans le modèle $XY$ n'est directement détectable que par des quantités basées sur la racine carrée de la matrice de densité réduite bipartite. Nous établissons que les techniques d'espace de phase fournissent un outil simple et prometteur sur le plan expérimental dans l'étude des systèmes à plusieurs corps et nous discutons leur relation avec les mesures de corrélations quantiques et la cohérence quantique. Enfin, nous nous concentrons sur la thermodynamique quantique des transitions de phase quantiques hors d'équilibre. Après avoir présenté la théorie classique de la thermodynamique, nous discutons son extension vers le régime non-équilibre et aux systemes quantique; ainsi que la théorie des ressources de la thermodynamique et son impact sur la théorie du calcul au niveau classique et quantique. Ensuite, nous nous concentrons sur la statistique de travail à travers une transition de phase quantique à l'état excité qui se manifestant dans la dynamique du modèle Lipkin-Meshkov-Glick, initialisée à l'état fondamental de la phase ferromagnétique, et soumise à une brusque trempe. Nous montrons comment l'information, le travail et l'entropie se comportent tout au long de la transition de phase à l'état excité . Enfin, nous démontrons que des caractéristiques similaires persistent lorsque le système est initialisé dans un état excité et explorons brièvement le comportement des états initiaux dans la phase paramagnétique.\\ \noindent À la fin nous discutons quelques perspectives, où nous visons l'exploitation des caractéristiques des systèmes quantiques afin de concevoir des technologies quantiques efficaces. En effet, l'intrication et la cohérence quantique ont été utilisées pour traiter efficacement l'information et communiquer en toute sécurité. Récemment, il y a eu une recrudescence de l'extension de la thermodynamique au régime quantique afin de concevoir machines thermiques quantiques pour surmonter certaines limitations de leurs homologues classiques. Une façon d'y parvenir est de modéliser le fluide de travail par un système quantique critique et de le conduire à travers le point critique. Au niveau des transitions de phase quantiques à l'équilibre, il a été montré que le franchissement d'une transition de phase quantique du second ordre peut améliorer l'efficacité des moteurs thermiques quantiques. Ici, nous nous intéressons à montrer l'impact de la transition de phase quantique à l'état excité sur l'efficacité des moteurs thermiques quantiques. Pour atteindre cet objectif, nous modéliserons le milieu de travail par un modèle LMG, piloté à travers la transition de phase quantique de l'état excité à travers différents protocoles, par ex. conduite adiabatique et non adiabatique. \chapter*{Nomenclature} \section*{Characters} \nomenclatureitem[\textbf{Unit}]{\textbf{Symbol}}{\textbf{Description}} \nomenclatureitem[$\Unit{m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$R$}{specific gas constant} \nomenclatureitem[$\Unit{m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$C_v$}{specific heat capacity at constant volume} \nomenclatureitem[$\Unit{m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$C_p$}{specific heat capacity at constant pressure} \nomenclatureitem[$\Unit{m^{2} \cdot s^{-2}}$]{$e_{\Des{T}}$}{specific total energy} \nomenclatureitem[$\Unit{m^{2} \cdot s^{-2}}$]{$e$}{specific internal energy} \nomenclatureitem[$\Unit{m^{2} \cdot s^{-2}}$]{$h_{\Des{T}}$}{specific total enthalpy} \nomenclatureitem[$\Unit{m^{2} \cdot s^{-2}}$]{$h$}{specific enthalpy} \nomenclatureitem[$\Unit{kg \cdot m \cdot s^{-3} \cdot K^{-1}}$]{$k$}{thermal conductivity} \nomenclatureitem[$\Unit{K}$]{$T$}{temperature} \nomenclatureitem[$\Unit{s}$]{$t$}{time} \nomenclatureitem[$\Unit{kg \cdot m^{-1} \cdot s^{-2}}$]{$p$}{thermodynamic pressure} \nomenclatureitem[$\Unit{kg \cdot m^{-1} \cdot s^{-2}}$]{$\hat{p}$}{hydrostatic pressure} \nomenclatureitem[$\Unit{kg \cdot m^{-2} \cdot s^{-2}}$]{$\Vector{f}_{\Des{b}}$}{body force} \nomenclatureitem[$\Unit{m^2}$]{$S$}{boundary surface} \nomenclatureitem[$\Unit{m^3}$]{$\Omega$}{spatial domain} \nomenclatureitem[$\Unit{m \cdot s^{-1}}$]{$\Vector{V}$}{velocity vector} \nomenclatureitem[$\Unit{m \cdot s^{-1}}$]{$u$}{x component of velocity} \nomenclatureitem[$\Unit{m \cdot s^{-1}}$]{$v$}{y component of velocity} \nomenclatureitem[$\Unit{m \cdot s^{-1}}$]{$w$}{z component of velocity} \nomenclatureitem[$\Unit{m \cdot s^{-1}}$]{$c$}{speed of sound} \nomenclatureitem[$\Unit{m}$]{$\Vector{x}$}{position vector} \nomenclatureitem[$\Unit{1}$]{$\unitVector{n}$}{unit outward normal vector} \nomenclatureitem[$\Unit{1}$]{$\hat{\unitVector{t}}$}{unit tangent vector} \nomenclatureitem[$\Unit{1}$]{$\tilde{\unitVector{t}}$}{unit bitangent vector} \nomenclatureitem[$\Unit{1}$]{$C_{\Des{R}}$}{coefficient of restitution} \nomenclatureitem[$\Unit{1}$]{$Re$}{Reynolds number} \nomenclatureitem[$\Unit{1}$]{$Pr$}{Prandtl number} \nomenclatureitem[$\Unit{1}$]{$Ma$}{Mach number} \nomenclatureitem[$\Unit{m^2 \cdot s^{-1}}$]{$\alpha$}{thermal diffusivity} \nomenclatureitem[$\Unit{kg \cdot m^{-1} \cdot s^{-1}}$]{$\mu$}{dynamic viscosity} \nomenclatureitem[$\Unit{m^2 \cdot s^{-1}}$]{$\nu$}{kinematic viscosity} \nomenclatureitem[$\Unit{1}$]{$\gamma$}{heat capacity ratio} \nomenclatureitem[$\Unit{kg \cdot m^{-3}}$]{$\rho$}{density} \nomenclatureitem{$\Vector{U}$}{vector of conservative variables} \nomenclatureitem{$\Vector{F}$}{vector of fluxes} \nomenclatureitem{$\Vector{\Phi}$}{vector of source terms} \nomenclatureitem[$\Unit{kg \cdot m^{-1} \cdot s^{-2}}$]{$\Tensor{\sigma}$}{stress tensor} \nomenclatureitem[$\Unit{kg \cdot m^{-1} \cdot s^{-2}}$]{$\Tensor{S}$}{deviatoric stress tensor} \nomenclatureitem[$\Unit{kg \cdot m^{-1} \cdot s^{-2}}$]{$\Tensor{\tau}$}{viscous stress tensor} \nomenclatureitem[$\Unit{1}$]{$\Tensor{\delta}$}{Kronecker tensor} \nomenclatureitem[$\Unit{1}$]{$\unitTensor{I}$}{identity tensor} \section*{Operators} \nomenclatureitem{\textbf{Symbol}}{\textbf{Description}} \nomenclatureitem{$\Order$}{order of magnitude} \nomenclatureitem{$\Delta$}{difference} \nomenclatureitem{$\nabla$}{gradient operator} \nomenclatureitem{$\delta^{\pm}$}{upwind-biased interpolation scheme} \nomenclatureitem{$\delta^{0}$}{central interpolation scheme} \section*{Abbreviations} \nomenclatureitem{\textbf{Acronym}}{\textbf{Description}} \nomenclatureitem{ANFO}{Ammonium Nitrate Fuel Oil} \nomenclatureitem{CFD}{Computational Fluid Dynamics} \nomenclatureitem{CFL}{Courant--Friedrichs--Lewy} \nomenclatureitem{CJ}{Chapman--Jouguet} \nomenclatureitem{EOS}{Equation of State} \nomenclatureitem{JWL}{Jones--Wilkins--Lee} \nomenclatureitem{TVD}{Total Variation Diminishing} \nomenclatureitem{SSP}{Strong Stability Preserving} \nomenclatureitem{WENO}{Weighted Essentially Non-oscillatory} \nomenclatureitem{ZND}{Zel'dovich--von Neumann--Doering} \fi \chapter*{Epilogue} \noindent We focused throughout this thesis on studying the equilibrium and non-equilibrium properties of critical quantum systems, using the formalism of quantum information theory and quantum thermodynamics. After an overview on the physics of classical and quantum phase transitions, we shed light on the theory of classical and quantum information. Then, equipped with this background we focused on analyzing the equilibrium properties of critical quantum systems, where we evaluated analytically and numerically the long range entanglement, quantum discord and quantum coherence in the critical Heisenberg $XX$ model, in order to demonstrate the versatility of the different forms of quantum information-theoretic measures in revealing the salient critical properties of quantum systems. Furthermore, we have analyzed the resilience of these measures with respect to thermal fluctuations, where we reported the robustness of quantum coherence and quantum discord, and the weakness of quantum entanglement to temperature. \noindent To fully explore the possible representations of physical systems in quantum mechanics, we have discussed the phase space formalism for infinite-, and finite-dimensional systems, with special focus on the later where we introduced the Wootters and Stratonovich Wigner functions. Through these measures we have introduced an analytic novel way to represent, detect, and distinguish first-, second- and infinite-order equilibrium quantum phase transitions in the critical quantum spin chains. We have developed a general analytical formula relating the Wootters and Stratonovich Wigner function and the thermodynamic quantities of spin models, which apply to single, bipartite and multipartite systems governed by the $XY$ and the $XXZ$ models. Additionally, we have shown, numerically, that the factorization of the ground state of the $XY$ model is only detectable using quantities based on the square root of the bipartite reduced density matrix. Hence, we established that phase space techniques provide a simple, experimentally promising tool in the study of many-body systems and we showed their relation with measures of entanglement and quantum coherence. \noindent Christopher Jarzynski once said: ``If we shift our focus away from equilibrium states, we find a rich universe of non-equilibrium behavior''~\cite{JarNat2015}. Motivated by this statement and equipped with the previous results, we shifted our attention toward addressing the non-equilibrium features of critical quantum systems, using the quantum thermodynamics approach. We provided a birds eye view on the phenomenological theory of classical thermodynamics and its extension to non-equilibrium settings via the stochastic theory of thermodynamics. Furthermore, we discussed how thermodynamics can be used as a resource for state manipulation, how it can be extended to quantum settings, and its interplay with classical and quantum computing. In the end, we provided a study on the work statistics in non-equilibrium critical quantum systems. In particular, we examined how the presence of an excited state quantum phase transition manifests in the dynamics of the Lipkin-Meshkov-Glick spin model subject to a sudden quench. By initializing the system in the ground state of the ferromagnetic phase we showed, numerically, that the work probability distribution displays non-Gaussian behavior for quenches in the vicinity of the excited state critical point. Furthermore, we reported that the entropy of the diagonal ensemble is highly susceptible to critical regions, making it a robust and practical indicator of the associated spectral characteristics. In the end, we evaluated the role that symmetry breaking has on the ensuing dynamics, highlighting that its effect is only present for quenches beyond the critical point; and we argued that similar features persist when the system is initialized in an excited state, while briefly exploring the behavior for initial states in the paramagnetic phase. \noindent An interesting line of research is the exploitation of the features of quantum systems in order to design efficient quantum technologies. Indeed, entanglement and quantum coherence have been used in order to process information efficiently and communicate safely. Recently, there has been an upsurge in extending thermodynamics to the quantum regime in order to design quantum-based thermal machines to overcome some limitations of their classical counterparts. One way to achieve this is by modeling the working fluid by a critical quantum system, and driving it across the critical point. At the level of equilibrium quantum phase transitions, it has been shown that crossing a second-order quantum phase transition can enhance the efficiency of quantum heat engines. Here we are interested in showing the impact of the excited state quantum phase transition on the efficiency of quantum heat engines. To achieve the goal, we will model the working medium by an LMG model, driven across the excited state quantum phase transition through different protocols, e.g. adiabatic and non-adiabatic driving. \noindent Another exciting and promising research field is quantum computing, which is the most prominent application of quantum technologies, and is believed to offer a computational advantage by being able to solve certain computational problems exponentially faster than classical computers. An important aspect in building new technology is the resource consumption, i.e its energy efficiency, which in the case of quantum computing is lacking consensus. The theoretical framework to address this issue is through quantum thermodynamics which provides the necessary tools to quantify and characterize the efficiency of emerging quantum technologies, and therefore is crucial in laying a road map to scalable devices. Following the recent push toward a quantum energy initiative~\cite{Auffeves:2021paz}, we are interested in studying the energetic cost of quantum computing by investigating the thermodynamics of quantum computing paradigms, such as: quantum annealers. These architectures are a promising quantum algorithm for solving optimization tasks, it consist of mapping the optimization problem onto finding the ground state of the Ising spin glass. Therefore, we are interested in investigating the dynamics and thermodynamics of the Ising spin glass, in order to evaluate how work, entropy and information behave upon external perturbation, to locate regions of minimal and high efficiency. \part{Quantum Information meets Quantum Phase Transitions \label{part1}} \chapter{Overview on Phase Transitions \label{chap1}} \section{Classical phase transitions} \subsection{What is a phase transition?} A phase transition is a sudden and discontinuous change in the properties of a system, driven by an external parameter. When this change is done by temperature we call the phenomenon classical phase transition~\cite{goldenfeld2018lectures}. Examples of classical phase transitions are ubiquitous in nature, from the melting of ice, evaporation of water to the loss of magnetisation in metals. The study of phase transitions lie at the heart of condensed matter physics and translates into numerous applications: semiconductors, transistors and microchips. The theoretical framework to analyze phase transitions is via statistical mechanics, which is a theory that aims to provide a microscopic description of macroscopic phenomena. Mathematically, the goal of statistical physics is to calculate the partition function $``\mathcal{Z}"$ of the system. It is given by \begin{equation} \mathcal{Z}_{\Omega}=\Tr e^{-\beta \mathcal{H}_{\Omega}}, \label{partition_function} \end{equation} where $\beta=\frac{1}{k_b T}$ is the Boltzmann factor, $\mathcal{H}_{\Omega}$ is the Hamiltonian of the system and $\Omega$ is the microstates sample region. All the thermodynamical quantities follow from the partition function ~\eqref{partition_function}, such as: the mean energy $\langle E\rangle$, the variance in the energy $\langle (\Delta E)^2\rangle$, the heat capacity $C_v$ and the entropy $S$. The most prominent figure of merit for analyzing phase transitions is the free energy ``$\mathcal{F}"$, given by \begin{equation} \mathcal{F}_{\Omega}[K]=-k_b T \log(\mathcal{Z}_{\Omega}[K]). \label{classical_free_energy} \end{equation} It provides access to the information on the thermodynamics of the system $\Omega$, through the derivatives $\frac{\partial F_{\Omega}}{\partial K_n}$ and $\frac{\partial^2 F_{\Omega}}{\partial K_n \partial K_m}$, where the $K_n$ are external parameters, such as: the magnetic field, the temperature or the exchange interactions. The nature of the phase transition present in the system can be identified through the discontinuity present in the derivatives of $\mathcal{F}_{\Omega}$~\eqref{classical_free_energy}. However, when $\Omega$ is finite, the partition function is a sum of terms each of which is the exponential of an analytic function of the parameter of the Hamiltonian, which cannot give rise to non-analytic behaviour. Only at the limit $\Omega \to \infty$, where non-analytical behaviour arise and phase transitions can effectively be studied. For a very large system of $N$ sites, which is the case studied in this thesis, the bulk free energy can be defined as: \begin{equation} f_b[K]=\lim_{N \to \infty} \frac{\mathcal{F}_{\Omega}[K]}{N}. \label{thermo_limit} \end{equation} \noindent The limit in~\eqref{thermo_limit}, is known as ``the thermodynamical limit''. Its existence allows to give, through $f_b[K]$, a precise definition of a phase boundary and the nature of the phase transition. However, the existence of the thermodynamical limit is not trivial, and some systems may fail to show bulk behaviour because of the nature of the interactions governing the system. For example, a charged system following inverse square law forces fail to show bulk behaviour, which is due to the fact that inverse square law forces are very long ranged to permit bulk behaviour in the thermodynamic limit~\cite{stab_matter}. \subsection{Classification of phase transitions \label{1.1.2}} A phase is a region where $f_b[K]$~\eqref{thermo_limit}, is analytic. Phase boundaries are regions of discontinuity of $f_b[K]$ ~\eqref{thermo_limit} and can be classified into two types \begin{enumerate} \item \textbf{First order phase transition}:\\ $\partial{f_b}/\partial{K}$ is discontinuous in the boundary between the phases. First order phase transitions are characterized by the release or absorption of energy in the form of latent heat. Figure~\eqref{water} represents the phase diagram of water, which undergoes this kind of phase transition. The diagram represents in the $P$-$T$ plane the different phases of water: solid, liquid and gas, while the solid lines separate the phases and the coexistence zones. The AB curve is the \textbf{``sublimation curve''}, which separates the solid and the vapor phases, while they coexist along the curve. The BD line is called the \textbf{``fusion curve''}, and it represents the coexistence zone of the solid and the liquid phases. The BC branch, is the \textbf{``vaporization curve''}, where the liquid phase coexists with the vapor phase. The point B is called \textit{``the triple point''}, where all the phases coexist at $T=273.16 K$. The point C is a \textit{critical point} where the density of the liquid and the gas are equal, and are not distinguishable. After crossing C, water transits continuously from liquid to gas. \item \textbf{Second order phase transition}: \\ $\partial{f_b}/\partial{K}$ is smooth, while $\partial^2{f_b}/\partial{K}^2$ is divergent. Second order phase transitions are also referred to as continuous phase transition. A prominent example of a second order phase transition is the ferromagnetic-paramagnetic transition in metals. The phase diagram of a ferromagnetic metal is represented in Figure~\eqref{ph_ferr}. The ferromagnetic-paramagnetic transition emerges, experimentally, when we heat up a ferromagnetic material above a critical temperature $T_c$ (which depends on the nature of the metal), where order (ferromagnetism) is destroyed by thermal fluctuations and disorder (paramgnetism) emerges. \end{enumerate} \begin{figure}[t!] \centering \begin{subfigure}[t]{0.49\textwidth} \begin{tikzpicture}[scale=1.5] \draw [<->,ultra thick] (0,4) node (yaxis) [above] {$P$} |- (4.5,0) node (xaxis) [right] {$T$}; \node[left] (A) at (1,2.5) {\textbf{solid}}; \node[left] (A) at (3.5,3) {\textbf{liquid}}; \node[right] (A) at (3,1) {\textbf{gas}}; \coordinate (O) at (0,0); \coordinate (A) at (2,2); \coordinate (B) at (2.8,4); \coordinate (C) at (4,2.5); \draw (0.3,0) node[anchor=south east]{A}; \draw[thick,color=black] (O) to [bend right=15] (A) node[anchor=north west]{B}; \fill[red] (2,2) circle (3pt); \draw[->,thick,color=black] (A) to [bend right=15] (B) node[anchor=south west]{D}; \draw[thick,color=black] (A) to [bend right=0] (C) node[anchor=south west]{C}; \fill[blue] (4,2.5) circle (3pt); \end{tikzpicture} \caption{Phase diagram of water, with respect to the temperature $T$ and pressure $P$.} \label{water} \end{subfigure} \begin{subfigure}[t]{0.49\textwidth} \begin{tikzpicture} \node[] (A) at (1.7,2) {\textbf{ferromagnetic}}; \node[] (A) at (5.5,2) {\textbf{paramagnetic}}; \draw[->,ultra thick] (0,0)--(6,0) node[right]{$T$}; \draw[->,ultra thick] (0,-3)--(0,3) node[above]{$B$}; \node[left] (A) at (0,0) {$0$}; \draw[->,thick] (1.5,0.5)--(1.5,1.); \draw[->,thick] (1.7,0.5)--(1.7,1.); \draw[->,thick] (1.9,0.5)--(1.9,1.); \draw[->,thick] (2.1,0.5)--(2.1,1.); \draw[->,thick] (2.3,0.5)--(2.3,1.); \draw[->,thick] (2.5,0.5)--(2.5,1.); \draw[->, thick] (1.5,-0.5)--(1.5,-1.0); \draw[->,thick] (1.7,-0.5)--(1.7,-1.); \draw[->,thick] (1.9,-0.5)--(1.9,-1.); \draw[->,thick] (2.1,-0.5)--(2.1,-1.); \draw[->,thick] (2.3,-0.5)--(2.3,-1.); \draw[->,thick] (2.5,-0.5)--(2.5,-1.); \node[above] (A) at (4,0) {$T_c$}; \draw[->,thick] (5,0.5)--(4.5,0.7); \draw[->,thick] (5.5,0.5)--(5.1,0.2); \draw[->,thick] (5.7,0.5)--(5.5,0.8); \draw[->,thick] (5,1)--(4.5,1.2); \draw[->,thick] (5.2,1)--(5.7,1.2); \draw[->,thick] (5.3,1)--(6,1.2); \fill[blue] (4,0) circle (3pt); \draw[->,thick] (5,-0.5)--(4.5,-0.7); \draw[->,thick] (5.5,-0.5)--(5.1,-0.2); \draw[->,thick] (5.7,-0.5)--(5.5,-0.8); \draw[->,thick] (5,-1)--(4.5,-1.2); \draw[->,thick] (5.2,-1)--(5.7,-1.2); \draw[->,thick] (5.3,-1)--(6,-1.2); \end{tikzpicture} \caption{Phase diagram of a ferromagnetic material, with respect to temperature $T$ and the magnetic field $B$.} \label{ph_ferr} \end{subfigure} \caption{Examples of (a) first order phase transition and (b) second order phase transition} \label{fig} \end{figure} \subsection{The Ising model \label{1.1.3}} Nature is abundant with phenomena where complex and large number of microscopic constituents interact to give rise to a macroscopic behaviour. For example, magnets and liquids are composed, respectively, of many interacting magnetic dipoles and molecules. In order to investigate the features of real world materials, physicists make use of mathematical models from statistical mechanics in order to simulate systems exhibiting global behaviour due to local interactions between large number of entities. The success of this approach is tightly connected to the theoretical assumption on how the particles of the system interact among themselves. In general, it is very difficult to design a realistic model that is mathematically tractable and provides comprehensive description of all macroscopic features. Among the class of exactly solvable models~\cite{baxterbook, franchini2017}, the Ising model is one of the touchstones of modern physics as it is the most simple and versatile model for magnetic materials. \noindent The Ising model was introduced by Lenz and Ising in 1925 to describe how temperature can transform a metal from a paramagnet to a permanent magnet (ferromagnet)~\cite{Ising:1925em}. It is defined on a regular lattice, where each site contains a magnetic dipole, i.e. spin, which can take $\pm 1$ values. Table~\eqref{isingtab} represents a sketch of the model in a two dimensional square lattice. \begin{table} \centering \begin{tabular}{| c c c c|} \hline + & + & + & + \\ - & - & - & - \\ - & + & + & - \\ - & + & + & + \\ \hline \end{tabular} \caption{Possible configuration of an $N=4^4=16$ Ising lattice~\eqref{ising1}.} \label{isingtab} \end{table} The Hamiltonian of the Ising model can be written as follows \begin{ceqn} \begin{equation} H_{\Omega} = \sum_{ij} J_{ij} S_iS_j+\sum_{i\in \Omega} h_iS_i, \label{ising1} \end{equation} \end{ceqn} where the $S_i$'s are classical spin operators and $J_{ij}$ is the exchange interaction between two classical spins. The spins also interact with an external magnetic field $h_i$ which, in general, varies from site to site. The Ising model~\eqref{ising1}, is exactly solvable in one-dimension for arbitrary values of the magnetic field, while in two-dimensions it is only solvable at zero magnetic field~\cite{onsager1, onsager2, onsager3}. The three dimensional Ising model has not yet been solved. The simplicity of the Ising model allows for the study of phase transitions. For instance, it was exploited in order to describe the critical behaviour in ferromagnetic films, binary alloys and liquid-gas phase transitions. Critical phenomena arise only in the thermodynamic limit, for this limit to exist in the Ising model~\eqref{ising1}, the exchange interaction $J_{ij}$ need to satisfy the following property~\cite{griffith} \begin{equation} \sum_{j\neq i} |J_{ij}| < \infty. \end{equation} The phase diagram of physical models, and in particular the Ising model, can be constructed by following the energy-entropy approach which consists of analysing and comparing the behaviour of the free energy $\mathcal{F}$~\eqref{classical_free_energy}, at high and low temperature. For a given system, the change of the free energy is given by \begin{equation} F= U - TS, \label{fe} \end{equation} where $U$ is the internal energy, $T$ is the temperature and $S$ is the entropy of the system. At high temperature, the free energy is dominated by the entropy $S$ and the free energy ~\eqref{fe}, is minimized by maximizing the entropy $S$. At low temperature, the internal energy $U$ has a significant chance of dominating the free energy $F$~\eqref{fe}. Therefore, the free energy is minimized by minimizing $U$. If the resulting macroscopic states at high and low temperatures are different, we conclude that at least one phase transition occurred at some critical temperature $T_c$. \subsection{One-dimensional phase diagram} We consider a one-dimensional chain of $N$ spins, described by the Ising model~\eqref{ising1}. At $T=0$ and zero magnetic field, the spins can point either all up or all down. Consider the spin up configuration, the free energy of the system is $F=-NJ$. Switching on the temperature has the effect of creating a domain of flipped spins as sketched below $$ \uparrow \uparrow \uparrow \uparrow \dots \uparrow \uparrow \uparrow \uparrow \uparrow \uparrow \uparrow | \downarrow \downarrow \downarrow \downarrow \downarrow \downarrow \dots \downarrow \downarrow \downarrow \downarrow \downarrow \downarrow $$ The energetic cost of the creation of this domain of flipped spins is: $E=-NJ+2J$. The domain can be placed at any of the $N$ sites, therefore the entropy is: $S=k_b\log N$. Thus, the change in the free energy is \begin{equation} \Delta F =\Delta E-T\Delta S= 2J -k_b T\log N. \label{fe131} \end{equation} For finite temperature, the free energy~\eqref{fe131}, diverges as $N \to \infty$. To gain stability, the system lowers its free energy by creating domain walls, a process that gets repeated until there are no domains left. Thus, at zero magnetic field, long-range order (the ferromagnetic phase) does not hold against thermal fluctuations. We conclude that for the one-dimensional Ising model, there are no finite temperature phase transitions at zero field. \subsection{Two-dimensional phase diagram \label{2d_diagram_ising}} In the same spirit, we consider a two-dimensional lattice described by the Ising model~\eqref{ising1}. We switch on the temperature and we analyze the energetic and entropic cost of the domain of flipped spins on the lattice. Since each flipped spin costs an amount of energy of $2J$, then the internal energy change of a domain of length $N$ is $\Delta E = 2JN$. The entropy can be estimated by enumerating the different possibilities of the domain wall, which is proportional to the coordinate number of the lattice $z^N$. The entropy is then $\Delta S = k_b N \log (z-1)$ and the free energy is \begin{equation} \Delta F =(2J-k_b T\log (z-1))N. \label{fe132} \end{equation} At the thermodynamical limit, i.e. $N \to \infty$, the stability of the free energy~\eqref{fe132}, is dependent on the temperature $T$. If \begin{equation} T>T_c=\frac{2J}{k_b \log(z-1)}, \end{equation} the free energy~\eqref{fe132}, diverges and the system is unstable toward the formation of domains. This implies that at $T>T_c$ the system is in a paramagnetic phase where the net magnetization $\langle S_i \rangle=0$. At $T<T_c$, long range order is stable and the net magnetization $\langle S_i \rangle\neq 0$. We conclude that the two-dimensional Ising model, exhibit a finite temperature phase transition at zero magnetic field. Figure~\eqref{mag_132}, represent the net magnetization $\langle S_i \rangle$ with respect to the temperature $T$, in the two-dimensional Ising model. The magnetization is non-zero in the ferromagnetic phase and decreases as we increase the temperature, until it vanishes at the critical point $T_c$, as the system enters the paramagnetic phase. \begin{figure}[t!] \centering \begin{tikzpicture}[scale=1.5] \draw [<->,ultra thick] (0,4) node (yaxis) [above] {$\langle S_i \rangle$} |- (5,0) node (xaxis) [right] {$T$}; \draw plot [smooth] coordinates {(0,3) (2.7,2.7) (3,0)}; \node[left] (A) at (0,0) {$0$}; \node[left] (A) at (0,3) {$1$}; \node[below] (A) at (3,0) {$T_c$}; \fill[blue] (3,0) circle (2pt); \node[] at (1.5,1) {\textbf{ferromagnetic}}; \node[] at (4.5,1) {\textbf{paramagnetic}}; \end{tikzpicture} \caption{Net magnetization in the two-dimensional Ising model ~\eqref{ising1}, with respect to the temperature $T$.} \label{mag_132} \end{figure} \subsection{Mean field theory \label{sec1.4}} Many-body systems are, in general, plagued with exact solvability issues which hinder the computation of their partition function $``\mathcal{Z}$''~\eqref{partition_function}, and therefore affect the access to their critical features, except for few cases like the one-dimensional Ising model. Mean field theory is an approximation method that aims to approximate the local field in the original ``\textit{hard to solve}'' Hamiltonian by an average effective field determined by the entire system. In other words, we look at the chain from the point of view of a given spin and we ignore the fluctuations of the system, while focusing on its mean behaviour~\cite{weiss-curie}. \noindent According to mean field theory, the Hamiltonian of the Ising model ~\eqref{ising1}, can be written as \begin{equation} H_{\Omega} = -\sum_i S_i H_i, \end{equation} where \begin{equation} H_i=\underbrace{h}_{\text{magnetic field}}+ \underbrace{\sum_j J_{ij}\langle S_j \rangle}_{\text{the mean field}} + \underbrace{\sum_j J_{ij} \left(S_j-\langle S_j. \rangle\right)}_{\text{the fluctuations}}. \end{equation} We ignore the fluctuation term, and we write $H_i$ for a $d$-dimensional hypercubic lattice as \begin{equation} H_i = h + 2dJm, \end{equation} where $2d$ is the coordination number of each site of the lattice and $m$ is the mean field sensed by the spin. Then, the magnetization is \begin{equation} M= \tanh\left(\frac{h+2dJm}{k_B T}\right). \label{sol_mft} \end{equation} \begin{figure}[t!] \centering \begin{tikzpicture}[scale=1.5] \draw[->,ultra thick] (-4,0)--(4,0) node[right]{$M$}; \draw[->,ultra thick] (0,-3)--(0,3) node[above]{$m$}; \draw [thick] plot [smooth] coordinates {(-3,-3) (0,0) (3,3)}; \draw [red,thick] plot [smooth] coordinates {(-3,-2) (-1,-1.5) (0,0) (1,1.5) (3,2)}; \draw [blue,dashed,thick] plot [smooth] coordinates {(-3,-1) (-1,-0.5) (0,0) (1,0.5) (3,1)}; \node[right] (A) at (3,2) {$T<T_c$}; \node[right] (A) at (3,3) {$M=m$}; \node[right] (A) at (3,1) {$T>T_c$}; \filldraw[purple] (-0.1,-0.1) rectangle (0.15,0.15); \fill[purple] (1.75,1.75) circle (3pt); \fill[purple] (-1.75,-1.75) circle (3pt); \end{tikzpicture} \caption{Graphical solution to mean field approximation~\eqref{sol_mft}.} \label{mean_field} \end{figure} \noindent At zero magnetic field, i.e. $h=0$, the critical temperature is \begin{equation} T_c =2dJ/k_B. \end{equation} Non-analytical behaviour arise due to the behaviour of the solutions of the magnetization~\eqref{sol_mft}, with respect to the temperature $T$. This is visualised graphically in Figure~\eqref{mean_field}, where we see at $T>T_c$, the $\tanh$ curve lies below $M=m$ and intersect only at $M=0$. Hence, at high temperatures, there is no net magnetization and that the ordered state is destroyed by thermal fluctuations. However, at $T<T_c$ the $\tanh$ intersects at $\pm M_0$ and $M=0$ (which is unstable). Thus, the spins are pointing in the same directions, either up or down. \subsection{Critical exponents \label{1.1.4.1}} We can study the behaviour of physical quantities around the critical point $T_c$, by expanding the equation of state~\eqref{sol_mft}, in the vicinity of $T_c$ as \begin{equation} M= \tanh(\frac{h}{k_B T} +m \tau) = \frac{\tanh(\frac{h}{k_B T})+\tanh m\tau }{1+\tanh(\frac{h}{k_B T}) \tanh m\tau}, \end{equation} where $\tau=T/T_c$. Then \begin{ceqn} \begin{equation} \tanh(\frac{h}{k_B T}) = \frac{M-\tanh m \tau}{1-M \tanh m \tau}, \label{criexpomagn} \end{equation} \end{ceqn} for weak $h$ and small $m$, we can write~\eqref{criexpomagn} as \begin{ceqn} \begin{equation} \frac{h}{k_B T} \approx M(1-\tau) + M^3\left(\tau -\tau^2 +\frac{\tau^3}{3} +\dots\right) + \dots \label{criexpomagn2} \end{equation} \end{ceqn} For zero magnetic field and when $T \to T_c^-$, we have \begin{equation} M^2 \approx 3 \frac{T_c - T}{T} + \dots. \end{equation} As $M \propto \left(\frac{T- T_c}{T}\right)^{\beta}$ we can extract immediately the critical exponent of the ferromagnetic transition: $\beta=1/2$. The critical isotherm is the curve in the $h$-$M$ plan corresponding to $T=T_c$. Near the critical point, it is described by a critical exponent $\delta$ \begin{equation} h \sim M^{\delta}. \end{equation} Setting $\tau=1$ in~\eqref{criexpomagn2}, we find $\delta=3$. That is \begin{ceqn} \begin{align} \frac{h}{k_B T} \sim M^3. \end{align} \end{ceqn} The isothermal magnetic susceptibility also diverges near $T_c$: \begin{equation} \chi_T =\frac{\partial M}{\partial h}, \end{equation} from~\eqref{criexpomagn2}, we get \begin{equation} \frac{1}{k_B T} = \chi_T(1-\tau)+3M^2 \chi_T (\tau -\tau^2+\frac{1}{3} \tau^3). \end{equation} At high temperatures, i.e. $T>T_c$, $M=0$. Then \begin{ceqn} \begin{align} \chi_T &=\frac{1}{k_B} \frac{1}{T-T_c} + \dots\\& \sim |T-T_c|^{-\gamma}. \label{eq113} \end{align} \end{ceqn} The critical exponent that characterizes the divergence in the isothermal susceptibility is $\gamma =1$. At low temperatures, i.e. $T<T_c$, we have \begin{equation} M=\sqrt{3} \left( \frac{T_c - T}{T} \right)^{1/2} + \dots \end{equation} which yields to \begin{equation} \chi_T =\frac{3}{2k_B} \frac{1}{T-T_c} + \dots \end{equation} Below the transition temperature, the isothermal susceptibility diverges with $\gamma=1$. The critical exponent $\alpha$ of the specific heat can also be calculated, for that we write the free energy in the mean field approximation as \begin{equation} F_m= -k_B T \ln\left[ 2\cosh\left( \beta J2dm \right) \right], \end{equation} knowing that $\cosh(x) = 1+\frac{x^2}{2!} + \frac{x^4}{4!} + \dots$ and that $M=0$ for $T>T_c$ while $M=\left(3 \frac{T_c - T}{T} \right)^{1/2}$ for $T<T_c$. Taking the second derivative of the free energy with respect to the temperature leads to \begin{equation} C=\begin{cases} \displaystyle{\frac{3}{2}} k_B N &T< T_c,\\ 0&T>T_c. \end{cases} \end{equation} Since $C\sim |\frac{T_c - T}{T}|^{-\alpha}$, the critical exponent $\alpha$ must be zero. An important relationship can be derived between the isothermal magnetic susceptibility and the correlations functions. For that, we start from the partition function of the Ising model~\eqref{ising1}, given by \begin{equation} Z= \Tr \exp \left[ -h \beta \sum_i S_i - \beta J \sum_{\langle ij \rangle} S_iS_{j} \right]. \end{equation} Then, we have \begin{ceqn} \begin{align} \sum_i \langle S_i \rangle &= \frac{1}{\beta Z} \frac{\partial Z}{\partial h}, \\ \sum_i \langle S_iS_j\rangle &= \frac{1}{\beta^2 Z} \frac{\partial^2 Z}{\partial h^2}. \end{align} \end{ceqn} On the other side \begin{ceqn} \begin{align} \chi_T &=\frac{\partial M}{\partial h}=\frac{1}{\beta N} \frac{\partial^2 \log Z}{\partial h^2},\nonumber\\ &=\frac{1}{N} k_B T \left[ \frac{1}{Z} \frac{\partial^2 Z}{\partial h^2} - \frac{1}{Z^2} \left( \frac{\partial Z}{\partial h}\right) \right], \nonumber\\ &=\frac{1}{N} (k_B T)^{-1} \left[ \sum_{ij} \langle S_iS_j\rangle - \left(\sum_i \langle S_i \rangle \right)^2 \right],\nonumber\\ &=\frac{1}{N} (k_B T)^{-1} \sum_{ij} G(r_i-r_j),\nonumber\\ &=(k_B T)^{-1} \sum_i G(x_i),\nonumber\\ &=(a^d k_B T)^{-1} \int_{\Omega} d^d rG(r). \end{align} \end{ceqn} Here, $G(r_i-r_j)=\langle S_iS_j \rangle - \langle S_i \rangle \langle S_j \rangle$ is the two point correlation function, where $r_i(r_j)$ is the spatial position of the spin $S_i(S_j)$. This result relates the divergence in $\chi_T$ with the two point correlation function $G$. Then, $G$ has to reflect the divergence in $\chi_T$, in general we have \begin{ceqn} \begin{align} G(r) \sim \frac{e^{-|r|/\xi}}{|r|^{(d-1)/2}\xi^{(d-3)/2}}, && \text{for } |r|>>\xi. \label{g(r)} \end{align} \end{ceqn} Combining this result with~\eqref{eq113} yields to \begin{ceqn} \begin{align} \left(\frac{T_c -T}{T}\right)^{-1} &\sim \int \frac{r^{d-1}e^{-r/\xi}}{r^{(d-1)/2}\xi^{(d-3)/2}} dr \\ &\sim \int \left(z^{(d-1)/2} e^{-z} dz\right) \xi^2, \end{align} \end{ceqn} with $z=r/\xi$. Thus \begin{ceqn} \begin{equation} \xi \sim \left(\frac{T_c -T}{T}\right)^{-\nu}, \end{equation} \end{ceqn} with $\nu=1/2$. $\xi$ is called the correlation length which describes the extent of spatial correlations between two spins $S_i$ and $S_j$. In the thermodynamical limit, $\xi$ diverges at the critical point. The last critical exponent we mention is $\eta$, which describes how the two points correlation function $G(r)$~\eqref{g(r)}, behave at long distances at the critical point. $G(r)$ for long distances near the critical point is given by: $G(r) \sim r^{-(d-2+\eta)}$, with $\eta=0$. In principle, $\eta$ can be non zero. \begin{table}[t!] \centering \begin{tabular}{ccccc } \hline Exponent & Mean Field & Experiment & 2D Ising & 3D Ising \\ \hline $\alpha$ & 0 &0.110-0.116 & 0& 0.110\\ $\beta$ & 1/2 & 0.316-0.327 & 1/8 & 0.325 $\pm$ 0.0015\\ $\gamma$ & 1 & 1.23-1.25 & 7/4 & 1.2405 $\pm$ 0.0015\\ $\delta$ & 3 & 4.6-4.9 & 15 & 4.82\\ $\nu$ & 1/2 & 0.625 $\pm$ 0.010 & 1 & 0.630 \\ $\eta$ & 0 & 0.016 - 0.06 & 1/4 & 0.032 $\pm$0.003\\ \hline \end{tabular} \caption{Critical exponents for the Ising universality class} \label{cri_exp_tab} \end{table} \noindent How accurate is the mean field theory? In Table~\eqref{cri_exp_tab}, we see the discrepancy between the critical exponents obtained by the mean field approximation and the experimental results while the exponents of the three-dimensional Ising model are in accordance with experience. This is due to the mean field approximation, where the exponents in this approach do not depend on the dimension, while from Table~\eqref{cri_exp_tab}, it is clear that the critical exponents depend on the dimensionality of the system. On the other hand, the approximation supposes that the spins do not interact and each spin feels the same field due to all the other spins, and this contradicts the essence of magnetism, which is based on cooperative long range cooperative behavior of spins. The mean field approximation is clearly not a good choice for magnetic systems.\\ The critical exponents satisfy scaling relations, which can be obtained by thermodynamic considerations, they are given by \begin{ceqn} \begin{align} \alpha +2\beta+\gamma=2&,\nonumber\\ \gamma=\beta(\delta-1)&,\\ \gamma=\nu(2-\eta).& \nonumber \end{align} \end{ceqn} The precision of the mean field approximation increases as we increase the dimension of the system. In fact, from the scaling relation $2-\alpha=d\nu$, where $d$ is the dimension of the system, we can deduce the critical dimension $d_c$ at which we get precise results from the mean field approximation. Since $\alpha=0$ and $\nu=1/2$, $d_c$ must be 4. \subsection{Landau theory of phase transitions} One of the main challenges in physics is to develop a universal framework, a theory of everything, for all physical aspects of our universe. In condensed matter physics and statistical mechanics, Landau proposed a theory for all phase transitions based on simple hypotheses~\cite{landau1936theory}. Landau theory of phase transitions consists of \textit{guessing} a quantity called the \textit{Landau potential}, where its minima with respect to the order parameter should describe the thermodynamic properties of the system at the critical point. \subsubsection{The order parameter} The order parameter $\Psi$ is a quantity used to describe phase transitions, it is zero (non-zero) in the disordered (ordered) phase. The definition of the order parameter is not always trivial as there are systems for which this quantity can not be defined. Depending on the nature of the system, the order parameter can be a scalar, vector or a tensor.\\ The order parameter of the ferromagnetic-paramagnetic transition is, in general, a vector: the net magnetization $M=\sum_i \langle S_i \rangle$. It is zero (non-zero) above (below) the critical temperature. For the liquid-gas transition, the order parameter is a scalar which is computed via the difference between the density of liquid and that of the gas, that is $\rho_l-\rho_g$. \subsubsection{Landau Theory} Landau theory of phase transitions consists of writing a function $L$ called \textit{Landau free energy} or \textit{Landau functional} in terms of the order parameter $\Psi$ and the coupling constants $\left[ K_i\right]$. In this decomposition, we keep only the terms that are compatible with the symmetry of the system and we assume that thermodynamic functions of the system can be calculated by differentiation of $L$. Landau free energy has the following constraints \begin{enumerate} \item $L$ has to follow the symmetries of the system. \item Near $T_c$, $L$ is an analytic function of $\Psi$ and $[K]$. We can write \begin{equation} L = \sum_{n=0}^{\infty} a_n([K])\Psi^n. \end{equation} \item $\Psi$=0 in the disordered phase, while it is small and non zero in the ordered phase near $T_c$. Thus, for $T>T_c$ we solve the minimum equation for $L$ by $\Psi=0$ and for $T<T_c$ $\Psi \neq 0$ solves the minimum equation. For a homogeneous system we can write \begin{ceqn} \begin{equation} L = \sum_{n=0}^{4} a_n([K])\Psi^n. \label{landau1} \end{equation} \end{ceqn} Where we suppose that all the necessary information about the physics of phase transitions appear at this order as it did for mean field theory in Section~\eqref{sec1.4}. \end{enumerate} Using~\eqref{landau1}, we have at equilibrium \begin{ceqn} \begin{equation} \frac{\partial L}{\partial \Psi} = a_1 +2a_2 \Psi+3a_3\Psi^2+4a_4\Psi^3=0. \label{dlandau1} \end{equation} \end{ceqn} For $T>T_c$, the order parameter $\Psi$ is zero. Then, $a_1=0$. In fact, the system is invariant under change of $\Psi$ by $-\Psi$, that is $L$ is an even function : $L(\Psi)=L(-\Psi)$. Thus \begin{ceqn} \begin{equation} L=a_0([K],T)+a_2([K],T)\Psi^2+a_4([K],T)\Psi^4. \label{landau0} \end{equation} \end{ceqn} Each term in Landau's free energy serve a role. $a_0([K],T)$ represents the value $L$ in the disordered phase ($\Psi=0$ for $T>T_c$), it describes the degrees of freedom of the system that cannot be understood via the order parameter. For $a_2$ and $a_4$ expanding in temperature near $T_c$, we obtain \begin{ceqn} \begin{align} a_4&=a^0_4+\left(T-T_c\right) a^1_4+\dots, \\ a_2&=a^0_2+\frac{\left(T-T_c\right)}{T_c}a^1_2+O\left(\left(T-T_c\right)^2\right). \end{align} \end{ceqn} Since $\partial^2L/\partial \Psi^2 =1/\chi=0$ as $T \to T_c$, one has $a^0_2=0$ and \begin{equation} a_2=\frac{\left(T-T_c\right)}{T_c}a^1_2+O\left(\left(T-T_c\right)^2\right). \end{equation} The extension to the case $h \neq 0$ for the Ising ferromagnet is immediate. The order parameter in the Ising model is the magnetization $M$, that is $\Psi=M$. The additional energy in the Hamiltonian due to the magnetic field is $-h\displaystyle{\sum_i S_i}=-hNM$. Thus, Landau free energy can be written as \begin{ceqn} \begin{equation} L = a\left(\frac{T-T_c}{T_c}\right)\Psi^2+\frac{1}{2}b\Psi^4-h\Psi, \label{landau2} \end{equation} \end{ceqn} where the coefficient $a$ and $b$ can be obtained from a microscopic analysis. \subsubsection{Continuous Phase Transitions} We present in Figure~\eqref{plot_l} the variation of Landau free energy~\eqref{landau2}, with respect to the order parameter $\Psi$. The case $h=0$ is when the continuous (second-order) phase transition occur. For $T>T_c$, $L$ has a minimum at $\Psi=0$. When $T=T_c$ Landau potential has zero curvature at $\Psi=0$ while $\Psi=0$ is still the global minimum. For $T<T_c$, Landau free energy shows two degenerate minima at $\Psi=\pm n_s(T)$.\\ Solving~\eqref{dlandau1} for $\Psi$ we can read off the critical exponent $\beta$. We have \begin{ceqn} \begin{align} \Psi=0 && \text{or} && \Psi =\sqrt{-\frac{at}{b}}, \end{align} \end{ceqn} where $t=\frac{T-T_c}{T_c}$. Then, for $T<T_c$ $\beta=1/2$.\\ Landau potential is zero for $t>0$ and for $t<0$ we can write \begin{equation} L=-\frac{1}{2} \frac{a^2t^2}{b}. \end{equation} The critical exponent $\alpha$ of the heat capacity can be extracted by writing: $C_V=-T \partial^2 L/\partial T^2$. Hence \begin{equation} C_v = \begin{cases} 0 & T>T_c,\\ a^2/bT_c & T<T_c. \end{cases} \end{equation} which shows that the heat capacity exhibits a discontinuity and that $\alpha=0$.\\ Switching on the magnetic field ``$h$'' allows to calculate the other critical exponents. Taking the derivative with respect to $\Psi$ in~\eqref{landau2} gives: \begin{ceqn} \begin{equation} at\Psi +b\Psi^3=\frac{1}{2}h. \label{landau3} \end{equation} \end{ceqn} On the critical isotherm: $t=0$. We have $h\propto\Psi^3$ and we read the critical exponent $\delta=3$. The isothermal susceptibility $\chi_T$ can be computed by taking the derivative of~\eqref{landau3} with respect to $h$. That is \begin{ceqn} \begin{equation} \chi_T =\frac{\partial \Psi(h)}{\partial h} =\frac{1}{2\left(at+3b\Psi(h)^2\right)}, \end{equation} \end{ceqn} where $\Psi(H)$ is a solution of~\eqref{landau3}. For $t>0$, we have $\Psi=0$, then $\chi_T \propto t^-1$ while for $t<0$, we have $\Psi=\left(-at/b\right)^{1/2}$ and $\chi_T \propto t^{-1}$. Thus, the critical exponent is $\gamma=1$. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.33\textwidth} \begin{tikzpicture}[scale=1.5] \draw[->,ultra thick] (-1,0)--(1,0) node[right]{$\Psi$}; \draw[->,ultra thick] (0,-1)--(0,2) node[above]{$\mathcal{L}$}; \draw [thick] plot [smooth] coordinates {(-1,2) (-0.5,-0.3) (0,0) (1,2)}; \draw [dashed,red,thick] plot [smooth] coordinates {(-1.3,2) (-0.6,-0.4) (0,0) (1.3,2)}; \draw [dotted,blue,thick] plot [smooth] coordinates {(-1.5,2) (-0.7,-0.5) (0,0) (0.5,-0.2) (1.5,2)}; \end{tikzpicture} \end{subfigure}% \begin{subfigure}[t]{0.33\textwidth} \begin{tikzpicture}[scale=1.5] \draw[->,ultra thick] (-1,0)--(1,0) node[right]{$\Psi$}; \draw[->,ultra thick] (0,-1)--(0,2) node[above]{$\mathcal{L}$}; \draw [thick] plot [smooth] coordinates {(-1,2) (0,0) (1,2)}; \draw [dashed,red,thick] plot [smooth] coordinates {(-1.2,2) (-0.5,0.2) (0,0) (0.5,0.2) (1.2,2)}; \draw [dotted,blue,thick] plot [smooth] coordinates {(-1.4,2) (-0.5,-0.5) (0,0) (0.5,-0.5) (1.4,2)}; \end{tikzpicture} \end{subfigure}% \begin{subfigure}[t]{0.33\textwidth} \begin{tikzpicture}[scale=1.5] \draw[->,ultra thick] (-1,0)--(1,0) node[right]{$\Psi$}; \draw[->,ultra thick] (0,-1)--(0,2) node[above]{$\mathcal{L}$}; \draw [thick] plot [smooth] coordinates {(-1,2) (0,0) (0.5,-0.2) (1,2)}; \draw [dashed,red,thick] plot [smooth] coordinates {(-1.3,2) (-1.1,1) (0,0) (0.5,-0.6) (1,1)}; \draw [dotted,blue,thick] plot [smooth] coordinates {(-1.1,2) (-0.5,-0.5) (0.,0.) (0.5,-1) (1,1)}; \end{tikzpicture} \end{subfigure} \caption{Landau free energy~\eqref{landau2}, for different values of $T$ and $H$. From left to right : $H<0$, $H=0$ and $H>0$.} \label{plot_l} \end{figure} \subsubsection{First Order Phase Transitions} The symmetry requirement prevents the Landau free energy in~\eqref{landau0} of having a cubic term in $\Psi$. In general, what is the effect of this term in Landau potential? We first write $L$ as \begin{ceqn} \begin{equation} L=at\Psi^2+\frac{1}{2}b\Psi^4+C\Psi^3-h\Psi. \label{1pt} \end{equation} \end{ceqn} Where $a$ and $ b $ are positive. A derivative of $L$ with respect to $\Psi$ at equilibrium and at zero magnetic field ($ h=0 $) gives: \begin{ceqn} \begin{align} \Psi= \begin{cases} 0,\\ -c \pm \sqrt{c^2-at/b},&\text{with } c= 3C/4b. \end{cases} \end{align} \end{ceqn} The solution $\Psi \neq 0$ is real when the argument of the square root is positive, i.e. $ \sqrt{c^2-at/b} > 0$. That is, $ t<t^*=bc^2/a $. When $t<t^*$, in addition to the minimum $\Psi=0$, $L$ develops a secondary minimum and a maximum. Reducing $t$ further, below a value $t_1$, the value of the order parameter which minimizes $L$ \textbf{jumps discontinuously} from $\Psi=0$ to a non-zero value and the secondary minimum becomes the global minimum of $L$. This is a \textit{first order phase transition}. In Figure~\eqref{1PT_landau} we sketch Landau's free energy~\eqref{1pt}, with respect to the order parameter $\Psi$. A sufficient but not necessary condition of the occurrence of continuous phase transitions is that there are no cubic terms in the potential. In general, the cubic term causes a first order phase transition. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.49\textwidth} \begin{tikzpicture}[scale=1.5] \draw[->,ultra thick] (-1,0)--(2,0) node[right]{$\Psi$}; \draw[->,ultra thick] (0,0)--(0,3) node[above]{$\mathcal{L}$}; \draw [thick] plot [smooth] coordinates {(-1,2) (0,0) (1.5,2)}; \node[above] (A) at (1.5,2) {$t>t^*$}; \end{tikzpicture} \end{subfigure}% \begin{subfigure}[t]{0.49\textwidth} \begin{tikzpicture}[scale=1.5] \draw[->,ultra thick] (-1,0)--(2,0) node[right]{$\Psi$}; \draw[->,ultra thick] (0,0)--(0,3) node[above]{$\mathcal{L}$}; \draw [thick] plot [smooth] coordinates {(-1.5,2) (0,0) (0.75,1) (1.5,0.5) (2,2)}; \node[above] (A) at (2,2) {$t<t^*$}; \end{tikzpicture} \end{subfigure} \begin{subfigure}[t]{0.49\textwidth} \begin{tikzpicture}[scale=1.5] \draw[->,ultra thick] (-1,0)--(2,0) node[right]{$\Psi$}; \draw[->,ultra thick] (0,0)--(0,3) node[above]{$\mathcal{L}$}; \draw [thick] plot [smooth] coordinates {(-1,2) (0,0) (0.75,1) (1.5,0.) (2,2)}; \node[right] (A) at (2,2) {$t=t_1$}; \end{tikzpicture} \end{subfigure} \begin{subfigure}[t]{0.49\textwidth} \begin{tikzpicture}[scale=1.5] \draw[->,ultra thick] (-1,1)--(2,1) node[right]{$\Psi$}; \draw[->,ultra thick] (0,0)--(0,3) node[above]{$\mathcal{L}$}; \draw [thick] plot [smooth] coordinates {(-0.5,2.5) (0,1) (0.5,1.5) (1,0) (2,2)}; \node[right] (A) at (2,2) {$t<t_1$}; \end{tikzpicture} \end{subfigure} \caption{Landau free energy ~\eqref{1PT_landau}, with respect to the order parameter $\Psi$.} \label{1PT_landau} \end{figure} \section{Quantum phase transitions} \subsection{What is a quantum phase transition?} The phase transitions studied so far occur at finite temperature, where long-range order is destroyed by thermal fluctuations. Many-body systems can exhibit a different kind of critical phenomena at zero temperature, called quantum phase transitions, where quantum fluctuations are dictating the properties of the system~\cite{sachdev2011quantum, vojta2003quantum}. Quantum phase transitions are driven by non-thermal parameters, such as pressure, magnetic field or the chemical composition, which creates quantum fluctuations, due to the Heisenberg principle, that destroy the long range order across the quantum critical point. \noindent From an experimental point of view, the study of quantum phase transitions appears to be a theoretical marginal problem and reserved only to a class of specialist theorists, due to their occurrence at an impossible to reach temperature in experiments. However, recent theoretical and experimental advances on the field have proved that the presence of quantum critical phenomena at zero temperature, provide a framework to solve problems in condensed matter physics, such as rare-earth magnetic insulators~\cite{bitko1996}, heavy-fermion compounds~\cite{coleman1999, L_hneysen_1996}, high-temperature superconductors~\cite{dagotto1994, orenstein2000} and two-dimensional electron gases~\cite{sachdev2000,krav1995}. \noindent Consider a quantum system describing a lattice of spins via a Hamiltonian $H(g)$, where $g$ is a dimensionless coupling parameter used to drive the system. The nature of the quantum phase transition can be inspected by tracking the low-lying energies of the system as a function of $g$. A quantum phase transition is essentially a non-analyticity in the ground state, which can manifest into two forms: \begin{itemize} \item \textbf{Level crossing:}\\ A singularity can manifest in the low-lying energy levels of the quantum system at $g=g_c$, by an excited state becoming the ground state of the system, as depicted in Figure~\eqref{lvl_cross}. Energy level crossing is a feature indicating a ``first-order quantum phase transition", which can occur in both finite and infinite systems \item \textbf{Avoided level crossing:}\\ The non-analyticity can develop by an avoided level crossing of the energy levels between the ground state and the first excited state as shown in Figure~\eqref{avoid_lvl_cross}. Continuous (second-order) quantum phase transitions are characterized by an avoided level crossing in the ground state energy. In the thermodynamical limit, the avoided level crossing tends to be infinitely sharp. \end{itemize} \begin{figure}[t!] \centering \begin{subfigure}[h]{0.49\textwidth} \begin{tikzpicture}[scale=1.5] \draw [<->,thick] (0,4) node (yaxis) [above] {$E_n$}|- (4,0) node (xaxis) [right] {$g$}; \coordinate (O) at (0.5,0.5); \coordinate (A) at (2.5,0.9); \coordinate (B) at (0.5,0.8); \coordinate (C) at (2.5,0.5); \coordinate (D) at (0.5,1.0); \coordinate (E) at (2.7,1.3); \coordinate (F) at (0.5,1.2); \coordinate (G) at (2.7,1.7); \draw[thick,color=black] (O) to [bend right=10] (A) node[anchor=south east]{}; \draw[thick,color=black] (B) to [bend left=10] (C) node[anchor=south east]{}; \draw[thick,color=black] (D) to [bend right=10] (E) node[anchor=south east]{}; \draw[thick,color=black] (F) to [bend right=10] (G) node[anchor=south east]{}; \draw[dashed] (1.87,0.0)--(1.87,2.5); \node[below] (A) at (1.86,0.0) {$g_c$}; \end{tikzpicture} \caption{Level crossing at $g=g_c$.} \label{lvl_cross} \end{subfigure}% \begin{subfigure}[h]{0.49\textwidth} \begin{tikzpicture}[scale=1.5] \draw [<->,thick] (0,4) node (yaxis) [above] {$E_n$}|- (4,0) node (xaxis) [right] {$g$}; \draw[dashed] (1.85,0.0)--(1.85,3.5); \draw[thick] (0.5,1) .. controls (2,2.5) .. (3,0.5); \draw[thick] (0.5,3) .. controls (2.,2.) .. (3,3); \node[below] (A) at (1.85,0.0) {$g_c$}; \end{tikzpicture} \caption{Avoided level crossing at $g=g_c$.} \label{avoid_lvl_cross} \end{subfigure} \caption{Energy level crossing at (a) first-order quantum phase transition, and (b) second-order quantum phase transition, with respect to the dimensionless coupling $g$.} \label{energy_crossing} \end{figure} The focus of this part will be on second-order quantum phase transitions, which are characterized by a vanishing energy gap $\Delta$, between the ground state and the first excited state as $g$ tends to $g_c$. In general, the energy gap $\Delta$ vanishes as \begin{equation} \Delta \sim |g-g_c|^{zv}, \label{quantum_delta} \end{equation} where $zv$ is a critical exponent, which is usually independent of the microscopic details of the Hamiltonian, in other words, $zv$ is universal. \noindent Continuous quantum phase transitions are also characterized by a diverging correlation length $\xi$, which describes the length scale of the decay of equal-time correlations in the ground state or the length scale where a crossover between correlations at long distances occur. The equal-time correlation function $G(r)$ of the order parameter $O(r,t)$ between two points distant by $r$, is given by \begin{equation} G(r)=\langle O(0,t)O(r,t) \rangle - \langle O(0,t)\rangle \langle O(r,t) \rangle \propto \frac{e^{-r/\xi}}{r^{d-2+\eta}}, \end{equation} where $d$ is the dimension of the system and $\eta$ is the Fisher exponent. Approaching the quantum critical point, the correlation length $\xi$ diverges as \begin{equation} \xi^{-1} \sim |g-g_c|^v. \label{quantum_xi} \end{equation} Unlike classical phase transitions, space and time are connected in a quantum phase transition. This can be seen from~\eqref{quantum_delta} and~\eqref{quantum_xi}, where we can define a time scale $\xi_{\tau}$ for the decay of equal-space correlations, which diverges as \begin{equation} \xi_{\tau} \sim \Delta^{-1} \propto \xi^{-z}. \end{equation} At the critical point, fluctuations occur on all length and time scales, due to the divergence of the correlation length and time. In Table~\eqref{quantum_cri_exp_tab}, we list the critical exponents for quantum magnetic systems. Similarly to the classical case, not all the quantum critical exponents are independent. From the seven critical exponents in Table~\eqref{quantum_cri_exp_tab}, we can obtain four scaling relations and only three exponents are independent. \begin{table}[t!] \centering \begin{tabular}{ccc } \hline Quantity & Exponent & Definition \\ \hline Correlation length $\xi$ & $v$ & $\xi \propto |g-g_c|^{-v}$\\ Order parameter $O$ &$\beta$ & $O \propto (g_c-h)^{\beta}$\\ Specific heat $C_v$ &$\alpha$ & $C_v \propto |g-g_c|^{-\alpha}$ \\ Susceptibility $\chi$ &$\gamma$ & $\chi \propto |g-g_c|^{-\gamma}$ \\ Critical isotherm &$\delta$ & $g_c \propto |O|^{\delta}$ \\ Correlation function $G(r)$ &$\eta$ & $G(r) \propto |r|^{-d+2-\eta}$ \\ Correlation time $\xi_{\tau}$ &$z$ & $\xi_{\tau}\propto \xi^z$ \\ \hline \end{tabular} \caption{Critical exponents for the quantum Ising universality class.} \label{quantum_cri_exp_tab} \end{table} \subsection{Quantum-classical crossovers} The singularities discussed above occur strictly at $T=0$. Therefore, theoretically speaking, quantum phase transitions occur only at zero temperatures. Experiments are always performed at very small, but nonzero temperature. One of the main goals of the theory of quantum phase transitions is to understand the ramifications of the presence of the singularity at $T=0$ on the physical properties of the system at $T>0$. \noindent At nonzero temperature, we have two energy scales: the thermal energy $k_bT$, and the energy associated to the characteristic frequency belonging to the diverging relaxation time $\hbar\omega_c$, quantum theory will be important as long as $\hbar\omega_c \gg k_bT $. On the other hand, when $\hbar\omega_c \ll k_bT $ the fluctuations follow the laws of classical mechanics. The crossover between quantum and classical theory in the vicinity of the quantum critical point leads to a rich phase diagram as depicted in Figure~\eqref{q_c_mapping}. We distinguish two cases depending on whether long range exists at zero or nonzero temperature. \noindent The situation where order exists only at $T=0$ is shown in Figure~\eqref{q_c_mapping_0}, a true phase transition cannot be seen experimentally at $T>0$. The nonzero temperature behavior is characterized by three regimes, separated by crossovers. In the thermally disordered regime, the long-range order is destroyed by thermal fluctuations, while in the quantum disordered region the system is dominated by quantum fluctuations. In both regimes, the energy gap $\Delta$ satisfies: $\Delta>k_bT$, which implies that the system reaches local thermal equilibrium after a time $\tau_{\text{eq}}$, satisfying $\tau_{\text{eq}}\gg \frac{\hbar}{k_bT}$. Thus, the dynamics can be effectively described with classical equation of motions. Between the thermally and quantum disordered regimes, is the quantum critical region, the energy gap $\Delta$ satisfies: $\Delta<k_bT$. Implying that both quantum and classical fluctuations are important. In this region, the system looks critical with respect to $g$, but thermal fluctuations drives it away from criticality. Therefore, the physics in the quantum critical region is dictated by thermal excitations of the quantum critical ground state, whose main feature is the absence of quasiparticle excitations. \begin{figure}[t!] \begin{subfigure}[t!]{0.49\textwidth} \caption{} \begin{tikzpicture}[scale=1.3] \draw[-,ultra thick] node[left]{$0$} (0,0)--(2,0) node[below]{$g_c$}; \draw[->] (2,0)--(4,0) node[right]{$g$}; \draw[->] (0,0)--(0,4) node[above]{$T$}; \draw [dashed,thick,fill=gray!30] plot [smooth] coordinates {(0.5,3) (2,0) (3.5,3)}; \draw[dashed, thick] (0.5,3.5)--(3.5,3.5); \node[above] (A) at (2,3.5) {non-universal}; \node[above] (A) at (2,2) {quantum critical}; \node[above] (A) at (3.2,0.4) {quantum}; \node[above] (A) at (3.2,0.2) { disordered}; \node[above] (A) at (0.7,0.4) {thermally}; \node[above] (A) at (0.7,0.2) {disordered}; \node[below] (A) at (1,-0.3) {ordered at $T=0$}; \node[below] (A) at (1,0) {\textbf{$\uparrow$}}; \end{tikzpicture} \label{q_c_mapping_0} \end{subfigure} \hspace{-2.\baselineskip} \begin{subfigure}[t!]{0.49\textwidth} \caption{} \begin{tikzpicture}[scale=1.3] \draw[-] node[left]{$0$} (0,0)--(3,0) node[below]{$g_c$}; \draw[->] (3,0)--(6,0) node[right]{$g$}; \draw[->] (0,0)--(0,4) node[above]{$T$}; \draw [dashed,thick,fill=gray!30] plot [smooth] coordinates {(1.5,3) (3,0) (4.5,3)}; \draw[thick] (0,2) arc (88:23:3.3); \draw[dashed,thick] (0,2.2) arc (88:19:3.2); \draw[dashed,thick] (0,1.8) arc (88:27:3.4); \draw[dashed, thick] (1.5,3.5)--(4.5,3.5); \node[above] (A) at (3,3.5) {non-universal}; \node[above] (A) at (3,2) {quantum critical}; \node[above] (A) at (5,0.4) {quantum}; \node[above] (A) at (5,0.2) { disordered}; \node[above] (A) at (0.7,2.7) {thermally}; \node[above] (A) at (0.7,2.5) {disordered}; \node[above] (A) at (0.7,0.3) {ordered}; \node[below] (A) at (0,1.8) {classical}; \node[below] (A) at (0,1.5) {critical}; \node[below] (A) at (0.5,2) {\textbf{$\nearrow$}}; \end{tikzpicture} \label{q_c_mapping_nonzero} \end{subfigure} \caption{Schematic phase diagram in the vicinity of a quantum critical point $g_c$. In (a) order exists only at $T=0$ and in (b) the order can exist even at finite temperature.} \label{q_c_mapping} \end{figure} \noindent The phase diagram can be richer when order can exist at finite temperature, as depicted in Figure~\eqref{q_c_mapping_nonzero}. In this case, a real phase transition is encountered at low temperature while varying $g$. There is an additional line of finite temperature transitions surrounded by a region, referred to as ``classically critical" where classical fluctuations are dominant. The quantum critical point can be seen as the endpoint of a line of finite temperature phase transitions. \subsection{Quantum-classical mapping} Deeper insight can be gained on the interplay between the quantum and classical behavior in the vicinity of the quantum critical point, by calling for quantum statistical mechanics. We consider a system described by a Hamiltonian of the form $H=H_{\text{kin}}+H_{\text{pot}}$, where $H_{\text{kin}}$ denotes the kinetic energy term and $H_{\text{pot}}$ represents the potential energy part. In classical mechanics, the kinetic and potential energy commute. Therefore, the partition function factorizes as $Z=e^{-H/{k_bT}}=Z_{\text{kin}}Z_{\text{pot}}$. Thus, in a classical system the statics and dynamics decouple. The kinetic part of the free energy is analytic, since it can be written as a product of simple Gaussian integrals. Therefore, classical critical phenomena can be studied using time-independent theories that live in $d$ dimensions. \noindent In contrast, in quantum mechanics the kinetic and potential part of the Hamiltonian $H$, do not commute in general. Therefore, the quantum partition function cannot be written in a simple factorized form. Thus, the statics and dynamics are always coupled. The canonical density operator $e^{-H/{k_bT}}$, can be seen as a time evolution operator with an imaginary time $\tau$, by identifying $1/k_bT=\tau=-i\theta/\hbar$ where $\theta$ is the real time. At zero temperature, the imaginary time acts as an additional space dimension, due to the system being infinite in this direction. Close to the critical point, the correlation length is the only relevant length scale. Therefore, any re-scale of the system by a factor, does not affect the physical properties while adjusting the external parameters in a way that keeps the correlation length unchanged. This allow us to introduce a scaling law for the singular part in the free energy, \begin{align} f(t,B)&=b^{-d}f(tb^{1/v},Bb^{yb}), &\text{classical phase transition,}\\ f(t,B)&=b^{-(d+z)}f(tb^{1/v},Bb^{yb}), &\text{quantum phase transition}, \label{qc_mapping_} \end{align} where $t=|g-g_c|/g_c$, $b$ is an arbitrary positive number and $(v,y_b)$ are critical exponents. The relation~\eqref{qc_mapping_} implies that a quantum phase transition in $d$ dimension is related to a classical phase transition in $(d+z)$ space dimension. For many phase transitions $z=1$, such as: clean insulators and Ising transition in two-dimensions. The classical phase transition in the two-dimensional model seen in Section~\eqref{2d_diagram_ising} is related to its counterpart in the one-dimensional quantum Ising model. \noindent At finite temperature, the crossover from quantum to classical corresponds to a dimensional jump. The temperature under the quantum-classical mapping is equivalent to an inverse length of the imaginary time axis. Approaching the transition, c.f. Figure~\eqref{q_c_mapping_nonzero}, the crossover is controlled by $\beta=1/k_bT$ and the correlation time $\tau_c$. When $\tau_c>\beta$, the crossover from quantum to classical occur, as the system is effectively only $d-$dimensional, instead of $(d+z)-$dimensional. The scaling law~\eqref{qc_mapping_}, can be generalized to finite temperatures, and we can write \begin{equation} f(t,B,T)=b^{-(d+z)}f(tb^{1/v},Bb^{yb},Tb^z). \end{equation} What is so special about quantum phase transitions, when they can be mapped to their classical counter parts? Quantum systems have special features and properties that outshine their classical counterparts, such as quantum entanglement, topological Berry phase and long-ranged effective interactions. Calculating the dynamics of quantum systems is never easy and requires sophisticated theories and careful considerations~\cite{sachdev2011quantum}. Therefore the approximation done on the imaginary axis, due to the quantum-classical mapping, is in general not valid for real times. Furthermore, near the critical point the dynamics of quantum systems are characterized by the phase coherence time $\tau_{\phi}$, which does not have a classical counterpart. When $T \to 0$, the phase coherence time diverges for all parameter values. This means a quantum system has perfect phase coherence in both the ordered and disordered phase. This peculiarity is related to the nature of the analytical continuation between imaginary and real times. For many models, it is found that $\tau_{\phi} \propto 1/T$ as $T \to 0$, and diverges faster in stable phases. \subsection{Quantum Ising model \label{1.2.3}} The Hamiltonian of the quantum Ising model is given by \begin{equation} H=-J\left(\sum_{i} \sigma_i^z\sigma_{i+1}^z-g\sigma_i^x\right), \label{eq_quantum_ising} \end{equation} where $J$ is the exchange energy between the spins and $g$ is a dimensionless coupling used to drive the system across the quantum phase transition. At each site $i$, the quantum degrees of freedom are represented by the Pauli matrices $\sigma_i^{\alpha}$, with $\alpha=x,y, z$, and they are given by \begin{equation} \sigma^x=\begin{pmatrix} 1&0\\ 0&-1 \end{pmatrix} \sigma^y=\begin{pmatrix} 0&-i\\ i&0 \end{pmatrix},% \sigma^z=\begin{pmatrix} 1&0\\ 0&1 \end{pmatrix}. \label{eq_pauli_matrix} \end{equation} The Pauli matrices~\eqref{eq_pauli_matrix}, satisfy the following commutation relations: \begin{itemize} \item At different sites $i$ and $j$: $[\sigma_i^{\alpha},\sigma_j^{\alpha}]=0$, for $i \neq j$. \item On the same site $i$: $[\sigma_i^{x},\sigma_i^{y}]=2i\sigma_i^{z}$. \end{itemize} The quantum Ising chain~\eqref{eq_quantum_ising}, can take two possible orientations: up $\ket{\uparrow}_i$ and down $\ket{\downarrow}_i$, corresponding to the two eigenvalues of $\sigma^z$: $\pm 1$. Therefore, when $g=0$ the quantum Ising model~\eqref{eq_quantum_ising}, reduces to a diagonal form in the basis of $\sigma^z$ which is equivalent to the classical Ising model~\eqref{ising1}, studied in Section~\eqref{1.1.3}. Switching on the coupling $``g$'' creates quantum fluctuations which are induced by the $\sigma^x$ term being non-diagonal in the $\sigma^z$ basis. These quantum fluctuations create quantum-tunneling in the Hamiltonian~\eqref{eq_quantum_ising}, which is capable of flipping the Ising spin on a site. As a consequence, competition arise between the term proportional to $``J$'' which favors the alignment of spins, either in the up or down orientation, which creates long-range magnetic order, and the term proportional to $``Jg$'' which disrupt and breaks the long-range magnetic order. The ground state of the quantum Ising model~\eqref{eq_quantum_ising}, is controlled solely by the coupling $``g$''. The phase diagram can be constructed by studying two limiting cases: $g\gg1$ and $g\ll1$. \begin{figure}[t!] \centering \begin{tikzpicture}[scale=1.5] \draw [<->, thick] (0,4) node (yaxis) [above] {$\langle \sigma^z \rangle$} |- (5,0) node (xaxis) [right] {$g$}; \draw[ultra thick] plot [smooth] coordinates {(0,3) (1,2.5) (2,1.5) (3,0)}; \node[left] (A) at (0,0) {$0$}; \node[left] (A) at (0,3) {$1$}; \node[below] (A) at (3,0) {$g_c$}; \fill[blue] (3,0) circle (2pt); \node[above] (A) at (1.5,1) {quantum}; \node[above] (A) at (1.5,0.7) {ferromagnet}; \node[above] (A) at (4,1) {quantum}; \node[above] (A) at (4,0.7) {paramagnet}; \end{tikzpicture} \caption{Spontaneous magnetization in the ground state~\eqref{gs_quantum_ising}, of the quantum Ising model~\eqref{eq_quantum_ising}, with respect to the coupling $g$.} \label{quantum_mag} \end{figure} \noindent At $g\gg1$, the $\sigma^x$ term in the Hamiltonian~\eqref{eq_quantum_ising}, dominates and the ground state $\ket{0}$ can be written, at a leading order of $1/g$, as \begin{equation} \ket{0}=\prod_i \ket{\rightarrow}_i, \label{gs_quantum_ising} \end{equation} where \begin{align} \ket{\rightarrow}_i=(\ket{\uparrow}_i + \ket{\downarrow}_i)/\sqrt{2},\\ \ket{\leftarrow}_i=(\ket{\uparrow}_i - \ket{\downarrow}_i)/\sqrt{2}, \end{align} are the eigenstates of $\sigma^x$ with eigenvalues $\pm1$. The spin-spin correlation function between two different sites $i$ and $j$, in the $z$-direction, is totally uncorrelated in the ground state~\eqref{gs_quantum_ising}, i.e. $\bra{0}\sigma_i^z\sigma_j^z \ket{0}=\delta_{ij}$. Using perturbation theory we can add corrections, at the leading order of $1/g$, in the form of correlations in $\sigma^z$. At each order in $1/g$, the build up correlations increase but remain short-ranged, so that for a large distance between two spins $i$ and $j$, the correlations decay as \begin{equation} \bra{0}\sigma_i^z\sigma_j^z \ket{0}\sim e^{-|x_i-x_j|/\xi}, \label{eq1.2.5} \end{equation} where $|x_i-x_j|$ is the distance between the spins $i$ and $j$ and $\xi$ is the correlation length discussed in Section~\eqref{1.1.4.1}. \noindent In the opposing limit, i.e. $g\ll1$, the first term in the Hamiltonian ~\eqref{eq_quantum_ising}, takes the lead. At $g=0$, the ground state is described via the eigenstates of $\sigma^z$, as it can take two orientations: up $\ket{\uparrow}_i$ or down $\ket{\downarrow}_i$. Consider the up configuration, turning on the coupling $``g"$ flips a fraction of spins. However, in the thermodynamic limit the degeneracy of the ground state survives due to the global spin-flip ($\mathcal{Z}_2$) symmetry that the Hamiltonian~\eqref{eq_quantum_ising}, obeys which maps the two ground states into each other, so that the Hamiltonian~\eqref{eq_quantum_ising}, remain invariant. The system will always chose one of the states as its ground state, this phenomenon is commonly referred to as ``spontaneous symmetry breaking''. \noindent In the thermodynamic limit and at small-$g$ perturbation theory, the spin spin correlation function between two different sites $i$ and $j$, in the $z$-direction, can be written as \begin{equation} \lim_{|x_i-x_j| \to \infty} \bra{0}\sigma_i^z\sigma_j^z \ket{0} =N_0^2, \label{eq1.2.6} \end{equation} where $\bra{0}\sigma_i^z\ket{0}=\pm N_0$ is the spontaneous magnetization. At $g=0$, we have $N_0=1$ meaning that all spins are in the up orientations. For small-$g$, quantum fluctuations reduces $N_0$ to a smaller, but non-zero value. \noindent The transition of the two-point correlation function between~\eqref{eq1.2.5} and~\eqref{eq1.2.6} does not occur analytically. In the thermodynamic limit and at a critical value of the coupling $g=g_c$, a quantum phase transition occurs between a quantum paramagnet ($g>g_c$) where equation~\eqref{eq1.2.5} holds, and a quantum ferromagnet ($g<g_c$) where equation~\eqref{eq1.2.6} is obeyed. Figure~\eqref{quantum_mag} illustrates the behaviour of the spontaneous magnetization of the ground state, upon crossing the quantum phase transition, with respect to $g$. We see $\langle \sigma^z \rangle$ is non zero in the quantum ferromagnetic phase and it reduces as we approach the quantum critical point at $g=g_c$, where it vanishes in the quantum paramagnet phase. \begin{table}[t!] \centering \begin{tabular}{cc } \hline System & Examples \\ \hline Order-disorder ferroelectrics & $KH_2PO_4$, $KD_2PO_4$ \\ Jahn-Teller systems & $DyVO_4,TbVO_4$\\ proton glasses & $Rd_{1-x}(NH_4)_x H_2PO_4$\\ quantum spin glasses & $LiHo_x Y_{1-x}F_4$\\ quasi-one-dimensional Ising systems & $CoNb_2O_6$\\ \hline \end{tabular} \caption{Systems described by transverse Ising model.} \label{table_transver_ising} \end{table} \subsection{Experimental realizations} There are a number of experimental verification of quantum phase transitions. In Table~\eqref{table_transver_ising}, we list some materials that can be described by the quantum Ising model~\eqref{eq_quantum_ising}. In the following we discuss some of the experiments of quantum phase transitions~\cite{under_qpt}. \begin{itemize} \item \textbf{Quantum dots:}\\ Over the last three decades, technological advances in nanofabrication and control of systems at low temperatures, allowed for the design of artificial atomic structures which imitates conventional materials. A prominent example is a quantum dot, which represents an artificial atom and can be used to model a localized magnetic moment~\cite{quantumdot}. A lattice of multiple quantum dots offer rich applications, it can be used to study spin transport~\cite{qdots_spin_trans}, heat transport~\cite{qdot_heat_transp} in low dimensional architectures and the interplay between single spins and conduction electrons~\cite{spin-cond_qdot}. \\ In artificial architectures, the microscopic properties such as energy spectrum, magnetic moment and the wavefunction spatial distribution, can be varied via gate voltage or magnetic field, without altering the material's structure or chemical composition, which is the case with real materials. As a consequence, in real materials tuning a single parameter, affect the other microscopic parameters and the Hamiltonian of system, which in turn make the two quantum phase transitions of the system, often belong to two different but related materials. The situation is different with quantum dots, where parameters can be controlled continuously and nearly independently, which allows the access to the critical features and phase diagram. \\ Quantum dots were used, in an experiment by Oreg and Goldhaber-Gordon, to observe the two-channel Kondo state, which describes a quantum phase transition between non-Fermi and Fermi liquids in metals~\cite{oreg2003}. \item \textbf{Two-dimensional electron systems:}\\ Quantum phase transitions can be realized experimentally in systems where the electrons are free to move in a plane but their motion perpendicular to the plane is quantized in a confined using a potential well. This type of systems is called: two-dimensional electron systems, and they were used for the metal-insulator transitions in perpendicular and zero magnetic field, as well as transitions in the Wigner crystal~\cite{wigcrys1988, 2d1992}. \item \textbf{The compound $\text{LiHoF}_{\boldsymbol{4}}$:}\\ The Ising model is used to describe the low-lying magnetic excitations of the insulator $\text{LiHoF}_4$. Bitko, Rosenbaum, and Aeppli studied experimentally this compound by placing the material in a transverse magnetic field to the magnetic axis~\cite{bitko1996}. The transverse magnetic field creates quantum tunneling between the states of the ion Ho, which can destroy the long-range magnetic order, if applied sufficiently strong. Indeed, such a quantum phase transition was successfully observed, where the ferromagnetic moment was observed to vanish at the critical point. \item \textbf{Ultracold atoms: }\\ Ultracold atoms in optical lattices are a versatile platform to study the genuine properties of quantum many-body systems~\cite{ultracoldbook}. The superfluid-mott insulator quantum phase transition have been realized experimentally using ultracold atoms in optical lattices. The experiment done by Greiner, Bloch and collaborators consist of cooling ${}^{87}$Rb atoms to low temperatures so that their quantum statistics is dominant. Since ${}^{87}$Rb atoms are bosons, they can condense in a superfluid state via Bose-Condensation. To drive the atoms to insulator phase, Greiner and his collaborator used an optical lattice to apply a periodic potential on the atoms. This forces the system to localize in the minima of the periodic potential, which leads to a quantum phase transition to an insulating state~\cite{bloch2002}. \end{itemize} \chapter{Classical \& Quantum Information Theory \label{chap2}} \section{What is information?} Classical information theory aims at studying the problem of sending classical information, which can take several forms: letters in alphabet, speech and strings of bits, over communication channels ruled by the laws of classical physics. In 1948, Claude Shannon developed his revolutionary mathematical theory of communication, where he defines communication as every procedure by which one mind may effects another~\cite{shannon}. Shannon's theory sets three levels of communications problems: \begin{enumerate} \item \textbf{The technical problem;}\\ this level deals with the engineering details of the communication system. In particular, how accurate is the transfer of information between the sender and receiver. \item \textbf{The semantic problem;}\\ after sending the information, how precisely do the transmitted message deliver the desired meaning? The semantic problem is tightly connected with the interpretation of the message by the receiver, as compared with the intended meaning by the sender. \item \textbf{The effectiveness problem;}\\ the essence of communication is to affect the physical conduct of the receiving party. Therefore, the effectiveness problems are dealing with the success of the desired interpretation of the sent message in affecting the physical act of the receiver. \end{enumerate} So far we have not given a clear definition of the key player of the theory of communication, that is information. The word information relates, according to Shannon, not so much to what do we say, but instead to what we could say. This implies that information is a measure of our freedom of choice when we select a message. Although, information must not be confused with meaning, as we can have two messages, one full of meaning and the other one is pure nonsense, that are equivalent from an information point of view. \noindent Classically, information processing is done via a communication system. Figure~\eqref{comm_sys}, depicts a sketch of the pathway of information, carried in a message, through a communication system. Out of a set of possible messages, the information source selects a desired message, e.g. words. The transmitter transforms the message into a signal, and send it across the communication channel to the receiver. The latter acts as an inverse transmitter, which reverse the signal back to a message and delivers it to the final destination. Examples of this process are encountered in our daily life. For example, in oral speech, the brain act as the information source. The vocal system produces the signal by varying air pressure and the communication channel is the air. Information processing is never perfect and unwanted noise, in the form of distortions of sound as in telephony, static in radio or errors in a picture, can change the sent message. Fortunately, error correcting codes exist in order to mitigate the undesirable effect of noise in communication protocols. \begin{figure}[t!] \begin{tikzpicture} \node[thick,rectangle,draw,minimum width = 2cm, minimum height = 2cm] (r1) at (0,0) {}; \node[thick,rectangle,draw,minimum width = 2cm, minimum height = 2cm] (r2) at (3,0) {}; \draw[->, ultra thick] (r1) -- (r2); \node[thick,rectangle,draw,minimum width = 1cm, minimum height = 1cm] (r0) at (6.5,0) {}; \draw[->, ultra thick] (r2) -- (r0); \node[thick,rectangle,draw,minimum width = 2cm, minimum height = 2cm] (r_b) at (6.5,-4) {}; \draw[->, ultra thick] (r_b) -- (r0); \node[thick,rectangle,draw,minimum width = 2cm, minimum height = 2cm] (r3) at (10,0) {}; \draw[->, ultra thick] (r0) -- (r3); \node[thick,rectangle,draw,minimum width = 2cm, minimum height = 2cm] (r4) at (13,0) {}; \draw[->, ultra thick] (r3) -- (r4); \node[above] (r1) at (0,1.5) {Information}; \node[above] (r1) at (0,1.0) {source}; \node[above] (r2) at (3,1.0) {Transmitter}; \node[above] (r1) at (5,-0.7) {Signal}; \node[above] (r1) at (8.,-0.7) {Received}; \node[above] (r1) at (8 ,-1.3) {Signal}; \node[above] (r3) at (10 ,1.5) {Receiver}; \node[above] (r4) at (13 ,1.5) {Destination}; \node[above] (r4) at (11.5,-1.7) {Message}; \node[above] (r4) at (1.5,-1.7) {Message}; \node[above] (r4) at (6.5,-5.7) {Noise source}; \end{tikzpicture} \caption{Sketch of a communication system.} \label{comm_sys} \end{figure} \section{Shannon information} The amount of information is measured by the logarithm, to the base 2, of the number of available choices. The case when there are only two choices has an information content of unity, as $\log_2(2)=1$. The unit of information is the ``bit'', which is a concatenation of ``binary digit'', proposed by John W. Turkey~\cite{shannon}. The use of the logarithm function as a measure of the amount of information seems even more natural as we consider more complex examples. In a system of four on-off switches, what is the amount of information? The natural answer is four bits, given the fact that in a single switch the information is unity. The number of possibilities in a system of four switches is $2^4=16$. The switches can be in 16 different configurations, which are: 0000, 0001, 0010, 0100, 0101, 0110, 1000, 1100, 1010, 1001, 0011, 1110, 1101, 1011, 0111 and 1111. The first and last configuration corresponds, respectively, to switches all on and off. The logarithmic measure associates 4 bits of information to this case, as $\log_2 16 = 4$. Doubling the amount of switches, squares the number of possible messages. Therefore, intuitively doubles the amount of information when measured by the logarithm. \noindent A general aim of information theory is to analyze communication systems, when the information source selects elementary sequences of symbols in order to form the message. In this situation, the output follows a stochastic process, where the symbols are chosen according to a probability distribution, in which the probabilities are not independent. In real life, humans form speech in ways that make the constituent words, probabilistically, tightly connected. For example after the three words ``in the event'', saying ``that'' is more probable than saying ``dog''. This class of stochastic process, where an event is dependent on previous events is called ``Markovian process''. To measure the amount of information in Markovian processes, Shannon borrowed the concept entropy from thermodynamics. Entropy is related to the degree of randomness in a physical system and its connection to the concept of information is intuitive, when seen in the following way: information is associated with the amount of freedom of choice in constructing messages. A situation where a system is highly organized, imply few choices. Therefore the entropy and information is low. \noindent For a set of $n$ independent messages, whose corresponding probabilities of choice are $p_1, p_2, \dots, p_n$. The entropy-like expression to measure the amount of information content is called ``the Shannon entropy'', it is given by \begin{equation} H(n)=-\sum_i p_i(n) \log_2 p_i(n). \label{shann_entro} \end{equation} It satisfy the following properties \begin{enumerate} \item $H(n)$ is monotonically decreasing in $n$. Gaining knowledge on a probable event, decreases the information on an observed event. \item $H(n)\geq 0$, information is a non-negative quantity. This is the motivation for introducing the negative sign in~\eqref{shann_entro}. \item An event occurring with unit probability, delivers zero information. i.e. $H(1)=0$. \item $H(n_1,n_2)=H(n_1)+H(n_2)$, if the events $n_1$ and $n_2$ are independent. \end{enumerate} Figure~\eqref{coin_toss} represents an application of Shannon entropy~\eqref{shann_entro}, for the case of a biased coin toss. The probability for heads is $p_h=x$ and for tails is $p_t=1-x$, so that the Shannon entropy~\eqref{shann_entro}, reduces to $H(x)=-x\log_2 x -(1-x)\log_2(1-x)$. From Figure~\eqref{coin_toss}, we see that $H(x)$ is maximum when the two outcomes are equally probable, i.e. $p_h=p_t=0.5$. As soon as one outcome becomes more probable, that is $p_h>p_t$, the value of $H(x)$ decreases and reaches zero when one outcome have unit probability. \noindent The observed outcome in the previous example can be generalized for situations with multiple events. More choices imply more information, which tend to increase with the homogeneity of the probability distribution, that is at equal probabilities. There is more information if we can select freely in a set of a hundred words than in set of twenty words. \begin{figure}[t!] \centering \includegraphics[scale=0.7]{figures/part1/chap1/shannon.pdf} \caption{The Shannon entropy~\eqref{shann_entro}, for the case of a biased coin toss.} \label{coin_toss} \end{figure} \section{Quantum bit} Shannon's communication theory invented the future. All modern day communication systems, from optical, underwater to interplanetary, are based on his mathematical theory of communication. However, the laws of classical physics, offer very limited features in order to solve today's growing complex problems, such as simulation of physical systems and cryptography. Additionally, we are witnessing a fast reduction of the component size of technological devices, to an order where quantum features are dominant, e.g. transistors. The superposition principle and entanglement are the main features of quantum theory, with no classical counterpart, are used in order to perform tasks that are difficult or even impossible using classical protocols, such as quantum teleportation, Shor's factorization algorithm and quantum cryptography~\cite{telepo, shor, crypto}. \noindent Quantum information theory seeks to exploit the rich features of quantum systems in designing new information processing protocols. The field emerged in mid-1980, since then various remarkable advances have been made in order to design quantum devices, such as: D-Wave systems~\cite{nielsen2002quantum}. The physical carrier of classical information is the bit, taking two values: either 0 or 1. In contrast, the indivisible unit of quantum information is the quantum bit or qubit, which can be represented mathematically as a vector in a complex Hilbert space, with two mutually orthogonal state $\ket{0}$ and $\ket{1}$ in the following way \begin{equation} \ket{\psi}=\alpha \ket{0} + \beta \ket{1}, \label{qubit} \end{equation} where $(\alpha, \beta) \in \mathbb{C}$, satisfying the normalization condition $|\alpha|^2 + |\beta|^2 =1$. The linear form of the qubit~\eqref{qubit}, allows it to take infinite possible superpositions, which is a feature due to the superposition principle. This implies that the amount of information that can be encoded into a qubit, in theory, is \textit{infinite}. However, the amount of information extracted from a qubit, via single measurement, is only one bit of classical information associated with the probability of the measured state. Another property that stems from the linearity of quantum mechanics is the no-cloning theorem, which forbids the creation of independent copies of an unknown qubit. This makes qubits very robust for quantum communication protocols as they prevent the creation of copies of transmitted quantum cryptographic key~\cite{quantum_comm_book}. \begin{figure}[t!] \centering \begin{tikzpicture}[line cap=round, line join=round, >=Triangle] \clip(-2.19,-2.49) rectangle (2.66,2.58); \draw [shift={(0,0)}, lightgray, fill, fill opacity=0.1] (0,0) -- (56.7:0.4) arc (56.7:90.:0.4) -- cycle; \draw [shift={(0,0)}, lightgray, fill, fill opacity=0.1] (0,0) -- (-135.7:0.4) arc (-135.7:-33.2:0.4) -- cycle; \draw(0,0) circle (2cm); \draw [rotate around={0.:(0.,0.)},dash pattern=on 3pt off 3pt] (0,0) ellipse (2cm and 0.9cm); \draw (0,0)-- (0.70,1.07); \draw [->] (0,0) -- (0,2); \draw [->] (0,0) -- (-0.81,-0.79); \draw [->] (0,0) -- (2,0); \draw [dotted] (0.7,1)-- (0.7,-0.46); \draw [dotted] (0,0)-- (0.7,-0.46); \draw (-0.08,-0.3) node[anchor=north west] {$\varphi$}; \draw (0.01,0.9) node[anchor=north west] {$\theta$}; \draw (-1.01,-0.72) node[anchor=north west] {$\mathbf {\hat{x}}$}; \draw (2.07,0.3) node[anchor=north west] {$\mathbf {\hat{y}}$}; \draw (-0.5,2.6) node[anchor=north west] {$\mathbf {\hat{z}=|0\rangle}$}; \draw (-0.4,-2) node[anchor=north west] {$-\mathbf {\hat{z}=|1\rangle}$}; \draw (0.4,1.65) node[anchor=north west] {$|\psi\rangle$}; \scriptsize \draw [fill] (0,0) circle (1.5pt); \draw [fill] (0.7,1.1) circle (0.5pt); \end{tikzpicture} \caption{Bloch Sphere of a two-dimensional quantum system.} \label{bloch_sphere} \end{figure} In general, the pure state of a qubit can be written as \begin{equation} \ket{\psi(\theta,\varphi)}=e^{-i^\varphi/2}\cos(\theta/2) \ket{0}+e^{i^\varphi/2}\sin(\theta/2)\ket{1}, \label{general_qubit} \end{equation} where $\theta$ and $\varphi$ are real numbers, satisfying $0\leq \theta \leq \pi$ and $0 \leq \varphi \leq 2\pi$. The qubit~\eqref{general_qubit} can be represented geometrically in the Bloch sphere as shown in Figure~\eqref{bloch_sphere}. The classical bit is limiting case of the qubit~\eqref{general_qubit}, where we know for sure the vector is always either up ($\ket{0}$) or down ($\ket{1}$). \noindent For mixed states, the statistical properties of quantum systems are described using the density matrix $``\rho$'', which is a self-adjoint positive semi-definite operator with unit trace. The density matrix can be decomposed in terms of the identity $\mathbb{I}$, and the Pauli matrices: \begin{equation} \sigma^x=\begin{pmatrix} 1&0\\ 0&-1 \end{pmatrix} \sigma^y=\begin{pmatrix} 0&-i\\ i&0 \end{pmatrix},% \sigma^z=\begin{pmatrix} 1&0\\ 0&1 \end{pmatrix}, \label{qubit_pauli_matrix} \end{equation} as \begin{equation} \rho = \frac{1}{2} (\mathbb{I}+\vec{n}.\vec{\sigma}), \end{equation} where $\vec{n}$ is the Bloch vector, and $\vec{\sigma}=(\sigma^x,\sigma^y,\sigma^z)$ is a vector of Pauli matrices ~\eqref{qubit_pauli_matrix}. The positivity condition of density matrices enforces $n\leq 1$. Equality is attained for pure states, where $\Tr(\rho^2)=\Tr(\rho)$, while the rest of the values are for mixed states. Geometrically, in the Bloch sphere, c.f. Figure~\eqref{bloch_sphere}, the surface of the sphere corresponds to all pure states of the qubit, while all mixed states lie within the sphere. The center of the sphere is described by a completely mixed state: $\rho=\frac{1}{2}\mathbb{I}$. \noindent The amount of information in a probability distribution is measure by the Shannon entropy~\eqref{shann_entro}. For quantum systems, the density operator replaces the probability distribution. The Von Neumann entropy generalizes the concept of the Shannon entropy~\eqref{shann_entro}, to quantum states and can be written as \begin{equation} S(\rho)=-\Tr \rho \log_2(\rho). \label{entropy_vn} \end{equation} If the $\lambda_i$ are the eigenvalues of the density matrix $\rho$, the Von Neumann entropy~\eqref{entropy_vn}, can be simplified into \begin{equation} S(\rho)=- \sum_i\lambda_i \log_2(\lambda_i). \label{eigen_entropy_vn} \end{equation} The Von Neumann entropy~\eqref{entropy_vn} is zero for known pure states, similarly with the Shannon entropy~\eqref{shann_entro}, of events occurring with unit probability. For a completely mixed density operator, living in a $d$-dimensional Hilbert space, the entropy reduces to $\log_2(d)$. Some other mathematical properties of the Von Neumann entropy~\eqref{entropy_vn}, are given next \begin{enumerate} \item \textbf{Concavity;}\\ for a collection of positive probabilities, which sum up to unity and a density matrix $\rho_i$, $S(\rho)$ is concave: \begin{equation} S \left( \sum_{i=1}^k p_i\rho_i \right) \geq \sum_{i=1}^k S(\rho_i). \end{equation} \item \textbf{Additivity;}\\ given two independent systems $A$ and $B$ described, respectively, by two density matrices $\rho_A$ and $\rho_B$, the Von Neumann entropy $S(\rho)$ is additive: \begin{equation} S(\rho_A \otimes \rho_B) = S(\rho_A)+S(\rho_B). \end{equation} \item \textbf{Strong subadditivity;}\\ for any three systems $A$, $B$ and $C$, strong subadditivity implies that \begin{equation} S(\rho_{ABC})+S(\rho_B) \leq S(\rho_{AB}) + S(\rho_{BC}), \end{equation} which automatically insures the subadditivity of $S(\rho)$, by \begin{equation} S(\rho_{AC}) \leq S(\rho_{A}) + S(\rho_{C}), \end{equation} where equality is reached for an uncorrelated system. \end{enumerate} The Von Neumnann entropy~\eqref{entropy_vn}, reduces to the Shannon entropy~\eqref{shann_entro}, when the density operator $\rho$ is written in terms of orthogonal states. Consider $\rho=\sum_i p_i \ket{\psi_i}\bra{\psi_i}$, the Von Neumnann entropy is \begin{align} S(\rho)&= -\Tr \rho \log_2\rho, \nonumber \\ &=-\Tr \left[\sum_i p_i \ket{\psi_i}\bra{\psi_i} \log_2 \left( \sum_j p_j \ket{\psi_j}\bra{\psi_j} \right) \right],\nonumber \\ &=- \sum_k \bra{\psi_k} \sum_i p_i \ket{\psi_i}\bra{\psi_i} \left( \sum_j p_j \ket{\psi_j}\bra{\psi_j} \right) \ket{\psi_k}, \nonumber \\ &=-\sum_{i,j,k} \delta_{k,j} p_j \delta_{j,i} \log_2 p_i \delta_{ik}, \nonumber \\ &=-\sum_i p_i \log_2 p_i, \nonumber \\ &=H(p_i). \end{align} However, for non-orthogonal quantum states, the Von Neumnann entropy~\eqref{entropy_vn}, and the Shannon entropy~\eqref{shann_entro}, are not equivalent. This can be seen by considering the following example, where the density operator is written as \begin{equation} \rho=p \ket{0}\bra{0}+\frac{1-p}{2}(\ket{0}+\ket{1})(\bra{0}+\bra{1}), \label{werner_state1} \end{equation} Figure~\eqref{werner_vnentropy} shows the behaviour of the Von Neumnann entropy~\eqref{entropy_vn}, with respect to the mixing parameter $p$ for the density operator~\eqref{werner_state1}. The behaviour is similar to that of the Shannon entropy reported in Figure~\eqref{coin_toss}. For $p=0$ and $p=1$, the density operator ~\eqref{werner_state1}, reduces to a pure state; thus, the entropy is zero. Switching on the mixing parameter $p$, increases the indistinguishablity of the quantum state, therefore, raises the entropy which reaches its maximum value of $0.6$ bits at equal mixture, i.e. $p=0.5$. In contrast, we see in Figure~\eqref{coin_toss} that the Shannon entropy~\eqref{shann_entro}, reaches 1 bit at equal probability. Thus, the cost of transmitting a quantum symbol is 0.6 bits, while the price is higher for transmitting a classical bit of information. Generally, we have \begin{equation} S(\rho)\leq H(p_i). \end{equation} Equality holds for quantum systems written in terms of orthogonal states. The Von Neumnann entropy~\eqref{entropy_vn}, is not basis dependent, while it is the opposite for the Shannon entropy~\eqref{shann_entro}. \begin{figure}[t!] \centering \includegraphics[scale=0.7]{figures/part1/chap1/entropy_vn.pdf} \caption{The Von Neumann entropy $S(\rho)$~\eqref{entropy_vn}, with respect to the mixing parameter $p$ for the density operator ~\eqref{werner_state1}.} \label{werner_vnentropy} \end{figure} \section{Entanglement} The extent of the features of quantum systems grows richer, when we consider composite systems. The most striking property of composite quantum systems is the entanglement, which has no classical counterpart~\cite{EPR}. This prevented physicists from providing a definition that encompasses the nature of the entanglement outside the usual mathematical way. For two parties, Alice ($A$) and Bob ($B$), the total quantum state can be written as \begin{equation} \ket{\psi_{AB}}=\ket{a} \otimes \ket{b}, \label{psi} \end{equation} where the states $\ket{a}$ and $\ket{b}$ belong, respectively, to the local Hilbert spaces $\mathcal{H}_A$ and $\mathcal{H}_B$. States of the form of~\eqref{psi}, are called separable or product states. Quantum mechanics allow states to be in another possibility, through superposition, which does not always yield product states: \begin{equation} \ket{\psi_{AB}^{'}}=\frac{1}{N}(\ket{a_1} \otimes \ket{b_1}+\ket{a_2} \otimes \ket{b_2}), \label{psi_entangled} \end{equation} where $N$ is a normalization constant, derived through the condition $\braket{\psi|\psi}=1$. If the state $\ket{\psi_{AB}^{'}}$~\eqref{psi_entangled}, cannot be written in a product form, i.e. $\ket{\psi_{AB}^{'}} \neq \ket{a} \otimes \ket{b} $. The state is said to be \textit{entangled}. A simple example of an entangled state of two qubits is \begin{equation} \ket{\psi^+}=\frac{1}{\sqrt{2}} (\ket{0}_A \ket{1}_B+\ket{1}_A\ket{0}_B). \end{equation} If Alice measures her qubit and finds the state $\ket{0}$, the state of Bob's qubit collapses to the state $\ket{1}$. As a consequence, the parties of an entangled state cannot be described individually and independently from one another. This feature makes the entanglement a robust resource for secure communications and efficient cryptography protocols. Indeed, in 1991 Ekert presented the first quantum key distribution protocol~\cite{ekert91}, that is based on entanglement, allowing two parties, Alice and Bob, to communicate in a completely secure way. Classical cryptography protocols are based on the conjecture that a large number is hard to factorize, whereas Ekert's protocol is provably secure. Another application of entanglement is quantum dense coding, that is a protocol developed by Bennett and Wiesner in 1992, which allows two entangled parties to communicate two bits of classical information by sending only a single qubit~\cite{weisner92}. Bennett showed, in 1993, that unknown quantum states can be perfectly communicated through quantum teleportation~\cite{telepo}, and in 1997 the protocol was verified experimentally by two research groups, led by Anton Zeillinger and Sandu Popescu~\cite{exp_telep, exp_telep_popescu}. \noindent The success of entanglement-based quantum protocols is highly connected with the state shared between the parties. In quantum dense coding, teleportation and cryptography, Alice and Bob need to share entangled singlet states. Quantum systems are, in general, represented by mixed states and pure quantum state are not always singlets. Therefore, a general resource theory for mixed quantum states is needed in order to assess their capability in succeeding quantum protocols. This is done by quantifying the amount of entanglement in quantum mixed states. A prominent measure is the distillable entanglement, which is defined as the maximal number of singlets that can be obtained per copy of a given mixed state via local operations and classical communication (LOCC), if the number of copies goes to infinity. LOCC are a set of operations used by two parties, where Alice performs a local operation on her part of the system and communicates the result via classical means, e.g. telephone. LOCC operations are useful for state preparation, state discrimination, and entanglement transformations. The distillable entanglement is hard to evaluate and exact expressions are only available for few simple systems, which pushed toward the development of other entanglement measures. An entanglement monotone $E(\rho)$, is a measure satisfying the following properties~\cite{rev_entanglement}: \begin{enumerate} \item $E(\rho)$ does not increase under LOCC. \item $E(\rho)\geq0$, the equality holds when $(\rho)$ is separable. \item $E(\rho)$ is invariant under local unitary operations. \item $E(\rho)$ does not increase under different preparation of $\rho$, i.e. $\sum_i p_i E(\rho_i) \geq E(\sum_i p_i \rho_i)$. \end{enumerate} For a pure bipartite state $\ket{\psi_{AB}}$, the entanglement can be quantified by the von Neumann entropy of the reduced density operator $\rho_A=\Tr_B(\ket{\psi_{AB}} \bra{\psi_{AB}})$: \begin{equation} E(\ket{\psi_{AB}})=S(\rho_A)=-\sum_i \lambda_i \log_2 \lambda_i, \label{dist_ent} \end{equation} where $\lambda_i$ are the eigenvalues of $\rho_A$. The distillable entanglement reduces to the von Neumann entropy~\eqref{dist_ent}, for all pure states. \noindent The quantification of entanglement in mixed states $\rho_{AB}$, can be done via convex roof measures and distance based measures; in this thesis, we focus on the former. Following the convex roof construction, any measure of the entanglement $E(\rho)$ for pure states can be extended to mixed states via \begin{equation} E(\rho)=\inf_{p_i,\ket{\psi_i}} \sum_i p_i E(\ket{\psi_i}), \label{ent_measure} \end{equation} where the infimum is taken over all possible decompositions $\{ p_i, \ket{\psi_i}\}$ of the density operator $\rho$. The most popular measure of entanglement for bipartite quantum systems is the entanglement of formation. For pure states, it reduces to the von Neumann entropy~\eqref{dist_ent} of the subsystems, and for mixed states Wootters solved the infimum in~\eqref{ent_measure}, for the case of systems composed of two qubits~\cite{wootters_concurrence}. The formula developped by Wooters can be written as \begin{equation} E_f(\rho)=h \left( \frac{1}{2}+\frac{1}{2}\sqrt{1-C^2(\rho)} \right), \label{entanglement_formation} \end{equation} where $h(x)=-x\log_2(x)-(1-x)\log_2(1-x)$ denotes the binary entropy and $C(\rho)$ is the conccurence, given by \begin{equation} C(\rho)=\max\{0,\lambda_1-\lambda_2-\lambda_3-\lambda_4\}, \label{concurrence} \end{equation} where the $\lambda_i$'s are the square roots of the eigenvalues of the matrix $\rho\Tilde{\rho}$ in decreasing order, with $\Tilde{\rho}$ being a transformed matrix of $\rho$, i.e. $\Tilde{\rho}=(\sigma^y \otimes \sigma^y) \rho^* (\sigma^y \otimes \sigma^y)$, $\sigma^y$ is the second Pauli matrix ~\eqref{qubit_pauli_matrix}. Throughout this dissertation, the concurrence~\eqref{concurrence}, will be used as the main measure of entanglement in quantum spin systems. \section{Quantum discord} Entanglement quantifies the class of quantum correlations that can be conceptualized under the separability paradigm. For general forms of quantum correlations the situation is difficult and not clear. Extending the notion of distilable entanglement, under LOCC, to general quantum correlations is meaningless, as LOCC creates an arbitrary amount of quantum correlations. This implies that a measure of distilable quantum correlations is infinite for all quantum states. During the past two decades, several approaches have been developed in order to measure and prove the existence of general forms of quantum correlations beyond entanglement. Quantum discord is the first measure among such approaches, that was discovered around 2000, which is based on the quantization of concepts from classical information theory~\cite{discord1,discord2, discord3}. \noindent Quantum discord is derived by noticing that the mutual information $I(X:Y)$, between two random variables $X$ and $Y$ can be expressed in two different ways. The mutual information is given by \begin{equation} I(X:Y)=H(X)+H(Y)-H(X,Y), \label{mutual_info} \end{equation} where $H(X)$ is the Shannon entropy~\eqref{shann_entro}, and $H(X,Y)$ is the Shannon entropy for the joint probability distribution $p_{X,Y}$. The mutual information~\eqref{mutual_info}, is equivalent to \begin{equation} J(X:Y)=H(X)-H(X|Y). \label{mutual_info2} \end{equation} Here, $H(X|Y)$ is the conditional entropy and can be written as \begin{equation} H(X|Y)=\sum_{y \in Y} p_y H(X|Y=y)=H(X,Y)-H(Y). \end{equation} The equality of $I(X:Y)$~\eqref{mutual_info}, and $J(X:Y)$~\eqref{mutual_info2}, for classical probability distributions stems from Bayes' rule: $p_{x|y}=p_{xy}/p_y$, which can be used to prove $J(X:Y)$~\eqref{mutual_info2}. However, this does not hold when quantum theory is applied. For a quantum system $\rho_{AB}$, the quantum mutual information is given by \begin{equation} I_{AB}=S(\rho_A)+S(\rho_B)-S(\rho_{AB}), \label{quantum_I} \end{equation} where $S(.)$ is the von Neumann entropy and the reduced density matrix $\rho_A=\Tr_B(\rho_{AB})$ ($\rho_B=\Tr_A(\rho_{AB}))$. The quantum mutual information~\eqref{quantum_I}, is the natural and straightforward quantization of the classical mutual information ~\eqref{mutual_info}. In contrast, writing the quantum version of $J(X:Y)$~\eqref{mutual_info2}, is not trivial. Replacing the Shannon entropy with the von Neumann entropy in this case, leads to a quantity that can be either positive or negative. The quantum conditional entropy is argued to be \begin{equation} S_{A|B}= \min_{\{ \prod_k^B \} \in \mathcal{M}^B} \sum p_k S(\rho_{A|k}), \label{cnd_entropy} \end{equation} where the minimization is taken over all quantum measurements, $\{ \prod_k^B \}$, performed on the subsystem $B$ and $\mathcal{M}^B$ is the set of such measurements. $\{p_k, \rho_{A|k}\}$ is the post-measurement ensemble that is formed at Alice's side, and $\rho_{A|k}= \Tr_B \left[ \prod_k^B \rho_{AB} \right]/p_k$ with $p_k=\Tr_{AB} \left[ \prod_k^B \rho_{AB}\right]$. The quantum version of $J(X:Y)$ ~\eqref{mutual_info2}, can now be written as \begin{equation} J_{A|B}=S(\rho_A)-S(A|B). \label{classical_corr} \end{equation} It is argued that $I_{AB}$~\eqref{quantum_I}, and $J_{A|B}$~\eqref{classical_corr}, quantify, respectively, total and classical correlations in a bipartite quantum system $\rho_{AB}$. Therefore, their difference is proposed as a measure of \textit{all} quantum correlations. Thus, quantum discord is: \begin{equation} D(\rho_{AB})=\min_{ \{ \prod_i^B \}} \left[ I_{AB}-J_{A|B} \right]. \label{quantum_discord} \end{equation} Here the minimization is over all measurements $\{ \prod_i^B \}$, in order to have a measurement-independent quantity. Similarly with entanglement measures, quantum discord satisfies a number of properties \begin{enumerate} \item $D(\rho_{AB}) \geq 0$, since in general $I_{AB}\geq J_{A|B}$. Equality is reached for classical systems, where a local measurement on subsystem $B$ does not disturb the system. In contrast, states with zero entanglement is not always a sign of classical system. \item Quantum discord is asymmetric, i.e. $D\left(\rho_{AB}^{ \{ \prod_i^B \} }\right) \neq D\left(\rho_{AB}^{ \{ \prod_i^A \} }\right) $, which is due to the conditional entropy~\eqref{cnd_entropy}, being non-symmetric. \item Similarly to entanglement measures, quantum discord~\eqref{quantum_discord}, is invariant under local unitary transformations. \item For pure bipartite states, quantum discord~\eqref{quantum_discord}, reduces to the entanglement measured via the von Neuman entropy~\eqref{entropy_vn}. \end{enumerate} We illustrate the difference between quantum discord~\eqref{quantum_discord}, and the entanglement for mixed states, by considering the example of a class of Werner states, given by \begin{equation} \rho_W= \frac{1-p}{4} \mathbb{I}_4 + \frac{p}{2} \left[ (\ket{01}-\ket{10})(\bra{01}-\bra{10}) \right], \label{werner_state} \end{equation} \begin{figure}[H] \centering \includegraphics[scale=0.7]{figures/part1/chap1/qd_cnc_werner.pdf} \caption{Quantum discord~\eqref{quantum_discord}, and the concurrence~\eqref{concurrence}, for the Werner state~\eqref{werner_state}, with respect to the relative weight $p$.} \label{plot_werner_qdcnc} \end{figure} \noindent where $p$ is the relative weight. The Werner state~\eqref{werner_state}, is separable for $p\leq1/3$ and entangled for $p>1/3$. This is confirmed in Figure~\eqref{plot_werner_qdcnc}, which depicts the behaviour of quantum discord~\eqref{quantum_discord}, and the concurrence~\eqref{concurrence}, in the Werner state~\eqref{werner_state}, with respect to the relative weight $p$. In contrast, we see that quantum discord is non-zero in the whole range of $p$. This simple example shows the resilience of quantum discord in capturing general forms of quantum correlations. \noindent Despite the efficiency of quantum discord in capturing general forms of quantum correlations, the usefulness of states with non-zero quantum discord is debated~\cite{barry_discord}. Moreover, a quantum resource theory for separable states with non-zero quantum discord is still lacking. There are a few quantum information processing tasks, where it is claimed that they require states with non-zero quantum discord and without having any amount of entanglement, such as quantum state merging protocol~\cite{quantum_state_merg}, identification of quantum channels~\cite{quantum_channel} and quantum metrology~\cite{metrology1,metrology2}. Quantum discord has been shown to play a role in the efficiency of quantum refrigerator~\cite{discord_refr} and in studying photosynthesis in biological systems~\cite{bio_discord}. \section{Quantum coherence} Coherence constitutes the principal building block of today's physical theories and underlies several phenomena, such as interference and optical coherence in the theory of electromagnetism, and the quantization of energy in quantum mechanics~\cite{quant_coherence}. Coherence plays a central role in the field of quantum information theory, as it is the basic ingredient for creating quantum interference and entanglement, which are the mandatory resources for performing quantum information tasks. The exploration of single particle coherence, enabled the realization of several devices, which are classified under the ``Quantum technologies 1.0'', such as the laser. The emergence of quantum information science introduced revolutionary and new protocols, for using quantum phenomena as resources to perform tasks that are not possible using classical laws. This resource-driven point of view, paved the way for constructing the resource theory of entanglement, and motivated the development of a mathematical framework that encompasses a wider range of quantum features. Quantum technologies 2.0 comprise applications where quantum coherence is the primary resource, this includes quantum-enhanced metrology, quantum thermal machines and communication protocols~\cite{coherence_review}. \noindent Coherence is naturally a basis dependent quantity. Therefore, the first step in constructing the resource theory for quantum coherence is by choosing a reference basis. Given a finite $d$-dimensional Hilbert space $\mathcal{H}$, with reference orthonormal basis $\{ \ket{i} \}_{i=0,\dots,d-1} $. All incoherent density operators $\rho$, can be written in the following form \begin{equation} \rho = \sum_{i=0}^{d-1} p_i \ket{i}\bra{i}. \label{incoherent_rho} \end{equation} Here, $p_i$'s are probabilities and $\rho \subset \mathcal{I}$, where $\mathcal{I} \subset \mathcal{B(H)}$ denotes the set of incoherent states that belong to $\mathcal{B(H)}$: the set of all bounded trace operators on $\mathcal{H}$. Incoherent states~\eqref{incoherent_rho}, are diagonal in the basis $\ket{i}$, which implies that they are accessible without any cost. \noindent For a single qubit, the reference basis can be the eigenstates of the Pauli matrix $\sigma^z$, i.e. the computational basis: $\{ \ket{0}, \ket{1}\}$. Therefore, any density matrix $\rho$ with non-zero diagonal elements is outside the set $\mathcal{I}$ and hence has non-zero resource content. In this case of multipartite systems, the reference basis is constructed by the tensor product of the local reference basis states of each subsystem. For example, in the case of systems composed of $N$-qubits, the set of incoherent states is $\mathcal{I}=\{ \ket{0}, \ket{1}\}^{\otimes N}$. \noindent Similarly with entanglement and quantum discord, quantifying quantum coherence follows certain postulates. A proper measure of coherence $C(\rho)$ needs to satisfy: \begin{enumerate} \item $C(\rho) \geq 0$, with equality if and only if $\rho$ is incoherent. \item $C(\rho)$ is a coherence monotone, which means that it does not increase under incoherent operations $\Lambda$, i.e. $C(\Lambda[\rho]) \leq C(\rho) $. \item Strong monotonicity, that is $C(\rho)$ does not increase on average under selective incoherent operations, i.e. $\sum_i p_i C(\sigma_i) \leq C(\rho)$, where $p_i=\Tr \left[ K_i \rho K_i^{\dagger} \right]$ represents probabilities, $\sigma_i=K_i \rho K_i^{\dagger}/p_i$ are the post-measurement states and Kraus operators $K_i$. \item Convexity: $\sum_i p_i C(\rho_i) \geq C\left( \sum_i p_i \rho_i \right) $. \item For pure states, $C(\rho)$ reduces to the von Neumann entropy~\eqref{entropy_vn}. \item Additivity: for a separable state $\rho=\rho_A \otimes \rho_B$, the coherence $C(\rho)$ is additive, i.e. $C(\rho)=C(\rho_A)+C(\rho_B) $. \end{enumerate} A meaningful measure of quantum coherence $C(\rho)$ is one that satisfies, at least, postulates 1 and 2. Measures of quantum coherence can be classified into two categories: distance-based and convex roof quantifiers. In general, distance-based quantum coherence $C_D(\rho)$ is defined as \begin{equation} C_D(\rho)=\inf_{\sigma \in \mathcal{I}} D(\rho,\sigma), \label{distance_coherence} \end{equation} where $D(\rho,\sigma)$ measures the distance between the state $\rho$ and its closest incoherent state $\sigma$, whereas infimum is taken over all incoherent states in $\mathcal{I}$. A suitable candidate for $D(\rho,\sigma)$, is the quantum relative entropy. It is given by \begin{equation} S(\rho||\sigma)=\Tr \left[ \rho \log_2 \rho \right] - \Tr \left[ \rho \log_2 \sigma \right]. \end{equation} Therefore, the corresponding measure of quantum coherence is the relative entropy of coherence, written as \begin{equation} C_r(\rho)=\min_{\sigma \in \mathcal{I}}S(\rho||\sigma), \label{relative_coherence} \end{equation} which satisfies the positivity, monotonicity and strong monotonicity postulates. In the same fashion with entanglement, the convex roof quantum coherence measure for mixed states can be written as \begin{equation} C(\rho)=\inf_{\{ p_i,\ket{\psi_i}\} } \sum_i p_i C(\ket{\psi_i}), \end{equation} where the infinimum is taken over all possible decompositions $\{ p_i, \ket{\psi_i}\}$ of the density operator $\rho$. When $\rho=\sum_{ij} \rho_{ij} \ket{i}\bra{j} $, the coherence of formation is equal to entanglement of formation~\eqref{entanglement_formation}, of the maximally correlated state $\rho_{mc}=\sum_{ij} \rho_{ij} \ket{ii}\bra{jj}$. Thus, we have \begin{equation} C_f(\rho)=E_f(\rho_{mc}). \label{coh_formation} \end{equation} Through the formula for the entanglement of formation of two-qubits systems~\eqref{entanglement_formation}, we can write the coherence of formation~\eqref{coh_formation}, for any single-qubit states as \begin{equation} C_f(\rho)=h \left( \frac{1+\sqrt{1-4|\rho_{01}|^2} }{2} \right), \end{equation} where $h(x)=-x\log_2(x)-(1-x)\log_2(1-x)$ is the binary Shannon entropy. \noindent In the remainder of this dissertation, we will be interested in studying a special figure of merit of quantum coherence, that combines geometric and entropic properties. To this end, we introduce the quantum Jensen-Shannon divergence~\cite{QJSD, coherencePRL} \begin{equation} \mathcal{J}(\rho,\sigma) = S\Big(\frac{\rho+\sigma}{2}\Big)-\frac{S(\rho)}{2}-\frac{S(\sigma)}{2}, \label{QJSD} \end{equation} where $S(.)$ is the von Neumann entropy~\eqref{entropy_vn}. The quantum Jensen-Shannon divergence~\eqref{QJSD}, is known to be a distance measure bounded between $0\leq \mathcal{J} \leq 1$. Additionally, it is well defined irrespective of the support of $\rho$ and $\sigma$. Then, the quantum coherence is defined as \begin{equation} QC(\rho)=\sqrt{ \mathcal{J}(\rho,\sigma) }. \label{sqrt_qjsd} \end{equation} The measure~\eqref{sqrt_qjsd}, will be the main figure of merit for quantum coherence in the next chapter. \chapter{Quantum Correlations in Spin Systems\label{chap3} } In this chapter we apply the quantum correlation approach to quantum spin systems, in order to study their quantum critical features. In particular, we will analyze the critical phenomena present in the $XY$ model via the entanglement, quantum discord and quantum coherence~\cite{Zakaria2019}. \section{The $XX$ model \label{xymodel}} The Hamiltonian of the $XY$ model describes a set of localized spin-$\frac{1}{2}$ particles interacting with nearest-neighbors exchanging coupling in a one-dimensional chain, subject to an external magnetic field $h$. It is given by \begin{equation} \mathcal{H}_{XY}=J\sum_{i=1}^N \big((1+\gamma)S_i^xS_{i+1}^x+(1-\gamma)S_i^yS_{i+1}^y\big)-h\sum_{i=1}^NS_i^z, \label{eq1} \end{equation} where $S_i$ is the spin-$\frac{1}{2}$ operator on site $i$, $J$ is the interaction energy between the spins and $\gamma$ is the anisotropy parameter. A positive (negative) exchange coupling $J$ favors anti-ferromagnetic (ferromagnetic) ordering of the spins. The $(\gamma-h)$ phase diagram at zero-temperature of this model is shown in Figure~\eqref{PH_XY}, where we see a critical line for $h=1$ and for $\gamma=0$ and $h<1$, shown in red. When $\gamma=1$ the model corresponds to the quantum Ising chain ~\eqref{eq_quantum_ising}. An additional critical phenomenon occurs in the $XY$ model~\eqref{eq1}, on the line $\gamma^2+h^2=1$, where the ground state is completely factorized in terms of product of single spin states. For simplicity, in the remainder of this chapter we work in the isotropic limit ($XX$ chain), i.e. $\gamma=0$. \noindent The Hamiltonian~\eqref{eq1}, belongs to the class of exactly solvable models~\cite{franchini2017, baxterbook}. To solve the Hamiltonian~\eqref{eq1}, we first map each spin operator to a fermion operator, using the Jordan-Wigner transformation~\cite{jordan-wigner}. For simplicity, we introduce the spin ladder operators \begin{equation} S^{\pm}=S^x\pm i S^y \quad\text{ with}\quad S^+=\begin{pmatrix} 0&1\\0&0 \end{pmatrix}, \quad \quad S^-=\begin{pmatrix} 0&0\\1&0 \end{pmatrix}. \label{eq2} \end{equation} Jordan and Wigner showed that the spin ladder operators can be represented exactly by the fermion operators ($c_i$'s) with the following mapping \begin{equation} S_i^+=c_i^+\exp{\left( \displaystyle{-j\pi\sum_{l=1}^{i-1}c_l^+c_l} \right) }, \quad \quad S_i^-=\exp{\left(\displaystyle{j\pi\sum_{l=1}^{i-1}c_l^+c_l}\right)}c_i, \quad \quad S_i^z=c_i^+c_i-\frac{1}{2}, \label{eq3} \end{equation} where $j$ is the imaginary unit. Rewriting the Hamiltonian~\eqref{eq1}, in terms of the ladder operators~\eqref{eq2}, and by applying the transformation~\eqref{eq3}, we can cast the Hamiltonian~\eqref{eq1}, into the following form \begin{equation} \mathcal{H}_{XX}=J\sum_{i=1}^N\left(c_i^+c_{i+1}+c_{i+1}^+c_i\right)-h\sum_{i=1}^N\left(c_i^+c_i-\frac{1}{2} \right). \label{hxx} \end{equation} The next step toward diagonalizing the $XX$ model~\eqref{eq1}, is making use of its translation invariance. This symmetry property enable us to write the fermion operators, $c_i$ and $c_i^{\dagger}$, in terms of the Fourier transform as \begin{figure}[t!] \centering \begin{subfigure}[t]{0.49\textwidth} \begin{tikzpicture}[scale=1.5] \draw[-] node[left]{$0$} (0,0)--(2,0) node[below]{$1$}; \draw[->] (2,0)--(4,0) node[right]{$\gamma$}; \draw[-,ultra thick,red] (0,0)--(0,2) node[left]{$1$}; \draw[->] (0,2)--(0,4) node[left]{$h$}; \draw[ultra thick, red] (0,2)--(4,2); \draw[dashed, thick] (2,0)--(2,4)node[above]{Ising}; \node[above] (A) at (1,0.3) {Oscillatory}; \node[above] (A) at (3,0.3) {Ordered}; \node[above] (A) at (3,3) {Disordered}; \draw [dotted,blue,thick] plot [smooth] coordinates {(0,2) (0.5,1.8) (1,1.5) (1.5,1) (2,0)}; \end{tikzpicture} \caption{} \label{PH_XY} \end{subfigure} \begin{subfigure}[t]{0.49\textwidth} \includegraphics[scale=0.5]{figures/part1/paper/JW_quspin.pdf} \caption{} \label{fig_jw_quspin} \end{subfigure} \caption{Phase diagram of the $XY$ model~\eqref{eq1}, in the $\gamma$-$h$ plane, and (b) the Spectrum of the $XX$ model~\eqref{eq1}, in the spin and fermion representation for $N=14$.} \end{figure} \begin{equation} d_k=\frac{1}{\sqrt{N}} \sum_{i=1}^N \exp{(\displaystyle{-jik})}c_i, \quad\text{and}\quad d_k^+=\frac{1}{\sqrt{N}}\sum_{i=1}^N \exp{(\displaystyle{jik})}c_i^+. \end{equation} The final diagonalized form of the Hamiltonian~\eqref{hxx}, written in terms of the spinless fermion creation and annihilation operators is \begin{equation} \mathcal{H}_{XX}=\sum_k \epsilon(k)d_k^+d_k, \quad\text{with}\quad \epsilon(k)=J\cos(k)-h. \label{diag_xx} \end{equation} Without loss of generality, the coupling constant $J$ will be equal to unity in the remaining of this chapter. The Jordan-Wigner transformation can be verified, numerically, using ``QuSpin'' a Python package for dynamics and exact diagonalisation of quantum many-body systems~\cite{quspin1, quspin2}. \noindent In Figure~\eqref{fig_jw_quspin} we show for a chain of $N=14$ spins, $J=1$ and $h=1$ with periodic boundary conditions the energy spectrum $E$ of the $XX$ chain~\eqref{eq1}, with respect to the number of states $N_S$. The red solid line corresponds to the eigenenergies of the usual spin representation of the $XX$ model~\eqref{eq1}, while the blue crosses are the eigenvalues of the fermionic Hamiltonian~\eqref{diag_xx}, obtained by the Jordan-Wigner mapping. We see that for each spin state there is a corresponding fermion state, which means that the two representations match exactly, as predicted. \section{Quantum correlations} We are interested in studying the quantum correlations present in an infinite-chain of spin-$\frac{1}{2}$, described via the isotropic $XX$ model~\eqref{eq1}. For this aim, we evaluate the reduced density matrix of two spins $i$ and $j$ distant by some lattice spacing $m$, where $i=j+m$. Using Pauli basis expansion~\cite{pauli_basis_exp}, we have \begin{equation} \rho_{i,i+m}=\frac{1}{4}\sum_{\alpha,\beta=0}^3 p_{\alpha \beta} \sigma_i^{\alpha}\otimes\sigma_{i+m}^{\beta}, \end{equation} with $p_{\alpha \beta}=\langle\sigma_i^{\alpha}\sigma_{i+m}^{\beta}\rangle$ is the two-site correlation function, and $\sigma_i^\alpha$ are the Pauli matrices, $\alpha=0,1,2,3$. In terms of Pauli ladder operators $\sigma^{\pm}=\frac{1}{2}(\sigma^x\pm i\sigma^y)$, we can write in the computational basis $\{\ket{\uparrow\uparrow},\ket{\uparrow\downarrow},\ket{\downarrow\uparrow},\ket{\downarrow\downarrow}\}$, the density matrix of two spins as follows \begin{equation} \rho_{i,i+m}= \begin{pmatrix} \langle P_i^{\uparrow}P_{i+m}^{\uparrow} \rangle&\langle P_i^{\uparrow}\sigma_{i+m}^-\rangle&\langle \sigma_i^-P_{i+m}^{\uparrow}\rangle&\langle \sigma_i^-\sigma_{i+m}^-\rangle\\ \langle P_i^{\uparrow}\sigma_{i+m}^+\rangle&\langle P_i^{\uparrow}P_{i+m}^{\downarrow} \rangle&\langle \sigma_i^-\sigma_{i+m}^+\rangle&\langle \sigma_i^-P_{i+m}^{\downarrow}\rangle\\ \langle \sigma_i^+P_{i+m}^{\uparrow}\rangle&\langle \sigma_i^+\sigma_{i+m}^-\rangle&\langle P_i^{\downarrow}P_{i+m}^{\uparrow} \rangle&\langle P_i^{\uparrow}\sigma_{i+m}^{-}\rangle\\ \langle \sigma_i^+\sigma_{i+m}^+\rangle&\langle \sigma_i^+P_{i+m}^{\downarrow}\rangle&\langle P_i^{\uparrow}\sigma_{i+m}^{+}\rangle&\langle P_i^{\downarrow}P_{i+m}^{\downarrow} \rangle \end{pmatrix}, \label{eq5} \end{equation} where $P^{\uparrow}=\frac{1}{2}(1+\sigma^z)$ and $P^{\downarrow}=\frac{1}{2}(1-\sigma^z)$. The brackets are average values taken in the ground state of the isotropic $XX$ model~\eqref{eq1}. \noindent The Hamiltonian~\eqref{eq1} satisfies several symmetries that reduce the number of non-zero elements of the density matrix~\eqref{eq5}. For instance, translation invariance means that $\rho_{i,i+m}=\rho_{i+m,i}$, therefore we have $p_{\alpha\beta}=p_{\beta\alpha}$. The global phase-flip symmetry implies that the commutator $\left[\sigma_i^z\sigma_{i+m}^z,\rho_{i,i+m}\right]=0$, then the coefficients $p_{01}=p_{10}$, $p_{02}=p_{20}$, $p_{13}=p_{31}$ and $p_{23}=p_{32}$ must be zero. Furthermore, the $z$-component of the total magnetization commutes with the Hamiltonian~\eqref{eq1}, $\left[ \sum_{i} \sigma_i^z,\mathcal{H_{XX}} \right]=0$ which implies that a coherent superposition of basis states $\ket{\uparrow\uparrow}$ and $\ket{\downarrow\downarrow}$ cannot be possible for any two spins. Then the coefficient $p_{30}$ and $p_{03}$ corresponding to the matrix elements $\ket{\uparrow\uparrow}\bra{\downarrow\downarrow}$ and $\ket{\downarrow\downarrow}\bra{\uparrow\uparrow}$ are zero. The density matrix~\eqref{eq5}, reduces to \begin{equation} \rho_{i,i+m}= \begin{pmatrix} X_{i,i+m}^+&0&0&0\\ 0&Y_{i,i+m}^+&Z_{i,i+m}^*&0\\ 0&Z_{i,i+m}&Y_{i,i+m}^-&0\\ 0&0&0&X_{i,i+m}^- \end{pmatrix}. \label{eq6_mat} \end{equation} \noindent In terms of the occupation number operator $n_i=c_i^+c_i$, the elements of the density matrix~\eqref{eq6_mat}, are given by \begin{equation} \begin{aligned} X_{i,i+m}^+&=\langle n_in_{i+m} \rangle, \quad\text{}\quad X_{i,i+m}^-=1- \langle n_i \rangle - \langle n_{i+m} \rangle+\langle n_in_{i+m} \rangle, \\ \quad\text{}\quad Y_{i,i+m}^+&=\langle n_i \rangle-\langle n_i n_{i+m}\rangle, \quad\text{}\quad Y_{i,i+m}^-=\langle n_{i+m} \rangle-\langle n_{i+m}n_i\rangle, \\ Z_{i,i+m}&=\langle c_i^+\Big(\prod_{k=i}^{i+m-1}\{1-2c_k^+c_k\}\Big)c_{i+m} \rangle. \end{aligned} \label{eq7} \end{equation} We investigate various contributions of correlations at long distances of $m$ in the $XX$ model~\eqref{eq1}. We study the correlations between second nearest $(2N)$ $m=2$, third nearest $(3N)$ $m=3$ and the fourth neighbor $(4N)$ $m=4$. Then, by using Wick's theorem~\cite{wick1950} the set of equations~\eqref{eq7}, reduce to \begin{equation} \begin{aligned} X_{i,i+m}^+&=f_0^2-f_m^2, \quad\text{}\quad X_{i,i+m}^-=1-2f_0+f_0^2-f_m^2,\\ Y_{i,i+m}^+&=Y_{i,i+m}^-=f_0-f_0^2+f_m^2, \label{eq_diag} \end{aligned} \end{equation} \noindent while for the element $Z_{i,i+m}$ we have \begin{equation} \begin{aligned} \quad\text{for $m=2$:}\quad Z_{i,i+2}&=f_2-2f_0f_2+2f_1^2,\\ \quad\text{for $m=3$:}\quad Z_{i,i+3}&=4(f_1^3-2f_0f_1f_2+f_2^2f_1+f_0^2f_3-f_1^2f_3+f_1f_2-f_0f_3)+f_3, \\ \quad\text{for $m=4$:}\quad Z_{i,i+4}&=8(f_1^4-3f_0f_1^2f_2+2f_1^2f_2^2+2f_0^2f_1f_3+f_0^2f_2^2-f_2^4-2f_0f_1f_2f_3\\&+2f_1f_2^2f_3-2f_1^3f_3+f_1^2f_3^2-f_0f_2f_3^2-f_0^3f_4+2f_0f_1^2f_4-2f_1^2f_2f_4\\&+f_0f_2^2f_4)+4(3f_1^2f_2-2f_0f_2^2-4f_0f_1f_3+2f_1f_2f_3+3f_0^2f_4-2f_1^2f_4\\&+f_2f_3^2-f_2^2f_4)+2(2f_1f_3-3f_0f_4+f_2^2)+f_4. \label{eqz} \end{aligned} \end{equation} \noindent For a non-negative integer number $m$, the function $f_m$ is given by \begin{equation} f_m=\frac{1}{\pi}\int_{0}^{\pi}\cos(km)g(k)dk, \label{eq11} \end{equation} \noindent where $g(k)=\frac{1}{1+\displaystyle{e^{\beta \epsilon(k)}}}$ is the Fermi-Dirac distribution, $\beta=\frac{1}{k_B T}$ and the Boltzmann constant is taken equal to unity. \subsection{Entanglement} \begin{figure}[t!] \subfloat[$T=0$\label{fig4.2.1a}]{% \includegraphics[width=0.5\textwidth]{figures/part1/paper/Zero_T_Entanglement.pdf} } \hfill \subfloat[$h=0.95$\label{fig4.2.1b}]{% \includegraphics[width=0.5\textwidth]{figures/part1/paper/nonZero_T_Entanglement.pdf} } \caption{The concurrence~\eqref{cnc_dm}, for the $2N$, $3N$ and $4N$ spin pairs. In (a) $T=0$ with respect to the magnetic field $h$ and (b) $h=0.95$ with respect to the temperature $T$.} \label{fig4.2.1} \end{figure} We evaluate the amount and the behaviour of the entanglement in the two site density matrix $\rho_{i,i+m}$~\eqref{eq6_mat}, using the concurrence~\eqref{concurrence}. In this case, the concurrence takes the following form \begin{equation} C(\rho_{i,i+m})=\max\Big\{0,2\Big(|Z_{i,i+m}|-\sqrt{X_{i,i+m}^+X_{i,i+m}^-}\Big)\Big\}, \label{cnc_dm} \end{equation} where $Z_{i,i+m},X_{i,i+m}^+$ and $X_{i,i+m}^-$ are given by the set of equations~\eqref{eq_diag} and~\eqref{eqz}. Figure~\eqref{fig4.2.1a} shows the behaviour of the concurrence~\eqref{cnc_dm}, at zero temperature with respect to the magnetic field $h$, for second-, third- and fourth-nearest neighbours ($2N$, $3N$ and $4N$). None of the spins are entangled at $h=0$, and as $h$ is increased we see the creation of the entanglement at the critical field $h_c^E$ of $\frac{1}{2}$ for $m=2$, $\frac{4}{5}$ for $m=3$, and $\frac{9}{10}$ for $m=4$~\cite{fumani2018, nishimori2005_ent}. Further increase of $h$ beyond $h_c^E$ enhances the entanglement, between all the pairs until its saturation close to the quantum critical point $h_c \sim 1$, where the entanglement drops quickly and dies out. In Figure~\eqref{fig4.2.1b}, we show the behaviour of the concurrence~\eqref{cnc_dm}, with respect to the temperature $T$, for $h=0.95$. For all the pairs, we see the entanglement start from a maximum value and drops quickly to zero with the temperature. This shows that entanglement is not resilient against thermal fluctuations. \noindent The reported behaviours of the concurrence~\eqref{cnc_dm}, can be seen more clearly with the $T-h$ phase diagram depicted in Figure~\eqref{fig4.1.1_}, where we show density plots of the concurrence~\eqref{cnc_dm}, for all the spins pairs. We see that the entangled region is small in the $T-h$ plane, and decreases in size as the distance between the spins $m$ is increased. Furthermore, the entanglement is maximum around the quantum critical point. This is due to the fact that at a quantum phase transition, fluctuations occur at all length and time scales, i.e. the divergence of the correlations length $\xi$~\cite{Sachdev}. \begin{figure}[t!] \subfloat[$2N$\label{fig4.2.1_a}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_entanglement_2N.pdf} }% \subfloat[$3N$\label{fig4.2.1_b}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_entanglement_3N.pdf} }% \subfloat[$4N$\label{ffig4.2.1_c}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_entanglement_4N.pdf} } \caption{$T-h$ phase diagram of the concurrence~\eqref{cnc_dm}, for (a) $2N$, (b) $3N$, (c) $4N$, spin pairs.} \label{fig4.1.1_} \end{figure} \subsection{Quantum discord and classical correlations } Quantum discord~\eqref{quantum_discord}, is difficult to solve due to the minimization procedure of the conditional entropy. Furthermore, obtaining an analytical expression for the classical correlations~\eqref{classical_corr}, is not an easy task for general states. However, for a special class of density matrices, called X-states, an explicit expression is available~\cite{discord_X_state}. An X-state is described by the following density matrix \begin{equation} \rho_{AB}= \begin{pmatrix} \rho_{11}&0&0&\rho_{14}\\ 0&\rho_{22}&\rho_{23}&0\\ 0&\rho_{32}&\rho_{33}&0\\ \rho_{41}&0&0&\rho_{44} \end{pmatrix}. \end{equation}. We evaluate classical correlations ($CC$), and quantum discord ($QD$) as follows \begin{equation} \begin{aligned} CC(\rho_{AB})=\max\{CC_1,CC_2\},\\ QD(\rho_{AB})=\min\{QD_1,QD_2\}, \end{aligned} \end{equation} where \begin{equation} \begin{aligned} CC_j&=H(\rho_{11}+\rho_{22})-D_j,\\ QD_j&=H(\rho_{11}+\rho_{33})+\sum_{k=1}^4 \lambda_k \log_2(\lambda_k)+D_j, \end{aligned} \end{equation} and \begin{equation} \begin{aligned} D_1&=H(w), D_2=-\sum_{j=1}^4 \rho_{jj} \log_2(\rho_{jj})-H(\rho_{11}+\rho_{33}),\\ w&=\displaystyle{\frac{1+\sqrt{[1-2(\rho_{33}+\rho_{44})]^2+4(|\rho_{14}|+|\rho_{23}|)^2}}{2}}, \end{aligned} \end{equation} $H(x)=-x\log_2(x)-(1-x)\log_2(1-x)$ being the binary Shannon entropy and $\lambda_k$ are the eigenvalues of the matrix $\rho_{AB}$. Then, for the two sites density matrix~\eqref{eq6_mat}, the analytical expression for $CC(\rho_{i,i+m})$ and $QD(\rho_{i,i+m})$ are given by \begin{equation} \begin{aligned} CC_1(i,i+m)&=H(X_{i,i+m}^++Y_{i,i+m}^+)-H\Bigg(\frac{1+\sqrt{[1-2(Y_{i,i+m}^-+X_{i,i+m}^-)]^2+4|Z_{i,i+m}|^2}}{2}\Bigg),\\ CC_2(i,i+m)&=H(X_{i,i+m}^++Y_{i,i+m}^+)+\{X_{i,i+m}^+\log_2(X_{i,i+m}^+)+Y_{i,i+m}^+\log_2(Y_{i,i+m}^+)\\&+Y_{i,i+m}^-\log_2(Y_{i,i+m}^-)+X_{i,i+m}^-\log_2(X_{i,i+m}^-)\}+H(X_{i,i+m}^++Y_{i,i+m}^-), \end{aligned} \label{dm_cc} \end{equation} \begin{equation} \begin{aligned} QD_1(i,i+m)&=H(X_{i,i+m}^++Y_{i,i+m}^-) +\{X_{i,i+m}^+\log_2{X_{i,i+m}^+}+X_{i,i+m}^-\log_2{X_{i,i+m}^-}\\&+(Y_{i,i+m}^+-|Z_{i,i+m}|)\log_2{(Y_{i,i+m}^+-|Z_{i,i+m}|)}+(Y_{i,i+m}^-+|Z_{i,i+m}|)\log_2{(Y_{i,i+m}^-+|Z_{i,i+m}|)}\}\\& +H\Bigg(\frac{1+\sqrt{[1-2(Y_{i,i+m}^-+X_{i,i+m}^-)]^2+4|Z_{i,i+m}|^2}}{2}\Bigg),\\ QD_2(i,i+m)&=H(X_{i,i+m}^++Y_{i,i+m}^-) +\{X_{i,i+m}^+\log_2{X_{i,i+m}^+}+X_{i,i+m}^-\log_2{X_{i,i+m}^-}\\&+(Y_{i,i+m}^+-|Z_{i,i+m}|)\log_2{(Y_{i,i+m}^+-|Z_{i,i+m}|)}+(Y_{i,i+m}^-+|Z_{i,i+m}|)\log_2{(Y_{i,i+m}^-+|Z_{i,i+m}|)}\}\\& -\{X_{i,i+m}^+\log_2(X_{i,i+m}^+)+Y_{i,i+m}^+\log_2(Y_{i,i+m}^+)+Y_{i,i+m}^-\log_2(Y_{i,i+m}^-)+X_{i,i+m}^-\log_2(X_{i,i+m}^-)\}\\& -H(X_{i,i+m}^++Y_{i,i+m}^-), \end{aligned} \label{dm_qd} \end{equation} where $X_{i,i+m}^+$,$X_{i,i+m}^-$,$Y_{i,i+m}^+$,$Y_{i,i+m}^-$ and $Z_{i,i+m}$ are given by the set of equations~\eqref{eq_diag} and~\eqref{eqz}. \begin{figure}[t!] \subfloat[$T=0$\label{fig4.2.2a}]{% \includegraphics[width=0.5\textwidth]{figures/part1/paper/Zero_Temp_QD.pdf} } \hfill \subfloat[$h=0.0$\label{fig4.2.2b}]{% \includegraphics[width=0.5\textwidth]{figures/part1/paper/nonZero_Temp_QD.pdf} } \caption{Quantum discord~\eqref{dm_qd}, for the $2N$, $3N$ and $4N$ spin pairs. In (a) $T=0$ with respect to the magnetic field $h$ and (b) $h=0$ with respect to the temperature $T$. } \label{fig4.2.1} \end{figure} \noindent Figure~\eqref{fig4.2.2a} shows the behaviour of quantum discord~\eqref{dm_qd}, at zero temperature with respect to the magnetic field $h$, for second-, third- and fourth-nearest neighbours. Unlike the concurrence, quantum discord is non-zero for $h<1$, and saturates around the quantum critical $h_c \sim 1$ where it tends to zero \textit{asymptotically}. In general, quantum discord originates from the coherence that arises from quantum superposition, which exists in the subsystems of a quantum system and persists even if the system is in a product state, while the amount of entanglement in a separable state is always zero. \noindent The effect of temperature on quantum discord~\eqref{dm_qd}, at zero magnetic field is reported in Figure~\eqref{fig4.2.2b}. We see a similar behavior to that of the entanglement, c.f. Figure~\eqref{fig4.2.1b}. The difference is that quantum discord is more robust to thermal fluctuations, which do not kill the quantumness of system, as quantum discord stay asymptotically around 0, even for high values of $T$. Only decoherence makes quantum discord vanish. \begin{figure}[b!] \subfloat[$2N$\label{fig4.2.2_a}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_qd_2N.pdf} }% \subfloat[$3N$\label{fig4.2.2_b}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_qd_3N.pdf} }% \subfloat[$4N$\label{fig4.2.2_c}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_qd_4N.pdf} } \caption{$T-h$ phase diagram of quantum discord ~\eqref{dm_qd}, for (a) $2N$, (b) $3N$, (c) $4N$, spin pairs.} \label{fig4.1.2_} \end{figure} \noindent The $T-h$ phase diagram of quantum discord~\eqref{quantum_discord}, is reported in Figure~\eqref{fig4.1.2_}. For all the spin pairs, we see that quantum discord persists for all values of temperature and magnetic field. Only its magnitude reduces as the distance between the spins $m$ increases. \noindent The behaviour of classical correlations~\eqref{dm_cc}, with respect to the magnetic field and the temperature is presented, respectively, in Figure~\eqref{fig4.2.2__a} and Figure~\eqref{fig4.2.2__b}. We report a similar behaviour to quantum discord, c.f. Figure~\eqref{fig4.2.1}. The difference arises only around the quantum critical point $h_c \sim 1$, where quantum discord saturates while classical correlations continue to decrease in this point. Furthermore, we report the dominance of quantum correlations over classical correlations, while in the transverse Ising model the inverse phenomenon takes place~\cite{Maziero2010}. \begin{figure}[t!] \subfloat[$T=0$\label{fig4.2.2__a}]{% \includegraphics[width=0.49\textwidth]{figures/part1/paper/Zero_T_CC.pdf} }% \subfloat[$h=0$\label{fig4.2.2__b}]{% \includegraphics[width=0.49\textwidth]{figures/part1/paper/Zero_field_CC.pdf} } \caption{Classical correlation~\eqref{dm_cc}, for all the spins pairs. In (a) $T=0$ with respect to the magnetic field, and (b) $h=0$ with respect to the temperature $T$.} \label{fig4.1.2__} \end{figure} \subsection{Quantum Coherence} We evaluate the quantum Jensen-Shannon divergence~\eqref{QJSD}, for the two-site density matrix~\eqref{eq6_mat}. In terms of $Y_{i,i+m}^+$,$Y_{i,i+m}^-$ and $Z_{i,i+m}$ given by the set of equations~\eqref{eq_diag} and~\eqref{eqz}, the analytical expression of quantum coherence in the $XX$ model~\eqref{eq1}, is given by \begin{equation} \begin{aligned} \mathcal{QC}(\rho_{i,i+m})&=\Bigg[\Big\{ -\Big(Y_{i,i+m}^+-\frac{|Z_{i,i+m}|}{2}\Big)\log_2{\Big(Y_{i,i+m}^+-\frac{|Z_{i,i+m}|}{2}\Big)}-\Big( Y_{i,i+m}^-+\frac{|Z_{i,i+m}|}{2}\Big)\\&\log_2{\Big(Y_{i,i+m}^-+\frac{|Z_{i,i+m}|}{2}\Big)}\Big\}-\frac{1}{2}\Big\{-(Y_{i,i+m}^+-|Z_{i,i+m}|)\log_2{(Y_{i,i+m}^+-|Z_{i,i+m}|)}\\&-(Y_{i,i+m}^-+|Z_{i,i+m}|)\log_2{(Y_{i,i+m}^-+|Z_{i,i+m}|)} \Big\}-\frac{1}{2}\Big\{-Y_{i,i+m}^+\log_2{Y_{i,i+m}^+}\\& -Y_{i,i+m}^-\log_2{Y_{i,i+m}^-}\Big\}\Bigg]^{\displaystyle{{\frac{1}{2}}}}. \end{aligned} \label{QJSD_qc} \end{equation} \begin{figure}[t!] \subfloat[$T=0$\label{fig4.2.3a}]{% \includegraphics[width=0.5\textwidth]{figures/part1/paper/nonZero_field_QC.pdf} } \hfill \subfloat[$h=0.0$\label{fig4.2.3b}]{% \includegraphics[width=0.5\textwidth]{figures/part1/paper/Zero_Field_QC.pdf} } \caption{Quantum coherence~\eqref{QJSD_qc}, for all the spins pairs. In (a) $T=0$ with respect to the magnetic field, and (b) $h=0$ with respect to the temperature $T$.} \label{fig4.2.3} \end{figure} \noindent The behaviour of quantum coherence~\eqref{QJSD_qc}, with respect to the magnetic field (temperature) at $T=0$ $(h=0)$ is shown in Figure~\eqref{fig4.2.3a} (Figure~\eqref{fig4.2.3b}), which is very similar to quantum discord. This is due to that fact that coherence stems from individual sites (local coherence) or may be distributed along sites (intrinsic coherence)~\cite{coherencePRL} and, one can show that due to spin-flip symmetry of the $XX$ chain~\eqref{eq1}, the one site density matrix is diagonal which means that the local coherence is zero for the $XY$ model. Hence, the total coherence observed in the system will entirely originate from the correlations between the two spins, and since quantum discord represents total quantum correlations, the behavior of quantum coherence will resemble that of quantum discord. It is worthwhile noting that in some models (e.g. Heisenberg spin models with Dzyaloshinsky-Moriya interactions~\cite{coherence_india1,coherence_india2}) the inverse behavior is observed, and the behavior of quantum coherence is reminiscent of entanglement not quantum discord. Moreover, it is argued that quantum discord can be understood from the discrepancy between the relative quantum coherence for the total system and that of the subsystem chosen for the calculation of quantum discord. We confirm the similarity of quantum coherence and quantum discord by the $T-h$ phase diagram in Figure~\eqref{fig4.2.3_}. \begin{figure}[t!] \subfloat[$2N$\label{fig4.2.2_a}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_qc_2N.pdf} }% \subfloat[$3N$\label{fig4.2.2_b}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_qc_3N.pdf} }% \subfloat[$4N$\label{ffig4.2.2_c}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/T-h_qc_4N.pdf} } \caption{$T-h$ phase diagram of quantum coherence~\eqref{QJSD_qc}, for (a) $2N$, (b) $3N$, (c) $4N$, spin pairs.} \label{fig4.2.3_} \end{figure} \section{Quantum phase transitions} \begin{figure}[t!] \subfloat[Concurrence\label{fig4.3a}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/dC.pdf} }% \subfloat[Quantum discord\label{fig4.3b}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/dQD.pdf} }% \subfloat[Quantum coherence\label{ffig4.3c}]{% \includegraphics[width=0.33\textwidth]{figures/part1/paper/dQC.pdf} } \caption{First derivative of (a) the concurrence~\eqref{cnc_dm} , (b) quantum discord~\eqref{dm_cc}, and (c) quantum coherence~\eqref{QJSD_qc}, with respect to the magnetic field $h $ at zero temperature for the $2N$, $3N$ and $4N$ spin pairs.} \label{fig4.3} \end{figure} The $XX$ model undergoes, in the thermodynamic limit, a second-order quantum phase transition at the critical field $h_c=1$, where the system transits from Mott-insulator phase to superfluid phase or vice versa. The ground state of the Mott-insulator phase is a separable state while the ground state of superfluid phase is argued to be an entangled state~\cite{zhang2012classification}. Moreover, quantum phase transition are followed by a specific change in the nature of quantum correlations in the ground state of the system. This is confirmed by the results of the previous sections, where we witnessed the saturation of entanglement, quantum discord and quantum coherence at the vicinity of the quantum critical point and their quick drop to zero, as the system crosses to the other phase. \noindent Second-order quantum phase transitions appear as singularities in the ground state of the quantum system, which manifest itself as divergences in the derivatives of thermodynamical quantities, i.e. free energy. The situation is similar for quantum correlation measures, taking the first derivative of the concurrence~\eqref{cnc_dm}, quantum discord~\eqref{dm_qd}, and quantum coherence~\eqref{QJSD_qc}, reveal the presence of the quantum critical point. This is shown in Figure~\eqref{fig4.3}, where we plot the first derivative of the studied figures of merit, for all the spins pairs, and we see that all the measures diverge at the quantum critical point $h_c=1$. Thus, quantum correlations measures can successfully reveal the critical properties of the isotropic $XY$ model. \section{Summary} \noindent Through this chapter, we presented a comparative study between various types of pairwise correlations that may emerge in a quantum spin system, such as: entanglement, quantum discord, classical correlations and quantum coherence. The analytical expressions of the pairwise quantities were provided using the Jordan–Wigner transformation, which we verified numerically, and the ``Pauli basis expansion''. Then, we showed the dominance of quantum correlations over their classical counterpart, the potential use of quantum discord in quantum information processing being robust against the temperature, and the role of quantum entanglement, quantum discord and quantum coherence in detecting the second-order quantum phase transition in the $XX$ model. Finally, we focused on quantum coherence, an essential feature of quantum mechanics which we proved to be a long range quantity that outperforms entanglement and quantum discord in the robustness to thermal perturbations. The present study shows that quantum correlations measures are very promising candidates in revealing the salient features of quantum-many body systems. In the next part, we analyze another approach to represent and detect quantum critical phenomena in quantum phase space. \part{Quantum Phase Transitions in Phase Space} \chapter{Phase Space Formulation of Quantum Mechanics \label{chap4}} Quantum theory proved to be very successful in describing the features of nano-scale systems, e.g. determination of energy levels of atoms and calculation of transition probabilities. However, a unified interpretation of quantum mechanics is still under debate, due to the existence of many different formulations~\cite{quantum_formulation}. Heisenberg's, Schr\"odinger's and Feynmann's formulations, to cite a few. Additionally, quantum theory can be represented using the density matrix, the second quantization and the variational approach. Finally, the pilot wave, the Hamilton-Jacobi and the Wigner formulation are also valid reformulations of quantum mechanics. Each of these formulations has its own advantages and most of them are equivalent. Nevertheless, the different formulations of quantum theory are often based on distinct views of reality. \noindent In this chapter, we focus on a special formulation of quantum theory, which is based on the Wigner function~\cite{wigner_review_1}. The approach is different in character, as it is a formulation of quantum theory in phase space. As a consequence, it is not equivalent to most of the other formulations of quantum mechanics. The Wigner formalism, being accessible experimentally, has received prominent attention in the field of quantum optics and quantum information theory, in order to explore the features of quantum systems. We start from the formulation of the Wigner function for infinite-dimensional systems and we discuss its features and its experimental implementations. The Wigner function can take negative values, as a consequence it is a quasi-probability distribution. Therefore, one of the goals of this chapter is to discuss the interpretation of negative probabilities and their interplay with non-classicality. Additionally, we focus also on the extension of the Wigner formalism to finite-dimensional quantum systems, its features and its experimental implementations~\cite{wigner_review_2}. \section{The Wigner function} The phase space formulation of quantum mechanics dates back to 1932, when Eugene Wigner developed the inverse of the Weyl transformation, which takes a Hamiltonian in phase space and maps it into a quantum mechanical operator. The Wigner function does the opposite, as it takes a quantum mechanical operator and represents it in phase space~\cite{wigner1932}. To complete the statistical aspect of quantum theory, Moyal and Gronewold pushed the development of the Wigner function further in the 40's, by describing the evolution of quantum systems in phase space, and relating the Wigner function to the expectation value of any quantum operator~\cite{moyal_1949,GROENEWOLD}. \noindent According to the laws of classical physics, the state of a system can be described by a point in a $6N$ dimensional phase space, where the axes are the position $x$ and momentum $p$. In classical physics, the position and momentum commute, hence we can determine the position and momentum of a particle simultaneously. In contrast, the uncertainty principle in quantum mechanics forbids the measurement of $x$ and $p$ at the same time. Therefore, the position $P(x)$ and momentum $Q(x)$ follow probability densities \begin{align} P(x)&=| \psi (x)|^2,\\ Q(k)&=|\phi (k)|^2, \end{align} where $\psi(x)$ and $\phi(k)$ represent wave-functions and are related via the Fourier transform: \begin{equation} \phi(k)=\frac{1}{\sqrt{2\pi}} \int_{-\infty}^{+\infty} \psi(x)e^{-ikx} dx. \end{equation} To adequately describe quantum mechanics in phase space, it is desirable to have a single function with both probabilities $P(x)$ and $Q(k)$. The Wigner function is constructed to achieve this task, and can be written as \begin{equation} W(x,p)=\frac{1}{2\pi \hbar} \int_{-\infty}^{+\infty} \psi^{*}\left(x-\frac{y}{2}\right)\psi\left(x+\frac{y}{2}\right) e^{-\frac{py}{\hbar}} d_y. \label{cont_wf} \end{equation} In general, it can be constructed for any operator $A$ via the expectation value of a kernel, $\Delta(\alpha)$, such that \begin{equation} W_A (\alpha)=\Tr \left[ A \Delta(\alpha) \right], \label{gen_wf} \end{equation} where $\alpha=\frac{(x+ip)}{\sqrt{2}}$. The kernel $\Delta(\alpha)$, can be written in terms of a parity and displacement operator as \begin{equation} \Delta(\alpha)=D(\alpha) \Pi D^{\dagger}(\alpha), \label{kernel} \end{equation} where the parity operator $\Pi$ is written as \begin{equation} \Pi=2e^{i\pi a^{\dagger}a}, \end{equation} and the displacement operator $D(\alpha)$, is given by \begin{equation} D(\alpha) = \exp(\alpha a^{\dagger} - \alpha^* a)=e^{-\frac{1}{2} |\alpha|^2} e^{\alpha a^{\dagger}} e^{-\alpha^* a} =e^{\frac{1}{2} |\alpha|^2} e^{-\alpha^* a} e^{\alpha a^{\dagger}}. \label{displacement} \end{equation} Here, $a^{\dagger}$ and $a$ are creation and annihilation operators, respectively. The displacement operator~\eqref{displacement} displaces any arbitrary state in phase space. For example, a coherent state $\ket{\alpha}$ can be defined as the displacement of the vacuum state $\ket{0}$~\cite{glauber1963,review_coh_state1990} \begin{equation} D(\alpha) \ket{0}=\ket{\alpha}. \end{equation} Any construction of the Wigner function needs to satisfy five criteria, called the Stratonovich-Weyl correspondence~\cite{GWF2016}. They are given as follows \begin{enumerate} \item \textbf{Linearity;} \\ we can fully reconstruct any operator $A$ from $W_A (\alpha)$ and vice versa, via the mapping $W_A (\alpha)=\text{Tr} \left( A \Delta(\alpha) \right)$ and $A=\int_{\alpha} W_A (\alpha) \hat{\Delta}(\alpha) d\alpha$. \item \textbf{Reality;} \\ $W_A (\alpha)$ is always real and normalized to unity. \item \textbf{Covariance;} \\ if $A$ is invariant under global unitary operations then so is $W_{A}(\alpha)$. \item \textbf{Traciality;} \\ the overlap between states, defined by the definite integral $\int_{\alpha} W_{A} W_{A^{\prime}} d\alpha=\text{Tr} \left(A A^{\prime}\right)$, exists and is considered a unique property of the Wigner function. \item \textbf{Standardization;} \\ $W_A (\alpha)$ is “standardized” so that the definite integral over all space $\int_{\alpha} W_A (\alpha) d\alpha = \Tr [A]$ exists and $\int_{\alpha} \Pi(\alpha) d\alpha=\mathbb{I}$. \end{enumerate} In the following, the operator $A$ will be replaced by the density matrix $\rho$. We can immediately see that the Wigner function contains the same amount of information as the density operator, since it is possible to map the two functions into each other. \section{Negativity and non-classicality} The traciality property of the Wigner function cannot hold unless the Wigner function takes negative values. As a consequence, the Wigner function is not a probability distribution and can not describe a physical quantity. Instead, it is a quasi-probability distribution that can be interpreted, when integrating either over $x$ or $p$ in phase space. Figure~\eqref{ex_wigner} represents the Wigner function for (a) Fock states, and (b) cat states, given by \begin{align} \ket{\psi}_{\text{Fock}}&=\frac{1}{\sqrt{2}} \left( \ket{0}_N+\ket{1}_N \right), \label{fock} \\ \ket{\psi}_{\text{Cat}}&=\frac{1}{\sqrt{2}} \left( \ket{\beta} + \ket{-\beta} \right), \label{cat} \end{align} where $N=10$ is the dimension of the Fock state, and $\ket{\beta}=e^{-\frac{1}{2}|\beta|^2}\sum_{n=0}^{+\infty} \frac{(-\beta)^n}{\sqrt{n!}} \ket{n}$ is a coherent state. We see for both examples that the Wigner function is negative in regions of the phase space. What does this mean? \begin{figure}[t!] \subfloat[\label{ex_fock}]{% \includegraphics[width=0.49\textwidth]{figures/part3/wigner_fock.pdf} }% \subfloat[\label{ex_cat}]{% \includegraphics[width=0.49\textwidth]{figures/part3/wigner_cat.pdf} } \caption{Wigner function for (a) the Fock states~\eqref{fock}, and (b) the Cat states~\eqref{cat}.} \label{ex_wigner} \end{figure} Since the early days of quantum mechanics, negative probabilities were under debate. In 1942, Dirac discussed them in the framework of negative energies~\cite{dirac1942}. Groenewold argued that negative probabilities are necessary in order to describe quantum systems in phase space~\cite{GROENEWOLD}. In the 1980s, Feynmann provided a simple argument for negative probabilities, where he considered them as a step in a total sum~\cite{feynamn_neg_prob}. Therefore, he concluded that the negativity should not be studied in isolation. \noindent The negativity of the Wigner function is generally accepted that it is arising due to non-classical features of quantum systems, such as quantum correlations or quantum interference. A system consisting of two coherent states in superposition, will have positive and negative oscillations which are due to the coherence of two states, cf. Figure~\eqref{ex_fock} and~\eqref{ex_cat}. These oscillations are precursor of quantum correlations. This motivated the proposition of measuring quantum correlations with the negative volume of the Wigner function~\cite{negativity2018}, given by \begin{equation} N(W_{\rho}(\alpha))=\frac{1}{2} \int_{\alpha} |W_{\rho}(\alpha)| d\alpha -1. \label{neg_wig} \end{equation} The versatility of the Wigner function in revealing quantum correlations can be seen by considering the example of Werner states~\eqref{werner_state1}. Figure~\eqref{neg_werner2} shows the Wigner function and the concurrence~\eqref{concurrence} in the case of the Werner state, with respect to the mixing parameter $p$. We notice that as soon as the concurrence is non-zero at $p\!>\!\frac{1}{3}$, the Wigner function takes negative values, indicating the presence of quantum correlations in the form of entanglement. \noindent However, the negativity of the Wigner function is not capable of capturing all forms of quantum correlations, as a consequence of Hudson's theorem, which relates the negativity to the non-Gaussianity of the state~\cite{hudson}. For example, squeezed states are written in the form of squeezed Gaussian states, which have no negative Wigner function. Hence, negativity cannot capture the quantum correlations in this system. Figure~\eqref{squeezed} shows the three dimensional plot of the Wigner function for squeezed states, which is positive for all values of $x$ and $p$. \begin{figure}[t!] \subfloat[\label{neg_werner2}]{% \includegraphics[width=0.49\textwidth]{figures/part3/negativity_werner.pdf} }% \subfloat[\label{squeezed}]{% \includegraphics[width=0.49\textwidth]{figures/part3/wigner_squeezed.pdf} } \caption{(a) The Wigner function~\eqref{cont_wf} and the concurrence~\eqref{concurrence} in a Werner state~\eqref{werner_state1}, with respect to the mixing parameter $p$, and (b) The Wigner function~\eqref{cont_wf}, for two mode squeezed states.} \label{ex_werner_wigner} \end{figure} Therefore, the negativity~\eqref{neg_wig} should be used carefully when measuring the quantumness of the system. The success of the negativity in revealing non-classical behavior is only limited to some cases, where quantum correlations arise in a particular form. Hence, a consensus on the use of negativity to reveal quantum correlations is still lacking. \section{Measuring quasi-probabilities} The Wigner function has several applications in statistical mechanics, quantum chemistry, classical optics and signal processing~\cite{ferry_wigner_book}. However, the use of quasi-probability distribution flourished in the field of quantum optics with the construction of quantum states via quantum tomography and the measurement of the spectral phase of ultra-short laser pulses by frequency-resolved optical gating methods~\cite{frog}. There are many approaches to generate the Wigner function experimentally, in the following we discuss two of them. The first consists of generating the density matrix $\rho$ to produce the Wigner function, while the second approach takes direct measurement of phase space points, without the need to generate the density operator. \begin{enumerate} \item \textbf{Creation of the density operator~\cite{direct_mesurement_wigner}.}\\ This procedure consists of making use of cyclic permutation within the trace operator to simplify the measurement of quantum systems in phase space into parity measurement of a displaced state \begin{align} W_{\rho}(\alpha)&=\Tr \left[ \rho \Delta(\alpha) \right]=\Tr \left[ \rho D(\alpha) \Pi D^{\dagger}(\alpha) \right], \nonumber \\ &=\Tr \left[ D^{\dagger}(\alpha) \rho D(\alpha) \Pi \right]=\Tr \left[ \rho(-\alpha) \Pi \right], \end{align} where $D(-\alpha)=D^{\dagger}(\alpha)$, and $\rho(\alpha)=D(\alpha) \rho D^{\dagger}(\alpha)$ is the rotated density matrix. Therefore, by creating, experimentally, the quantum state and displacing it by $\alpha$ we can measure the Wigner function by applying the parity operator using classical computation of diagonal elements or by coupling the state to a two-level system, where the two levels act as the $\pm 1$ parity values. \item \textbf{Direct measurement of phase space points~\cite{direct_mesurement_weyl1, direct_mesurement_weyl2}.}\\ In this method, the qubit is measured in the $x$ and $y$ Pauli basis, instead of taking parity measurements. First, we couple the state $\rho$ with another qubit in the state $\ket{+}=(\ket{0}+\ket{1})/\sqrt{2}$, such that \begin{equation} \rho_{tot}(0)=\ket{+}\bra{+} \otimes \rho. \end{equation} Then, a unitary transformation is performed of the form $\rho_{tot}(\tilde{\alpha})=R(\tilde{\alpha})\rho_{tot}(0)R^{\dagger}(\tilde{\alpha})$, where \begin{equation} R(\tilde{\alpha})=\exp\left( \frac{1}{2} \sigma^z \otimes \left[ a^{\dagger} \tilde{\alpha}-a\tilde{\alpha}^* \right] \right). \end{equation} After the preparation of the state in the desired phase point $\alpha$. We generate the characteristic function, $\chi_{\rho}(\tilde{\alpha})$, by measuring the qubit in the $x$ and $y$ basis, which gives \begin{equation} \chi_{\rho}(\tilde{\alpha})=\langle \sigma^x \rangle +i\langle \sigma^y \rangle, \end{equation} where $\langle \sigma^x \rangle=\Tr \left[ \sigma^x \rho_{tot}(\tilde{\alpha}) \right]$ and $\langle \sigma^y \rangle=\Tr \left[ \sigma^y \rho_{tot}(\tilde{\alpha}) \right]$. Then by performing the Fourier transform of the characteristic function $\chi_{\rho}(\tilde{\alpha})$, we can generate the quasi-probability distribution. \end{enumerate} \section{Qubits in phase space} The focus of this section is on representing finite dimensional quantum systems in phase space. Several formulations are available in the literature~\cite{wigner_review_2}, here we study two particular representations for two-level qubits: Wootters'~\cite{DWFbook} and Stratonovich ~\cite{GWF2016,GWF_entanglement_PRA}. The latter considers the qubit in the Bloch sphere, while the former represents qubit states in a toroidal lattice. \subsection{The Stratonovich kernel} A general extension of the Wigner function~\eqref{gen_wf} to finite-dimensional systems requires the construction of a kernel $\Delta(\Omega)$ that reflects the symmetries of the system at hand. For a qubit, Tilma \textit{et al}~\cite{GWF2016} argued that the parity operator $\Pi$ has analogous properties to the Pauli matrix $\sigma^z$ which rotates the qubit by $\pi$ about the $z$-axis of the Bloch sphere in the Pauli representation, while the displacement operator $D$ is equivalent to the SU(2) rotation operator, given by \begin{equation} U(\theta,\varphi,\phi)=e^{i\sigma^z\varphi}e^{i\sigma^y\theta}e^{i\sigma^z\phi}. \end{equation} $U(\theta,\varphi,\phi)$ displaces the two level quantum state along the surface of the Bloch sphere. This line of thought leads to the following kernel for a qubit \begin{equation} \Delta(\theta,\varphi)=\left[U(\theta,\varphi,\phi) \Pi U^{\dagger}(\theta,\varphi,\phi) \right], \label{startonovich_kernel} \end{equation} where $\theta\!\in\![0,\frac{\pi}{2}]$ and $\varphi\!\in\![0,2\pi]$ parameterize the representation in phase space and $\Pi\!=\! \frac{1}{2} \left( \mathbb{I}\!-\!\sqrt{3} \hat{\sigma}_z \right)$ is a Hermitian operator. Due to the commutation of $\sigma^z$ with $\Pi$, $\phi$ does not contribute to the function. The generalization to a composite system of qubits is straightforward by performing the tensor product \begin{equation} \Delta(\theta,\varphi)=\bigotimes_i^N U \Pi U^{\dagger}. \end{equation} The choice of the kernel $\Delta(\Omega)$ and the set of parameters $\Omega$ is not unique to define the Wigner function. The advantage of the kernel~\eqref{startonovich_kernel} is that it can be applied to construct the Wigner function for any arbitrary quantum system, represented by the density matrix $\rho$. For $d-$dimensional quantum systems, we can use the generalized Gell-Mann matrices $\Lambda_i$ in order to construct a natural extension of the kernel~\eqref{startonovich_kernel}~\cite{gell-mann} \begin{equation} \Delta^d(\Omega)=\frac{1}{d}U(\Omega)\Pi^d U^{\dagger}(\Omega), \end{equation} where the parity operator is written as \begin{equation} \Pi^d=\mathbb{I}_{dxd}-\mathcal{N}(d) \Lambda_{d^2 -1}. \end{equation} Here, $\mathcal{N}(d)=\sqrt{\frac{d(d+1)(d-1)}{2}}$ is a normalization constant, and $\Lambda_{d^2 -1}$ is a $d\! \times \!d$ diagonal matrix, with entries: $\sqrt{2/d(d-1}$ except $\left(\Lambda_{d^2 -1}\right)_{d,d}=-\sqrt{2(d-1)/d}$. \noindent We represent in Figure~\eqref{ex_stratonovich} density plots of the Wigner function using the Stratonovich kernel~\eqref{startonovich_kernel}, for three quantum systems \begin{align} \ket{\psi}&=\frac{1}{\sqrt{2}}\left( \ket{0} + \ket{1} \right) && \text{one qubit},\\ \ket{\Phi}&=\frac{1}{\sqrt{2}} \left( \ket{00} + \ket{11} \right) && \text{Bell state},\\ \ket{\Psi}&=\frac{1}{\sqrt{2}} \left( \ket{000} + \ket{111} \right) && \text{GHZ state}. \end{align} \begin{figure}[t!] \subfloat[One qubit\label{neg_werner}]{% \includegraphics[width=0.33\textwidth]{figures/part3/1qubit_stratonovich.pdf} }% \subfloat[Bell state\label{squeezed}]{% \includegraphics[width=0.33\textwidth]{figures/part3/bell_stratonovich.pdf} }% \subfloat[GHZ state\label{squeezed}]{% \includegraphics[width=0.33\textwidth]{figures/part3/ghz_stratonovich.pdf} } \caption{The Wigner function using the Stratonovich kernel~\eqref{startonovich_kernel}, for (a) one qubit, (b) Bell state, and (c) GHZ state.} \label{ex_stratonovich} \end{figure} \noindent In the three examples, the Wigner function takes both negative and positive values in a similar fashion to its continuous counterpart. Negativity in these cases, can be interpreted as a sign of superposition. Symmetry also plays an important role in the negativity, as any pure state of a qubit can be written as the superposition of two antipodal pure states. This shows the versatility of the Stratonovich kernel in revealing the salient features of symmetric quantum states. \subsection{The Wootters' kernel} Wootters' Winger function~\cite{wootters} can be seen as a generalization of Feynman's phase space construction for two-level systems~\cite{feynamn_neg_prob}. Feynman treated the case of qubits, while Wootters extended the construction to systems with prime powered dimension. Feynman phase space is constructed by writing the probability distributions as \begin{align} p_{++}&= \frac{1}{2} \langle \mathbb{I} + \sigma^x + \sigma^y + \sigma^z \rangle, && p_{+-}= \frac{1}{2} \langle \mathbb{I} - \sigma^x - \sigma^y + \sigma^z \rangle,\\ p_{-+}&= \frac{1}{2} \langle \mathbb{I} + \sigma^x - \sigma^y - \sigma^z \rangle, && p_{--}=\frac{1}{2} \langle \mathbb{I} - \sigma^x + \sigma^y - \sigma^z \rangle, \label{feynmann} \end{align} which represent the joint probability of finding the qubit aligned with the $\pm z$ and $\pm x$ axes, respectively. In contrast, Wootters phase space can be constructed by turning the set of equations~\eqref{feynmann}, into a phase point operator. Hence, the phase space is an $N\!\times\!N$ grid, labelled by a pair of coordinates $(x,p)$, each taking values from $0$ to $N-1$ and for each coordinate we define the usual addition and multiplication mod $N$. If the dimension of the system is $N\!=\!q^k$, with $q$ a prime and $k$ an integer greater than 1, the phase space is constructed by performing the $k$-fold Cartesian product of $q\!\times\!q$ phase spaces. Naturally, the simplest example one can consider is a system with two orthogonal states, i.e. a qubit with $N\!=\!2$, whose discrete phase space consists of four points, while for a composite system of two qubits, i.e. $N\!=\!2^2$ the phase space is formed by 16 points, cf. Table~\eqref{tab1}. Each point in the phase space is described by the discrete phase point operator, $A(x_i,p_i)$. For a single qubit it is given by \begin{equation} A(x_1,p_1)=\frac{1}{2} \Big( \mathbb{I} + (-1)^{x_1} \sigma^z+(-1)^{p_1} \sigma^x+(-1)^{x_1+p_1} \sigma^y \Big), \label{wootters_kernel} \end{equation} \begin{table}[t!] \begin{subtable}{.3\linewidth} \centering \captionsetup{justification=centering} \caption{One qubit} \tikzmark{t}\\ \tikzmark{l} \begin{tabular}{c c c c} & & $0$ & $1$\\[-8pt] & \multicolumn{1}{@{}l}{\tikzmark{x}}\\ 0 & & .&.\\ 1 & & . &.\\ \end{tabular} \tikzmark{r}\\ \tikzmark{b} \tikz[overlay,remember picture] \draw[-triangle 45] (x-|l) -- (x-|r) node[right] {$p_1$}; \tikz[overlay,remember picture] \draw[-triangle 45] (t-|x) -- (b-|x) node[below] {$x_1$}; \label{tab1a} \end{subtable}% \hfill \begin{subtable}{.6\linewidth} \centering \captionsetup{justification=centering} \caption{Two qubits} \tikzmark{t}\\ \tikzmark{l} \begin{tabular}{c c c c c c} & & $00$ & $01$&10&11\\[-8pt] & \multicolumn{1}{@{}l}{\tikzmark{x}}\\ 00 & & .&.&.&.\\ 01 & & . &.&.&.\\ 10&&.&.&.&.\\ 11&&.&.&.&. \end{tabular}\tikzmark{r}\\ \tikzmark{b} \tikz[overlay,remember picture] \draw[-triangle 45] (x-|l) -- (x-|r) node[right] {$(p_1,p_2)$}; \tikz[overlay,remember picture] \draw[-triangle 45] (t-|x) -- (b-|x) node[below] {$(x_1,x_2)$}; \label{tab1b} \end{subtable} \vskip0.5cm \caption{Discrete phase space for (a) one qubit and (b) two qubits.} \label{tab1} \end{table} \noindent where $\sigma^i$ ($i=x,y,z$) are the usual Pauli operators. For composite systems the phase point operators are constructed from the tensor product of the phase point operators of the corresponding subsystems, i.e. $A(x_1\dots x_k,p_1\dots p_k)\!=\!A(x_1,p_1)\otimes A(x_2,p_2) \otimes \dots \otimes A(x_k,p_k)$. Since the $A(x_i,p_i)$'s form a complete orthogonal basis of the Hermitian $N\!\times\!N$ matrices, any density matrix can be decomposed as $\rho\!\!=\!\!\sum\limits_{(x_i,p_i)}W(x_i,p_i)A(x_i,p_i)$, where the real-valued coefficients \begin{equation} W(x_i,p_i)=\frac{1}{N} \text{Tr} (\rho A(x_i,p_i)), \label{wooters_wigner} \end{equation} correspond to the discrete Wigner function and $N$ is the dimension of the overall system. We can relate Feynman's and Wootters' phase space, by noticing that $W(0,0)=p_{++}$, $W(0,1)=p_{+-}$, $W(1,0)=p_{-+}$, and $W(1,1)=p_{--}$. \noindent The Wootters kernel~\eqref{wootters_kernel} can be written in terms of the Stratonovich kernel. This can be achieved by introducing the displacement operator for Wootters' phase space \begin{equation} D(x,p)=\exp{\left(\frac{1}{2}i\pi xp\right)} (\sigma^x)^p (\sigma^z)^x, \end{equation} while the generalized parity operator is \begin{equation} A(0,0)=\frac{1}{2}( \mathbb{I} + \sigma^x + \sigma^y + \sigma^z). \end{equation} Therefore, the kernel in displaced parity form is \begin{equation} A^{\prime}(x,p)=D(x,p)A(0,0)D^{\dagger}(x,p). \end{equation} The eigenvalues of $A(0,0)$ are $(1\pm \frac{\sqrt{3}}{2})$, which are the same for the parity operator of the Stratonovich kernel $\Pi$. Thus, we can diagonalize $A(0,0)$ as \begin{equation} A(0,0)=U(\theta,\phi)\Pi U^{\dagger}(\theta,\phi), \end{equation} where $\theta=\arccos(\frac{1}{\sqrt{3}})$, and $\phi=-\frac{\pi}{4}$. Hence, we can write the Wootters kernel $A^{\prime}(x,p)$ in terms of the Stratonovich kernel as \begin{equation} A^{\prime}(x,p)=\Delta \left(\theta+p\pi,\phi+ \frac{2x-p}{2} \pi \right). \label{map_wott_stra} \end{equation} The result~\eqref{map_wott_stra} implies that Wootters' Wigner function is a sub-quasi probability distribution of the Stratonovich Wigner function. \section{Measuring qubits in phase space} The experimental techniques to measure qubits in phase space are based upon their continuous counterpart. Re-creation of the density matrix was used in order to simulate an atomic cat state via Rydberg atoms with angular momentum $j=25$~\cite{rydb_exp_wigner}. The atom in this experiment is represented by a large angular momentum space, with Hilbert space dimension of 51. Alternatively, tomography techniques such as discrete representation of operators for spin systems (DROPS) can be used to measure multi-qubit states~\cite{drops1,drops2}. The disadvantage of these methods is that they require full tomography to construct the full density matrix, which becomes exponentially difficult as the number of qubits increases. Hence, the motivation behind developing techniques that do not require full tomography in constructing the density operator. \noindent The displaced parity formalism can be used in order to measure the phase space of quantum states directly. The Wigner function in this case takes the form: \begin{align} W_{\rho}(\theta,\phi)&=\Tr \left[ \rho \Delta(\theta,\phi) \right]=\Tr \left[ \rho U(\theta,\phi,\Phi) \Pi U^{\dagger}(\theta,\phi,\Phi) \right], \nonumber\\ &=\Tr \left[ \rho(\theta,\phi,\Phi) \Pi \right] = \langle \Pi \rangle_{(\theta,\phi,\Phi)}. \end{align} Here, $\rho(\theta,\phi,\Phi)=U^{\dagger}(\theta,\phi,\Phi) \rho U(\theta,\phi,\Phi) $. The measurement procedure is to first rotate the generated state $\rho$ to the desired location in phase space in order to create $\rho(\theta,\phi,\Phi)$. Then, apply the appropriate parity measurement. This protocol has been used in order to measure a two-level Caesium atom~\cite{caesium} and a state produced via the Nitrogen vacancy center in diamond~\cite{nitrogen}. In both experiments, they prepared the state in a superposition of the ground and excited state. Then, the state is rotated in ($\theta,\phi$) by applying pulses. The protective measurement $p_{m}(\theta,\phi)$ for $m=\pm \frac{1}{2}$, are given by \begin{equation} p_{\pm \frac{1}{2}}(\theta,\phi)=\Tr \left[ \rho U(\theta,\phi) P_{\pm \frac{1}{2}} U^{\dagger}(\theta,\phi) \right], \end{equation} where $P_{\pm \frac{1}{2}}$ represent projectors of the eigenstates of$\sigma^z/2$ with eigenvalues $\pm \frac{1}{2}$. Therefore, the Wigner function reduces to \begin{align} W_{\rho}(\theta,\phi)&=\sum_{m=-1/2}^{1/2} p_m(\theta,\phi)\Pi_m, \nonumber \\ &=\frac{1}{2} \left[ 1+\sqrt{3} \left( p_{1/2}(\theta,\phi) - p_{1/2}(\theta,\phi) \right) \right]. \end{align} Full tomography for one qubit is to some extent feasible, as it requires few measurements. In contrast, multi-qubit systems are difficult to measure due to the exponential increase of the Hilbert space. An interesting approach to represent multi-qubit states is by taking advantage of symmetric states. In many situations, symmetric states are the main requirement to use for computational advantage or metrology. Coherent states~\cite{glauber1963}, GHZ states~\cite{ghz}, Cat states~\cite{cat}, W states or Dicke states~\cite{dicke}, are all prominent examples of symmetric states. \chapter{Quantum Criticality in Phase Space \label{chap5} } In this chapter, We apply Wootters' discrete Wigner function and the Stratonovich Wigner function, to detect quantum phase transitions in critical spin-$\tfrac{1}{2}$ systems. We develop a general formula relating the phase space techniques and the thermodynamical quantities of spin models, which we apply to single, bipartite and multipartite systems governed by the $XY$ and the $XXZ$ models. We will see that this approach allows us to introduce a novel way to represent, detect, and distinguish first-, second- and infinite-order quantum phase transitions. Furthermore, we will show that the factorization phenomenon of the $XY$ model is only directly detectable by quantities based on the square root of the bipartite reduced density matrix. Finally, we will establish that phase space techniques provide a simple, experimentally promising tool in the study of many-body systems and we discuss their relation with measures of quantum correlations and quantum coherence~\cite{mzaouali2019}. \section{The $XY$ model} The most natural candidate to investigate how phase space methods can explore criticality, are quantum spin chains, as they exhibit rich quantum critical behavior. To test the validity of our idea, we start from a simple model of interacting spins: the $XY$ model, introduced in Section~\eqref{xymodel}: \begin{equation} \mathcal{H}_{XY}\!=\!-\sum_{i=0}^{N-1} \left[ \frac{\lambda}{2} \bigg\{ \left(1\!+\!\gamma\right)\sigma_i^x\sigma_{i+1}^x+\left(1\!-\!\gamma\right)\sigma_i^y\sigma_{i+1}^y \bigg\}\!+\!\sigma_i^z \right], \label{xy} \end{equation} We have seen in the previous part that the $XY$ model~\eqref{xy} can be solved exactly and undergoes a second-order quantum phase transitions at $\lambda_c=1$, for $0\!\leq\!\gamma\!\leq\!1$. Moreover, this model exhibits a non-trivial factorization line, where the ground state of the model becomes completely factorized at \begin{equation} \lambda_f=\frac{1}{\sqrt{1\!-\!\gamma^2}} \label{fact} \end{equation} and is understood as an entanglement transition which is characterized by an energy level degeneracy~\cite{GiorgiPRB, CampbellPRA2013, GiampaoloPRA, AmicoPRB}. Figure~\eqref{fac_cnc_xy} shows the concurrence~\eqref{concurrence} of the $XY$ model~\eqref{xy} in the $(\gamma - \lambda)$ plane. The white curve is where the concurrence is zero, which indicates the separability of the ground state. In the following, the system of interest will be an infinite chain, and we calculate the reduced density matrix for a single-, two- and three-site system in order to evaluate the corresponding Wootters' discrete Wigner function (DWF). \begin{figure}[t!] \centering \includegraphics[scale=0.7]{figures/part2/cnc_xy.pdf} \caption{ $(\gamma - \lambda)$ phase diagram of the concurrence~\eqref{concurrence} in the $XY$ model~\eqref{xy}. The white curve represents the factorization line~\eqref{fact} of the ground state.} \label{fac_cnc_xy} \end{figure} \subsection{Single site} We start by considering a single site taken by performing the partial trace over all the other sites of an infinite chain. The reduced density matrix $\rho_i$ can be expressed as \begin{equation} \rho_i=\frac{1}{2} \sum_{\alpha=0}^{3} \langle \sigma^\alpha \rangle \sigma_i^\alpha, \label{sdm} \end{equation} plugging~\eqref{sdm} in~\eqref{wooters_wigner} and taking into account the reality of the density matrix and the $\mathbb{Z}_2$ symmetry of quantum spin$-\frac{1}{2}$ chains, the DWF for one site takes the form \begin{equation} W(x_1,p_1)=\frac{1}{2} \Big( 1+(-1)^{x_1}\langle \sigma^z \rangle \Big). \label{DWF_single_site} \end{equation} Due to the $\mathbb{Z}_2$ symmetry, the single site DWF only depends on $x_1$ and thus the DWF in this case consists of two distinct behaviors as depicted in Figures~\eqref{ssDWF},~\eqref{der_ssDWF} and Table~\eqref{tab_ss1}. Choosing $\gamma\!=\!0.5$ we see the concavity of the DWF changes after crossing the critical point, $\lambda_c\!\!=\!\!1$, which is further reflected by a divergence at $\lambda_c$ in the first derivative of the DWF with respect to $\lambda$. For this value of $\gamma$ the factorization point at $\lambda_f\!\sim\!1.1547$ and we find that the single site DWF shows no signatures of this phenomenon, which is to be expected since the reduced density matrix depends only on the magnetization and contains no information about correlations within the chain. \noindent Turning our attention to the single site Stratonovich's generalized Wigner function (GWF), using the reduced density matrix~\eqref{sdm} and the Stratonovich kernel ~\eqref{startonovich_kernel} we find \begin{equation} \text{GWF}_{\rho_i}(\theta)\!=\!\frac{1}{2} \left(1-\sqrt{3}\cos(2\theta)\langle \sigma_z \rangle \right). \label{gwf_ss} \end{equation} \begin{table}[t!] \centering \tikzmark{t}\\ \tikzmark{l} \begin{tabular}{c c c c} & & $0$ & $1$\\[-8pt] & \multicolumn{1}{@{}l}{\tikzmark{x}}\\ 0 & & \begingroup \color{blue!55} \textbf{\textemdash}\endgroup&\begingroup \color{blue!55} \textbf{\textemdash} \endgroup\\ 1 & & \begingroup \color{orange!55} \textbf{-.-} \endgroup & \begingroup \color{orange!55} \textbf{-.-} \endgroup\\ \end{tabular} \tikzmark{r}\\ \tikzmark{b} \tikz[overlay,remember picture] \draw[-triangle 45] (x-|l) -- (x-|r) node[right] {$p_1$}; \tikz[overlay,remember picture] \draw[-triangle 45] (t-|x) -- (b-|x) node[below] {$x_1$}; \vskip0.5cm \caption{Discrete phase space for the single site $XY$ model. Each symbol corresponds to a particular curve shown in Figure~\eqref{fig_ss_dwf}. } \label{tab_ss1} \end{table} The single site GWF is insensitive to the angle $\varphi$ which is due to the $\mathbb{Z}_2$ symmetry. It is evident that the DWF~\eqref{DWF_single_site} corresponds to a particular choice of angle $\theta$ in the GWF~\eqref{gwf_ss}. In Figure~\eqref{ssgwf} we focus on two limits of the GWF~\eqref{gwf_ss} by fixing the value of the parameter $\theta$. For $\theta\!=\!0$ ($\theta\!\sim\!3\pi/7$) the GWF~\eqref{gwf_ss} is maximized (minimized), where we report an abrupt change in both limits after crossing the critical point $\lambda_c\!=\!1$ which is reflected in the first derivative of the GWF with respect to $\lambda$ (cf. Figure~\eqref{der_ssgwf}) by a divergence at the critical point $\lambda_c$. However, similarly to the analysis of the single site DWF, no sign of the factorization point manifests in the GWF. Due to the simple form of the single site density matrix, we find that both~\eqref{DWF_single_site} and~\eqref{gwf_ss} are directly related to the $\sigma_x$ coherence measures~\cite{CakmakPRB2014}. Furthermore, this is consistent with the fact that the presence of the interference terms in the original continuous Wigner function of a given quantum state indicates quantum coherence within the state. \begin{figure}[t!] \subfloat[\label{ssDWF}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig1a.pdf} }% \subfloat[\label{der_ssDWF}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig1b.pdf} }\\ \subfloat[\label{ssgwf}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig1c.pdf} }% \subfloat[\label{der_ssgwf}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig1d.pdf} } \caption{(a) Discrete Wigner function and (b) its first derivative with respect to $\lambda$ for the single site $ XY $ model~\eqref{xy}. The two distinct behaviors of $W(x;p)$ and $\partial_{\lambda} W(x;p)$ correspond to the appropriate phase space points indicated in Table~\eqref{tab_ss1}. Panels (c) and (d) show the behavior of the maximum $(\theta=0)$, the minimum $\left(\theta \sim 3\pi/7\right)$ of the GWF (c) and their first derivative with respect to $\lambda$ (d), for the $XY$ model. In all plots $\gamma\!=\!0.5$.} \label{fig_ss_dwf} \end{figure} \subsection{Two sites} We extend our analysis to the case of a system of two sites $i$ and $j$ of an infinite quantum chain, with $i\!<\!j$ separated by some lattice spacing $m\!=\!j-i$. The reduced density matrix can be expressed as \begin{equation} \rho_{i,i+m}=\frac{1}{4}\sum_{\alpha,\beta=0}^3 p_{\alpha \beta} \sigma_i^{\alpha}\otimes\sigma_{i+m}^{\beta}, \label{rho_ij} \end{equation} where $p_{\alpha \beta}=\langle\sigma_i^{\alpha}\sigma_{i+m}^{\beta}\rangle$ are the spin-spin correlation functions, ($\alpha,\beta)\!=\!0, \!1, \!2, \!3$. The two-site DWF can be concisely expressed as \begin{equation} \begin{split} W_{\rho_{ij}}(x_1,x_2;p_1,p_2)=\frac{1}{16} \Big( 1+ \big[(-1)^{x_1}+(-1)^{x_2}\big]\langle \sigma^z \rangle\\+ (-1)^{p_1+p_2} \langle \sigma^x_i \sigma^x_{i+m} \rangle + (-1)^{x_1+x_2}\langle \sigma^z_i \sigma^z_{i+m} \rangle\\+ (-1)^{x_1+x_2+p_1+p_2} \langle \sigma^y_i \sigma^y_{i+m} \rangle \Big). \end{split} \label{eq4} \end{equation} On inspection it is evident that the DWF for a given choice of $(x_i,p_i)$ involves contributions from the various spin-spin correlation functions as well as the magnetization, which are central to spotlighting critical behavior. An advantage of the DWF~\eqref{eq4} is that it allows for a panoramic view of the properties of the system. In particular, evaluating the various DWF allows us to focus on contributions that are relevant in exhibiting the critical behavior. Since a given correlation measure will often depend on only specific spin-spin correlation functions, evaluating the DWF~\eqref{eq4} also allows a window into understanding the behavior of measures of quantum correlations across quantum phase transitions. A further advantage of the DWF~\eqref{eq4} is that any given DWF is experimentally accessible~\cite{expdwf2}. It is worth emphasizing that this expression is not specific to the models considered in this work, but applies to any Hamiltonian that is real and exhibits $\mathbb{Z}_2$ symmetry. \noindent It is well known that various measures of bipartite quantum correlation accurately pinpoint the quantum phase transitions of this model~\cite{rozario, niel_osb, SarandyPRA2009, QPT2004, qptdiscord, Werlang2010, CampbellPRA2013, TonySciRep, qptcoherence, CakmakPRB2014}, therefore since the DWF is constructed from combinations of correlation functions that enter into the definition of such measures, it is not surprising that we find a qualitatively similar behavior. In line with these previous studies, Figure~\eqref{tsDWF} shows the first derivative of the DWFs for a pair of nearest neighbor spins. We see that there are six characteristic behaviors, c.f. Table~\eqref{tabXY}, and all of them clearly signal the quantum phase transition by showing a divergence in the first derivative at the critical point. Thus, as all discrete phase space points exhibit a qualitatively similar behavior, choosing to study any one in particular is sufficient to study the quantum phase transition. \noindent It is interesting to note that, despite being dependent on all the relevant spin-spin correlation functions, there is no evidence of ground state factorization in the behavior of $\partial_{\lambda}W_{\rho_{ij}}$. In fact, as was shown for some coherence measures~\cite{CakmakPRB2014}, the factorization phenomenon is connected to an inherited discontinuity at the level of $\sqrt{\rho_{ij}}$ instead of $\rho_{ij}$. Remarkably we find a consistent behavior in the DWF by calculating $\partial_{\lambda} W_{\sqrt{\rho_{ij}}}$ in Figure~\eqref{sqtsDWF}. Now we find that the DWF develops a finite discontinuity at the factorization point for all six characteristic behaviors. \begin{table}[t] \begin{subtable}{\linewidth} \centering \tikzmark{t}\\ \tikzmark{l} \begin{tabular}{c c c c c c} & & $00$ & $01$&10&11\\[-8pt] & \multicolumn{1}{@{}l}{\tikzmark{x}}\\ 00 & & \begingroup \color{blue!55} \textbf{-.-}\endgroup&\begingroup \color{orange} \textbf{\textemdash} \endgroup&\begingroup \color{orange} \textbf{\textemdash} \endgroup&\begingroup \color{blue!55} \textbf{-.-}\endgroup\\ 01 & & \begingroup \color{green} \textbf{ - - - }\endgroup&\begingroup \color{violet} \textbf{ \textellipsis\textellipsis }\endgroup&\begingroup \color{violet} \textbf{ \textellipsis\textellipsis }\endgroup&\begingroup \color{green} \textbf{ - - - }\endgroup \\ 10 & & \begingroup \color{green} \textbf{ - - - }\endgroup&\begingroup \color{violet} \textbf{ \textellipsis\textellipsis }\endgroup&\begingroup \color{violet} \textbf{ \textellipsis\textellipsis }\endgroup&\begingroup \color{green} \textbf{ - - - }\endgroup\\ 11 & & \begingroup \color{red} \huge $,$ \endgroup&\begingroup \color{Sepia} $\bigstar$ \endgroup&\begingroup \color{Sepia} $\bigstar$ \endgroup& \begingroup \color{red} \huge $,$ \endgroup \\ \end{tabular}\tikzmark{r}\\ \tikzmark{b} \tikz[overlay,remember picture] \draw[-triangle 45] (x-|l) -- (x-|r) node[right] {$(p_1,p_2)$}; \tikz[overlay,remember picture] \draw[-triangle 45] (t-|x) -- (b-|x) node[below] {$(x_1,x_2)$}; \end{subtable} \vskip0.5cm \caption{Discrete phase space of the $ XY $ model. Each symbol corresponds to a particular curve shown in Figure~\eqref{fig_quantum phase transition_fp_xy}.} \label{tabXY} \end{table} \begin{figure}[t] \subfloat[\label{tsDWF}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig2a.pdf} }% \subfloat[\label{sqtsDWF}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig2b.pdf} }\\ \subfloat[\label{der_tsDWF}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig2c.pdf} }% \subfloat[\label{der_sqssDWF}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig2d.pdf} } \caption{First derivative with respect of $\lambda$ of the discrete Wigner function of (a) $W_{\rho_{ij}}$ and (b) $W_{\sqrt{\rho_{ij}}}$ for a pair of nearest neighbor spins for the $XY$ model. The six distinct behaviors correspond to the appropriate phase space points indicated in Table~\eqref{tabXY}. (c) and (d) show the same quantities for the long-range case of a pair of spins separated by 20 sites. In all panels $\gamma\!=\!0.5$} \label{fig_quantum phase transition_fp_xy} \end{figure} \noindent Finally we examine the long range behavior of the DWF in the $XY$ model. Figure~\eqref{der_tsDWF} and~\eqref{der_sqssDWF} depict the first-order derivative of the DWF for a pair of spins $i$ and $j\!=\!i+m$ separated by $m\!=\!20$. For all phase space points, both first-order derivatives with respect to $\lambda$ of $W_{\rho_{i,i+20}}$ and $W_{\sqrt{\rho_{i,i+20}}}$ diverge at the critical point $\lambda_c\!=\!1$, revealing the quantum phase transition, while the discontinuity at the factorization point persists at long range only at the level of the first derivative of $W_{\sqrt{\rho_{i,i+20}}}$, which is consistent with the previous finding in the case of nearest neighbors. \noindent As with the single site case, we extend the GWF formalism to the case of a system composed of two sites $i$ and $j$ with $i\!<\!j$, separated by some lattice spacing $m\!=\!j-i$. Plugging the reduced density matrix $\rho_{ij}$~\eqref{rho_ij} into the Stratonovich Wigner function~\eqref{gen_wf}, the two site GWF can be expressed as \begin{align} &\text{GWF}_{\rho_{ij}}(\theta_i,\varphi_i,\theta_j,\varphi_j)\!=\!\frac{1}{4} \Big[ 1-\sqrt{3} \left(\cos{2\theta_i} + \cos{2\theta_j} \right) \langle \sigma^z \rangle + \nonumber\\& 3\cos{2\varphi_i}\sin{2\theta_i}\cos{2\varphi_j}\sin{2\theta_j} \langle \sigma^x_i\sigma^x_{j} \rangle + 3\sin{2\theta_i}\sin{2\theta_j} \nonumber \\&\sin{2\varphi_i}\sin{2\varphi_j} \langle \sigma^y_i\sigma^y_{j} \rangle + 3\cos{2\theta_i}\cos{2\theta_j} \langle \sigma^z_i\sigma^z_{j} \rangle \Big]. \label{gwf_ij} \end{align} In line with the DWF analysis, the GWF is written in terms of the various correlation functions with the additional dependence on the set of angles $(\theta_i,\varphi_i,\theta_j,\varphi_j)$. Again we see that~\eqref{gwf_ij} is a generalization of Wootters' DWF. \begin{figure}[t!] \centering \subfloat[\label{tsgwf}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig3a.pdf} }% \subfloat[\label{sqtsgwf}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig3b.pdf} }\\ \subfloat[\label{der_tsgwf}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig3c.pdf} }% \subfloat[\label{der_sqssgwf}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig3d.pdf} } \caption{The two sites GWF of the $XY$ model taking $\gamma=0.5$ in~\eqref{gwf_ij} [upper panels] and its first derivative with respect to $\lambda$ [lower panels] for (a) $\theta_i\!=\!\theta_j\!=\!\pi/2$; $\varphi_i\!=\!\varphi_j\!=\!2\pi$ and (b) $ \theta_i\!=\!\theta_j\!=\!\varphi_i\!=\!\varphi_j\!=\!0 $ in the case of nearest and the $20^{\text{th}}$ neighbor using $\rho_{ij}$ and $\sqrt{\rho_{ij}}$.} \label{fig_gwf_quantum phase transition_fp} \end{figure} \noindent Figure~\eqref{fig_gwf_quantum phase transition_fp} shows the behavior of the two site GWF for the $XY$ model with $\gamma=0.5$ for two angle configurations: $(\theta_i\!=\!\theta_j\!=\!\varphi_i\!=\!\varphi_j\!=\!0)$ and $(\theta_i\!=\!\theta_j\!=\!\pi/2 ; \varphi_i\!=\!\varphi_j\!=\!2\pi)$. Focusing on the upper panels of (a) and (b), we see an inflection point for both configurations for nearest neighbors (blue line) and $20^{\text{th}}$ neighbors (green line) at the critical point $\lambda_c\!=\!1$. As with the DWF, the factorization point can only be directly detected by examining the GWF for ${\sqrt{\rho_{ij}}}$, where a discontinuity appears in the derivative. However, the factorization phenomenon comes with an additional property: the value of the GWF {\it at the factorization point} is constant for any lattice distance $m$ which can be seen clearly for the $\text{GWF}_{\rho_{ij}}$ and $\text{GWF}_{\sqrt{\rho_{ij}}}$ in Figure~\eqref{fig_gwf_quantum phase transition_fp}. Such a behavior was first noted for the quantum discord in the same model~\cite{EPL2011, CampbellPRA2013}. This property can be understood when looking at the energy levels of finite-sizes of the $XY$ chain, where an energy-level crossing between the ground state and the first excited state take place exactly at the factorization point~\cite{CampbellPRA2013, AmicoPRB, GiorgiPRB} which forces the spin-spin correlation functions to have a constant value at any distance $m$. \subsection{Three sites} \begin{figure}[t!] \subfloat[\label{3sgwf0}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig4a.pdf} }% \subfloat[\label{3sgwfpi}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig4b.pdf} }\\ \subfloat[\label{der_3sgwf0}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig4c.pdf} }% \subfloat[\label{der_3sgwfpi}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig4d.pdf} } \caption{The three sites GWF of the $XY$ model taking $\gamma=0.5$ in~\eqref{gwf_ijk} and its first derivative with respect to $\lambda$ for (a) $\theta_i\!=\!\theta_j\!=\!\pi/2$; $\varphi_i\!=\!\varphi_j\!=\!2\pi$ and (b) $ \theta_i\!=\!\theta_j\!=\!\varphi_i\!=\!\varphi_j\!=\!0 $ in the case of nearest neighbor spins.} \label{fig_gwf_ijk} \end{figure} A significant advantage of the GWF approach is that it can readily be extended to multipartite systems. Here we examine a three site system of the $XY$ model. The reduced density matrix $\rho_{ijk}$, taken by performing the partial trace over the infinite chain except the sites $(i,j,k)$, expressible as \begin{equation} \rho_{ijk}=\frac{1}{2^3} \sum_{\alpha,\beta,\gamma=0}^3 \langle \sigma_{i}^{\alpha} \sigma_{j}^{\beta} \sigma_{k}^{\gamma} \rangle \sigma_{i}^{\alpha} \otimes \sigma_{j}^{\beta} \otimes \sigma_{k}^{\gamma} \label{rho_ijk} \end{equation} and the full expression for the GWF is given below, c.f. formula~\eqref{gwf_ijk}. While in principle one could also consider the DWF for this case, in general the discrete phase space will consist of 64 behaviors, making it difficult to visualize. Furthermore, as we have established from the single and two-site analyses, the DWF corresponds to particular choices for the angles entering into the GWF. In analogy with the analysis of the two sites GWF, we consider two angle configurations: $\theta_i\!=\!\theta_j\!=\!\theta_k\!=\!\pi/2;\varphi_i\!=\!\varphi_j\!=\!\varphi_k\!=\!2\pi$ and $\theta_i\!=\!\theta_j\!=\!\theta_k\!=\!\varphi_i\!=\!\varphi_j\!=\!\varphi_k\!=\!0$ of the three sites GWF. In Figure~\eqref{fig_gwf_ijk} we see that in the multipartite case continues to spotlight the second order quantum phase transition for both sets of angles, however no sign of the factorization point can be seen. The failure of a multipartite non-classicality indicator to witness the factorization point is remarkable and is at variance with the behavior of certain indicators of multipartite entanglement which vanish in the thermodynamic limit~\cite{GiampaoloPRA}. \begin{small} \begin{align} &\text{GWF}_{\rho_{ijk}}(\theta_i,\varphi_i,\theta_j,\varphi_j,\theta_k,\varphi_k) = \frac{1}{8} \Big[ 1-\sqrt{3}\left(\cos{2\theta_i} + \cos{2\theta_j} + \cos{2\theta_k} \right) \langle \sigma^z \rangle + 3 \cos{2\varphi_i} \nonumber \\& \sin{2\theta_i}\cos{2\varphi_k}\sin{2\theta_k} \langle \sigma^x_i\sigma^x_k \rangle + 3\left( \cos{2\varphi_i}\sin{2\theta_i}\cos{2\varphi_j}\sin{2\theta_j} + \cos{2\varphi_j}\sin{2\theta_j}\cos{2\varphi_k}\sin{2\theta_k} \right) \nonumber \\& \langle \sigma^x_i\sigma^x_j \rangle + 3 \sin{2\theta_i}\sin{2\varphi_i} \sin{2\theta_k}\sin{2\varphi_k} \langle \sigma^y_i\sigma^y_{k} \rangle + 3 \cos{2\theta_i}\cos{2\theta_k} \langle \sigma^z_i\sigma^z_{k} \rangle + \nonumber \\& 3 \left(\sin{2\theta_i}\sin{2\theta_j}\sin{2\varphi_i}\sin{2\varphi_j} + \sin{2\theta_i}\sin{2\theta_k}\sin{2\varphi_j}\sin{2\varphi_k} \right) \langle \sigma^y_i\sigma^y_{k} \rangle + \nonumber \\& +3 \left(\cos{2\theta_i}\cos{2\theta_j} + \cos{2\theta_j}\cos{2\theta_k} \right) \langle \sigma^z_i\sigma^z_{j} \rangle - 3\sqrt{3} \cos{2\varphi_i}\sin{2\theta_i}\cos{2\varphi_j}\sin{2\theta_j}\cos{2\theta_k} \langle \sigma^x_i\sigma^x_{j} \rangle \langle \sigma^z \rangle + \nonumber \\ & 3\sqrt{3} \cos{2\varphi_i}\sin{2\theta_i}\cos{2\varphi_k}\sin{2\theta_k}\cos{2\theta_j} \langle \sigma^x_i\sigma^x_{k} \rangle \langle \sigma^z \rangle - 3\sqrt{3} \sin{2\theta_i}\sin{2\varphi_i} \sin{2\theta_j}\sin{2\varphi_j}\cos{2\theta_k} \langle \sigma^y_i\sigma^y_{j} \rangle \langle \sigma^z \rangle + \nonumber \\& 3\sqrt{3} \sin{2\theta_i}\sin{2\varphi_i} \sin{2\theta_k}\sin{2\varphi_k}\cos{2\theta_j} \langle \sigma^y_i\sigma^y_{k} \rangle \langle \sigma^z \rangle - 3\sqrt{3} \cos{2\theta_i}\cos{2\theta_j}\cos{2\theta_k} \left( \langle \sigma^z_i\sigma^z_{j} \rangle - \langle \sigma^z_i\sigma^z_{k} \rangle \right) \langle \sigma^z \rangle \Big], \label{gwf_ijk} \end{align} \end{small} \section{The $XXZ$ model} As a second interesting candidate system, we consider the $XXZ$ model with periodic boundary conditions \begin{equation} \mathcal{H}_{XXZ}=\frac{1}{4}\sum_{i=1}^N \sigma_i^x\sigma_{i+1}^x+\sigma_i^y\sigma_{i+1}^y+\Delta \sigma_i^z\sigma_{i+1}^z, \label{eq6} \end{equation} where $\Delta$ is the anisotropy parameter. The phase diagram is split into three regions, separated by two different quantum phase transitions. For $\Delta\!\leq\!-1$, the system is in a ferromagnetic (gapped) phase and at $\Delta\!=\!-1$ a first-order quantum phase transition occurs. For $-1\!<\!\Delta\!<\!1$, the system is in a gapless (Luttinger liquid) phase and at $\Delta\!=\!1$ an infinite-order continuous quantum phase transition occurs, known as the Kosterlitz-Thouless quantum phase transition~\cite{Kosterlitz1973}. Finally, for $\Delta\!>\!1$, the system enters the anti-ferromagnetic (gapped) phase. The equilibrium properties of this model have been well studied, and in particular various measures of bipartite quantum correlations and their behavior across the different quantum phase transitions have been explored~\cite{qptdiscord,JafariPRA2008, SarandyPRA2009, RulliPRA2010, JafariPRA2017}. While entanglement and quantum discord were shown to reveal the critical points, their qualitative behaviors were shown to be strikingly different~\cite{SarandyPRA2009}. Here, by examining the DWF and the GWF we can shed greater light on these behaviors and show that when extremization procedures are employed, features spotlighting criticality become more pronounced. \begin{table}[t] \begin{subtable}{\linewidth} \centering \tikzmark{t}\\ \tikzmark{l} \begin{tabular}{c c c c c c} & & $00$ & $01$&10&11\\[-8pt] & \multicolumn{1}{@{}l}{\tikzmark{x}}\\ 00 & & \begingroup \color{magenta}$ \bigstar$ \endgroup&\begingroup \color{red} \textbf{ - - - } \endgroup&\begingroup \color{red} \textbf{ - - - } \endgroup&\begingroup \color{magenta} $ \bigstar$ \endgroup\\ 01 & & \begingroup \color{green} $\times$ \endgroup&\begingroup \color{green} $\times$ \endgroup&\begingroup \color{green} $\times$ \endgroup&\begingroup \color{green} $\times$ \endgroup \\ 10 & & \begingroup \color{green} $\times$ \endgroup&\begingroup \color{green} $\times$ \endgroup&\begingroup \color{green} $\times$ \endgroup&\begingroup \color{green} $\times$ \endgroup\\ 11 & & \begingroup \color{magenta} $ \bigstar$ \endgroup&\begingroup \color{red} \textbf{ - - - } \endgroup&\begingroup \color{red} \textbf{ - - - } \endgroup&\begingroup \color{magenta}$ \bigstar$ \endgroup \\ \end{tabular}\tikzmark{r}\\ \tikzmark{b} \tikz[overlay,remember picture] \draw[-triangle 45] (x-|l) -- (x-|r) node[right] {$(p_1,p_2)$}; \tikz[overlay,remember picture] \draw[-triangle 45] (t-|x) -- (b-|x) node[below] {$(x_1,x_2)$}; \end{subtable} \vskip0.5cm \caption{Discrete phase space of the $XXZ$ model~\eqref{eq6}. Each symbol corresponds to one of the three characteristic behaviors shown in Figure~\eqref{fig_XXZ}.} \label{tabxxz} \end{table} \noindent Due to the form of Hamiltonian~\eqref{eq6} we find that no relevant information about the critical properties of the system can be revealed by studying only the single site density matrix. This is simply due to the fact that the single site density matrix depends only on $\langle \sigma^z \rangle$, which is constant for the $XXZ$ model. Therefore, for the remainder we will focus on the two site setting. \begin{figure}[b!] \subfloat[\label{xxz1}]{% \includegraphics[width=0.33\textwidth]{figures/part2/paper/fig5a.pdf} }% \subfloat[\label{xxz2}]{% \includegraphics[width=0.33\textwidth]{figures/part2/paper/fig5b.pdf} } \subfloat[\label{xxz3}]{% \includegraphics[width=0.33\textwidth]{figures/part2/paper/fig5c.pdf} } \caption{Discrete Wigner function for a pair of nearest neighbors spins for the $XXZ$ model~\eqref{eq6}. The three distinct behaviors correspond to the appropriate phase space points indicated in Table~\eqref{tabxxz}.} \label{fig_XXZ} \end{figure} \noindent For the $XXZ$ model we find that the two-site DWF calculated following~\eqref{eq4} exhibits three distinct behaviors shown in Figure~\eqref{fig_XXZ} and Table~\eqref{tabxxz} as a function of $\Delta$, and their corresponding first and second derivatives for nearest-neighboring sites. Let us first consider the behavior of the DWF at the corners of the discrete phase space i.e. (00,00), (00,11), (11,00) and (11,11) [cf. Figure~\eqref{xxz1}]. We see that the DWF is discontinuous at the first-order quantum phase transition $\Delta\!\!=\!\!-1$ while it reaches a minimum at the infinite-order quantum phase transition at $\Delta\!\!=\!\!1$, after which the DWF approaches zero with increasing anisotropy. This behavior is qualitatively identical to that of the entanglement measured via concurrence which in this case is simply $2 |\langle \sigma_i^x \sigma_j^x \rangle|$. The relationship is evident due to the fact that the DWF at these points depends on both $\langle \sigma_i^x \sigma_j^x \rangle$ and $\langle \sigma_i^z \sigma_j^z \rangle$. It is interesting that by direct calculation we confirm that the negativity of the DWF coincides with the presence of entanglement in the state, inline with a negative behavior of the continuous Wigner function implying genuine non-classicality of the state\cite{wfrabat, wfiran}. \noindent The second significant behavior is located at phase space points (00,01), (00,10), (11,01), and (11,10) shown in Figure~\eqref{xxz2} where, in contrast with the previous cases, signatures of the critical points are less evident immediately in the behavior of the DWF. For $\Delta\!\!<\!\!-1$ these functions are constant and exhibit a sudden change at the first-order quantum phase transition. On inspection we can see a point of inflection around $\Delta\!=\!1.5$. Looking at the first derivative of the DWF we see that it presents an amplitude bump at $\Delta=1.5$, and the second derivative is divergent at $\Delta\!=\!-1$ and around $\Delta\!=\!1$. The more peculiar behavior seen in this DWF is due to the destructive interference at these phase space points between the two terms that control the DWF which are $1+\langle \sigma_i^z \sigma_j^z \rangle$ and $-2\langle \sigma_i^x \sigma_j^x \rangle$, and the inflection point seen arises from a sudden change in the concavity of $-2\langle \sigma_i^x \sigma_j^x \rangle$. Thus, unlike in the $XY$ model where all DWFs readily witness the quantum phase transition, the DWF in these four points can only easily signal the first-order quantum phase transition exactly, while for the infinite-order quantum phase transition it shows only some anomalies around $\Delta\!\!=\!\!1$. However, we will revisit this behavior in the context of extremization procedures shortly. \noindent Finally we consider the remaining eight phase space points, Figure~\eqref{xxz3}. Here the DWF depends solely on a single term, $1-\langle \sigma_i^z \sigma_j^z \rangle$, and owing to the fact that spin-spin correlation functions are discontinuous at $\Delta\!\!=\!\!-1$ and that on their own they fail at revealing the infinite-order quantum phase transition at $\Delta\!=\!1$ the DWF at these points inherits these properties from the $\langle \sigma_i^z \sigma_j^z \rangle$ contribution which explains why the DWF is discontinuous and its derivatives are divergent at $\Delta\!=\!-1$, while it does not show any special behavior at the infinite-order quantum phase transition $\Delta\!=\!1$. \begin{figure}[t!] \subfloat[\label{extremization}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig6a.pdf} }% \subfloat[\label{maxmin}]{% \includegraphics[width=0.49\textwidth]{figures/part2/paper/fig6b.pdf} } \caption{(a) Extremization of the DWF following~\eqref{eqExtreme}. The topmost curve shows the maximization $W_M$ and the lower curve shows the minimization $W_m$. The inset shows the second derivative with respect to $\Delta$ of $W_M$. (b) The maximum and the minimum behavior of the GWF for the $XXZ$ model~\eqref{gwf_xxz}.} \label{fig3} \end{figure} \noindent Several correlation measures involve a minimization or maximization to be performed and often such correlation measures stand out as the preferred figures of merit for studying criticality~\cite{EPL2011, SarandyPRA2009, CampbellPRA2013, Werlang2010, CakmakPRB2014}. In this regard it is interesting to consider a similar extremization procedure for the DWF. Let $W_M$ and $W_m$ be the maximized and minimized DWF over the discrete phase space, respectively, given by \begin{equation} \begin{aligned} W_M&=\max(W_{00,00},W_{00,01},W_{01,00}),\\ W_m&=\min(W_{00,00},W_{00,01},W_{01,00}), \end{aligned} \label{eqExtreme} \end{equation} where we have chosen $W_{00,00}$, $W_{00,01}$, and $W_{01,00}$ to capture the three distinct behaviors exhibited in the discrete phase space. In Figure~\eqref{extremization} we see $W_M$ reveals a cusp exactly at the infinite-order quantum phase transition and thus its first (second) derivative is discontinuous (divergent) at the critical point, $\Delta\!=\!1$, as shown in the inset. This indicates that the DWF could be a good alternative to correlation measures that involve extremization procedures due to the comparative simplicity in its calculation and its easy physical interpretation following~\eqref{eq4}. Information about the entanglement in the two-qubit $XXZ$ model, can be extracted from the minimization of the DWF, $W_m$. On close inspection, we notice from Figure~\eqref{concurrence_xxz} and~\eqref{fig3}, that the concurrence is proportional to $|W_m|$. Looking at $\partial_\Delta^2 W_M$ of the DWF in the inset of Figure~\eqref{extremization} and the corresponding second derivatives of the distinct behaviors in discrete phase space shown in Figure~\eqref{xxz2}, where we have destructive interference between the terms that control the DWF (for example the point (00,01)), we find that both behave quite similarly. Therefore, it appears that to be able to detect \textit{reliably} the infinite-order quantum phase transition, one requires a figure of merit that includes all the spin-spin correlation functions of the quantum system. This is further evidenced by the fact that the other parts of the phase space, where only a single spin-spin correlation term is dominant, are less sensitive to this quantum phase transition. Figure~\eqref{concurrence_xxz} depicts the concurrence~. \begin{figure}[t!] \centering \includegraphics[scale=0.7]{figures/part2/paper/cnc_xxz.pdf} \caption{The concurrence in the two-qubit $XXZ$ model with respect to $\Delta$.} \label{concurrence_xxz} \end{figure} \noindent We finally consider the two site GWF \begin{align} \text{GWF}_{\rho_{ij}}&(\theta_i,\varphi_i,\theta_j,\varphi_j)\!=\!\frac{1}{4} \Big( 1+ 3 \cos{2\theta_i}\cos{2\theta_j} \langle \sigma^z_i\sigma^z_{j} \rangle + \nonumber\\ & 3\sin{2\theta_i}\sin{2\theta_j}\cos{2(\varphi_i-\varphi_j)} \langle \sigma^x_i\sigma^x_{j} \rangle \Big). \label{gwf_xxz} \end{align} Similarly with the $XY$ model, we are interested in a set of angles $(\theta_i,\varphi_i,\theta_j,\varphi_j)$ that yield the maximum ($\theta_i\!=\!\theta_j\!=\!\pi/2$ for $\Delta\!\leq\!1$ and $\theta_i\!=\!\theta_j\!=\!\pi/4$ for $\Delta\!>\!1$) and the minimum ($\theta_i\!=\!\theta_j\!=\!\pi/4$ for $\Delta\!\leq\!1$ and $\theta_i\!=\!\theta_j\!=\!\pi/2$ for $\Delta\!>\!1$) behavior of the GWF. One may notice that this procedure does not depend on the angles $(\varphi_i,\varphi_j)$, this is because they cancel out in~\eqref{gwf_xxz} when they are bounded by the same interval. Looking at Figure~\eqref{maxmin} we see that the maximum (minimum) behavior of the GWF of the $XXZ$ model is constant when $\Delta \!\!<\!\!-1$ and shows an inherited discontinuity from the spin-spin correlation functions, at the first-order quantum phase transition point $\Delta\!\!=\!\!-1$. Moreover, reaching the point of the infinite-order quantum phase transition $\Delta\!=\!+1$, the angles describing the maximum (minimum) behaviors of~\eqref{gwf_xxz} switch from $\pi/4$ to $\pi/2$ ($\pi/2$ to $\pi/4$) which manifests as a cusp, revealing the infinite-order quantum phase transition at $\Delta\!\!=\!\!1$ and thus by exploiting an extremization procedure we are able to faithfully spotlight the infinite-order quantum phase transition. \section{Summary} \noindent Throughout this chapter, we presented an alternative method to study quantum phase transitions from a phase space perspective using two approaches: the discrete Wigner function (DWF) and the generalized Wigner function (GWF). By establishing a connection between the phase space techniques and the thermodynamical quantities of a quantum spin-$\frac{1}{2}$ chain, we have shown the DWF and the GWF to be versatile tools in studying first, second, and infinite-order quantum phase transitions. Furthermore, we have shown that signatures of ground state factorization are only present in bipartite quantities. In addition, our approach may provide a promising tool for the experimental investigation of quantum phase transitions following the procedures proposed in References~\cite{expwf, expdwf2, GWF_entanglement_PRA}. Furthermore, through equations~\eqref{DWF_single_site},~\eqref{gwf_ss},~\eqref{eq4},~\eqref{gwf_ij},~\eqref{gwf_xxz}, and~\eqref{gwf_ijk} a given DWF/GWF is easily physically interpreted and can be generalized to higher dimensional systems which is a task proven to be difficult and complex for quantum correlations measures. Beyond characterizing phase transitions, our approach also provides insight into the behavior of various correlation measures and quantum coherence in such systems. While we have focused on equilibrium systems, we expect our approach to be useful in examining the dynamical properties of such critical systems~\cite{CampbellPRB2016, HeylReview, NJPSchachenmayer, PRASchachenmayer, PRBGasenzer, QST2019, PRXSchachenmayer}. \part{Quantum Thermodynamics meets Quantum Phase Transitions} \chapter{Thermodynamics of Information \label{chap6} } \section{Foundations of thermodynamics} Thermodynamics is a theory that aims to describe the behavior of heat and work in physical systems. Historically, understanding the forms of energy was limited to practical needs. In the late $18^{\text{th}}$ century, heat was recognized as a form of energy by Rutherford (also known as Thompson), when he analyzed the amount of heat generated via cannon barrels~\cite{rutherford}. The industrial revolution in the $19^{\text{th}}$ century ignited the development of the theory of thermodynamics, in order to design efficient steam engines. Sadi Carnot is considered the founding father of thermodynamics, as he noticed that the efficiency of steam engines can be optimized by understanding their energy balance between work and heat~\cite{carnot1978reflexions}. Carnot's results were generalized by E. Clapeyron~\cite{clapeyron1834memoire}, and after three decades R. Clausius constructed the mathematical framework of thermodynamics~\cite{clausius}. In principle, the theory of thermodynamics focuses on the transformation of systems from one state of \textit{equilibrium} to another, while satisfying five axioms called the laws of thermodynamics. \begin{enumerate} \item \textbf{Zeroth law;}\\ when two systems are each in thermal equilibrium with a third system, the first two systems are in thermal equilibrium with each other. This law allows us to use thermometers as the “third system” and to define a temperature scale. The Zeroth Law of thermodynamics defines a state of equilibrium of a system with respect to its environment, which can be described by an equation of state relating the experimentally accessible parameters of the system. For steam engines, the parameters are pressure $P$, temperature $T$, and volume $V$ which are related by \begin{equation} f(P,V,T)=0, \label{eq_state} \end{equation} where $f$ is a characteristic function. For an ideal gas, the formula~\eqref{eq_state} translates into the well known $PV=Nk_bT$, where $N$ is the number of particles, and $k_b$ is the Boltzmann constant. \item \textbf{First law;}\\ the change in the system's internal energy, $dE$, is equal to the difference between the heat, $\delta Q$, absorbed by the system from its environment, and the work, $\delta W$, done by the system to its environment. Mathematically, this statement can be written as \begin{equation} dE=\delta Q- \delta W. \end{equation} Here, $dE$ is an exact differential which means that it does not depend on the path taken in the thermodynamical manifold. In contrast, work $\delta W$ and heat $\delta Q$ are path dependent processes. \item \textbf{Second law;}\\ heat does not flow spontaneously from a colder bath to a hotter bath, or, equivalently, heat at a given temperature cannot be converted entirely into work. Through this law we define a new quantity called the entropy. For reversible processes it is given by \begin{equation} \Delta S:=\frac{\delta Q}{T}. \label{thermo_entropy} \end{equation} In general, the second law of thermodynamics expresses the fact that the entropy of the universe increases with time, \begin{equation} \Delta S_{\text{universe}} \geq 0. \end{equation} Equality holds for perfect (reversible) processes. \item \textbf{Third law;}\\ for classical systems, the entropy vanishes in the limit $T\to0$. That is \begin{equation} \lim_{T \to 0} \Delta S =0. \end{equation} The third law of thermodynamics is also called Nernst theorem, and its validity for quantum systems is still debated~\cite{oppenheim1, oppenheim2}. \end{enumerate} In addition to the traditional and well known laws of thermodynamics given above, there exists a ``Fourth law'' that describes situations away from equilibrium. Through this law, thermodynamics takes a step in complexity, in order to study realistic systems where their physical properties vary in space $\vec{x}$, and time $t$. In this case, the dynamics can be approximated by assuming that the system is described by a state of microscopic local equilibrium in any point in space and time, while the thermodynamic variables, such as the temperature $T(\vec{x},t)$, the local density $n(\vec{x},t)$, and the local energy density $e(\vec{x},t)$, vary weakly on a macroscopic scale. In this case, the rate of change of the dynamical local entropy $s(\vec{x},t)$ is given by \begin{equation} \frac{ds}{dt}=\sum_k \frac{\partial s}{\partial X_k} \frac{dX_k}{dt}. \end{equation} where $\{X_k\}_k$ is a set of extensive parameters that vary with time. Hence, we can define the thermodynamic fluxes as the time-derivative of these $\{X_k\}_k$, \begin{equation} J_k :=\frac{dX_k}{dt}. \end{equation} Therefore, we have \begin{equation} \frac{ds}{dt}=\sum_k F_k J_k, \label{dsdt} \end{equation} where $F_k=\frac{\partial s}{\partial X_k}$ represent thermodynamic forces, or affinities. When the system is in a local equilibrium, $F_k$ is small. Therefore, we can expand $J_k$ to leading order in $F_k$, and we can write \begin{equation} J_k=\sum_j L_{j,k} F_j, \label{Jk} \end{equation} where the kinetic coefficients $L_{j,k}$ are given by \begin{equation} L_{j,k}:=\frac{\partial J_k}{\partial F_j}\bigg|_{F_j =0}, \end{equation} with $F_j=0$ at equilibrium. The fourth law of thermodynamics states that the matrix of kinetic coefficient $L$ is symmetric, i.e. \begin{equation} L_{j,k}=L_{k,j}. \label{Ljk} \end{equation} Equation~\eqref{Ljk} is also known as the Onsager theorem~\cite{onsager_thermo}, and is equivalent to Newton's third law. This seems natural when identifying equation~\eqref{Jk} with Newton's second law. \noindent Thermodynamics has been very successful in describing the average macroscopic behavior of classical systems, which impacted several branches of science from physics (heat engines and black holes), chemistry (chemical compounds and chemical reactions) to biological systems. However, despite this success and universality the theory of thermodynamics is plagued with three major challenges: (i) thermodynamics does not provide a microscopic analysis of physical systems, (ii) the theory is limited to equilibrium states, and only infinitely-slow, quasi-static processes are fully describable; and (iii) the original formulation of thermodynamics is not suitable for quantum systems. \section{Stochastic thermodynamics} The above shortcomings of thermodynamics can be resolved by making use of stochastic thermodynamics, where work and heat are treated as stochastic random variables following probability densities~\cite{strasberg_2021}. The fruit of this approach is the invention of various fluctuation theorems, which connect the non-equilibrium properties of a system to its equilibrium counterpart. The most general form of a fluctuation theorem is given by \begin{equation} \frac{\mathcal{P}(\Sigma=-A)}{\mathcal{P}(\Sigma=A)} = \exp{(A)}, \label{general_fluctuation} \end{equation} which relates the probability to find a negative entropy production $\Sigma$, with the probability to find a positive value. Applying Jensen's inequality, $\exp{(-\langle x \rangle)}\geq \langle \exp{(-x)}\rangle $, to the fluctuation theorem~\eqref{general_fluctuation} gives \begin{equation} \langle \Sigma \rangle \geq 0, \end{equation} which can be interpreted as an extension of the second law of thermodynamics to the case of out-of-equilibrium systems. In the following we discuss how probability distributions are defined for work, and we derive two important fluctuation relations, called the Tasaki-Crooks relation, and the Jarzynski equality. \noindent Consider a quantum system governed by a time-dependent Hamiltonian $H(\lambda(t))$, where $\lambda(t)$ is an external \textit{work} parameter, used to drive the system out-of-equilibrium. We initialize the system in a thermal state by allowing it to equilibrate with a thermal reservoir at inverse temperature $\beta$, for a fixed value of the work parameter $\lambda(t<t_i)=\lambda_i$. Hence, the initial state is a Gibbs state, given by \begin{equation} \rho_i(\lambda,\beta)=\frac{e^{-\beta H(\lambda_i)}}{\mathcal{Z}(\lambda_i,\beta)}, \label{gibbs} \end{equation} here, $\mathcal{Z}(\lambda_i,\beta)$ is the partition function. At $t=t_i$ the system is decoupled from the thermal reservoir, and a reversible protocol is applied on the system, by changing the work parameter from $\lambda_i$ to $\lambda_f$ at $t=t_f$. The initial and final Hamiltonian are defined by their respective spectral decompositions \begin{align} H(\lambda_i)&=\sum_n E_n(\lambda_i) \ket{\psi_n}\bra{\psi_n},\\ H(\lambda_f)&=\sum_m E_m(\lambda_f) \ket{\phi_m}\bra{\phi_m}, \end{align} where $\ket{\psi_n}$ $(\ket{\phi_m})$ denotes the $n$th ($m$th) eigenstate of the initial (final) Hamiltonian, with the corresponding eigenvalue $E_n(\lambda_i)$ $(E_m(\lambda_f))$. The initial and finale Hamiltonian are connected by the unitary time evolution operator $U(t_f,t_i)$, which takes the following form \begin{equation} U(t_f,t_i)=\boldsymbol{T}_{\rightarrow}\exp{\left[ -i \int_{t_i}^{t_f} H(\lambda(t^{\prime}))dt^{\prime} \right]}, \label{evolve} \end{equation} where $\boldsymbol{T}_{\rightarrow}$ denotes the time ordering operator. \noindent The work performed on the system is determined by two projective energy measurements. The outcome of the first measurement, where the system is initialized in the Gibbs state~\eqref{gibbs}, is the energy $E_n(\lambda_i)$ with the probability \begin{equation} p(n)=\frac{e^{-\beta E_n(\lambda_i)}}{\mathcal{Z}(\lambda_i)}. \end{equation} Then, the system evolves under the evolution operator~\eqref{evolve}, until a second measurement is performed at time $t_f$. It produces the energy outcome $E_m(\lambda_f)$, with the probability \begin{equation} p(m|n)= | \bra{\phi_m} U(t_f,t_i) \ket{\psi_n} |^2. \end{equation} Hence, the joint probability of obtaining the outcome $E_n(\lambda_i)$ followed by $E_m(\lambda_f)$ in the final measurement is \begin{equation} p(n,m)=p(n)p(n|m)=\frac{e^{-\beta E_n(\lambda_i)}}{\mathcal{Z}(\lambda_i)} | \bra{\phi_m} U(t_f,t_i) \ket{\psi_n} |^2. \end{equation} Therefore, the quantum work probability distribution is defined as \begin{equation} P(W)=\sum_{n,m} p(n,m)\delta \left( W-[E_m(\lambda_f)-E_n(\lambda_i)] \right), \label{wpd} \end{equation} where $\delta(.)$ is the Dirac delta function. The distribution~\eqref{wpd} is constructed via discrete values of the work $(E_m(\lambda_f)-E_n(\lambda_i))$, weighted by the probability $p(n,m)$. As a consequence, the quantum work distribution represents fluctuations due to thermal statistics in the first measurement, and fluctuations from quantum measurement statistics in the second measurement. \noindent The Tasaki-Crooks fluctuation theorem~\cite{tasaki} follows from the work probability distribution~\eqref{wpd}. It is written as \begin{equation} \frac{P(+W)}{P(-W)}=e^{\beta(W-\Delta F)}. \label{tasaki} \end{equation} Here, $P(+W)$ denotes the work probability distribution of the forward process~\eqref{wpd}, whereas $P(-W)$ represents the distribution of the backward process, in which the system is initialized in the Gibbs state of the final Hamiltonian $H(\lambda_f)$ at $t=0$. The time evolution in this case is dictated by the time reverse protocol $\Theta U(t_f,t_i) \Theta^{\dagger}$, where $\Theta$ is the anti-unitary time reversal operator. The Tasaki-Crooks fluctuation theorem~\eqref{tasaki} shows that for a closed system under non-equilibrium driving, the fluctuation in work are related to the equilibrium free energy difference between the equilibrium states $\rho_i(\lambda_i)$ and $\rho_f(\lambda_f)$, \begin{equation} \Delta F=\frac{1}{\beta} \log\left(\frac{\mathcal{Z}_{\beta}(\lambda_i)}{\mathcal{Z}_{\beta}(\lambda_f)}\right). \end{equation} The second prominent fluctuation theorem is Jarzynski equality~\cite{Jarzynski1, Jarzynski2}, which can be derived by integrating the Tasaki-Crooks fluctuation theorem, \begin{equation} \int P(+W)e^{-\beta W} dW=\langle e^{-\beta W} \rangle= e^{-\beta \Delta F}. \label{Jarzynski} \end{equation} The Jarzynski equality~\eqref{Jarzynski} implies that information about $\Delta F$ can be extracted by measuring the exponential of the work $W$. We note here that the Tasaki-Crooks fluctuation theorem~\eqref{tasaki} is only valid to Markovian process, while the Jarzynski equality~\eqref{Jarzynski} holds also for non-Markovian settings. \noindent A straightforward application of Jensen's inequality on the Jarzynski equality gives $\langle W \rangle =\Delta F$, from which we can define the dissipated work \begin{equation} \langle W \rangle_{\text{irr}}=\langle W \rangle -\Delta F, \end{equation} which quantifies the irreversible nature of non-equilibrium processes, and is always positive $\langle W \rangle_{\text{irr}} \geq 0$ due to the Jarzynski equality~\eqref{Jarzynski}. \noindent The irreversible entropy change $\langle \Sigma \rangle$ corresponding to the irreversible work $\langle W \rangle_{\text{irr}}$ follows from the Tasaki-Crooks fluctuation theorem~\eqref{tasaki}, by taking the logarithm of both sides and integrating over the forward distribution $P(+W)$, \begin{equation} \langle \Sigma \rangle=\beta(W-\Delta F)=K\left( P(+W) || P(-W) \right), \end{equation} where $K(.||.)$ is the classical Kullback-Leibler divergence, which is a statistical distance measuring how the distribution $P(+W)$ is different from $P(-W)$. For a quantum system, the irreversible entropy change is determined by the quantum relative entropy, \begin{equation} \langle \Sigma \rangle=D(\sigma||\rho(\lambda_f,\beta)). \end{equation} Here, $\sigma=U(t_f,t_i) \rho(\lambda_i,\beta) U^{\dagger}(t_f,t_i)$ is the out-of-equilibrium state at the end of the protocol. \section{Quantum work, heat and entropy production} The original formulation of thermodynamics and the fluctuation theorems can be used alongside quantum theory in order to extend the notion of work, heat and entropy production to quantum systems~\cite{booksteve, thermo_quantum_regime}. In particular, we discuss the case when the quantum system follows a quasi-static process, and the situation of weak (strong) coupling to the environment, where the quantum system is described by Gibbs (non-Gibbsian) equilibrium states. \begin{enumerate} \item \textbf{Quasi-static process.}\\ Consider a quantum system $\Omega$ described by the Hamiltonian $H(\lambda)$, where $\lambda$ is the control parameter e.g. the magnetic field or the volume of a piston. For an infinitely slow quasi-static process, the quantum system $\Omega$ is always in thermal equilibrium with the environment. The dynamics of the system $\Omega$ is dictated by the Liouville equation $\dot{\rho}=L_{\lambda}(\rho)$, where $L_{\lambda}$ is a superoperator reflecting two contributions to the dynamics. The first is the unitary dynamics due to $H$, and the second is the non-unitary part generated by the interaction with the environment. \item \textbf{Gibbs equilibrium states.}\\ The Gibbs state describes systems interacting very weakly with their environment, it is written as \begin{align} \rho^{\text{eq}}=\frac{e^{-\beta H}}{\mathcal{Z}}, &&& \text{where} && \mathcal{Z}=\Tr(e^{-\beta H}), \end{align} and $\beta$ is the inverse temperature of the environment. Therefore, the internal energy is determined via the expectation value of $H$ in the Gibbs state $\rho^{\text{eq}}$, that is $E=\Tr(\rho^{\text{eq}} H)$, whereas the free energy is $F=\frac{1}{\beta}\log(\mathcal{Z})$, so that the thermodynamic entropy is given by \begin{equation} S=\beta(E-F)=-\Tr\left(\rho^{\text{eq}} \log_2\rho^{\text{eq}}\right). \label{thermo_entropy} \end{equation} The rate of change of the entropy~\eqref{thermo_entropy} in the case of isothermal quasi-static processes is \begin{equation} dS=\beta \left[ \Tr\left(d\rho^{\text{eq}} H\right)+ (\Tr\left( \rho^{\text{eq}} dH \right) -\Delta F) \right]=\beta \Tr\left(d\rho^{\text{eq}} H\right). \end{equation} Similarly, the rate of change of the internal energy is given by \begin{equation} dE= \underbrace{\Tr\left(d\rho^{\text{eq}} H\right)}_{\delta Q=\frac{dS}{\beta}} + \underbrace{\Tr\left(\rho^{\text{eq}} dH \right)}_{\delta W=dF}. \end{equation} The identification is consistent with the first and second law of thermodynamics. It reflects the fact that heat, $Q$, is the change of internal energy due to the variation of the entropy, while the work, $W$, is the change of the internal energy resulting from the change of the Hamiltonian of the system via external parameters. \item \textbf{Non-Gibbsian equilibrium states.}\\ Realistically, the interaction energy between a quantum system and its environment is not negligible, as a consequence of the strong correlations between them. Therefore, thermodynamics needs to be reformulated in order to take into account the energy cost of the system-environment interaction. In this case the thermodynamic entropy can be written as \begin{align} \mathcal{S}&=-\Tr\left( \rho^{\text{ss}}\log_2 \rho^{\text{ss}} \right) + \left[ \Tr \left(\rho^{\text{ss}}\log_2 \rho^{\text{ss}}\right) - \Tr \left(\rho^{\text{ss}}\log_2 \rho^{\text{eq}}\right) \right],\nonumber \\ &=\beta \left[ E-\left( F+TS( \rho^{\text{ss}} || \rho^{\text{eq}} ) \right)\right] = \beta \left[ E-\mathcal{F} \right]. \end{align} Here, $\rho^{\text{ss}}$ is the non-Gibbsian equilibrium state, and $E=\Tr(\rho^{\text{ss}}H)$ is the internal energy of the system. $\mathcal{F}=F+TS( \rho^{\text{ss}} || \rho^{\text{eq}} )$ is the information free energy, while $S(.||.)$ denotes the quantum relative entropy. In the same fashion with Gibbs equilibrium states, we write the change of the entropy for quasi-static processes as \begin{align} d\mathcal{S}&=\beta \left[ \Tr \left( d\rho^{\text{ss}} H \right) + \Tr \left( \rho^{\text{ss}} dH \right) -d\mathcal{F}\right], \nonumber \\ &=\beta \left( \delta Q_{\text{tot}}-\delta Q_c \right), \end{align} where $\delta Q_{\text{tot}}=\Tr \left( d\rho^{\text{ss}} H \right)$ is the total heat, and $\delta Q_c=d\mathcal{F}-\Tr \left( \rho^{\text{ss}} dH \right)$ represents the energy cost to maintain coherence and quantum correlations. We can also associate an entropic cost through the excess heat $\delta Q_{\text{ex}}=d\mathcal{S}/\beta$. Hence the first law of thermodynamics is written as \begin{equation} dE=\delta W_{\text{ex}}+\delta Q_{\text{ex}}, \end{equation} where $\delta W_{\text{ex}}=\delta W +\delta Q_c$ is the excess work. \end{enumerate} Next, we move to the concept of quantum entropy production. We consider a system $\Omega$ initialized in a thermal equilibrium state (which is not necessarily a Gibbs state) with the temperature of the environment, and can be driven by an external parameter $\lambda$. The change of the internal energy $\Delta E$ and thermodynamic entropy $\Delta \mathcal{S}$ are given, respectively, by \begin{align} \Delta E=W+Q, && \Delta \mathcal{S}=\beta Q + \Sigma, \end{align} where $\Sigma$ is the entropy production and $Q$ is the amount of heat exchanged with the environment at inverse temperature $\beta$. Therefore, the entropy production is written as, \begin{equation} \Sigma=\Delta \mathcal{S}-\beta( \Delta E - W). \label{entropy_prod} \end{equation} The internal energy can be expressed in terms of the equilibrium state $\rho^{\text{eq}}$, \begin{equation} \beta E=\beta \Tr \left( \rho^{\text{ss}} H \right) =-\Tr \left( \rho^{\text{ss}} \log_2 \rho^{\text{eq}} \right) + \log \mathcal{Z}. \label{bE} \end{equation} Therefore, for a protocol driving the system through $\lambda$ from $\lambda_i$ to $\lambda_f$, we have \begin{align} \beta W &=\beta \int_{\lambda_i}^{\lambda_f} \Tr \left( \rho^{\text{ss}}(\lambda) \partial_{\lambda} H(\lambda)\right) d\lambda, \nonumber \\ &=-\int_{\lambda_i}^{\lambda_f} \left[ \Tr \left( \rho^{\text{ss}}(\lambda) \partial_{\lambda} \log_2 \rho^{\text{eq}}(\lambda)\right) -\log_2 Z_f +\log_2 Z_i \right]d\lambda. \label{bW} \end{align} Injecting equation~\eqref{bE} and~\eqref{bW} in~\eqref{entropy_prod} yields \begin{equation} \Sigma=S(\rho^{\text{ss}}(\lambda_i)||\rho^{\text{eq}}(\lambda_i))-S(\rho^{\text{ss}}(\lambda_f)||\rho^{\text{eq}}(\lambda_f))-\int_{\lambda_i}^{\lambda_f} \Tr \left( \rho^{\text{ss}}(\lambda) \partial_{\lambda} \log_2 \rho^{\text{eq}}(\lambda)\right) d\lambda, \label{entropy_prod_non_equ} \end{equation} which represents the entropy production along a non-equilibrium path in the thermodynamic manifold. \section{Resource theory for thermodynamics} Resource theories allow us to quantify and manage resources using an information-theoretic framework. The basic procedure to construct a resource theory is by defining (i) free operations, (ii) free states, and (iii) the set of allowed state transformations~\cite{gilad2019}. The most prominent example of a resource theory comes from the field of quantum information, where a resource is identified with the entanglement between two quantum states~\cite{rev_entanglement}. In this case, the free operations are the well known ``Local Operations and Classical Communication (LOCC)'', and the free states are the separable states. Whereas the set of allowed state transformations are defined under the entanglement monotones. Another example is the resource theory of coherence, where incoherent operations constitute the free operations, and the free states are any diagonal density matrix $\rho$ in the coherence basis $\ket{i}$. Whereas the coherence monotones, e.g. relative entropy of coherence, sets the state conversion conditions~\cite{coherence_review}. The resource theory for thermodynamics is developed in order to study thermal interactions. The free operations are energy-preserving unitary operators, while the free states are equilibrium states, i.e. Gibbs states or catalysts. In the same fashion with entanglement and coherence, the state conversion conditions are set by a monotone function, which in the case of thermodynamics can be the free energy~\cite{gooldreview}. The advent of the resource theory for thermodynamics inspired the interpretation of information-theoretic results in the context of the thermodynamics of quantum systems. \noindent The thermodynamic resource theory can be built through different models, which differ in the set of allowed operations. These can only be (i) contact with a thermal bath, and (ii) reversible operations that preserve a thermodynamic quantity. In the following we list some incarnations of these two kinds of operations. \begin{enumerate} \item \textbf{Noisy operations.}\\ Noisy operations are the simplest resource theory, in which the Hamiltonians are considered fully degenerate. Therefore, the free states are described by maximally mixed states of arbitrary dimensions. Whereas the free operations are the partial trace and all the unitary transformations. Noisy operations model the transition $\rho_S \rightarrow \rho^{\prime}_S$, if and only if there exist a $d_R -$dimensional ancillary system $R$ satisfying \begin{equation} \rho^{\prime}_{S}:=\mathcal{E}_{\text{Noisy}}(\rho_S):=\Tr_R \left( U_{SR} \left[ \rho_S \otimes \frac{\mathbb{I_R}}{d_R} \right] U^{\dagger}_{SR} \right), \label{NO} \end{equation} where $U_{SR}$ is a unitary matrix and $\mathcal{E}_{\text{Noisy}}$ is chosen such that it preserves the maximally mixed state $\rho_S =\frac{\mathbb{I}_S}{d_S}$, i.e. unital map. Noisy operations aim at describing the information content carried in systems, instead of energy. This information aspect paved the way to use noisy operations in exorcizing the Maxwell demon problem. State transformation follows the Shur monotone functions, which make use of majorization in order to determine the degree of mixture of the state~\cite{gour2015}. Information-theoretical entropy measures, i.e. von Neumann entropy, are examples of the Shur monotone functions. \item \textbf{Thermal operations.}\\ We take a step further in complexity by allowing systems with non-degenerate Hamiltonian $H$, which implies that the distribution of energy levels is non-trivial. Hence, at fixed average energy, the state with maximum entropy (maximally mixed state) corresponds to the thermal Gibbs state given by \begin{equation} \rho^{\beta}=\frac{e^{-\beta H}}{\mathcal{Z}}. \label{gibbs_state} \end{equation} Gibbs states~\eqref{gibbs_state} have unique features that justify their use as free states. In particular, they are completely passive which means that one cannot increase the mean energy contained in them by unitary operations. Additionally, Gibbs states do not allow arbitrary energy transitions during the transformation $\rho \rightarrow \sigma$, which implies that Gibbs states cannot be used to extract work. Thermal operations (TO) are defined as \begin{equation} \mathcal{E}_{TO}(\rho_S)=\Tr_R \left[ U_{SR} \left( \rho_S \otimes \rho^{\beta}_R \right) U^{\dagger}_{SR} \right]. \label{TO} \end{equation} Here, $U_{SR}$ is a unitary operator reflecting the energy-preserving unitary dynamics across the system $S$ and bath $R$. The energy conservation implies that $U_{SR}$ commutes with the total Hamiltonian $H_{SR}=H_S\otimes \mathbb{I}_R + \mathbb{I}_S \otimes H_R$. In the limit $H_S=\mathbb{I}_S$ and $H_R=\mathbb{I}_R$, the thermal operations~\eqref{TO} reduce to the noisy operations~\eqref{NO}. The monotones for state transformations are different forms of the free energy. \item \textbf{Gibbs-preserving maps.}\\ Gibbs-preserving maps (GPs) constitute a general model for thermal interactions, in which the set of free operations is the set of all quantum maps that preserve the Gibbs state at inverse temperature $\beta$: \begin{equation} \mathcal{E}_{GP}\left( \rho_S^{\beta} \right)=\rho_S^{\beta}. \end{equation} For general quantum states, the Gibbs-preserving maps are less restrictive than thermal operations, and may allow for transformations that are not possible using thermal operations, such as creating coherence in the final state of an initial energy-incoherent state. This can be seen by considering a qubit system described by the Hamiltonian $H=e\ket{1}\bra{1}$. The transformation $\ket{1}\rightarrow \ket{+}=\frac{1}{\sqrt{2}}\left( \ket{0}+\ket{1} \right)$ is not possible via thermal operations, because they cannot create coherence; while there exist Gibbs-preserving maps that can achieve this task. \end{enumerate} The difference between thermal operations and Gibbs-preserving maps motivated the study of the role of coherence in state transformation. In order to perform the transformation $\ket{1}\rightarrow \ket{+}=\frac{1}{\sqrt{2}}\left( \ket{0}+\ket{1} \right)$, we need to extract coherence of a reservoir, e.g. doubly infinite harmonic oscillator $H=\sum_{n=-\infty}^{\infty} n\Delta \ket{n}\bra{n}$ in a coherent state $\ket{\Psi}=\frac{1}{N} \sum_{n=a}^{a+N} \ket{n}$. In practice, an example of such a reservoir is the laser which can be used in order to apply transformations on quantum systems, e.g. ion traps. Coherence reservoirs can be implemented multiple times in order to perform state transformations, which is due to the catalyst nature of coherence. In fact, after each use of the coherence reservoir its state spreads out, but its ability to implement operations stays invariant. In general, catalysts in thermodynamics can be used to overcome the limits imposed to transform states via thermal operations~\cite{catalytic_coherence}. \noindent The resource theory of thermodynamics sets energetic limitations on the manipulation of quantum systems, while the resource theories in quantum information introduce bounds for the creation and control of quantum features, i.e. entanglement and quantum coherence. Since thermodynamics and information are intimately connected, we ask whether a thermodynamics price exists for establishing quantum correlations? In the following, we briefly report some prominent results. \noindent In the case of a two-qubit system, the minimal cost of creating entanglement was found to be \begin{equation} C(E)=\sqrt{\frac{\Delta E}{E} \left( 2-\frac{\Delta E}{E} \right)}, \label{c(e)} \end{equation} where $C(.)$ is the concurrence, and $E$ is the energy gap. Equation~\eqref{c(e)} sets the cost for creating entanglement between two qubits, from thermal states~\cite{Huber_2015}. Moreover, for an arbitrary composite system $AB$ it has been shown that the work cost $W_{\text{cost}}$ for creating correlations between $A$ and $B$ is proportional to the mutual information $\mathcal{I}(A:B)$, and the temperature of the system, \begin{equation} W_{\text{cost}}\geq k_bT\mathcal{I}(A:B), \end{equation} which defines the work cost for creating correlations~\cite{huber_2015_2}. The quantum advantage in terms of work extraction has been studied. It has been shown that two entangled qubits can store twice the amount of information that can be stored via separable (classical) states. However, for very large system sizes, $N$, the difference between the separably encoded work from correlations $W_{\text{sep}}$, and the maximally possible work in correlations $W_{\text{max}}$ scales as, \begin{equation} \frac{W_{\text{sep}}}{W_{\text{max}}}=1-\mathcal{O}(N^{-1}). \end{equation} Hence, the quantum advantage does not hold in the thermodynamic limit $N\to \infty$~\cite{Huber_2015_3}. \noindent Thermodynamics can be used to reveal the quantumness of a system. In fact it is argued that the energy of the system can be used as an entanglement witness for zero, and non-zero temperature settings~\cite{Vedral_2004}. This is motivated by the observation that a low average energy implies that the density matrix is close to the entangled ground state. Therefore, as this distance becomes small, the witness becomes more efficient in validating the entanglement of the state. On the other hand, it has been established that macroscopic thermodynamic functions, i.e. entropy~\cite{entropy_2015} and magnetic susceptibility~\cite{Wie_niak_2005}, can be used to reveal the entanglement of the system. \section{Thermodynamics of computation} Shannon's definition of information, as being a measure of our freedom of choice, remains abstract and does not reflect the physical essence of information. Since information can be encoded in physical systems, it is natural to think of it as a physical quantity. This is confirmed through the Landauer principle, which sets an energetic cost for information processing~\cite{landauer1961}. In particular, Landauer's principle sets a constraint-free minimum cost to erase information. The most famous consequences of Landauer's limit are the exorcism of Maxwell’s Demon~\cite{bennett2003notes}, and the development of fully reversible models of computation~\cite{Bennett1982TheTO}. \subsection{Landauer's principle} Rolf Landauer proposed the principle in 1961, while working on the problem of thermodynamical limitations on information processing. The derivation of the limit follows from evaluating the change of entropy after erasure of information. Consider a two-state system $\mathfrak{S}$ containing 1 bit of information, the initial Shannon entropy $H(p)=-\sum_i p_i \log_2 p_i=\log_2 2=1$. Whereas the final entropy after erasure is zero. Suppose the system $\mathfrak{S}$ is in equilibrium, at temperature $T$, with an environment $\mathcal{E}$ in the form of a thermal bath. The second law of thermodynamics states that the total change of entropy of $\mathfrak{S}+\mathcal{E}$ is positive, i.e. \begin{equation} \Delta S_{\text{tot}}=\Delta S_{\mathfrak{S}}+\Delta S_{\mathcal{E}} \geq 0, \end{equation} where $\Delta S= S_f - S_i$ denotes the changes of the entropy. Therefore, using Clausius inequality we can write the amount of heat dissipated to the environment (we assume a large thermal bath, so that thermal equilibrium always holds) as, \begin{equation} Q_{\mathcal{E}} \geq -T\Delta S_{\mathfrak{S}}. \end{equation} Since the thermodynamic entropy $S$ is linked to Shannon's entropy $H(p)$ by $S=k_bH(p)$, whereas the change of entropy between the pre-erasure and after-erasure states is $\Delta H=-\log_2 2$. Hence, the heat dissipated in the environment is bounded by \begin{equation} Q_{\mathcal{E}} \geq k_bT\Delta H = k_b T \log_2 2. \label{landauer} \end{equation} Landauer's principle~\eqref{landauer} implies that erasing one bit of information increases the entropy of the environment by \textit{at least} $k_b\log_2 2$. Through this principle, modern computers can be seen as engines consuming free energy to produce heat and mathematical work. Modern computers still operate above the Landauer limit by many degrees of magnitude, however it is predicted by Koomey's law that the limit will be reached around 2050. \noindent The paradox of Maxwell's demon was solved by Charles Bennett using insights from Landauer's principle~\cite{bennett2003notes}. Maxwell's demon is an intelligent agent in a thought experiment conceptualized by Maxwell, where the demon monitors an ideal gas in a container. The demon inserts a partition, in the middle of the container, with a controllable door which he uses in order to sort the fast particles on one side and the slow particles on the other side of the container. As a consequence, the entropy of the gas decreases, which violates the second law of thermodynamics. In contrast, Bennett showed that the demon will run out of information storage space and must begin to erase the information it has previously gathered, which is a process that increases the entropy of the system and restores the second law of thermodynamics. \subsection{Quantum Landauer's principle} Landauer's limit~\eqref{landauer} can be extended to quantum systems, via Reeb and Wolf formulation~\cite{Reeb_2014}. Consider a system $\mathfrak{S}$ in contact with an environment $\mathcal{E}$, the set of minimal assumptions that validate the Landauer's principle are \begin{enumerate} \item $\mathfrak{S}$ and $\mathcal{E}$ are quantum systems living, respectively, in Hilbert space $\mathcal{H}_{\mathfrak{S}}$ and $\mathcal{H}_{\mathcal{E}}$. \item The initial state is uncorrelated, i.e. $\rho_{\mathfrak{S}\mathcal{E}}=\rho_{\mathfrak{S}} \otimes \rho_{\mathcal{E}}$. \item The environment is modeled by a thermal Gibbs state, i.e. $\rho_{\mathcal{E}}=\exp{\left(-\beta H_{\mathcal{E}}\right)}/\mathcal{Z_E}$, with $\mathcal{Z_E}$ being the partition function. \item The system-environment interaction is described by a unitary transformation $U(t)=\exp{\left( -iH_{\text{tot}}t/\hbar\right)}$, where $H_{\text{tot}}$ is the total Hamiltonian, $H_{\text{tot}}=H_{\mathfrak{S}} + H_{\mathcal{E}} + H_{\mathfrak{S}\mathcal{E}}$. \end{enumerate} Similarly with the original formulation of the Landauer principle~\eqref{landauer}, we write the change of the entropy for the system (environment) as the difference between the initial and final entropies: \begin{equation} \Delta S_{\mathfrak{S}(\mathcal{E})}=S\left( \rho^0_{\mathfrak{S}(\mathcal{E})} \right)-S\left( \rho^t_{\mathfrak{S}(\mathcal{E})} \right). \end{equation} According to the second law of thermodynamics, the entropy production of the process must be positive. Therefore, we have \begin{align} -\Delta S_{\mathfrak{S}}-\Delta S_{\mathcal{E}}&=S(\rho^t_{\mathfrak{S}})-S(\rho^0_{\mathfrak{S}})+S(\rho^t_{\mathcal{E}})-S(\rho^0_{\mathcal{E}}),\nonumber \\ &=S(\rho^t_{\mathfrak{S}})+S(\rho^t_{\mathcal{E}})-S(\rho^0_{\mathfrak{S}} \otimes \rho^0_{\mathcal{E}}),\nonumber \\ &=S(\rho^t_{\mathfrak{S}})+S(\rho^t_{\mathcal{E}})-S(\rho^t_{\mathfrak{S}\mathcal{E}}),\nonumber \\ &=I(\rho^t_{\mathfrak{S}\mathcal{E}})\geq 0. \label{eq6.45} \end{align} Here, $I(\rho^t_{\mathfrak{S}\mathcal{E}})$ is the mutual information between the system and environment. Equation~\eqref{eq6.45} can be seen as a version of the second law of thermodynamics, due to the non-negativity of the mutual information. The Landauer limit follows by developing~\eqref{eq6.45} as \begin{align} I(\rho^t_{\mathfrak{S}\mathcal{E}})&+\Delta S_{\mathfrak{S}}=-\Delta S_{\mathcal{E}}, \nonumber\\ &=-\Tr \left(\rho^t_{\mathcal{E}} \log_2 \rho^t_{\mathcal{E}} \right) + \Tr \left( \rho^0_{\mathcal{E}} \log_2 \left[ \frac{e^{-\beta H_{\mathcal{E}}}}{\Tr e^{-\beta H_{\mathcal{E}}} } \right] \right), \nonumber \\ &=-\Tr \left(\rho^t_{\mathcal{E}} \log_2 \rho^t_{\mathcal{E}} \right)-\beta \Tr H_{\mathcal{E}}\rho^0_{\mathcal{E}} - \log_2 \left( \Tr e^{-\beta H_{\mathcal{E}}} \right) +\beta \Tr \left( H_{\mathcal{E}}\rho^t_{\mathcal{E}} \right) -\beta \Tr \left( H_{\mathcal{E}}\rho^t_{\mathcal{E}} \right), \nonumber \\ &=\beta \Tr \left( H_{\mathcal{E}} (\rho^t_{\mathcal{E}}-\rho^0_{\mathcal{E}})\right)-\Tr \left( \rho^t_{\mathcal{E}} \log_2 \rho^t_{\mathcal{E}} \right) + \Tr \left( \rho^t_{\mathcal{E}} \log_2 \rho^0_{\mathcal{E}} \right), \nonumber \\ &=\beta \langle Q_{\mathcal{E}} \rangle -S(\rho^t_{\mathcal{E}}||\rho^0_{\mathcal{E}}). \end{align} In the end we have \begin{equation} \beta \langle Q_{\mathcal{E}} \rangle= \Delta S_{\mathfrak{S}} + I(\rho^t_{\mathfrak{S}\mathcal{E}})+S(\rho^t_{\mathcal{E}}||\rho^0_{\mathcal{E}}), \end{equation} which represent the equality version of the non-equilibrium Landauer limit. Since the relative entropy $S(.||.)$ and the mutual information $I(.)$ are non-negative quantities, we have \begin{equation} \beta \langle Q_{\mathcal{E}} \rangle \geq \Delta S_{\mathfrak{S}}, \end{equation} which represents the quantum Landauer limit for non-equilibrium settings~\cite{Reeb_2014}. \chapter{Work Statistics \& Symmetry Breaking in an Excited State Quantum Phase Transition \label{chap7} } We examine how the presence of an excited state quantum phase transition (ESQPT) manifests in the dynamics of a many-body system subject to a sudden quench. Focusing on the Lipkin-Meshkov-Glick model initialized in the ground state of the ferromagnetic phase, we demonstrate that the work probability distribution displays non-Gaussian behavior for quenches in the vicinity of the excited state critical point. Furthermore, we show that the entropy of the diagonal ensemble is highly susceptible to critical regions, making it a robust and practical indicator of the associated spectral characteristics. We assess the role that symmetry breaking has on the ensuing dynamics, highlighting that its effect is only present for quenches beyond the critical point. Finally, we show that similar features persist when the system is initialized in an excited state and briefly explore the behavior for initial states in the paramagnetic phase~\cite{mzaouali2021}. \section{The LMG model} The Lipkin-Meshkov-Glick (LMG) model~\cite{lmg1965} describes a set of $N$ spin-$\tfrac{1}{2}$'s with infinite range interaction subject to a transverse field~\cite{prl_vidal, pre_vidal, prb_vidal, prb_castanos, quan_pra, CampbellPRB}. The fully anisotropic Hamiltonian can be written in terms of the Pauli matrices $\sigma^i_{x,z}$ acting on site $i$ as \begin{equation} \mathcal{H}=-\frac{1}{N} \sum_{i<j} \sigma_x^i \otimes \sigma_x^j + h\sum_i \sigma_z^i, \label{lmg} \end{equation} where $h\geq 0$ is the strength of the magnetic field in the $z-$direction. It is convenient to recast the LMG model in terms of the total spin operators $S_\alpha\!=\!\sum_{i} \sigma_{\alpha}^i/2$, with $\alpha\!=\!\{ x,y,z\}$, \begin{equation} \mathcal{H}=-\frac{1}{N} S_x^2 + h\: \Bigg(S_z +\frac{N}{2} \Bigg), \label{lmg_spin} \end{equation} which can be written in a bosonic form by applying the Schwinger representation of spin operators \begin{align} S^z=t^{\dagger}t-\frac{N}{2}=\hat{n}_t-\frac{N}{2}, \: S^+=t^{\dagger}s=\big(S^-\big)^{\dagger}, \end{align} where $S^{\pm}\!=\!S_x \pm i\:S_y$ are spin ladder operators. This results in a Hamiltonian describing a system of two species of scalar bosons $s$ and $t$, given by \begin{equation} \mathcal{H}=h\:t^{\dagger}t-\frac{1}{4N}\big( t^{\dagger}s+s^{\dagger}t\big)^2. \label{lmg_boson} \end{equation} The non-zero elements of the Hamiltonian~\eqref{lmg_boson} in the basis \begin{equation} \ket{N,n_t} = \frac{\big(t^{\dagger}\big)^{n_t} \big(s^{\dagger}\big)^{N-n_t} }{\sqrt{n_t ! \big(N-n_t\big)!}} \ket{0}, \label{base} \end{equation} are given by \begin{gather} \bra{N,n_t}\mathcal{H} \ket{N,n_t}\!=\! h \: n_t\!-\!\frac{(n_t+1)(N-n_t)+n_t(N-n_t+1)}{4N} ,\nonumber \\ \bra{N,n_t}\mathcal{H} \ket{N,n_t+2}\!=\!-\frac{\sqrt{(n_t+1)(N-n_t)(n_t+2)(N-n_t-1)}}{4N}, \label{element_matrix} \end{gather} where $\ket{0}$ is the vacuum state and $0 \! \leq \! n_t \! \leq \! N $ and therefore the dimension of the Hamiltonian~\eqref{lmg_boson}, is $N\!+\!1$. The LMG model exhibits a $\mathbb{Z}_2$ parity symmetry, given by the operator $\Pi=e^{i\pi(S_z+N/2)}=e^{i\pi t^\dagger t}$ so that $[\mathcal{H},\Pi]=0$. As a consequence, the Hamiltonian can be split into odd and even parity blocks of dimension $D_{\text{odd}}\!=\!N/2\:+1$ and $D_{\text{even}}\!=\!N/2$, respectively. \begin{figure}[t] \includegraphics[width=\columnwidth]{figures/part3/paper/fig1_altered.pdf} \caption{Spectrum of the LMG model~\eqref{lmg_boson}, with respect to the magnetic field $h$. {\it Main:} Energy spectrum for $N\!=\!100$, showing the crossing between the critical line of the ESQPT $E_c\!=\!0$ and the lifting of the degeneracy. Only 1/5 of the total eigenstates are shown for clarity. Solid and dashed lines refer to eigenstates with opposite parity. {\it Lower right inset:} Zoom around the critical energy for $N\!=\!500$ spins. {\it Upper right+lower left insets:} Sketch of the effective potential above and below the ESQPT, respectively.} \label{lmg_energies} \end{figure} \noindent In the thermodynamic limit, the model exhibits a spontaneous symmetry-breaking second-order QPT in the ground state at $h_c\!=\!1$~\cite{prl_vidal, pre_vidal, prb_vidal, prb_castanos} between a ferromagnetic phase ($h\!<\!1$) where the spectrum becomes doubly degenerate, and therefore the system is effectively a double well, and a paramagnetic phase ($h\!>\!1$) where all energy levels are distinct and equi-spaced. We qualitatively see the difference between these phases in Figure~\ref{lmg_energies} where we show the eigenenergies of the LMG model~\eqref{lmg_boson} as a function of $h$, for $N\!=\!100$. The double degeneracy in the spectrum leads to another critical feature in the excited-states. For a finite value of $N$ and fixed value of $h\!<\!1$ we see that the spectrum is only doubly degenerate up to a particular energy level which characterizes ESQPT~\cite{Caprio:08}. We can identify ESQPTs either by fixing the energy while varying the control parameter of the model, or equivalently, by increasing the energy at a fixed value of the control parameter. The ESQPT refers to a non-analytical behavior of the density of states, $\nu(E)=\sum_k \delta(E-E_k)$ with $E_k$ the eigenenergies of the Hamiltonian, i.e. $\mathcal{H}=\sum_k E_k\ket{k}\bra{k}$~\cite{Caprio:08,esqpt_2020review}. As the system approaches an ESQPT in the LMG, the density of states develops a logarithmic divergence $\nu(E)\propto -\log|E-E_c|$ due to a concentration of the energy levels at $E_c\!=\!0$~\cite{prl_vidal,pre_vidal,2016_pra_lea} and for $h\!<\!1$ which is the critical region for the ESQPT in the Hamiltonian~\eqref{lmg_boson}. In what follows we explore how dynamical signatures of the ESQPT are present in the work statistics after a sudden quench and examine the effect of breaking the $\mathbb{Z}_2$ parity symmetry. \section{Figures of merit} \noindent We consider a protocol where the Hamiltonian~\eqref{lmg_boson} is initialized in a particular state, $\ket{\psi_i}\!=\!\ket{\psi(0)}$, for a given value of the magnetic field, $h_i$. At $t\!\!=\!\!0$ we abruptly change the magnetic field $h_i\!\to\!h_f$ and study the time evolution of the system under the final Hamiltonian, $\mathcal{H}_f$, according to $\ket{\psi(t)}\!=\!e^{-i\mathcal{H}_f t} \ket{\psi(0)}$. In what follows, we consider $\mathbb{Z}_2$ symmetric and $\mathbb{Z}_2$ symmetry-broken ground states and excited states. A key figure of merit for studying the dynamical response of a system to such a sudden perturbation is captured by the time-dependent fidelity or survival probability which has been extensively used in studying the critical features of spin models~\cite{RMP_Silva, JoPA_Jafari, prb_najafi, prb_bose, scirep_campo, pra_fazio, prl_zanardi, prl_jafari, PR_Gorin, qian_pra, quan_pra, CampbellPRB}. Assuming the system begins in an eigenstate, it is defined as \begin{equation} \mathcal{L}(t)=\vert \chi(t) \vert^2 \label{echo} \end{equation} where \begin{equation} \chi(t)=\bra{\psi(0)} \psi(t) \rangle=\bra{\psi(0)} e^{-i\mathcal{H}_f t} \ket{\psi(0)} \label{echo2} \end{equation} is the characteristic function of the work distribution in the case of a sudden quench and given by~\cite{prl_silva} \begin{equation} P_W=\sum_{m} p_{m\vert n}^\tau \delta \left( W - (E_m - E_n) \right), \label{pw} \end{equation} with $E_m (E_n)$ the energy of the corresponding eigenstate of the final (initial) Hamiltonian. Unless otherwise stated, we will assume the system begins in the ground state, $n\!=\!0$, and therefore $p_{m\vert 0}$ is the conditional probability of measuring $E_m$ after the quench. The moments of the work distribution due to the sudden quench can be readily determined~\cite{prx_fusco}: \begin{equation} \langle W^l \rangle = \sum_{m} \Big( E_m^f - E_0^i \Big)^l |\langle\psi^i_0 \vert \psi^f_m \rangle |^2\equiv (-i)^l \partial_{t}^l \chi(t) \vert_{t\to0}, \label{work} \end{equation} with the first and second moments corresponding to the average work and variance, respectively. Recent proposals have demonstrated that the distribution~\eqref{pw} is experimentally accessible~\cite{WorkDistPRL}. Under these conditions, namely initial ground state and sudden quench, the work distribution is mathematically equivalent to the infinite time average of the quantum state, i.e. the diagonal ensemble. Therefore, we have all the information necessary to determine the entropy of the diagonal ensemble~\cite{prb_goold_1, prb_goold_2, cakan2020_DE}, which is simply given by the Shannon entropy of $P_W$: \begin{equation} S_W=-\sum_{W}\ P_W \log_2 P_W. \label{entropy} \end{equation} \section{Quench from the ferromagnetic phase} Before analyzing the impact of symmetry breaking and ESQPT in the work statistics, it is convenient to find the critical value of the magnetic field $h_f^c$ for which the initially prepared ground state at $h_i$ is brought to the critical energy $E_c$ at which the ESQPT takes place. For that we rely on a semiclassical approximation. We first compute the semiclassical energy using a spin coherent representation, $\ket{\alpha}=(1+\alpha^2)^{-J}e^{\alpha S^+}\ket{J,-J}$ with $\alpha\in \mathbb{R}$ and where $\ket{J,m_J}$ denotes the standard basis of $\{S^2,S_z\}$ for the Dicke states, such that $S_z\ket{J,m_J}=m_J\ket{J,m_J}$. The energy is \begin{align}\label{eq:Ealpha} E(\alpha,h)=\lim_{N\rightarrow \infty} \bra{\alpha}\mathcal{H}\ket{\alpha}=\frac{(\alpha^4-1)h-2\alpha^2}{(1+\alpha^2)^2}, \end{align} where we have neglected the irrelevant constant energy contribution $hN/2$, which does not modify the double-well structure of $E(\alpha,h)$. The ground state parameter under this spin-coherent representation is achieved by minimization of $E(\alpha,h)$, which yields \begin{align} \alpha_{\rm gs}(h)= \begin{cases}0 \qquad \qquad h>1 \\ \pm \sqrt{\frac{1-h}{1+h}} \quad 0\leq h\leq 1 \end{cases}. \end{align} The solution $\alpha=0$ that ensures $dE(\alpha,h)/d\alpha=0$ becomes a local maximum for $h>1$, which is precisely the ESQPT. For the energy functional as given in~\eqref{eq:Ealpha}, the ESQPT takes place at the critical energy $E_c=-h$ for $0\leq h\leq 1$. The two equivalent solutions for $0\leq h\leq 1$ signal the spontaneous symmetry breaking. \noindent In this manner, we can compute the energy of the quenched initial state as $E_q(h_i,h_f)\equiv E(\alpha_{\rm gs}(h_i),h_f)=\lim_{N\rightarrow \infty} \langle \alpha_{\rm gs}(h_i)|\mathcal{H}(h_f) |\alpha_{\rm gs}(h_i)\rangle $ where we have explicitly written the dependence of the Hamiltonian on the final parameter $h_f$. The critical quench strength follows from $E_q(h_i,h_f^c)=E_c$ which for $0\leq h_i\leq 1$ results in the simple expression \begin{align} h_f^c=\frac{1+h_i}{2}. \label{eq:hfc} \end{align} That is, for $h_f<h_f^c$ the ground state of $\mathcal{H}$ at $h_i$ is confined within the symmetry-broken phase, while a quench $h_f>h_f^c$ provides sufficient energy so that the quenched state is brought above the ESQPT where the degeneracy is lifted (cf. Figure~\ref{lmg_energies}). \noindent Note however that if $h_i>1$, then $E(h_i,h_f)=-h_f$ which corresponds to the ground state energy for $h_f\geq 1$ and the critical energy of the ESQPT for $h_f<1$. Hence, the impact of the QPT can be captured by quenching from the paramagnetic phase ($h_i>1$) to the critical point $h_f=h_c=1$. \begin{figure*}[t] \subfloat[\label{echo_symm}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/symmetric_GS_echo.pdf} }% \subfloat[\label{pw_symm}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/symmetric_GS_Pw.pdf} } \subfloat[\label{sw_symm}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/LMG_Sw_symmetric_gs.pdf} } \caption{{\bf Symmetric ground state.} (a)+(b) The survival probability~\eqref{echo}, and the work probability distribution~\eqref{pw}, respectively for a system size $N\!=\!2000$ and initial magnetic field $h_i=0.5$, when the quench is performed to below ($h_f\!=\!0.6$), above ($h_f\!=\!0.9$) and at the ESQPT critical point ($h_f\!=\!0.75$). (c) The Shannon entropy~\eqref{entropy} with respect to the magnetic field $h_f$ for various system sizes $N\!=\!100 [\text{bottom,~blue}]\!\to\!1000[\text{top,~cyan}]$, the inset show the scaling of the maximum of $S_W$ with respect to $\log_2(N)$.} \label{symb_gs} \end{figure*} \subsection{Symmetric ground state} We begin our analysis by initializing our system in the ground state of the ferromagnetic phase ($h\!<\!1$) of the LMG model~\eqref{lmg_boson} and perform a sudden quench from $h_i\!=\!0.5$. The ESQPT corresponds to the point at which the energy of the final Hamiltonian, measured in the initial energy basis, crosses the critical line of the ESQPT $E_c\!=\!0$, cf. Figure~\ref{lmg_energies}. As explained above, the energy of the post-quenched Hamiltonian crosses $E_c\!=\!0$ at $h_f^c\!=(1+h_i)/2=0.75$ where the ESQPT occurs. We consider quenches to three different values of $h_f$: (i) below the ESQPT, $h_f\!<\!0.75$, (ii) to the ESQPT, $h_f\!=\! 0.75$, and (iii) beyond the ESQPT, $h_f\!>\!0.75$. We remark that qualitatively similar results hold for other choices of $h_i$ with the caveat that the location of the ESQPT is shifted accordingly as dictated by equation~\eqref{eq:hfc}. \noindent Figure~\eqref{echo_symm} depicts the survival probability~\eqref{echo} for a system size $N\!=\!2000$ and a quench starting from $h_i\!=\!0.5$. We find that quenches either sufficiently below or above the ESQPT point show qualitatively similar behaviors. In particular, for $h_f\!=\!0.6$ we find strong periodic revivals with the system almost perfectly returning to the initial state, while for $h_f\!=\!0.9$ the system still exhibits sharp revivals between periods of dynamical orthogonality, albeit with the revivals decaying in amplitude. This qualitative behavior persists for other values of $h_f$, including when quenching to and beyond the second order ground state QPT $h_c\!=\!1$~\cite{CampbellPRB} with the notable exception in the vicinity of the ESQPT. For quenches to the ESQPT point we see the survival probability no longer exhibits such a clear periodic behavior, but instead remains dynamically close to a fully orthogonal state. The sensitivity to the presence of the ESQPT is further reflected in the work probability distribution shown in Figure~\eqref{pw_symm}, where we find $P_W$ is generally Gaussian for quenches to arbitrary values of $h_f$, except in the vicinity of the ESQPT, $h_f\!=\! h_f^c\!=\!0.75$, where the shape of $P_W$ changes to a double peak with the emergence of a dip, reflecting the effect of the presence of the ESQPT, as previously discussed~\cite{2011_relano}. \noindent We next examine the entropy of the diagonal ensemble~\eqref{entropy}, in Figure~\eqref{sw_symm} for $h_i\!=\!0.5$ as a function of the quench amplitude, $h_f$, for various system sizes. We immediately see the emergence of a peak in the entropy at the ESQPT point. We observe a logarithmic scaling of $S_W\propto \log_2(N)$ as the system size is increased, as demonstrated in the inset where we show this explicitly for the peak, however we remark that this scaling holds for any value of $h_f$. Finally, we note that the moments of the work distribution are also readily accessible. However they exhibit no sensitivity to the presence of the ESQPT, with the first (second) moments scaling linearly (quadratically) with the quench amplitude, as depicted in Figure~\eqref{fig_mom_work}. \begin{figure}[t!] \subfloat[First moment $\langle W \rangle$.\label{work1_symm}]{% \includegraphics[width=0.49\textwidth]{figures/part3/paper/work1_0.5.pdf} }% \subfloat[Second moment $\langle W^2 \rangle$.\label{work2_symm}]{% \includegraphics[width=0.49\textwidth]{figures/part3/paper/work2_0.5.pdf} } \caption{Moments of the average work~\eqref{work} with respect to the final magnetic field $h_f$, for a system size $N=100$ and initial ground state at $h_i=0.5$. In (a) we represent the first moment, and in (b) the second moment.} \label{fig_mom_work} \end{figure} \subsection{Symmetry-broken ground state} As previously mentioned, in the thermodynamic limit and for $h<1$ the LMG undergoes a spontaneous $\mathbb{Z}_2$ symmetry breaking. For finite systems, any small perturbation in $S_x$ leads to a symmetry breaking in the ferromagnetic phase ($h<1$), while it does not alter the paramagnetic phase ($h>1$). For that reason, we introduce a small perturbation $|\epsilon|\!<\!<\!1$ in $S_x$, such that it does not affect the critical features of the model, i.e. \begin{equation} \mathcal{H}=-\frac{1}{N} S_x^2 + h\: \Bigg(S_z +\frac{N}{2} \Bigg) + \epsilon\: S_x. \label{lmg_epsilon} \end{equation} In this case, the non-zero elements of the Hamiltonian in the basis~\eqref{base}, are given by~\eqref{element_matrix} and \begin{equation} \bra{N,n_t}\mathcal{H} \ket{N,n_t+1}\!=\!\frac{\epsilon}{2} \sqrt{(N-n_t)(n_t+1)}. \end{equation} When $h\!<\!1$ the ground state of the Hamiltonian~\eqref{lmg_epsilon}, is a fully symmetry broken (FSB) ground state, i.e. a superposition of the two degenerate fully symmetric ground states with opposite parity, $\ket{\varphi_{\pm}}$ such that $\Pi\ket{\varphi_{\pm}}=\pm \ket{\varphi_{\pm}}$. In particular, the FSB states can be written as $\ket{\varphi_{\rm FSB,\pm}}=(\ket{\varphi_{+}}\pm\ket{\varphi_-})/\sqrt{2}$ which yield a maximum value of the symmetry-breaking order parameter, $|\langle S_x \rangle|$, and are only degenerated up to an energy factor $|\epsilon|\ll 1$. \begin{figure}[t!] \subfloat[\label{echo_symm_br}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/symmetry_broken_GS_echo.pdf} }% \subfloat[\label{pw_symm_br}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/symmetry_broken_GS_Pw.pdf} } \subfloat[\label{sw_symm_br}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/LMG_Sw_epsilon.pdf} } \caption{{\bf Fully symmetry broken ground state.} (a)+(b) The survival probability~\eqref{echo}, and the work probability distribution\eqref{pw}, respectively for a system size $N\!=\!2000$ and initial ground state at $h_i=0.5$, when the quench is performed to below ($h_f\!=\!0.6$), above ($h_f\!=\!0.9$) and at the ESQPT critical point ($h_f\!=\!0.75$). (c) The Shannon entropy~\eqref{entropy} with respect to the magnetic field $h_f$ for various system sizes $N\!=\!100 [\text{bottom,~blue}]\!\to\!1000[\text{top,~yellow}]$. } \label{fsb} \end{figure} We can now examine the effect that breaking the $\mathbb{Z}_2$ symmetry has on the figures of merit. Considering the same quench parameters as before, in Figure~\eqref{echo_symm_br} we show the behavior of the survival probability. While largely consistent with the previous case, we nevertheless see some qualitative differences appearing. For quenches below the ESQPT, we see that symmetry breaking has no effect and the survival probability is identical in both instances, as can be seen by comparing the blue dot-dashed curves in Figure~\eqref{echo_symm} and~\eqref{echo_symm_br}. For quenches beyond the ESQPT, breaking the symmetry leads to a change in the period of the revivals in the survival probability. In fact, the period of these revivals doubles in the symmetry broken case with respect to the symmetric ground state due to the fact that the $\mathbb{Z}_2$ symmetry is no longer conserved. In this case, the absent peaks in the survival probability with respect to the symmetric ground state (cf. Figure~\eqref{echo_symm}) correspond to the overlap $|\langle \varphi_{\rm FSB,-}|e^{-i\mathcal{H}_f t}|\varphi_{\rm FSB,+}\rangle|^2$, which is intimately related to the emergence of a dynamical quantum phase transition. Quenches to the ESQPT point are notably affected by breaking the symmetry, with the system remaining closer to orthogonality throughout. \noindent The work distribution is similarly affected, showing evidence of the symmetry breaking only when the quench is sufficiently strong. As shown in Figure~\eqref{pw_symm_br}, the distribution is the same for both the symmetric and symmetry broken initial states when the quench is below the ESQPT as the energies in this region are not symmetry dependent (cf. Figure~\eqref{lmg_energies}). However, while $P_W$ retains its Gaussian profile for quenches far above/below the ESQPT point, when quenching beyond the ESQPT the distribution peak is halved, which is due to the spreading of $P_W$ over both parity subspaces of the model. The effect of symmetry breaking is most notable in the work distribution when the system is quenched to the ESQPT. Once again the distribution loses the Gaussian profile and exhibits a dip similar to the symmetric case. We now find that to the left of the dip, corresponding to states below the critical energy, both the symmetric and symmetry broken initial states show the same distribution, however to the right of the dip the amplitude of the probabilities is halved again due to involvement of both parity subspaces. \noindent The behavior of the entropy of the diagonal ensemble~\eqref{entropy}, when we break the $\mathbb{Z}_2$ symmetry is shown in Figure~\eqref{sw_symm_br} for various system sizes $N\!=\!100 [\text{blue}]\!\to\!1000[\text{yellow}] $ and is consistent with the behavior of the fully symmetric case shown in Figure~\eqref{sw_symm}. As in the symmetric case, $S_W$ increases quickly, peaking at the ESQPT point, $h_f^c\!=\!0.75$. We remark that, while a symmetric ground state can only populate a single parity subspace, an initial symmetry-broken ground state populates both subspaces. As a consequence, the entropy $S_W$ is larger in the symmetry-broken case by a factor $\log_2(2)=1$ when $h_f>h_f^c$, reflecting the spreading of $P_W$ over the two parity subspaces. Finally, in contrast to these figures of merit, the first and second moments of the work distribution~\eqref{work} are unaffected by symmetry breaking, as shown in Figure~\eqref{fig_mom_work_br}. \begin{figure}[t!] \subfloat[First moment $\langle W \rangle$.\label{work1_symm_br}]{% \includegraphics[width=0.49\textwidth]{figures/part3/paper/work1_0.5_sb.pdf} }% \subfloat[Second moment $\langle W^2 \rangle$.\label{work2_symm_br}]{% \includegraphics[width=0.49\textwidth]{figures/part3/paper/work2_0.5_sb.pdf} } \caption{Moments of the average work~\eqref{work} with respect to the final magnetic field $h_f$, for a system size $N=100$ and initial symmetry-broken ground state at $h_i=0.5$. In (a) we represent the first moment, and in (b) the second moment.} \label{fig_mom_work_br} \end{figure} \subsection{Weighted superposition} Having discussed the features of symmetric and fully symmetry broken ground states, we complete the picture by considering the case of an initial state which does not maximise the value of the symmetry-breaking order parameter $|\langle S_x\rangle|$ but still breaks the $\mathbb{Z}_2$ parity symmetry. As an example, we choose $|\varphi_{\rm sup}\rangle\propto 2\ket{\varphi_{+}}+\ket{\varphi_{-}}$ and we (arbitrarily) fix $h_i\!=\!0.25$ with $N\!=\!1000$. In Figure~\eqref{echo_super} we show the work probability distribution for all three initial states when the quench is exactly to the ESQPT critical point, $h_f^c\!=\!0.625$. All distributions exhibit the same double-peaked behavior and, furthermore, the distributions are identical to the left of the cusp. It is only for values of the work above the cusp, which corresponds to those states of the final eigenspectrum that are above the critical energy, that show the effects of symmetry breaking. Indeed, by taking a suitable superposition we can smoothly transition between the two extreme cases shown above. The entropy of the diagonal ensemble similarly reflects the effect of taking such a superposition, as shown in Figure~\eqref{pw_super}, where $S_W$ also interpolates between the two extreme behaviors, and nevertheless clearly spotlights the presence of the ESQPT. \begin{figure}[t] \subfloat[\label{echo_super}]{% \includegraphics[width=0.49\textwidth]{figures/part3/paper/LMG_Pw_SuperPosition.pdf} }% \subfloat[\label{pw_super}]{% \includegraphics[width=0.49\textwidth]{figures/part3/paper/LMG_Sw_superposition.pdf} } \caption{(a) The work probability distribution $P_W$~\eqref{pw}, and (b) The Shannon entropy $S_W$~\eqref{entropy}, with respect to $h_f$ in the LMG model~\eqref{lmg_epsilon}. In both panels we quench from $h_i\!=\!0.25$ in a system of size $N\!=\!1000$, initialized in the symmetric ground state (S), fully symmetry broken (FSB) ground state and in superposition between the two ground states. Note the peak at $h_f\approx 0.625$ which corresponds the critical value $h_f^c=(1+h_i)/2$ in this case (cf. Equation~\eqref{eq:hfc}).} \label{superposition} \end{figure} \subsection{Quenching from excited states} \begin{figure}[t] \subfloat[\label{echo_exc}]{% \includegraphics[width=0.49\textwidth]{figures/part3/paper/excited_state_echo.pdf} }% \subfloat[\label{pw_exc}]{% \includegraphics[width=0.49\textwidth]{figures/part3/paper/excited_state_Pw.pdf} } \caption{{\bf Symmetric excited state.} (a) The survival probability~\eqref{echo}, for a system size $N\!=\!2000$, when the quench is performed from $h_i\!=\! 0.5$ to below ($h_f\!=\!0.6$), above ($h_f\!=\!0.9$) and to the ESQPT critical point ($h_f\!=\!0.75$). (b) The work probability distribution~\eqref{pw}, for a system of size $N\!=\!2000$ quenched from $h_i\!=\! 0.5$ to the ESQPT critical point ($h_f\!=\!0.75$).} \label{lmg_es} \end{figure} An interesting feature of the model is that the double degeneracy occurring in the ferromagnetic phase is not restricted to the ground and first excited states and, in fact, extends to higher excited states up to the critical energy for $0\leq h\leq 1$. These higher excited states exhibit the same critical features and therefore here we examine whether signatures of the ESQPT are also present in the dynamics and work statistics for systems initialized in their excited state conserving the $\mathbb{Z}_2$ parity symmetry. To this end, we fix $h_i\!=\!0.5$, $N\!=\!2000$ and initialize the system in the second excited state. In Figure~\eqref{echo_exc} we show the survival probability when the quench is performed to below ($h_f\!=\!0.6$), above ($h_f\!=\!0.9$) and to the ESQPT critical point $h_f^c\!=\!0.75$. Note that although $h_f^c$ corresponds to the critical value when quenching from the ground state, for low lying excited states it ensures that the quenched state has an energy in the vicinity of the ESQPT. While the behavior is in keeping with the ground state cases, a remarkable feature emerging is the presence of higher frequencies in the revivals of the survival probability for quenches both below and above the ESQPT point and quenching to the critical energy again ensures the system remains close to orthogonality throughout the dynamics. A consequence of these higher frequencies is directly exhibited in the work probability distribution cf. Figure~\eqref{pw_exc}, where a bi-modal shape emerges. For quenches to the ESQPT point we find that there is still a cusp appearing in the distribution, similarly as for the ground state case. In addition, it is worth commenting that the same phenomenology of symmetry breaking applies to this scenario too. \section{Quench from the paramagnetic phase} \begin{figure*}[t] \subfloat[\label{echo_para}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/LMG_echo_from_hi_1.pdf} }% \subfloat[\label{pw_para}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/LMG_pw_from_hi_1.pdf} } \subfloat[\label{sw_para}]{% \includegraphics[width=0.33\textwidth]{figures/part3/paper/LMG_Sw_from_para.pdf} } \caption{{\bf Paramagnetic ground state.} (a)+(b) The survival probability~\eqref{echo}, and the work probability distribution~\eqref{pw}, respectively for a system size $N\!=\!2000$, when the quench is performed to below ($h_f\!=\!1.2$), above ($h_f\!=\!0.5$) and the second order QPT critical point ($h_f\!=\!1.0$). (c) The Shannon entropy~\eqref{entropy} with respect to the magnetic field $h_f$ for various system sizes $N\!=\!100 [\text{bottom,~blue}]\!\to\!1000[\text{top,~cyan}]$. } \label{para} \end{figure*} For completeness we also consider the case of a system initialized in the paramagnetic phase ($h\!>\!1$). Unlike from the ferromagnetic phase, it is not possible to cross the ESQPT by quenching the ground state with $h_i>1$. To the contrary, the quench will be able to signal the QPT when $h_f=h_c=1$, while for $h_f<1$ the state is brought to the critical energy of the ESQPT. In Figure~\eqref{echo_para} the survival probability is shown for system size $N\!=\!2000$ and a quench starting from $h_i\!=\!1.5$. Constraining the quench to within the same phase, that is $h_f\!=\!1.2$ (blue dot-dashed curve), shows small oscillations with perfect revivals. Conversely, quenching either to the second order QPT $h_f\!=\! h_c\!=\!1$ (orange solid line) or beyond $h_f=0.5$ (dashed green line) initially drives the state far from equilibrium and the dynamics is no longer oscillatory. Furthermore, large quenches beyond the QPT drive the system to orthogonal states~\cite{CampbellPRB, CampbellPRL2020}. The work probability distribution reflects the results found for the survival probability as shown in Figure~\eqref{pw_para}. $P_W$ is dominated by a single value of the work when the quench is confined within the same phase, this is a consequence of the fact that the energy levels in the paramagnetic phase are equidistant. Quenching to the QPT, we see that the distribution is still ruled by one value of the work, however other contributions are starting to emerge. A large quench crossing the QPT results in a broader probability distribution reflecting the irreversible nature of the dynamics when crossing a critical point. \noindent Turning our attention to the entropy of the diagonal ensemble, Figure~\eqref{sw_para} shows that the entropy is small in the paramagnetic phase $h\!>\!1$, reflecting the fact that the dynamics is reversible and dominated by a single eigenstate. As we approach the QPT, the entropy sharply increases and a cusp appears tending to $h_f\!\to\!h_c=1$ as $N\!\to\!\infty$ thus indicating that the entropy of the diagonal ensemble is a faithful indicator of the ground state QPT in this case. We remark this is in contrast to the case of initial states in the ferromagnetic phase discussed previously where the presence of the ESQPT and its crossing was succinctly captured by the diagonal entropy, regardless of the presence of absence of symmetry breaking, but it was not sensitive to the ground state QPT at $h_f\!=\!1$. \section{Summary} \noindent In this chapter we have examined the dual effect of symmetry breaking and excited state quantum phase transitions have on the dynamics of a many-body system. Focusing on the LMG model we have demonstrated that while the average work, and higher moments of the distributions, are indifferent to either the presence of an ESQPT or the effect of symmetry breaking, the distribution itself is acutely sensitive to both. Furthermore, we have established that the entropy of the diagonal ensemble is a favorable figure of merit for pinpointing and studying ESQPTs and the symmetry breaking effects~\cite{2020_wang_arxiv}. The qualitative features exhibited when the system is initialized in the ground state were shown to largely extend to initially excited states, with some notable changes, in particular, the emergence of a bimodal distribution for the work that is nevertheless sensitive to quenches to the ESQPT. Finally, we examined the behavior for quenches that start in the paramagnetic phase, where the only critical features exist in the ground state and demonstrated that the entropy of the diagonal ensemble continues to be a useful tool for spotlighting the underlying critical features of the spectrum. \chapter*{Prologue} \noindent The history of life, humankind, and society is marked with prominent transitions in lifeforms, ecosystems, and civilization~\cite{harari2014sapiens}. The evolution of the universe from creation to its today's shape, is argued to have gone through several phase transitions, from the high-temperature plasma, due to the Big Bang, to the cooled form we know nowadays. Therefore, phase transitions are a cornerstone in nature and are of great importance regardless of the field one might be interested in~\cite{chappin2012review, mathis2017emergence}. In physics, complex systems display macroscopic phase transitions as a consequence of the interactions between numerous microscopic components. This makes phase transition an emergent phenomenon~\cite{goldenfeld2018lectures, sachdev2011quantum, vojta2003quantum}, and throughout history many advances have been made in order to capture the essence of how the emergence of states of matter takes place. In the late $19^{\text{th}}$ century, Pierre Curie discovered the mechanism by which metals transform between ferromagnetism and paramagnetism~\cite{curie1895proprietes, kittel1949physical}. The phenomenon of superconductivity was discovered by Onnes in 1911, which describes how the ability of the material to conduct electricity changes with the temperature~\cite{onnes1913investigations}. In order to approximate the behavior of real-world materials, physicists work with mathematical models. A prominent model for complex systems is the Ising model, which was proposed by Lenz and solved by Ising in 1925, in order to describe magnetic materials~\cite{Ising:1925em, magnetismhandbook, physicsmagnetism}. The advent of the theory of quantum mechanics revolutionized the way physicists think about and approach the atomic realm~\cite{cohen1986quantum, cohen1986quantum2, cohen2019quantum3}. As a consequence, a series of discoveries have been achieved, i.e. the quantum theory of solids by Felix Bloch in 1928~\cite{bloch1928quantum}, the quantum theory of ferromagnetism by Paul Dirac and Werner Heisenberg in 1929~\cite{dirac1928quantum}, as well as the discovery of antiferromagnetism and diamagnetism by N\'eel~\cite{neel} and Meissner~\cite{diamagnetism}, respectively, in the early $30$'s. Following these developments, Lev Landau worked on a universal theory for criticality in physical systems between 1933-1937, after which he presented his phenomenological theory of phase transitions, where he provided a classification and description of first-, and second-order phase transitions~\cite{landau1936theory}. Shortly after, Landau explained the state of superconductivity~\cite{landausuperc} and superfluidity, where a fluid has zero viscosity~\cite{landausuperf}. Building on the discovery of Onnes and using quantum mechanics, the microscopic theory of superconductivity was developed by Bardeen, Cooper, and Schrieffer (BCS theory) in 1957~\cite{bcs1, bcs2, bcs3}. Then, in the early 60's the concept of localization was predicted by Anderson in disordered systems~\cite{andresonlocal}. Numerical methods were also subject to important developments in order to simulate, efficiently, the salient properties of physical systems and in particular, complex critical systems. In this regard, Wilson introduced in 1974 the renormalization group technique for treating phase transitions~\cite{wilson1974renormalization, wilson1983}.\\ \noindent By the 80's a new field started emerging, that is quantum information theory, which characterizes information and how it can be manipulated at the quantum level~\cite{bennett1998quantum, wilde2013quantum}. Two decades later, the connection between the field of condensed matter theory, statistical mechanics, and quantum information has become more evident, and physicists started to study the features of condensed matter architectures using quantum information tools~\cite{preskill2000quantum, nielsen2002quantum, petz2007quantum}. In fact, at zero temperature the features of many-body systems are dictated by a complex ground state wave function, which contains all the necessary information on the correlations that give rise to the various phases of matter, such as: superfluidity, ferromagnetism, and superconductivity~\cite{fazioreview}. In contrast, these correlations can be captured by quantum-information theoretic measures~\cite{dutta2015quantum}. As a consequence, a fertile line of research emerged where figures of merit in quantum information, such as: the entanglement, quantum discord, quantum coherence, and Wigner functions, are used to spotlight quantum phase transitions and extract their critical exponents, which cemented the important role that such figures of merit play in unraveling the curious properties of many-body systems~\cite{niel_osb, rozario, QPT2004, qptdiscord, CampbellPRA2013, AmicoPRB, SarandyPRA2009, Werlang2010, CakmakPRB2014, qptcoherence, TonySciRep, CampbellPRB2015, CakmakPRB2016, RogersPRA2014, HofmannPRB, GiampaoloPRA, NJPCampbell, BayatPRL2017, BellIneqPRA2012, JafariPRA2017, JafariPRA2008, RulliPRA2010, Zakaria2019, mzaouali2019, ahami2021thermal, abaach2021pairwise, mansour2020quantum, el2020quantum}. Indeed, while quantum phase transitions only strictly occur at zero-temperature, approaches based on these quantum information theoretic tools have revealed that signatures of these phenomena persist even at finite temperatures and can be rigorously studied~\cite{DeChiaraReview}. The cross-fertilization of the experience built up over the last decades in condensed matter physics, with the new tools offered by quantum information theory, has paved the way to many discoveries of new properties of critical quantum systems, and the development of new protocols for quantum computation and communications~\cite{nishimori, heim2015annealer, yan2021annealer, bose2007quantumcommu}. A prominent example is the quantum computer, which can be represented as a many-body system and can be controlled and manipulated through protocols. Numerical methods were also re-visited under the tools of quantum information science in order to design new efficient simulation methods for quantum many-body systems, e.g. the density matrix renormalization group, and tensor networks~\cite{dmrgtensor}. \\ \noindent Information is physical, as a consequence of the intimate relationship between information and thermodynamics, through the entropy. Einstein describes thermodynamics as: \textit{``the only physical theory of universal content, which I am convinced, that within the framework of applicability of its basic concepts will never be overthrown''}. Indeed, thermodynamics is the most basic building block of modern science, and provides a framework to understand various range of natural phenomenons in physics, chemistry, and biology~\cite{perrot1998z}. Historically, the motivation behind the invention of thermodynamics is to enhance the efficiency of heat engines, through the study of the relationship between work and heat~\cite{carnot1978reflexions}. However, with the advances of statistical mechanics~\cite{reif}, the theory of thermodynamics attained its mathematically rigorous form, which paved the way to apply it to quantum settings~\cite{thermo_quantum_regime, booksteve}. Thermodynamics benefited heavily from the developments of the field of classical and quantum information theory, which allowed extending the theory to atomic systems and solving paradoxes, such as: Maxwell's demon~\cite{bennett2003notes}. Additionally, the relationship between information and thermodynamics was also inspected in the context of the Szillard engine~\cite{szilard, szilardexp}, and for finding the thermodynamic cost of classical (quantum) information processing, via the Landauer's principle~\cite{Bennett1982TheTO}. The resource theory for thermodynamics was developed, by inspiration of its analogue in quantum information theory, which sets the boundaries on what can and cannot be achieved while performing thermodynamic state transformations~\cite{gooldreview}. Quantum thermodynamics has been very successful in capturing and exploiting the features of quantum systems in order to design efficient quantum devices~\cite{CampbellPRB2016, mzaouali2021}. In particular, entanglement and coherence have been used as resources in order to design quantum-analogues of thermal machines and batteries~\cite{Hammam_2021, Giorgi_2015iop, batt2020, batt2021}. Quantum criticality has been harnessed in order to increase the efficiency of quantum heat engines, where the working medium is a quantum spin chain driven across its equilibrium (non-equilibrium) quantum phase transition~\cite{topo_qhe, Fogarty_2020qhe, qhe_campsi2020, myers_qhe, qpt_qhe2017, lmg_qhe2016}. \noindent The scope of the present thesis is to provide a theoretical study on the equilibrium and out-of-equilibrium critical features of quantum systems. Therefore, to build the necessary background, we start in \autoref{chap1} with an overview on the critical phenomenons at the classical and quantum levels. In particular, we discuss how a classical phase transition emerges, their classifications, and the mathematical theories that describes them, i.e. Weiss' mean field and Landau's theory. Furthermore, we extend the overview toward the quantum level in order to discuss quantum phase transitions, and the difference with their classical counterparts. \\ \noindent The first goal in this thesis is to analyze critical quantum systems, using the quantum information formalism. Hence, in \autoref{chap2} we review the topic of classical and quantum information theory, where we discuss the notion of information, how it can be measured, and how it can be manipulated in a classical and quantum manner. Additionally, we present in \autoref{chap3} an application of the formalism of quantum correlations from quantum information theory, to the study of the second-order quantum phase transition in the critical Heisenberg $XX$ model.\\ \noindent The second goal is to study quantum phase transition in phase space. For this reason, we discuss in \autoref{chap4} the phase space formulation of quantum mechanics, where we present the traditional Wigner function for infinite-dimensional systems, its properties, and some experimental procedures to measure phase space quantities. Through the rest of the chapter, special focus will be on the case of finite-dimensional systems, where we introduce two formulations of the Wigner function for discrete systems, i.e. Wootters' and Stratonovich Wigner function; and we discuss their features, as well as some experimental protocols to measure them. In the end of this part, \autoref{chap5} is devoted to applying the Wootters and Stratonovich Wigner function in order to detect first-, second-, and infinite-order quantum phase transitions in the $XY$ and $XXZ$ model. \\ \noindent The final goal in this thesis is to inspect the non-equilibrium aspect of critical quantum systems, using the quantum thermodynamics approach. As such, we explore in \autoref{chap6} the phenomenological theory of thermodynamics, its extension to out-of-equilibrium and quantum settings. We discuss in parallel the resource theory for thermodynamics, and the interplay between classical and quantum computing with thermodynamics. We provide in \autoref{chap7} an analysis on the dynamics and thermodynamics of the Lipkin-Meshkov-Glick model. In particular, we present the effect of the presence of the excited state quantum phase transition on the statistics of the work, when the system is initialized in the ferromagnetic phase, and subject to a quench. Furthermore, We assess the role of symmetry breaking has on the ensuing dynamics, highlighting that its effect is only present for quenches beyond the critical point. Moreover, we show that similar features persist when the system is initialized in an excited state and briefly explore the behavior for initial states in the paramagnetic phase. In the end, we conclude the thesis by presenting the short-term and long-term future projects.
84ebe5e7f7c0ca1c46764ddc32b958c78693810f
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Differential privacy (DP) \cite{dwork2006calibrating} is a mathematical standard for quantifying the privacy performance of a data publishing or data analysis mechanism \cite{survey_2017}. To conceal the presence of any individual in the dataset, DP mechanisms perturb the query response or the outcome of an analysis according to a random distribution. The main DP parameter is called $\varepsilon$. If $\varepsilon$ is small, then any mechanism output is almost as likely to occur whether or not any particular individual's data was used in the database. Despite many scientific and operational challenges \cite{Censusissues}, the United States Census Bureau has implemented differential privacy for the 2020 Census release \cite{USCBadopts}. One challenge, which is also documented in many other works including \cite{epsilonvote, economic}, is the difficulty in choosing an appropriate value for $\varepsilon$. Two possible reasons for such a challenge are as follows. First, differential privacy is not well-equipped with theories that maximize utility subject to a privacy constraint or minimize $\varepsilon$ subject to a utility constraint \cite{Censusissues}. In \cite{staircase, ghosh2012universally, natashalaplace}, the staircase, geometric and Laplace mechanisms were respectively identified as utility-maximizing mechanisms under various notions of utility. However, only the global sensitivity of the query across all datasets is taken into account. Such \emph{data-independent} mechanisms can adversely affect utility, especially when an individual's response does not change the query outcome compared to any of its neighboring datasets \cite{individual}. \emph{Data-dependent} mechanisms aim to enhance utility. However, since utility is not provably optimized, the challenge remains to determine which data-dependent algorithm is best for a given application \cite{data_depenedent}. Second, a ``one-size-fits-all" \cite{personalized} approach to setting a global privacy level can be damaging to both utility and privacy. Current implementations of differential privacy lack sufficient flexibility for accommodating \emph{data-dependent} privacy setting. For example, there may be minority groups whose data must be better protected. There may also be statutory mandates, demanding publication of certain datasets with more accuracy. The authors of \cite{epsilonvote, personalized} present several social reasons in favor of incorporating users' preferences when choosing $\varepsilon$. Towards addressing these challenges, the authors in \cite{RafnoDP2colorPaper} proposed a methodology for data-dependent utility-optimal mechanism design for binary-valued queries. This was done via representing datasets as vertices and dataset neighborhoods as edges on a graph. \emph{Boundary} datasets are those where an individual's data changes the query outcome compared to its neighbors. For the case that the mechanism was defined only \emph{partially} at the boundary datasets, \cite{RafnoDP2colorPaper} showed it is possible to \emph{extend} the mechanism over the entire graph in an optimal manner. To solve the problem efficiently, \cite{RafnoDP2colorPaper} focused on the \emph{homogeneous} case where the partial mechanism had the same probability distribution at the boundary and also $\varepsilon$ was the same across the graph. However, an efficient solution to the general problem remained open. This paper generalizes the work \cite{RafnoDP2colorPaper} in two main directions.\footnote{We remark that \cite{RafnoDP2colorPaper} considered approximate $(\varepsilon, \delta)$-DP. Here we set $\delta = 0$ and consider pure-DP. This will make the analysis manageable.} First, we study \emph{heterogeneous mechanisms} where the partial mechanism can have different probability distributions at the boundary. Second, we study a \emph{general heterogeneous privacy setting} on neighboring datasets, which recovers personalized DP \cite{personalized} as a special case. Efficiently solving both generalizations required a radically different way of thinking about the problem compared to \cite{RafnoDP2colorPaper}. Instead of using graph morphism to simple path graphs, we use the partial mechanism as \emph{seed to optimally grow} via the concept of \emph{strongest induced DP condition}. We show this can be done in polynomial time. After recalling standard definitions for graphs and differential privacy in Section \ref{sec:standard}, we introduce heterogeneous DP in Section \ref{HDP}. Section \ref{sec:main} presents our main results in a semi-informal manner, focusing on insights and intuitions. Section \ref{sec:technical} contains the technical statements and the Algorithm for finding the optimal mechanism. \section{Differential Privacy and Utility via Graphs}\label{sec:standard} Let $\mathcal{G}(V,E)$ be a simple, connected, and undirected graph with vertex set $V$ and edge set $E$. A sequence of vertices $u = u_0, u_1, \cdots, u_n = v$ is said to form a path from $u$ to $v$, denoted by $(u,v)$-path, if $(u_0, u_1), \cdots, (u_{n-1},u_n) \in E$. \begin{definition}[$(u,v)$-path set] For every two vertices $u,v \in V$, we define $\mathcal{P}(u,v) := \{\text{all the } (u,v)\text{-paths in } \mathcal{G}\}$. For subsets $A_1,A_2 \subseteq V$, we define $\mathcal{P}(A_1,A_2):= \cup _{u \in A_1, v \in A_2} \mathcal{P}(u,v)$. Finally, $\mathcal{P}$ is the set of all paths in $\mathcal{G}$. \end{definition} Let $\rho$ be a path and $w$ be a neighbor of $\rho$'s tail not on $\rho$. The path obtained from adding $w$ to $\rho$ is denoted by $\rho w$. \begin{definition}[Neighborhood] The neighborhood of a subset $S \subseteq V$ of the vertices, denoted by $N(S)$ is the set of all the vertices in $V\setminus S$ which are connected to at least one element of $S$ by an edge. \end{definition} In this work, the vertices represent datasets and the edges represent neighborhood relationships between pairs of datasets. Neighboring datasets $u$ and $v$ are also denoted by $u\sim v$. The true query function $T: V\to Q$, associates to each dataset a query value from a finite set $Q$. \begin{definition}[Boundary set]\label{def:boundary} The \emph{boundary} set of $\mathcal G$ with respect to $T$ is denoted by $\partial _T (\mathcal{G})$ and is the set of vertices in $\mathcal G$ whose neighborhood contains at least one vertex with a different true query value. Formally, \begin{align*} \partial _T (\mathcal{G}) = \{u \in V: \exists v \in N(u), T(v) \neq T(u)\}. \end{align*} \end{definition} For privately responding to $T$, a privacy-preserving mechanism $\mathcal{M}$ randomizes the response. \begin{definition}[Differential privacy \cite{dwork2006calibrating}] \label{def:dp} Let $\varepsilon \geq 0$. Then, a mechanism $\mathcal{M}:V \to Q$ on $\mathcal{G}$ is $\varepsilon$-differentially private (in short is $\varepsilon$-DP) if, for every $u \sim v$ and $\mathcal{S} \subseteq Q$, \[ \Pr [\mathcal{M}(u) \in \mathcal{S}] \leq e^\varepsilon \Pr [\mathcal{M}(v) \in \mathcal{S}].\] \end{definition} In this paper we consider the case where $Q = \{1, 2\}$ of binary-valued queries. It then suffices to use the following notion of \emph{binary-valued} differential privacy. \begin{definition}[Binary-valued differential privacy]\label{def:binaryDP} Let $\varepsilon \geq 0$ and $p : V \to [0,1]$. We say $p$ is binary-valued $\varepsilon$-DP if for every pair $u \sim v$, we have: \begin{align} \label{eq: p1} p(u) &\leq e^\varepsilon p(v), \\ 1-p(v) &\leq e^\varepsilon (1-p(u)).\label{eq: p2} \end{align} \end{definition} Due to the symmetry of dataset neighborhood, $v \sim u$ will yield the other two inequalities involving $p(v)$ and $p(u)$. \begin{lemma} Let $\mathcal{M}: V \to \{1,2\}$ be a mechanism. Then, $\mathcal{M}$ is $\varepsilon$-DP if $p:=\Pr[\mathcal{M}(v)=1]$ is binary-valued $\varepsilon$-DP. \end{lemma} The proof is straightforward and is omitted here. The following definition captures the optimal utility of a binary mechanism over the space of datasets. Roughly speaking, a mechanism is said to be optimal if for every dataset $v \in V$, the probability of correctly outputting the true query value $T(v)$ is the highest it can be. Recall that $p := \Pr[\mathcal{M} (v) =1]$ and $1-p := \Pr[\mathcal{M} (v) = 2]$. \begin{definition}[Optimal binary mechanism]\label{def:optimal} A binary-valued $\varepsilon$-DP mechanism $p^*$ is said to be optimal on $\mathcal{G}$ if, for every other binary-valued $\varepsilon$-DP mechanism $p$ on $\mathcal{G}$ and every vertex $v \in V$, we have: \begin{align} \begin{cases} p^*(v) \geq p(v), \quad &\text{if } T(v) = 1,\\ 1-p^*(v) \geq 1-p(v), \quad &\text{if } T(v) = 2. \end{cases} \end{align} We denote this ordering with respect to $T$ by $p \leq_T p^*$. \end{definition} \section{Heterogeneous Differential Privacy}\label{HDP} The standard definition of differential privacy in Definition~\ref{def:dp} is \emph{homogeneous} in the sense that the privacy conditions between any two neighboring datasets are given by the same $\varepsilon$. In this section, we extend the homogeneous $\varepsilon$-DP to the heterogeneous case. For each edge $(u,v) \in E$, there is an $\varepsilon(u,v)$, which specifies how neighboring datasets $u$ and $v$ should be protected with respect to each other. Throughout the paper, we assume $\varepsilon(\cdot)$ is symmetric, i.e, $\varepsilon(u,v) = \varepsilon(v, u)$, for every $(u,v) \in E$. \begin{definition}[Heterogeneous differential privacy] \label{def:hetDP} A mechanism $\mathcal{M}:V \to Q$ on $\mathcal{G}$ is heterogeneous $\varepsilon(\cdot)$-differentially private if, for every $u \sim v$ and $\mathcal{S} \subseteq Q$, \[ \Pr [\mathcal{M}(u) \in \mathcal{S}] \leq e^{\varepsilon(u,v)} \Pr [\mathcal{M}(v) \in \mathcal{S}].\] \end{definition} If $\varepsilon(\cdot) = \varepsilon$ is a constant function, we recover the standard differential privacy in Definition \ref{def:dp}. A small $\varepsilon(u,v)$ means high privacy and vice versa. Whenever we write $\varepsilon(\cdot)$-DP as opposed to just $\varepsilon$-DP, it is to emphasize that we mean a heterogeneous DP mechanism on $\mathcal{G}$. Definition \ref{def:hetDP} is more general than the personalized DP \cite{personalized} as follows. In \cite{personalized}, the variability of $\varepsilon$ is tied to the identity of an individual $i$. To clarify, for any $v = (v^1, \cdots, v^i, \cdots, v^n) \in V$, where $n$ is the dimension of the dataset, let $V^{-i}(v) \subset V$ denote all vertices in $V$ whose $i$-th element differs from $v$. That is, $v^{-i}= (v^1, \cdots, v'^i, \cdots, v^n)$. In \cite{personalized}, $\varepsilon(v,v^{-i}) = \varepsilon_i$ for all $v^{-i} \in V^{-i}$. In this paper, there is no such constraint and $\varepsilon(v, v^{-i})$ has full degrees of freedom to depend on both $v$ and $v^{-i}$. In \cite{dmetric}, the authors define $\varepsilon(u,v)$ \emph{for all} $u,v \in V$ and assume $d(\cdot)$ is a metric function, which satisfies the triangle inequality $\varepsilon(u,v)\leq \varepsilon(u,w) + \varepsilon(w,v)$ for all $u,v, w \in V$. Here, we define $\varepsilon(u,v)$ for neighboring vertices $u \sim v$ only. See the examples in Fig. \ref{fig: ex graphs} that clarify these distinctions. \begin{figure*}[!t] \begin{subfigure}[t]{0.30\textwidth} \centering \input{tikz/cubehetero} \caption{Heterogeneous DP} \label{fig: ex graphs a} \end{subfigure} \begin{subfigure}[t]{0.30\textwidth} \centering \input{tikz/cubeindiv} \caption{Personalized DP} \label{fig: ex graphs b} \end{subfigure} \begin{subfigure}[t]{0.30\textwidth} \centering \input{tikz/dmetric} \caption{$d$-metric privacy} \label{fig: ex graphs b} \end{subfigure} \caption{Examples of heterogeneous DP in this paper, personalized DP \cite{personalized}, and $d$-metric DP \cite{dmetric}. Each dataset $v = (v^1, v^2, v^3)$ contains three votes, $v^i \in \{1,2\}$. The query is the majority vote which is color coded as \texttt{blue} or \texttt{red}. A higher privacy $\varepsilon_2 < \varepsilon_1$ is schematically shown with thicker lines . Imagine the first person's vote needs to better protected, \emph{but only if} it is the deciding vote. In heterogeneous DP, it is possible to assign higher privacy only on edges $(121)-(221)$ and $(112)-(212)$. In personalized DP, all datasets in which the first person's vote is different must be assigned the same privacy parameter. In $d$-metric privacy, privacy conditions between all datasets must be pre-specified subject to the triangular inequality.} \label{fig: ex graphs} \end{figure*} \section{Main Results}\label{sec:main} Let $\mathcal{G}$ be a graph with privacy function $\varepsilon(\cdot)$. Let $T$ be a binary-valued query function on $V$ and $p: S \to [0,1]$ be a \emph{partial} function such that $S \subseteq V$ contains the boundary set $\partial _T (\mathcal{G})$. An \emph{extension} of $p$ is a function $\tilde{p}: V \to [0,1]$ such that for all $v \in S$, we have $ \tilde{p}(v) = p(v)$. The main result of this paper is as follows. \begin{theorem}\label{theorem:main1} There exists a polynomial time algorithm which takes a graph $\mathcal{G}$, a privacy function $\varepsilon(\cdot)$, a binary-valued query $T$, and a partial function $p$ as input and outputs as follows. If $p$ cannot be extended to an $\varepsilon(\cdot)$-DP mechanism, it outputs ``no $\varepsilon$-DP extension of $p$ exists". Otherwise, it outputs an extension $\tilde{p}$ of $p$ which is $\varepsilon(\cdot)$-DP and is also the unique optimal with respect to the $\leq_T$ ordering. \end{theorem} Before we outline the main steps of the proof of Theorem~\ref{theorem:main1}, we explain some helpful facts. \subsection{Initial DP Conditions:} The notion of the $\varepsilon(\cdot)$-DP on $\mathcal{G}$ is a \emph{local} property in the sense that for a mechanism to be $\varepsilon(\cdot)$-DP, certain local conditions must be satisfied. For binary-valued heterogeneous mechanisms, this is captured in Definition \ref{def:binhetDP}. \begin{definition}[Binary-valued heterogeneous differential privacy]\label{def:binhetDP} The function $p:V\to [0,1]$ is called binary-valued heterogeneous $\varepsilon(\cdot)$-differentially private if, for every $u\sim v$, the following conditions are satisfied: \begin{align} \label{eq: r1} p(u) &\leq e^{\varepsilon(u,v)} p(v), \\ 1-p(u) &\leq e^{\varepsilon(u,v)}(1- p(v)).\label{eq: r2} \end{align} Furthermore, by the symmetry, the same set of inequalities hold if we interchange $u$ and $v$: \begin{align} \label{eq: r3} p(v) &\leq e^{\varepsilon(u,v)} p(u),\\ 1-p(v) &\leq e^{\varepsilon(u,v)}(1- p(u)).\label{eq: r4} \end{align} We refer to \eqref{eq: r1}-\eqref{eq: r4} as the \emph{initial DP conditions}. \end{definition} Note that \eqref{eq: r1}-\eqref{eq: r4} can be rearranged to obtain two upper bounds on $p(u)$ and two lower bounds on $p(u)$. In particular, \eqref{eq: r4} can be rewritten as \begin{align} \label{eq: 0DPW3} p(u) &\leq \frac{ p(v) -1 + e^{\varepsilon(u,v)} } {e^{\varepsilon(u,v)}}. \end{align} That is, \eqref{eq: r1} and \eqref{eq: 0DPW3} impose two upper bounds on the mechanism $p(u)$. Because of this simple fact and also the fact that neighboring relationship is a symmetric relationship, we may only consider the upper bounds. That is, if all the upper bound inequalities hold for every adjacent pair of vertices, the lower bounds automatically hold. \subsection{Strongest Induced DP Condition:} Despite the fact that an $\varepsilon(\cdot)$-DP mechanism has a very localized definition as described above, it must also satisfy \emph{less local} conditions as follows. If two vertices $u,v$ are not neighbors, but both satisfy local $\varepsilon(\cdot)$-DP conditions with a third mutual neighboring vertex $u_0$, then a weaker set of inequalities must hold for the value of the mechanism at $u$ and $v$. As we take different $(u,v)$-paths, still certain inequalities, depending on that path, on the value of the mechanism at the two end vertices must be satisfied. The upper bounds a vertex imposes on another vertex via some path are called \emph{induced DP conditions}. However, as the path is incremented, the induced conditions become weaker. In fact, for every pair of nodes $u,v \in V$, any $\varepsilon(\cdot)$-DP mechanism on $\mathcal{G}$, and any path $\rho \in \mathcal{P}(u,v)$, the vertex $u$ imposes an upper bound on $p(v)$, which depends on both $p(u)$ and $\rho$. We denote this upper bound by $U_{\rho , p(u)}(v)$. Thus, from now on, every time we talk about the best bound $u$ imposes on $p(v)$, we mean the smallest upper bound on $p(v)$ among all $\rho \in \mathcal{P}(u,v)$, i.e., $\min_{\rho\in \mathcal{P}(u,v)} U_{\rho , p(u)}(v)$. We call this smallest bound \emph{the strongest induced condition of $u$ on $p(v)$.} The following lemma summarizes these facts. \begin{lemma} \label{lem: increasing} Let $\rho$ be a $(u,v)$-path and $v'$ be a middle vertex of this path. Let $\rho'$ and $\rho''$ be $(u,v')$ and $(v',v)$ subpaths on $\rho$. Then, for the upper bound $U$ function we obtain the expression $U_{\rho, p(u)}(v) = U_{\rho'', U_{\rho', p(u)}(v')}(v)$. Also, for every $\varepsilon(\cdot)$-DP mechanism $p$, the upper bounds $u$ imposes on $p(v')$ are smaller than the ones it imposes on $p(v)$. \end{lemma} The above lemma follows from Theorem \ref{theo:path} that will appear later in the paper. \subsection{Finding the Strongest Induced DP Condition} For a single path graph, finding the strongest induced DP condition can be solved efficiently. The closed-form expression of the optimal induced DP conditions for a path graph is derived in Theorem \ref{theo:path}. However, finding the strongest induced condition is challenging in a general graph, since the number of the paths in the graph can be exponentially large on the number of vertices. However, in Algorithm \ref{algo: acomplete}, we show that this task can be accomplished in polynomial time. In the next section, we describe this algorithm, prove its correctness, and analyze its time complexity. We now explain the proof of Theorem \ref{theorem:main1} and the construction of Algorithm \ref{algo: acomplete}. \begin{itemize} \item{\textbf{Checking the extendibility:}} The idea is very simple. We find a necessary condition that any extendable function must satisfy to be $\varepsilon(\cdot)$-DP and we check it in polynomial time. If it is not satisfied, the algorithm declares that no $\varepsilon(\cdot)$-DP extension exists. Actually, the necessary conditions are the induced DP conditions over the pairs $u,v\in S$. In fact, all the induced conditions are necessary, but since we only have access to partial $p$, over the set $S$, we only consider those ones. Note that it is enough to only check the strongest induced conditions. The number of the ordered pairs in $S$ is $|S|\cdot(|S|-1)$ and hence, polynomial. Also checking if the strongest condition is satisfied over any pair in $S$ can be done using Algorithm \ref{algo: acomplete}. \item{\textbf{Finding an extension:}} Note that if the necessary condition is satisfied in the previous part, then Algorithm \ref{algo: acomplete} outputs some extension function of $p$. If we can prove that the output in this case is indeed an $\varepsilon(\cdot)$-DP mechanism, firstly it shows that the checking extendibility is indeed sufficient, and more importantly, the output satisfies $\varepsilon(\cdot)$-DP. The way the algorithm extends the function $p$ over the entire $V$ is as follows. For a vertex $v$ outside $S$, and based on the value of $T(v)$ it does the following. When $T(v)=1$, the algorithm searches over all the vertices $u\in S$ and finds the one whose strongest induced condition on the vertex $v$ is the smallest. In other words, among all the paths of the form $\rho \in \mathcal{P}(u,v)$ in which $u\in S$, it takes the one with minimum possible $U_{\rho , p(u)}(v)$. For any fixed $u$, this can be done by using Algorithm \ref{algo: subroutine}. Since $|S|$ has also polynomial size, the entire task can be done in polynomial time. When $T(v)=2$, the symmetry in the problem can be used to perform exactly the same steps except that we call Algorithm \ref{algo: acomplete} with the input $1-p$ instead of $p$. In Section \ref{TSaP.B}, we prove that the resulting extension of $p$ is $\varepsilon(\cdot)$-DP. \item{\textbf{Optimality with respect to $\leq_T$:}} This part is a direct consequence of the previous item. The reason is that for every vertex $v\in V \setminus S$, depending on whether $T(v)=1$ or $2$, we assigned the minimum upper bound (respectively, maximum lower bound) that is necessary for any $\varepsilon(\cdot)$-DP mechanism. In other words, if we increase the value of $p(v)$ (for the case $T(v)=1$) by any positive value, then one necessary condition fails and therefore the function cannot be $\varepsilon(\cdot)$-DP. \end{itemize} \section{Technical Statements and Proofs}\label{sec:technical} \subsection{The Path Graph} Let $\rho = v_0, \cdots, v_n$ be a path graph of length $n$ with the mechanism specified only at the head node $v_0$, i.e., $p(v_0) = \Pr[\mathcal{M}(v_0) = 1] =\alpha$ is given. The query value at $v_0$ can be either $T(v_0) = 1$ or $T(v_0) = 2$, but it is assumed $T(v_i) = 1$ across every other node on the path. This ensures that extending $p(v_0)$ in an optimal manner across the rest of the path is equivalent to maximizing $p(v_i)$, for $1 \leq i \leq n$. Since we are dealing with a path graph only and for simplicity of notation, we use the shorthand $\varepsilon_i \coloneqq\varepsilon(v_i,v_{i+1})$ here. Therefore, \eqref{eq: r1} and \eqref{eq: 0DPW3} are re-written for $i = 0, \cdots, n-1$ as \begin{align}\label{eq: d=0, ex+d} p(v_{i+1}) &\leq e^{\varepsilon_i} p(v_{i}),\\ p(v_{i+1}) &\leq \frac{ p(v_{i}) -1 + e^{\varepsilon_i}}{e^{\varepsilon_i}} \label{eq: d=0, e(1-a)+d}. \end{align} Among the two upper bounds \eqref{eq: d=0, ex+d} and \eqref{eq: d=0, e(1-a)+d} on $p(v_{i+1})$, the smallest one prevails at dictating the optimal mechanism: $$p(v_{i+1}) \leq \min \left\{ e^{\varepsilon_i} p(v_{i}), \frac{ p(v_{i}) -1 + e^{\varepsilon_i}}{e^{\varepsilon_i}}\right\}.$$ We first present a simple lemma that characterizes which upper bound among \eqref{eq: d=0, ex+d} and \eqref{eq: d=0, e(1-a)+d} is the tightest. \begin{lemma}\label{lem: iff} A necessary and sufficient condition for \[\min \left\{ e^{\varepsilon_i} p(v_{i}), \frac{ p(v_{i}) -1 + e^{\varepsilon_i}}{e^{\varepsilon_i}}\right\} = e^{\varepsilon_i} p(v_{i}) \] is that $p(v_i) \leq (e^{\varepsilon_i}+ 1)^{-1}$. \end{lemma} \begin{IEEEproof} \begin{align*} e^{\varepsilon_i} p(v_i) \leq \frac{ p(v_i) -1 + e^{\varepsilon_i}}{e^{\varepsilon_i}} &\iff\\ e^{2\varepsilon_i} p(v_i) \leq p(v_i) -1 + e^{\varepsilon_i} &\iff \\ e^{2\varepsilon_i} p(v_i) -p(v_i) \leq e^{\varepsilon_i} -1 &\iff \\ (e^{2\varepsilon_i}-1) p(v_i) \leq e^{\varepsilon_i} -1 &\iff p(v_i) \leq \frac{1}{e^{\varepsilon_i}+1} \end{align*} where the last step follows from $e^{\varepsilon_i} -1 \geq 0$. Note, that if $e^{\varepsilon_i}-1 = 0$ then, the inequality is trivial.\footnote{Note that Lemma \ref{lem: iff} is true for the general graph and general $\varepsilon(u,v)$.} \end{IEEEproof} The optimal binary-valued heterogeneous differentially private mechanism $p^*$ with initial condition $p^*(v_0) = \alpha$, follows from Lemma \ref{lem: iff} and induction on $i$, and is given by\footnote{We check if \eqref{eq: optimalp} gives a value greater than 1 and if so, set $ p^*(v_{i+1}) = 1$.} \begin{align}\label{eq: optimalp} p^*(v_{i+1}) = \min \left\{ e^{\varepsilon_i} p^*(v_{i}), \frac{ p^*(v_{i}) -1 + e^{\varepsilon_i}}{e^{\varepsilon_i}}\right\}. \end{align} \begin{theorem}\label{theo: pathupperboundary} The function $p^*$ given in \eqref{eq: optimalp} is the unique optimal $\varepsilon(\cdot)$-DP mechanism on the path graph $\rho$. \end{theorem} \begin{IEEEproof} Assume that $p^*$ is not optimal. Let $ p':V\to [0,1]$ be another binary-valued heterogeneous $\varepsilon(\cdot)$-differentially private function and let $k \in \mathbb{N}$ be the smallest number such that $p^*(v_k) < p'(v_k)$. As $k$ is the smallest number which satisfies the statement above, we obtain $ p'(v_{k-1}) \leq p^*(v_{k-1}) $. This means we have \begin{align}\label{eq:intermediate1} e^{\varepsilon_{k-1}} p'(v_{k-1}) &\leq e^{\varepsilon_{k-1}} p^*(v_{k-1}),\\ \frac{ p'(v_{k-1}) -1 + e^{\varepsilon_{k-1}}}{e^{\varepsilon_{k-1}}} &\leq \frac{ p^*(v_{k-1}) -1 + e^{\varepsilon_{k-1}}}{e^{\varepsilon_{k-1}}}.\label{eq:intermediate2} \end{align} Since $p'$ is an $\varepsilon(\cdot)$-differentially private function, it satisfies \eqref{eq: d=0, ex+d} and \eqref{eq: d=0, e(1-a)+d}. Combining this with \eqref{eq:intermediate1} and \eqref{eq:intermediate2} we obtain \begin{align} p'(v_{k}) &\leq \min \left\{e^{\varepsilon_{k-1}} p'(v_{k-1}) , \frac{ p'(v_{k-1}) -1 + e^{\varepsilon_i}}{e^{\varepsilon_{k-1}}} \right\}\\ &\leq \min \left\{e^{\varepsilon_i} p^*(v_{k-1}),\frac{ p^*(v_{k-1}) -1 + e^{\varepsilon_{k-1}}}{e^{\varepsilon_{k-1}}}\right\} \\&= p^*(v_{k}), \end{align} where the last equality is due to the construction of $p^*$ in Theorem \ref{theo: pathupperboundary}. This contradicts the first assumption. The proof of uniqueness is straightforward. \end{IEEEproof} We now show how to find the optimal $\varepsilon(\cdot)$-DP mechanism for the path graph. \begin{theorem}\label{theo:path} Let the path graph $\rho = v_0, \cdots, v_n$ and the mechanism at its head vertex $p(v_0) = \alpha$ be given. Assume that $T(v_i) = 1$ and $\varepsilon_i > 0$ is fixed, for $1\leq i\leq n$. Then, the optimal binary-valued heterogeneous differentially private mechanism $p^*$ is given by \begin{align*} p^*(v_i) \coloneqq \begin{cases} e^{\varepsilon_{i-1}+\cdots + \varepsilon_{0}} \alpha, & i \leq \tau, \\ e^{-\varepsilon_{i-1}-\dots - \varepsilon_{\tau+1} - \varepsilon_{\tau} +\varepsilon_{\tau-1}\dots + \varepsilon_{0}} \alpha & i > \tau. \\ \quad + 1 - e^{-\varepsilon_{i-1}-\dots - \varepsilon_{\tau}}, \end{cases} \end{align*} where \begin{align}\label{eq:tau0} \tau &= \argmin_{i \in [n]}\left\{\frac{1}{\alpha}\leq e^{\varepsilon_{i-1}+\varepsilon_{i-2} +\dots + \varepsilon_{0}}(e^{\varepsilon_{i}}+1)\right\}. \end{align} \end{theorem} \begin{IEEEproof} First assume that there exists some $k \in [n]$ such that for all $1 \leq i < k$, we have $\min \{ e^{\varepsilon_i} p(v_{i}), \frac{ p(v_{i}) -1 + e^{\varepsilon_i}}{e^{\varepsilon_i}}\} = e^{\varepsilon_i} p(v_{i})$. That is, \eqref{eq: d=0, ex+d} is the tightest upper bound on $p(v_{i+1})$. We will soon find the largest $k$ for which this can happen. Iterating over $i = k, k-1, \cdots, 1$, we will construct the mechanism $p^*$ through induction \begin{align}\label{eq:last1} \mathllap p^*(v_{k}) & = e^{\varepsilon_{k-1}} p^*(v_{k-1})\\ & = e^{\varepsilon_{k-1}}\big{(}e^{\varepsilon_{k-2}} p^*(v_{k-2})\big{)}\\ & \cdots\\ & = e^{\varepsilon_{k-1}}\bigg{(} e^{\varepsilon_{k-2}} \Big{(} \cdots \big{(}e^{\varepsilon_{0}} p(v_{0}) \big{)} \cdots \Big{)} \bigg{)}\\ &= e^{\varepsilon_{k-1}+\varepsilon_{k-2} +\dots + \varepsilon_{0}} \alpha.\label{eq:lastn} \end{align} We now want to find the smallest index on the path for which \eqref{eq: d=0, ex+d} is not tight. This is, we want to find the last index for which the iterations \eqref{eq:last1}-\eqref{eq:lastn} hold. Let this parameter to be $\tau$. Therefore, on the one hand, $\tau$ satisfies \begin{align}\label{eq:tau1} p^*(v_{\tau}) & = e^{\varepsilon_{\tau-1}+\varepsilon_{\tau-2} +\dots + \varepsilon_{0}}\alpha. \end{align} On the other hand, by the definition of $\tau$, for $i = \tau + 1$, \eqref{eq: d=0, e(1-a)+d} will give the tightest upper bound on $p(v_{\tau+1})$. That is, $$\min \left\{ e^{\varepsilon_\tau} p^*(v_{\tau}), \frac{ p^*(v_{\tau}) -1 + e^{\varepsilon_\tau}}{e^{\varepsilon_\tau}}\right\} = \frac{ p^*(v_{\tau}) -1 + e^{\varepsilon_\tau}}{e^{\varepsilon_\tau}}.$$ Therefore, from Lemma \ref{lem: iff}, we must have \begin{align}\label{eq:tau2} p^*(v_{\tau}) \geq \frac{1}{ e^{\varepsilon_{\tau}} + 1}. \end{align} Combining \eqref{eq:tau2} and \eqref{eq:tau1} and taking the minimum over all $i\in [n]$ gives \eqref{eq:tau0}. We need to verify that the upper bounds \eqref{eq: d=0, ex+d} and \eqref{eq: d=0, e(1-a)+d} do not ``toggle" or ``alternate" in providing the tightest bound on $p^*(v_i)$ for $i > \tau$. Referring to Lemma \ref{lem: iff}, this is equivalent to verifying that for every $\tau \leq i \leq n$ we will have \[p^*(v_{i}) \geq \frac{1}{ e^{\varepsilon_{i}} + 1}.\] For $i = \tau$ this holds by definition. For $\tau < i \leq n$, this can be proved via contradiction. Assume there exists $i> \tau$ such that the following statements are satisfied. \begin{align}\label{eq:firsttau} p^*(v_{i}) &\geq \frac{1}{ e^{\varepsilon_{i}} + 1},\\ p^*(v_{i+1}) &< \frac{1}{ e^{\varepsilon_{i+1}} + 1}.\label{eq:secondtau} \end{align} Since \eqref{eq:firsttau} is satisfied, from Lemma \ref{lem: iff}, we must have: \begin{align} p^*(v_{i+1})&= \min \left\{ e^{\varepsilon_i} p^*(v_{i}), \frac{ p^*(v_{i}) -1 + e^{\varepsilon_i}}{e^{\varepsilon_i}}\right\} \\&= \frac{ p^*(v_{i}) -1 + e^{\varepsilon_{i}}}{e^{\varepsilon_{i}}}. \end{align} Therefore, substituting $p^*(v_{i+1})$ with the above equation in \eqref{eq:secondtau} leads us to: \begin{align} \label{eq: <1} p^*(v_{i+1}) = \frac{ p^*(v_{i}) -1 + e^{\varepsilon_{i}}}{e^{\varepsilon_{i}}} <\frac{1}{ e^{\varepsilon_{i+1}} + 1}. \end{align} Using the bound in \eqref{eq:firsttau} on $p^*(v_i)$ in the above gives \[ \frac{ \frac{1}{ e^{\varepsilon_{i}} + 1} -1 + e^{\varepsilon_{i}}}{e^{\varepsilon_{i}}} < \frac{1}{ e^{\varepsilon_{i+1}} + 1}, \] which is equivalent to: \begin{align} \frac{ \frac{1+ e^{2\varepsilon_{i}} - 1}{ e^{\varepsilon_{i}} + 1}} {e^{\varepsilon_{i}}} &< \frac{1}{ e^{\varepsilon_{i+1}} + 1}\iff \\ \frac{ e^{\varepsilon_{i}}} { e^{\varepsilon_{i}} + 1} &< \frac{1}{ e^{\varepsilon_{i+1}} + 1} \iff e^{\varepsilon_{i}} e^{\varepsilon_{i+1}} < 1. \end{align} The last statement is a contradiction as $ 0< \varepsilon_{i} + \varepsilon_{i+1}$. Having proved that the optimal mechanism has at most two regimes, as determined by a single $\tau$, the last step is to provide a closed-form expression for the iterations $\tau < i \leq n $. Starting with $i = \tau+1$, we will have \begin{align} p^*(v_{\tau+1}) &= \frac{ p^*(v_{\tau}) -1 + e^{\varepsilon_\tau}}{e^{\varepsilon_\tau}}\\&=\frac{e^{\varepsilon_{\tau-1}+\varepsilon_{\tau-2} +\dots + \varepsilon_{0}}\alpha-1+e^{\varepsilon_\tau}}{e^{\varepsilon_\tau}}\\&=e^{-\varepsilon_\tau}e^{\varepsilon_{\tau-1}+\varepsilon_{\tau-2} +\dots + \varepsilon_{0}}\alpha-e^{-\varepsilon_\tau}+1. \end{align} For $i = \tau +2$, we will get \begin{align*} p^*(v_{\tau+2}) &= \frac{ p^*(v_{\tau+1}) -1 + e^{\varepsilon_{\tau+1}}}{e^{\varepsilon_{\tau+1}}}\\&=\frac{ e^{-\varepsilon_\tau+\varepsilon_{\tau-1}+\varepsilon_{\tau-2} +\dots + \varepsilon_{0}}\alpha-e^{-\varepsilon_\tau}+ e^{\varepsilon_{\tau+1}}}{e^{\varepsilon_{\tau+1}}}\\&= e^{-\varepsilon_{\tau+1}-\varepsilon_\tau+\varepsilon_{\tau-1}+\varepsilon_{\tau-2} +\dots + \varepsilon_{0}}\alpha-e^{-\varepsilon_{\tau+1}-\varepsilon_\tau}+1. \end{align*} continuing this for $i > \tau + 2$ completes the proof. \end{IEEEproof} We recover the result for the homogeneous case \cite{RafnoDP2colorPaper}. \begin{corollary} Let $\varepsilon > 0$ and set $\varepsilon_i = \varepsilon$ for $i \in [n]$. Theorem~\ref{theo:path} recovers the results in \cite{RafnoDP2colorPaper} for $\delta = 0$. \end{corollary} \begin{IEEEproof} For $\varepsilon_i = \varepsilon$ for $i \in [n]$, the value of $\tau$ from \eqref{eq:tau0} is \begin{align}\label{eq:tauspecial} \tau_1 &= \left\lceil\frac{1}{\varepsilon}\log\left(\frac{1}{\alpha(1+e^{\epsilon})}\right)\right\rceil. \end{align} Under $\varepsilon_i = \varepsilon$ for $i \in [n]$, $p^*$ given in Theorem \ref{theo:path} is simplified to \begin{align*} p^*(v_i) \coloneqq \begin{cases} e^{i\varepsilon} \alpha, & i \leq \tau_1, \\ 1-e^{(i-\tau_1)\varepsilon}+e^{(-i+2\tau_1)\varepsilon}\alpha, & i > \tau_1. \end{cases} \end{align*} Note the results in \cite{RafnoDP2colorPaper} were in terms of ``the probability of being red": $R_i = (1-p_i) = \Pr[\mathcal{M}(v_i) = 2]$. Also, the head vertex in \cite{RafnoDP2colorPaper} started at $i = n_B$ instead of $i=0$ here, which is adopted for easier notation in this paper. With appropriate index conversion, it can be verified that we recover the results in Theorem 10 in \cite{RafnoDP2colorPaper} for $\delta = 0$. \end{IEEEproof} \subsection{The General Case}\label{TSaP.B} In this section, we generalize the results of the previous section. We assume for a given general graph $\mathcal{G}$ and heterogeneous privacy budget $\varepsilon(\cdot)$ over $E$, the mechanism is specified a priori over a subset of vertices $S\subseteq V$, such that $\partial _T (\mathcal{G})\subseteq S$, i.e, $p(u) = \alpha_u$, for every $u\in S$, is given with no additional assumptions on $\alpha_u$. Our goal is to extend $p$ for all other vertices whose mechanism is to be specified in an optimal and computationally efficient manner. The following definition will come handy. \begin{definition}[The path upper bound function]\label{def: The path upper bound function} For every vertex $v \in \mathcal{G}$ and $(u,v)$-path $\rho \in \mathcal{P}(u,v)$ such that its head node $u\in S$, we define $U_{\rho, \alpha_u} (v)$ to be the upper bound on the value of $p(v)$ imposed by $p(u) = \alpha_u$. \end{definition} We prove that the following optimization problem can be solved in polynomial time for every vertex $u$ with a fixed value $\alpha \in [0,1]$. \[\minimize_{\rho \in \mathcal{P}(u,v)} \quad U_{\rho, \alpha}(v)\] To this end, we propose the polynomial Algorithm \ref{algo: subroutine} which takes $u,\alpha$ and $ \mathcal{G}$ as the input and outputs $A_{u, \alpha}(v)$ for every vertex $v \in V$ such that $A_{u, \alpha}(v) = \min _{\rho \in \mathcal{P}(u,v)} U_{\rho, \alpha}(v).$ \begin{theorem}\label{theo: aoptimal} If $A_{u, \alpha}(v)$ is the output of the Algorithm \ref{algo: subroutine} then, \[A_{u, \alpha}(v) = \min _{\rho \in \mathcal{P}(u,v)} U_{\rho, \alpha}(v).\] \end{theorem} \begin{IEEEproof} Let $v_1, \dots , v_{n-1}$ be the vertices of graph in the order Algorithm \ref{algo: subroutine} selects. By contradiction, let $k$ be the smallest index such that $A_{u, \alpha}(v_k) \not = \min _{\rho \in \mathcal{P}(u,v_k)} U_{\rho, \alpha}(v).$ First, assume that $A_{u, \alpha}(v_k) < \min _{\rho \in \mathcal{P}(u,v_k)} U_{\rho, \alpha}(v_k).$ From Algorithm \ref{algo: subroutine} (line 7), we have $A_{u, \alpha}(v_k) = \min_{v \in N(S_k)} \alpha^*(v)$. Define $u_k$ as: \[ \begin{aligned} u_k := \argmin_{v' \in N^*(v_k)} U_{(v',v_k),A_{u, \alpha}(v')}(v_k)\\ \Rightarrow A_{u, \alpha}(v_k) = U_{(u_k,v_k),A_{u, \alpha}(u_k)}(v_k). \end{aligned} \] Then, by the choice of $k$, $u_k $ belongs to $S_k$ and we have: \[A_{u, \alpha}(u_k) = \min _{\rho \in \mathcal{P}(u,u_k)} U_{\rho, \alpha}(u_k) = U_{\rho', \alpha}(u_k).\] Then, following from Lemma \ref{lem: increasing} we have: \[ \begin{aligned} A_{u, \alpha}(v_k) & = U_{(u_k,v_k),A_{u, \alpha}(u_k)}(v_k) &\\ & = U_{(u_k,v_k),U_{\rho', \alpha}(u_k)}(v_k)& = U_{\rho' v_k,\alpha}(v_k). \end{aligned} \] Thus, $ A_{u, \alpha}(v_k)$ ($=U_{\rho' v_k,\alpha}(v_k)$) cannot be less than $\min _{\rho \in \mathcal{P}(u,v)} U_{\rho, \alpha}(v_k)$. \\It remains to consider the case: $A_{u, \alpha}(v_k) > \min _{\rho:\rho \in \mathcal{P}(u,v_k)} U_{\rho, \alpha}(v_k).$ Let $\rho$ be the $(u,v_k)$-path that imposes the strongest induced condition on $v_k$. First observe that $\rho$ connects a vertex inside $S_k$ (i.e., $u$) to a vertex outside (i.e., $v_k$). Following from Lemma \ref{lem: increasing}, if we traverse this path from head to tail, the first time we leave $S_k$ must be the last step. Since, otherwise we would not have selected $v_k$. \\Let $w$ be the vertex on $\rho$ before we reach $v_k$. Hence, $w $ is also appeared in $N^*(v_k)$. Therefore, by the choice of $\alpha^*(v_k)$, we have $A_{u, \alpha}(v_k)=\alpha^*(v_k) \leq U_{(w,v_k),A_{u,\alpha}(w)}(v_k)$. The equality is because of the choice of $v_k$ and the inequality is because of the definition of $\alpha^*$ and the fact that $U_{(w,v_k),A_{u,\alpha}(w)}$ is one of the terms in minimizing the problem which defines $\alpha^*(v_k)$. \end{IEEEproof} Let $p: S \to [0,1]$ be a partial function. We want to know under what condition $p$ can be extended to an $\varepsilon$-DP function. To this end, first we define the notion of \say{compatible function} and then we show that the necessary and sufficient condition for $p$ to be extendable to a $\varepsilon$-DP function is the compatibility condition. We also prove that testing compatibility can be done in polynomial time. \begin{definition} A partial function $p:S \to [0,1]$ is called compatible if, for every vertices $u,v \in S$, it follows that $p(v) \leq \min _{\rho \in \mathcal{P}(u,v)} U_{\rho, \alpha}(u)$. \end{definition} Now we give the technical proof of Theorem \ref{theorem:main1}. \begin{algorithm}[t] \caption{Construction of the $A$ function}\label{algo: subroutine} \SetAlgoLined \SetAlgoNoLine \SetAlgoLined \textbf{Input:} Graph $\mathcal{G} $, $u \in V$, $\alpha_{u} = p(u)$. \textbf{Output: Function $A_{u, \alpha}: V \to [0,1]$} \nl $i \gets 1$ \nl $S_1 \gets \{u\}$ \nl $A_{u,\alpha}(u) \gets \alpha_{u} $ \While{$|S_i|< |V| $}{ \For{ $v \in N(S_i)$}{ \nl $N^*(v) \gets N(v) \cap S_i $ \nl $\alpha^*(v) \gets \min_{v' \in N^*(v)} U_{(v',v),A_{u,\alpha}(v')}(v)$ } \nl $v_i \gets \argmin_{v \in N(S_i)} \alpha^*(v)$ \nl $A_{u, \alpha}(v_i) \gets \min_{v \in N(S_i)} \alpha^*(v)$ \nl $S_{i+1} \gets S_i \cup \{v_i\}$ \nl $i \gets i+1$ } \end{algorithm} \begin{algorithm}[t] \caption{Construction of the extension of a mechanism} \label{algo: acomplete} \SetAlgoLined \textbf{Input:} Graph $\mathcal{G} $, subset $S \subseteq V$ which $\partial _T (\mathcal{G}) \subseteq S$, partial function $p: S \to [0,1]$. \textbf{Output: Function $\tilde{p}: V \to [0,1]$} \nl $S_1 \gets S$ \If{$p$ is not compatible}{ \nl \Return No $\varepsilon(\cdot)$-DP extension of $p$ exists. } \For{$v \in S $ }{ \nl $\tilde{p}(v) \gets p(v) $ } \For{ $v \in V \setminus S $}{ \If{$T(v) = 1$}{ \nl $\tilde{p}(v) \gets \min_{u \in S} A_{u, \tilde{p}(u)}(v)$ } \If{$T(v) = 2$}{ \nl $\tilde{p}(v) \gets \min_{u \in S} A_{u, 1- \tilde{p}(u)}(v)$ } } \end{algorithm} \begin{IEEEproof}[Proof of Theorem \ref{theorem:main1}] Since $\tilde{p}$ is an extension function of $p$, for the sake of simplicity, in the rest of the proof, we denote $\tilde{p}$ by $p$. In Section \ref{HDP}, we argued that to complete the proof of Theorem \ref{theorem:main1}, we must show that if Algorithm \ref{algo: acomplete} outputs a function $p$, then it is an $\varepsilon(\cdot)$-DP mechanism. By the definition, to show that a function is $\varepsilon(\cdot)$-DP, we must verify \eqref{eq: r1} and \eqref{eq: r2} hold for every edge $(u, v)$ in $E$. We consider three cases. \begin{itemize} \item{\textbf{Case 1: ($u,v \in S$)}} In this case, since the algorithm has passed the compatibility test, the value of $p$ at $u,v$ are consistent; that is, $p(v)$ is no more than the strongest condition $p(u)$ imposes on it via all possible $(u, v)$-paths. In particular, the one imposed by the edge $(u,v)$ is also guaranteed. Similarly, the condition $p(v)$ imposes on $p(u)$ must be satisfied. Thus, the initial conditions on the edge $(u,v)$ are satisfied. \item{\textbf{Case 2: ($u\in S, v\notin S$)}} First, because of the symmetry and without loss of generality, let us assume that $T(v)=1$. In this case, similar to the earlier case, we can observe that the condition $p(u)$ imposes on $p(v)$ is satisfied. We just have to show that the converse is also true. Assuming the opposite we have $U_{(v,u), p(v) } (u) < p(u)$. Since $p(v)$ is assigned by the algorithm as the least upper bounds imposed by all the vertices in $S$ via all the possible paths connecting them to $v$, let $\omega$ and $\rho_1$ be the vertex and the path that give the least upper bound to $p(v)$. Then, following from Lemma \ref{lem: increasing} we have: \begin{align}\label{eq: T5,e2} \begin{aligned} U_{\rho_1u, p(\omega) } (u) & = U_{(v,u), [U_{\rho_1, p(\omega) } (v) ]} (u) \\& = U_{(v,u), p(v)} (u) . \end{aligned} \end{align} Following from the compatibility condition, as $\omega, u \in S$: \begin{align}\label{eq: T5,e1} p(u) \leq U_{\rho_1u, p(\omega) } (u). \end{align} Finally, \eqref{eq: T5,e2} and \eqref{eq: T5,e1} lead us to the following contradiction: $p(u) \leq U_{\rho_1u, p(\omega) } (u) = U_{(v,u), p(v)} (u) < p(u) $. \item{\textbf{Case 3: ($u,v \notin S$)}} In this case, we first observe that $T(u)=T(v)$, since if it is not the case, then $u$ and $v$ are boundary vertices and therefore by the assumption, $u,v\in S$, which is a contradiction. Now, without loss of generality, let us assume that $T(u)=T(v)=1$ and $U_{(v,u), p(v) } (u) < p(u)$. Then, from the same setting of the previous case we obtain the following equation: $ U_{\rho_1u, p(\omega)}(u) = U_{(v,u), p(v) } (u) < p(u) $. Also, Algorithm \ref{algo: acomplete} (line 13) implies that $p(u) = \min_{\omega' \in S} A_{\omega', p(\omega')}(u)$ and, Theorem \ref{theo: aoptimal} leads us to the following: \[ p(u) = \min_{\omega' \in S} A_{\omega', p(\omega')}(u) = \min_{\omega' \in S, \rho \in \mathcal{P}(\omega',u)} U_{\rho, p(\omega')}(u),\] which contradicts $U_{\rho_1u, p(\omega)}(u)< p(u)$. \end{itemize} The proof of uniqueness is straightforward. The last part in Theorem \ref{theorem:main1} is regarding the time complexity of Algorithm \ref{algo: acomplete}. This is discussed in the next part. \end{IEEEproof} Now, we analyze the running time of Algorithms. In Algorithm \ref{algo: subroutine} at each iteration, every edge which has exactly one endpoint in $S$ is considered, and the one with the best (minimum) upper bound on the other end is selected. This will take at most $\mathcal{O}(|E|)$ time. Thus, Algorithm \ref{algo: subroutine} runs in $\mathcal{O}(|E|\cdot|V|)$ time. In Algorithm \ref{algo: acomplete}, compatibility test takes $\mathcal{O}(|V|^2)$ calls of Algorithm \ref{algo: subroutine}. If $p$ is compatible, then for every vertex $v\in V\setminus S$ we check the best bound. For that, we will call Algorithm \ref{algo: subroutine} $\mathcal{O}(|S| \cdot |V\setminus S| = \mathcal{O}(|V|^2) $ many times. In conclusion, we have the following theorem. \begin{theorem} Algorithm \ref{algo: subroutine} and \ref{algo: acomplete} run in $\mathcal{O}(|E| |V|)$ and $\mathcal{O}(|V|^3|E|)$ respectively. \end{theorem}
a0224214f5937a6609682a65cc7d81a20f02c3a4
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Preliminaries} In this section we summarize the notation that we use throughout the paper, and describe the fundamental notions of vector-valued modular forms. For the basics of classical modular forms, we refer to the book by Miyake~\cite{miyake-1989}, and the book by Diamond and Shurman~\cite{diamond-shurman-2005}. We adopt some notation from~\cite{diamond-shurman-2005} without further mentioning; for example, $\Gamma_\infty$ denotes the parabolic subgroup of~$\SL{2}(\ensuremath{\mathbb{Z}})$ including negative identity, and $\ensuremath{\mathrm{M}}_k$ and~$\ensuremath{\mathrm{S}}_k$ are spaces of modular forms and of cusp forms of weight $k$ and level one. \subsection{Vector-valued modular forms} Let $S=\begin{psmatrix}0&-1\\1&0\end{psmatrix}$ and $T=\begin{psmatrix}1&1\\0&1\end{psmatrix}$ be the standard generators for $\SL2(\ensuremath{\mathbb{Z}})$. An arithmetic type is a finite-dimensional complex representation $\rho$ of $\SL2(\ensuremath{\mathbb{Z}})$. We denote the representation space of $\rho$ by $V(\rho)$ and write $\rho^\vee$ for the dual of $\rho$. Let $k$ be an integer and let $\rho$ be an arithmetic type. Let $f:\mathbb{H}\to V(\rho)$ be a function and let $\|\cdot\|$ be a norm on $V(\rho)$. If there exists a number $a\in\ensuremath{\mathbb{R}}$ such that for all $\gamma\in\SL2(\ensuremath{\mathbb{Z}})$ we have uniformly in $\Re(\tau)$ that \begin{gather*} \big\| \big( f\big|_k\gamma \big) (\tau) \big\| = \ensuremath{\mathcal{O}}(\Im(\tau)^a) \quad\ensuremath{\text}{as\ } \Im(\tau)\to\infty \ensuremath{\text}{,} \end{gather*} then we say that $f$ has moderate growth. Given a function~$f :\, \mathbb{H} \ensuremath{\rightarrow} V(\rho)$, $k \in \ensuremath{\mathbb{Z}}$, and an arithmetic type~$\rho$, we write \begin{gather*} \big( f\big|_{k,\rho}\gamma \big) (\tau) = (c\tau+d)^{-k} \rho(\gamma^{-1}) f(\gamma\tau) \ensuremath{\text}{,}\quad \ensuremath{\text}{where\ } \gamma = \begin{psmatrix}a&b\\c&d\end{psmatrix} \in \SL2(\ensuremath{\mathbb{Z}}). \end{gather*} A vector-valued modular form of weight $k$ and type $\rho$ is a holomorphic function~$f :\, \mathbb{H} \ensuremath{\rightarrow} V(\rho)$ of moderate growth that satisfies $f|_{k,\rho}\gamma=f$ for all~$\gamma\in\SL2(\ensuremath{\mathbb{Z}})$. The space of vector-valued modular forms of type $\rho$ and weight $k$ is denoted by $\ensuremath{\mathrm{M}}_k(\rho)$. \subsection{Vector-valued modular forms of type \texpdf{$\sym^\sfd$}{symd}} \label{ssec:preliminaries:vector_valued_symd} Let $\mathsf{d}$ be a non-negative integer and let $\ensuremath{\mathbb{C}}[X]_\mathsf{d}$ be the space of polynomials in $X$ of degree at most $\mathsf{d}$. Then the $\mathsf{d}$\nobreakdash-\hspace{0pt} th{} symmetric power of the standard representation of $\SL2(\ensuremath{\mathbb{Z}})$, denoted by $\sym^\sfd(X)$, is defined by $V(\sym^\sfd(X))=\ensuremath{\mathbb{C}}[X]_\mathsf{d}$ and the action \begin{gather*} \sym^\sfd(X)(\gamma^{-1})p(X) \;:=\; p(X) \big|_{-\mathsf{d}} \gamma = (cX+d)^\mathsf{d}\, p\big(\mfrac{aX+b}{cX+d}\big) \ensuremath{\text}{,}\quad\ensuremath{\text}{where\ } \gamma=\begin{psmatrix}a&b\\c&d\end{psmatrix} \ensuremath{\text}{.} \end{gather*} The~$j$\nobreakdash-\hspace{0pt} th{} coefficient of~$p \in \ensuremath{\mathbb{C}}[X]_\mathsf{d}$ will be written as~$p_j$. We have a self-duality given by the following pairing on~$\sym^\sfd(X) \otimes \sym^\sfd(X)$: \begin{gather} \label{eq:def:symd_self_duality_pairing} \langle p, q \rangle \;:=\; \sum_{i=0}^\mathsf{d} (-1)^{\mathsf{d}-i} \mbinom{\mathsf{d}}{i}^{-1} p_i q_{\mathsf{d}-i} \ensuremath{\text}{.} \end{gather} Given a polynomial~$p(\tau) \in \ensuremath{\mathbb{C}}_\mathsf{d}[X]$, we have $\langle p(X), (X-\tau)^\mathsf{d} \rangle = p(\tau)$. We use the shorthand notation $|_{k,\mathsf{d}}$ for $|_{k,\sym^\sfd(X)}$ and $\ensuremath{\mathrm{M}}_{k,\mathsf{d}}$ for $\ensuremath{\mathrm{M}}_k(\sym^\sfd(X))$. The graded $\ensuremath{\mathrm{M}}_\bullet$\nobreakdash-\hspace{0pt} module of vector-valued modular forms of type $\sym^\sfd$ is given by \begin{gather*} \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}} \;:=\; \bigoplus_{k \in \ensuremath{\mathbb{Z}}} \ensuremath{\mathrm{M}}_{k,\mathsf{d}} \ensuremath{\text}{.} \end{gather*} The next result is due to Kuga--Shimura~\cite{kuga-shimura-1960}, and we merely rephrase it in our language. Given an integer~$0 \le j \le \mathsf{d}$, we consider the increasing filtration of~$\ensuremath{\mathrm{M}}_{k,\mathsf{d}}$ by the spaces \begin{gather} \label{eq:def:component_vanishing_filtration} \ensuremath{\mathrm{M}}_{k,\mathsf{d}}[j] \;:=\; \Big\{ \sum_{r=j}^\mathsf{d} (X - \tau)^r f_r \in \ensuremath{\mathrm{M}}_{k,\mathsf{d}} \;:\; f_j :\, \mathbb{H} \ensuremath{\rightarrow} \ensuremath{\mathbb{C}} \Big\} \end{gather} of modular forms of type~$\sym^\sfd$, whose lower~$(X-\tau)^r$\nobreakdash-\hspace{0pt} terms vanish. Observe that \begin{gather*} \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j] \;:=\; \bigoplus_{k \in \ensuremath{\mathbb{Z}}} \ensuremath{\mathrm{M}}_{k,\mathsf{d}}[j] \end{gather*} is a module for~$\ensuremath{\mathrm{M}}_{\bullet}$. Therefore the filtration in~\eqref{eq:def:component_vanishing_filtration} yields a filtration of~$\ensuremath{\mathrm{M}}_\bullet$\nobreakdash-\hspace{0pt} modules. \begin{lemma}[See Kuga--Shimura~\cite{kuga-shimura-1960}] \label{la:projection_to_lowest_symd_component} Let~$k$ and~$\mathsf{d} \ge 0$ be even integers. Then for every integer~$0 \le j \le \mathsf{d}$ there is a map \begin{gather} \label{eq:la:projection_to_lowest_symd_component} \pi^{\mathrm{low}}_{k,\mathsf{d},j} :\, \ensuremath{\mathrm{M}}_{k,\mathsf{d}}[j] \ensuremath{\longrightarrow} \ensuremath{\mathrm{M}}_{k + 2j - \mathsf{d}} \ensuremath{\text}{,}\, \sum_{r=j}^{\mathsf{d}} (X - \tau)^r f_r \ensuremath{\longmapsto} f_{j} \ensuremath{\text}{.} \end{gather} The map \begin{gather*} \pi^{\mathrm{low}}_{\bullet,\mathsf{d},j} :\, \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j] \ensuremath{\longrightarrow} \ensuremath{\mathrm{M}}_\bullet \end{gather*} obtained by applying~\eqref{eq:la:projection_to_lowest_symd_component} in weight~$k$ is a homomorphism of\/~$\ensuremath{\mathrm{M}}_\bullet$\nobreakdash-\hspace{0pt} modules. \end{lemma} \begin{proof} The second part of the statement follows directly, since the~$\ensuremath{\mathrm{M}}_\bullet$\nobreakdash-\hspace{0pt} module structure on~$\ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}$ is given by component-wise multiplication with respect to the basis~$(X - \tau)^r$, $0 \le r \le \mathsf{d}$ at~$\tau \in \mathbb{H}$. To prove that the given map is well-defined, we have to show that~$f_{j}$ is invariant under the slash action of~$\SL{2}(\ensuremath{\mathbb{Z}})$ of weight~$k + 2j - \mathsf{d}$. Invariance of~$f_{j}$ under the action of~$T$, follows when employing invariance of the left hand side and comparing terms on the left and right hand side of \begin{gather*} \sum_{r = 0}^\mathsf{d} (X - \tau)^r f_r \;=\; \Big( \sum_{r = 0}^\mathsf{d} (X - \tau)^r f_r \Big) \Big|_{k,\mathsf{d}} T \;=\; \sum_{r = 0}^\mathsf{d} (X - \tau)^r \big( f_r \big| T \big) \ensuremath{\text}{,} \end{gather*} where we have suppressed the weight from the slash action on the right hand side, since the action of~$T$ does not depend on it. To verify invariance under~$S$, we compute \begin{align*} \sum_{r = 0}^\mathsf{d} (X - \tau)^r f_r \;&{}=\; \Big( \sum_{r = 0}^\mathsf{d} (X - \tau)^r f_r \Big) \Big|_{k,\mathsf{d}} S \;=\; \sum_{r = 0}^\mathsf{d} (-1)^r ((X - \tau) + \tau)^{\mathsf{d} -r} (X - \tau)^r \big( f_r \big|_{k+r} S \big) \\ \;{}&=\; \sum_{r = 0}^\mathsf{d} (-1)^r \sum_{i = 0}^{\mathsf{d}-r} \mbinom{\mathsf{d}-r}{i} (X - \tau)^{r+i} \big( f_r \big|_{k+2r+i-\mathsf{d}} S \big) \\ \;{}&=\; \sum_{i = 0}^\mathsf{d} (X - \tau)^i \sum_{r = 0}^i (-1)^r \mbinom{\mathsf{d}-r}{i-r} \big( f_r \big|_{k+r+i-\mathsf{d}} S \big) \ensuremath{\text}{.} \end{align*} If~$f_r = 0$ for~$r < j$, then comparing the left and right hand side, the term with~$r = i = j$ reveals that~$f_{j} = f_{j} |_{k + j + j - \mathsf{d}}\, S$, finishing our proof. \end{proof} \section{Generalized second order modular forms} \label{sec:g2mf} In this section, we define generalized second order modular forms and show that holomorphic Eichler integrals are generalized second order modular forms. Our generalized second order modular forms are similar to the ``extended second order modular forms'' recently studied by Diamantis~\cite{diamantis-2020-preprint}. The next definition features the parabolic cohomology group~$\rmH^1_{\para}(\Gamma, \sigma^\vee \otimes \rho)$, which we revisit in Section~\ref{ssec:second_order:cohomology} for completeness. \begin{definition} \label{def:generalized_second_order_modular_forms} Let $\rho$ and $\sigma$ be arithmetic types for a finite index subgroup $\Gamma\subseteq\SL2(\ensuremath{\mathbb{Z}})$, and let $k$ be an integer. We say that a holomorphic function $f:\, \mathbb{H} \ensuremath{\rightarrow} V(\rho)$ of moderate growth is a generalized second order modular form of weight~$k$ and type~$(\rho,\sigma)$ if there exists a finite subset $A \subseteq \rmZ^1_{\para}(\Gamma, \sigma^\vee\otimes\rho)$ and a corresponding set of holomorphic modular forms $g_\phi \in \ensuremath{\mathrm{M}}_k(\sigma)$, $\phi \in A$, such that for every $\gamma\in\Gamma$, we have \begin{gather} \label{eq:def:generalized_second_order_modular_forms} \big( f \big|_{k,\rho} (\gamma-1) \big)(\tau) \;=\; \sum_{\phi\in A} \phi\big( \gamma^{-1} \big) \big( g_\phi(\tau) \big) \ensuremath{\text}{.} \end{gather} \end{definition} We write~$\ensuremath{\mathrm{M}}_k^{[1]}(\rho,\sigma)$ for the space of generalized second order modular forms of weight~$k$ and arithmetic type~$(\rho,\sigma)$. We have an inclusion \begin{gather} \ensuremath{\mathrm{M}}_k(\rho) \;\subseteq\; \ensuremath{\mathrm{M}}_k^{[1]}(\rho,\sigma) \ensuremath{\text}{.} \end{gather} Generalized second order modular forms of type $(\ensuremath{\mathds{1}},\ensuremath{\mathds{1}})$ are the same as second order modular forms, introduced by Goldfeld~\cite{goldfeld-1999}. It is possible to view generalized second order modular forms as components of vector-valued modular forms of suitable arithmetic type~\cite{mertens-raum-2021}. \subsection{Cohomology} \label{ssec:second_order:cohomology} Consider arithmetic types~$\rho$ and~$\sigma$. Throughout this work, we identify~$V(\sigma)^\vee \otimes V(\rho)$ with~$\ensuremath{\mathrm{Hom}}(V(\sigma), V(\rho))$. We denote the group of $1$-coboundaries and $1$-cocycles by \begin{align*} \ensuremath{\mathrm{B}}^1(\SL{2}(\ensuremath{\mathbb{Z}}),\, \rho) &\;=\; \big\{ f : \SL{2}(\ensuremath{\mathbb{Z}}) \to V(\rho), \gamma \ensuremath{\mapsto} \rho(\gamma) v - v \,:\, v \in V(\rho) \big\} \ensuremath{\text}{,} \\ \ensuremath{\mathrm{Z}}^1(\SL{2}(\ensuremath{\mathbb{Z}}),\, \rho) &\;=\; \big\{ f : \Gamma \to V(\rho) \,:\, \forall \gamma_1,\gamma_2 \in \Gamma \,.\, f(\gamma_1\gamma_2) = \rho(\gamma_1) f(\gamma_2) + f(\gamma_1) \big\} \ensuremath{\text}{.} \end{align*} Cocycles and coboundaries that vanish on all parabolic elements of~$\Gamma$ are called parabolic. We denote the corresponding subgroups by~$\rmB^1_{\para}(\SL{2}(\ensuremath{\mathbb{Z}}), \rho)$ and~$\rmZ^1_{\para}(\SL{2}(\ensuremath{\mathbb{Z}}), \rho)$. The quotient \begin{gather*} \rmH^1_{\para}(\SL{2}(\ensuremath{\mathbb{Z}}),\, \rho) \;:=\; \rmZ^1_{\para}(\SL{2}(\ensuremath{\mathbb{Z}}),\, \rho) \big\slash \rmB^1_{\para}(\SL{2}(\ensuremath{\mathbb{Z}}),\, \rho) \end{gather*} is called the $1$-st parabolic cohomology group with coefficients in~$\rho$. We identify cohomology classes with representatives via a section to the quotient map from cocycles to cohomology classes, that we fix once and for all. Recall the pairing on~$V(\sym^\sfd) \otimes V(\sym^\sfd)$ in~\eqref{eq:def:symd_self_duality_pairing}. Given~$\phi \in \rmZ^1_{\para}(\SL{2}(\ensuremath{\mathbb{Z}}), \sym^\sfd(X))$, we define a ``dual'' cocycle~$\phi^\vee \in \rmZ^1_{\para}(\SL{2}(\ensuremath{\mathbb{Z}}), \sym^\sfd(X)^\vee)$ by \begin{gather} \label{eq:def:dual_cocycle} \phi^\vee(\gamma)(v) \;:=\; \langle \phi(\gamma), v \rangle \ensuremath{\text}{,}\qquad \phi^\vee(\gamma^{-1}) = \sum_{i = 0}^\mathsf{d} (-1)^{\mathsf{d}-i} \mbinom{\mathsf{d}}{i}^{-1} \phi(\gamma^{-1})_{\mathsf{d}-i} (X^i)^\vee \ensuremath{\text}{,} \end{gather} where~$X^{\vee\,i}$, $0 \le i \le \mathsf{d}$, is the dual basis of~$X^i$, $0 \le i \le \mathsf{d}$. Given a holomorphic function~$f :\, \mathbb{H} \ensuremath{\rightarrow} \ensuremath{\mathbb{C}}$ and~$k \in \ensuremath{\mathbb{Z}}$, we have a $1$-coboundary \begin{gather} \label{eq:def:cocycle_modular_deficit} \phi_f(\gamma) \;:=\; f \big|_k (\gamma^{-1} - 1) \,\in\, \ensuremath{\mathrm{B}}^1\big( \SL{2}(\ensuremath{\mathbb{Z}}),\, \ensuremath{\mathcal{H}}_k(\mathbb{H}) \big) \ensuremath{\text}{,} \end{gather} where~$\ensuremath{\mathcal{H}}_k(\mathbb{H})$ is space of holomorphic functions from~$\mathbb{H}$ to~$\ensuremath{\mathbb{C}}$ equipped with the weight-$k$ slash action of~$\SL{2}(\ensuremath{\mathbb{Z}})$. Note that~$\phi_f$ vanishes if and only if~$f$ is modular invariant of weight~$k$ for $\SL2(\ensuremath{\mathbb{Z}})$. \subsection{Eichler integrals} \label{ssec:eich_int_g2mf} Given a positive, even integer~$k$, recall the Eichler integral associated with a cusp form~$f \in \ensuremath{\mathrm{S}}_k$: \begin{gather} \label{eq:def:eichler_integral} \mathcal{E}(f)(\tau) \;:=\; \int_\tau^{i\infty} f(z) (\tau-z)^{k-2} \ensuremath{\mathrm{d}} z \ensuremath{\text}{.} \end{gather} This integral is absolutely convergent and holomorphic in~$\tau$. The cocycle attached to~$\ensuremath{\mathcal{E}}(f)$ is given by \begin{gather} \label{eq:cocycle_eichler_integral} \phi_{\mathcal{E}(f)}(\gamma) = \mathcal{E}(f) \big|_{2-k} (\gamma^{-1}-1) \in \rmZ^1_{\para}\big( \SL{2}(\ensuremath{\mathbb{Z}}), \ensuremath{\mathrm{sym}}^{k-2}(\tau) \big) \ensuremath{\text}{.} \end{gather} Notice that while it is a co-boundary when viewed as a cocycle with coefficients in~$\ensuremath{\mathcal{H}}_{2-k}(\mathbb{H})$ as in~\eqref{eq:def:cocycle_modular_deficit}, it is nontrivial in general when viewed as a cocycle with coefficients in~$\ensuremath{\mathrm{sym}}^{k-2}(\tau)$. The value of~\eqref{eq:cocycle_eichler_integral} at~$S$ can be described in terms of special~$\ensuremath{\mathrm{L}}$-values for~$f$ (see for example~\cite{kohnen-zagier-1984}): \begin{gather*} \phi_{\mathcal{E}(f)}(S) = \sum_{j=0}^{k-2} \tau^{k-2-j}\, \frac{(k-2)!}{(k-2-j)!\, (2\pi i)^{j+1}} \ensuremath{\mathrm{L}}(f;j+1)\, \ensuremath{\text}{.} \end{gather*} A similar consideration shows that for~$\gamma = \begin{psmatrix} a & b \\ c & d \end{psmatrix} \in \SL{2}(\ensuremath{\mathbb{Z}})$, we have \begin{gather} \label{eq:cocycle_explicit_expression} \phi_{\mathcal{E}(f)}( \gamma^{-1} ) = \sum_{j = 0}^{k-2} \tau^{k-2-j}\, \frac{(k-2)!}{(k-2-j)!} \sum_{r = 0}^j \frac{( d \slash c )^{j-r}}{(j-r)!\, (2 \pi i)^{r+1}} \ensuremath{\mathrm{L}}\big(f, \mfrac{-d}{c}; r+1 \big) \ensuremath{\text}{,} \end{gather} where the additively twisted~$\ensuremath{\mathrm{L}}$\nobreakdash-\hspace{0pt} function of~$f$ is defined via analytic continuation of \begin{gather*} \ensuremath{\mathrm{L}}\big(f, \mfrac{-d}{c}; s \big) := \sum_{n = 1}^\infty e\big(\mfrac{-d}{c}n\big) \frac{c(f;n)}{n^s} \ensuremath{\text}{.} \end{gather*} Leveraging the cocycle in~\eqref{eq:cocycle_eichler_integral}, we find that Eichler integrals are generalized second order modular forms. The next proposition can be viewed as a special case of Theorem~3.7 of~\cite{mertens-raum-2021} when using the language of vector-valued modular forms. \begin{proposition} \label{prop:eichler_integral} Given a positive, even integer~$k$, consider a cusp form~$f \in \ensuremath{\mathrm{S}}_k$. Then \begin{gather*} \ensuremath{\mathcal{E}}(f) \in \ensuremath{\mathrm{M}}^{[1]}_{2-k}\big( \ensuremath{\mathds{1}}, \ensuremath{\mathrm{sym}}^{k-2}(X) \big) \ensuremath{\text}{.} \end{gather*} \end{proposition} \begin{proof} We write~$\phi$ for the cocycle attached to~$\ensuremath{\mathcal{E}}(f)$ in~\eqref{eq:cocycle_eichler_integral} and~$\phi^\vee$ for its dual defined in~\eqref{eq:def:dual_cocycle}. In Definition~\ref{def:generalized_second_order_modular_forms}, we set~$A = \{\phi^\vee\}$ and~$g_{\phi^\vee} = (X - \tau)^{k-2}$. Rephrasing~\eqref{eq:cocycle_eichler_integral}, we have \begin{gather*} \big( \ensuremath{\mathcal{E}}(f) \big|_{2-k} (\gamma - 1) \big)(\tau) = \phi(\gamma^{-1})(\tau) \ensuremath{\text}{.} \end{gather*} To verify~\eqref{eq:def:generalized_second_order_modular_forms}, we have to see that \begin{gather} \label{eq:prop:eichler_integral:cocycle} \phi(\gamma^{-1})(\tau) = \phi^\vee(\gamma^{-1}) \big( (X - \tau)^{k-2} \big) \ensuremath{\text}{,} \end{gather} which follows directly from the definition of~$\phi^\vee$ in~\eqref{eq:def:dual_cocycle} and the relation stated after~\eqref{eq:def:symd_self_duality_pairing}. Since~$(X - \tau)^{k-2}$ has moderate growth and~$\ensuremath{\mathcal{E}}(f)(\tau) \to 0$ as $\tau \to i\infty$, we see that~$\ensuremath{\mathcal{E}}(f)$ is of moderate growth. Since~$\ensuremath{\mathcal{E}}(f)$ is holomorphic, we have finished the proof. \end{proof} \section{Eisenstein series} \label{sec:eis} In this section we introduce generalized second order Eisenstein series, which yield generalized second order modular forms in the sense of Definition~\ref{def:generalized_second_order_modular_forms}. In particular, they are associated with a pair of arithmetic types~$(\rho,\sigma)$. The construction is based on a parabolic $1$-cocycle for~$\sigma^\vee \otimes \rho$. We determine the Fourier series expansions in the special cases~$(\rho,\sigma)=(\ensuremath{\mathds{1}},\sym^\sfd(X))$ and~$(\rho,\sigma)=(\sym^\sfd(X),\ensuremath{\mathds{1}})$. We start with vector-valued Eisenstein series of type~$\sym^\sfd$ for a nonnegative integer~$\mathsf{d}$. If~$\mathsf{d} = 0$, it equals the classical Eisenstein series~$E_k$ of weight~$k$. Given integers~$k > 2 + \mathsf{d}$ and~$0 \le j \le \mathsf{d}$ with $k \equiv \mathsf{d} \,\pmod{2}$ we define \begin{gather} \label{eq:def:eisenstein_series_symd} E_k(\tau;\mathsf{d},j) \;:=\; \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}})} (X - \tau)^j \big|_{k,\sym^\sfd(X)} \gamma \ensuremath{\text}{.} \end{gather} The definition of generalized second order Eisenstein series requires the group of real unipotent upper triangular matrices: \begin{gather*} \SL{2}(\ensuremath{\mathbb{R}})_\infty \;:=\; \big\{ \pm \begin{psmatrix} 1 & b \\ 0 & 1 \end{psmatrix} \in \SL{2}(\ensuremath{\mathbb{R}}) \; : \; b \in \ensuremath{\mathbb{R}} \big\} \ensuremath{\text}{.} \end{gather*} Note that~$(X-\tau)^j$ in~\eqref{eq:def:eisenstein_series_symd} is invariant under the slash action of~$\SL{2}(\ensuremath{\mathbb{R}})_\infty$. \begin{definition} \label{def:second_order_eisenstein_series} Let $k$ be an integer, $\rho$ and $\sigma$ be arithmetic types, and~$\phi$ be a parabolic $1$-cocycle, i.e., $\phi \in \rmZ^1_{\para}(\SL2(\ensuremath{\mathbb{Z}}), \sigma^\vee \otimes \rho)$. Assume that the restriction of~$\sigma$ to~$\Gamma_\infty$ admits an extension, say~$\sigma_\infty$, to~$\SL{2}(\ensuremath{\mathbb{R}})_\infty$. Consider a smooth function~$f:\mathbb{H} \to V(\sigma)$ that is covariant with respect to real translations: \begin{gather*} \forall g \in \SL{2}(\ensuremath{\mathbb{R}})_\infty \,:\, f \big| g = \sigma_\infty(g) f \ensuremath{\text}{.} \end{gather*} Assuming absolute and locally uniform convergence of the right hand side, the generalized second order Eisenstein series of weight $k$ and type $(\rho,\sigma)$ associated to $(\phi,f)$ is defined as \begin{gather} \label{eq:def:second_order_eisenstein_series} E_k^{[1]}(\tau;\, \phi,f) := \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}})} \phi( \gamma^{-1} ) \Big( \big( f \big|_{k,\sigma} \gamma \big)(\tau) \Big) \ensuremath{\text}{.} \end{gather} \end{definition} \begin{remark} The Eisenstein series in~\eqref{eq:def:second_order_eisenstein_series} is a component of a suitable vector-valued Eisenstein series~\cite{mertens-raum-2021}. \end{remark} A usual argument via reordering summation yields the next statement. \begin{proposition} \label{prop:g2es_is_g2mf} Let~$k$, $\rho$, $\sigma$, $\phi$, and~$f$ be as in Definition~\ref{def:second_order_eisenstein_series}. Assume that~\eqref{eq:def:second_order_eisenstein_series} and the vector-valued Eisenstein series~$\sum f |_{k,\sigma} \gamma$ of type~$\sigma$ converge absolutely and locally uniformly. If~$f$ is holomorphic and ~$E_k^{[1]}(\tau;\,\phi,f)$ has moderate growth, then we have \begin{gather} E_k^{[1]}(\tau;\,\phi,f) \in \ensuremath{\mathrm{M}}_k^{[1]}(\rho,\sigma) \ensuremath{\text}{,} \end{gather} \end{proposition} \begin{proof} As a locally uniform limit of holomorphic functions, $E_k^{[1]}(\;\cdot\;;\, \phi, f)$ is holomorphic. Given~$\delta \in \SL{2}(\ensuremath{\mathbb{Z}})$, continuity and the cocycle relation for~$\phi$ yield \begin{align*} & \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}})} \phi( \gamma^{-1} ) \Big( f \big|_{k,\sigma} \gamma \Big) \big|_{k,\rho} \delta \;=\; \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}})} \rho(\delta^{-1}) \phi( \gamma^{-1} ) \Big( \sigma(\gamma^{-1}) f \big|_k \gamma \delta \Big) \\ =\;& \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}})} \phi( \delta^{-1} \gamma^{-1} ) \Big( \sigma(\delta^{-1}) \sigma(\gamma^{-1}) f \big|_k \gamma \delta \Big) \,-\, \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}})} \phi( \delta^{-1} ) \Big( \sigma(\delta^{-1}) \sigma(\gamma^{-1}) f \big|_k \gamma \delta \Big) \\ =\;& \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}})} \phi( \gamma^{-1} ) \Big( \sigma(\gamma^{-1}) f \big|_k \gamma \Big) \,-\, \phi( \delta^{-1} ) \Bigg( \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}})} \sigma(\delta^{-1}) \sigma(\gamma^{-1}) f \big|_k \gamma \delta \Bigg) \ensuremath{\text}{.} \end{align*} The contribution of~$\delta$ in the argument of the second term can be discarded by modular invariance, thus finishing the proof. \end{proof} Given even integers~$k$ and~$\mathsf{d} \geq 0$, and an integer~$0 \leq j \leq \mathsf{d}$, the constant functions and the functions~$(X-\tau)^j$ satisfy the condition on~$f$ in Definition~\ref{def:second_order_eisenstein_series} for the arithmetic types~$\sigma = \ensuremath{\mathds{1}}$ and~$\sigma = \sym^\sfd(X)$, respectively. By Proposition~5.4 of~\cite{mertens-raum-2021} the associated generalized second order Eisenstein series are defined for~$k \ge 5 + \mathsf{d}$ and yield functions of moderate growth, i.e., generalized second order modular forms. Note that one can improve this bound when employing convexity of additively twisted $\ensuremath{\mathrm{L}}$-functions as in Lemma~\ref{eq:la:cocycle_estimate} or in~\cite{diamantis-2020-preprint}. We use the following shorthand notation: \begin{gather} \label{eq:def:second_order_eisenstein_series_sym_cases} \begin{alignedat}{2} E_k^{[1]}(\tau;\phi) &\;:=\; E_k^{[1]}(\tau;\phi,1) \ensuremath{\text}{,}\quad && \text{if\ }(\rho,\sigma)=(\sym^\sfd(X),\ensuremath{\mathds{1}}) \ensuremath{\text}{;} \\ E_k^{[1]}(\tau;\phi,j) &\;:=\; E_k^{[1]}(\tau;\phi,(X-\tau)^j) \ensuremath{\text}{,}\quad && \text{if\ }(\rho,\sigma)=(\ensuremath{\mathds{1}},\sym^\sfd(X)) \ensuremath{\text}{.} \end{alignedat} \end{gather} \subsection{Fourier series expansion of~\texpdf{$E_k(\;\cdot\;; \mathsf{d}, j)$}{Ekdj}} Note that the function~$X - \tau$ is invariant under the slash action of any weight~$k$ and type~$\sym^\sfd$, $\mathsf{d} \ge 0$. In particular, holomorphic modular forms of type~$\sym^\sfd$ for~$\SL{2}(\ensuremath{\mathbb{Z}})$, including these Eisenstein series, afford a Fourier series expansion of the form \begin{gather} \label{eq:symd_fourier_series} \sum_{r = 0}^{\mathsf{d}} (X - \tau)^r\, \sum_{n = 0}^\infty c(n)_r e(n \tau) \ensuremath{\text}{,}\quad c(n)_r \in \ensuremath{\mathbb{C}} \ensuremath{\text}{.} \end{gather} The next proposition identifies the Fourier coefficients in case of the Eisenstein series of type~$\sym^\sfd$. Its Corollary~\ref{cor:eisenstein_series_symd_filtration_steps} is instrumental in Section~\ref{sec:saturation}. \begin{proposition} \label{prop:eisenstein_series_symd_fourier_expansion} Given even integers~$\mathsf{d} \ge 0$ and~$k > 2 + \mathsf{d}$, and an integer~$0 \le j \le \mathsf{d}$, we have \begin{gather} \label{eq:prop:eisenstein_series_symd_fourier_expansion} E_k(\tau;\, \mathsf{d}, j) \;=\; (X - \tau)^j + \sum_{r = j}^{\mathsf{d}} (X - \tau)^r\, \sum_{n = 1}^\infty c(n)_r e(n \tau) \end{gather} with Fourier coefficients for~$j \le r \le \mathsf{d}$ and~$n \ge 1$: \begin{gather*} c(n)_r \;=\; \mbinom{\mathsf{d}-j}{r-j} \frac{(-2\pi i)^{k+j+r-\mathsf{d}}}{(k+j+r-\mathsf{d}-1)!\, \zeta(k+2j-\mathsf{d})}\, n^{r - j} \sigma_{k+2j-\mathsf{d}-1}(n) \ensuremath{\text}{.} \end{gather*} \end{proposition} \begin{corollary} \label{cor:eisenstein_series_symd_filtration_steps} For even integers~$\mathsf{d} \ge 0$ and~$k > 2 + \mathsf{d}$, and for an integer~$0 \le j \le \mathsf{d}$, we have \begin{gather*} E_k(\,\cdot\,;\, \mathsf{d}, j) \in \ensuremath{\mathrm{M}}_{k,\mathsf{d}}[j] \ensuremath{\text}{.} \end{gather*} The map~$\pi^{\mathrm{low}}_{k,\mathsf{d},j}$ from~$\ensuremath{\mathrm{M}}_{k,\mathsf{d}}[j]$ to~$\ensuremath{\mathrm{M}}_{k + 2j - \mathsf{d}}$ sends it to the usual Eisenstein series~$E_{k + 2j - \mathsf{d}}$. \end{corollary} \begin{proof}% [Proof of Proposition~\ref{prop:eisenstein_series_symd_fourier_expansion}] Given $\gamma = \begin{psmatrix} a & b \\ c & d \end{psmatrix} \in \SL{2}(\ensuremath{\mathbb{Z}})$ with $c \neq 0$, we find that $(X - \tau)^j |_{k,\mathsf{d}}\,\gamma$ equals \begin{align*} & (c X + d)^{\mathsf{d}-j}(c \tau + d)^{-k-j}\, \big( (a X + b) (c \tau + d) - (a \tau + b) (c X + d) \big)^j \\ =\;{}& \frac{1}{c^{k+2j-\mathsf{d}}}\, \big((X - \tau) + (\tau + \tfrac{d}{c}) \big)^{\mathsf{d}-j}\, \big(\tau + \tfrac{d}{c}\big)^{-k-j}\, \big( (ac - ac) X \tau + (a d - b c) (X - \tau) + (bd - bd) \big)^j \\ =\;{}& \frac{1}{c^{k+2j-\mathsf{d}}}\, \sum_{r = 0}^{\mathsf{d}-j} \mbinom{\mathsf{d}-j}{r} \frac{(X - \tau)^{j+r}} {(\tau + \frac{d}{c})^{k+j-(\mathsf{d}-j-r)}} \;=\; \frac{1}{c^{k+2j-\mathsf{d}}}\, \sum_{r = j}^{\mathsf{d}} \mbinom{\mathsf{d}-j}{r-j} \frac{(X - \tau)^r} {(\tau + \frac{d}{c})^{k+j+r-\mathsf{d}}} \ensuremath{\text}{.} \end{align*} To apply the Lipschitz summation formula in the usual way, we extend~$E_k(\tau;\, \mathsf{d}, j)$ by the auxiliary factor~$\zeta(k+2j-d)\,\zeta(k+2j-d)^{-1}$ and split the defining summation over~$\Gamma_\infty \backslash \SL{2}(\ensuremath{\mathbb{Z}})$ into a sum over double cosets in~$\Gamma_\infty \backslash \SL{2}(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty$ with bottom entries~$c \in \ensuremath{\mathbb{Z}}$ and~$d \pmod{c}$ and over~$m \in \ensuremath{\mathbb{Z}}$. We thus find that~$E_k(\tau;\, \mathsf{d}, j)$ equals \begin{align*} &\hphantom{{}=\;} (X - \tau)^j \,+\, \frac{1}{\zeta(k+2j-\mathsf{d})} \sum_{r = j}^{\mathsf{d}} (X - \tau)^r\, \mbinom{\mathsf{d}-j}{r-j} \sum_{c = 1}^\infty \frac{1}{c^{k+2j-\mathsf{d}}}\, \sum_{\substack{d \pmod{c}\\m \in \ensuremath{\mathbb{Z}}}} \frac{1} {(\tau + \frac{d}{c} + m)^{k+j+r-\mathsf{d}}} \\ &{}= (X - \tau)^j \,+\, \frac{1}{\zeta(k+2j-\mathsf{d})} \sum_{r = j}^{\mathsf{d}} (X - \tau)^r\, \mbinom{\mathsf{d}-j}{r-j} \sum_{c = 1}^\infty \frac{1}{c^{k+2j-\mathsf{d}}}\, \\ & \hphantom{{}= (X - \tau)^j \,+\,}\qquad\qquad \sum_{d \pmod{c}} \frac{(-2\pi i)^{k+j+r-\mathsf{d}}}{(k+j+r-\mathsf{d}-1)!} \sum_{n = 1}^\infty n^{k+j+r-\mathsf{d}-1} e\big( n (\tau + \tfrac{d}{c})\big) \\ &{}= (X - \tau)^j \,+\, \sum_{r = j}^{\mathsf{d}} (X - \tau)^r\, \mbinom{\mathsf{d}-j}{r-j} \frac{(-2\pi i)^{k+j+r-\mathsf{d}}}{(k+j+r-\mathsf{d}-1)!\, \zeta(k+2j-\mathsf{d})} \\ & \hphantom{{}= (X - \tau)^j \,+\, \sum_{r = j}^{\mathsf{d}} (X - \tau)^r\, \mbinom{\mathsf{d}-j}{r-j}}\qquad\qquad \sum_{c = 1}^\infty \sum_{n = 1}^\infty c^{r-j} n^{k+j+r-\mathsf{d}-1} e(c n \tau) \ensuremath{\text}{.} \end{align*} \end{proof} \subsection{Evaluation of~\texpdf{$E_k(\;\cdot\;; \mathsf{d}, j)$}{Ekdj}} We use the Fourier series expansions of~$E_k(\;\cdot\;; \mathsf{d}, j)$ to evaluate it at points~$\tau \in \mathbb{H}$. This requires the following tail estimate. \begin{lemma} \label{la:errorbound_ekd_partial} Given~$\tau = x + iy \in \mathbb{H}$, integers~$a \ge 0$ and~$b > 0$, and an integer~$N \ge 1 + (a+b) \slash 2 \pi y$ we have \begin{gather} \label{eq:prop:errorbound_ekd_partial} \bigg| \sum_{n = N}^\infty n^a \sigma_b(n) e(n \tau) \bigg| \;\le\; \frac{b\, \Gamma(a+b+1,\, 2 \pi (N-1) y)}{(b-1)\, (2 \pi y)^{a+b+1}} \ensuremath{\text}{.} \end{gather} \end{lemma} \begin{remark} \label{rm:la:errorbound_ekd_partial_lambert_series} Instead of employing the Fourier series expansion of~$E_k(\;\cdot\;; \mathsf{d}, j)$ to evaluate it, one might rewrite it as a Lambert series using the relation \begin{gather*} \sum_{n = 1}^\infty n^a \sigma_b(n) e(n \tau) \;=\; \sum_{n = 1}^\infty A_a(e(n \tau)) \frac{n^{a+b} e(n \tau)}{(1 - e(n \tau))^{a + 1}} \ensuremath{\text}{,} \end{gather*} where~$A_a$ is the~$a$\nobreakdash-\hspace{0pt} th{} Eulerian polynomial. We do not employ this in our setting. \end{remark} \begin{proof}% [Proof of Lemma~\ref{la:errorbound_ekd_partial}] We have~$n^a \sigma_b(n) = n^{a+b} \sigma_{-b}(n)$ and the trivial bound using~$b > 0$ \begin{gather*} \sigma_{-b}(n) \;=\; \sum_{d \ensuremath{\mathop{\mid}} n} d^{-b} \;\le\; 1 + \int_{1}^n t^{-b} \ensuremath{\mathrm{d}}\!t \;=\; 1 + \frac{1}{b - 1} - \frac{n^{1-b}}{(b - 1)} \;<\; \frac{b}{b - 1} \ensuremath{\text}{.} \end{gather*} We insert this into the left hand side of~\eqref{eq:prop:errorbound_ekd_partial} to find \begin{gather*} \bigg| \sum_{n = N}^\infty n^a \sigma_b(n) e(n \tau) \bigg| \;\le\; \frac{b}{b-1} \sum_{n = N}^\infty n^{a+b} \exp(-2 \pi n y) \ensuremath{\text}{.} \end{gather*} The assumption~$N \ge 1 + (a+b) \slash 2 \pi y$ guarantees that the summand is monotone as a function of~$n \ge N-1$, which allows us to insert the estimate \begin{gather*} \sum_{n = N}^\infty n^{a+b} \exp(-2 \pi n y) \;\le\; \int_N^\infty \exp(- 2 \pi n y) n^{a+b+1} \frac{\ensuremath{\mathrm{d}}\!n}{n} \le \frac{\Gamma(a+b+1, 2 \pi (N-1) y)}{(2 \pi y)^{a+b+1}} \ensuremath{\text}{.} \end{gather*} \end{proof} \subsection{Fourier series expansions of generalized second order Eisenstein series} We next present the Fourier series expansions of generalized second order Eisenstein series in~\eqref{eq:def:second_order_eisenstein_series_sym_cases}. Generalized second order modular forms of type~$(\sym^\sfd,\ensuremath{\mathds{1}})$ admit a usual Fourier series expansion, while those of type~$(\ensuremath{\mathds{1}},\sym^\sfd)$ have a Fourier series of the form~\eqref{eq:symd_fourier_series}. We are not able to give the Fourier series expansion in Theorem~\ref{thm:fourier_expansion_second_order_eisenstein_series} in closes form, since they feature values of a cocycle~$\phi$. We preserve the sum over double cosets in~$\Gamma_\infty \backslash \SL{2}(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty$ as an outer summation to emphasize the way~$\phi$ contributes to the expression. Recall that we write~$\phi(\gamma)_j$ for the~$j$\nobreakdash-\hspace{0pt} th{} coefficient of the polynomial~$\phi(\gamma)$. \begin{theorem} \label{thm:fourier_expansion_second_order_eisenstein_series} Fix even integers~$\mathsf{d} \ge 0$ and~$k \ge 5 + \mathsf{d}$, and an integer~$0 \le j \le \mathsf{d}$. Then for a cocycle $\phi \in \rmZ^1_{\para}(\SL2(\ensuremath{\mathbb{Z}}), \sym^\sfd(X))$, we have \begin{gather*} E_k^{[1]}(\tau;\, \phi) \;=\; \sum_{r = 0}^{\mathsf{d}} (X - \tau)^r\, \sum_{n = 1}^\infty c(n)_r e(n \tau) \end{gather*} with Fourier coefficients \begin{gather} \label{eq:thm:fourier_expansion_second_order_eisenstein_series:Ephi} c(n)_r \;=\; \sum_{\substack{\gamma \in \Gamma_\infty \backslash \SL{2}(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty\\\gamma \not\in \Gamma_\infty}} \frac{e(n \frac{d}{c})}{c^k}\, \sum_{j = r}^{\mathsf{d}} \phi(\gamma^{-1})_{j}\; \sum_{l = r}^j \frac{(-2 \pi i)^{k - j + l}}{(k - j + l - 1)!} \binom{l}{r} \binom{j}{l}\, \big(-\tfrac{d}{c}\big)^{l-r} n^{k - j + l - 1} \ensuremath{\text}{,} \end{gather} where~$c$ and~$d$ are the bottom entries of the double coset representative~$\gamma$. Similarly for~$\phi^\vee \in \rmZ^1_{\para}(\SL2(\ensuremath{\mathbb{Z}}), \sym^\sfd(X)^\vee)$, we have \begin{gather*} E_k^{[1]}(\tau; \phi^\vee,j) = \sum_{n = 1}^\infty c(n) e(n \tau) \end{gather*} with Fourier coefficients \begin{gather} \label{eq:thm:fourier_expansion_second_order_eisenstein_series:Ephij} c(n) = \sum_{\substack{\gamma \in \Gamma_\infty \backslash \SL{2}(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty\\\gamma \not\in \Gamma_\infty}} \frac{(-1)^{j-k} e(n \tfrac{d}{c})}{c^{k+2j-\mathsf{d}}} \sum_{r = 0}^j \binom{j}{r} \frac{(2 \pi i)^{k + r}}{(k + r - 1)!}\, \phi^\vee(\gamma^{-1}) \Big( \big( X + \tfrac{d}{c} \big)^{\mathsf{d}-j+r} \Big) n^{k + r - 1} \ensuremath{\text}{.} \end{gather} \end{theorem} \begin{proof} Recall that the series defining~$E_k^{[1]}(\tau;\phi)$ is absolutely convergent by Proposition~5.4 of~\cite{mertens-raum-2021}. As usual in Eisenstein series calculations, we split the summation into two contributions, one from double cosets and one from~$\Gamma_\infty$, and then employ the cocycle relation for~$\phi$ and~$\phi(T) = 0$ to find that: \begin{gather*} E_k^{[1]}(\tau;\phi) = \sum_{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty} \sum_{m \in \ensuremath{\mathbb{Z}}} \phi\big( (\gamma T^m)^{-1} \big) \big|_k \gamma \delta \;=\; \sum_{\substack{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty\\\gamma \not\in \Gamma_\infty}} \frac{1}{c^k} \sum_{m \in \ensuremath{\mathbb{Z}}} \frac{\sym^\sfd(T^{-m}) \phi(\gamma^{-1})}{(\tau + \frac{d}{c} + m)^k} \ensuremath{\text}{.} \end{gather*} We expand~$\phi(\gamma^{-1})$ and insert the action of the symmetric power representation: \begin{gather*} \sym^\sfd(T^{-m}) \sum_{j=0}^\mathsf{d} \phi(\gamma^{-1})_j X^j \;=\; \sum_{j=0}^\mathsf{d} \phi(\gamma^{-1})_j (X + m)^j \ensuremath{\text}{.} \end{gather*} This leads to the following sum, which we can evaluate using the Lipschitz summation formula: \begin{gather} \label{eq:lipschitz_factorization_summation_formula} \sum_{m \in \ensuremath{\mathbb{Z}}} \frac{(X + m)^j}{(\tau + m)^k} \;=\; \sum_{m \in \ensuremath{\mathbb{Z}}} \frac{\big( (X - \tau) + (\tau + m) \big)^j}{(\tau + m)^k} \;=\; \sum_{l = 0}^j (X - \tau)^l\, \binom{j}{l} \frac{(-2 \pi i)^{k-j+l}}{(k-j+l-1)!} \sum_{n = 1}^\infty n^{k-j+l-1} e(n \tau) \ensuremath{\text}{.} \end{gather} We insert~$\tau + \frac{d}{c}$ for~$\tau$, expand the result in terms of~$(X - \tau)^r$, and interchange the summations over~$j$, $l$, and~$r$ to obtain the desired formula. We proceed in a similar way in the second case. We use continuity of~$\phi^\vee(\gamma^{-1})$ to find that \begin{gather*} E_k^{[1]}(\tau;\phi^\vee,j) \;=\; \sum_{\substack{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty\\\gamma \not\in \Gamma_\infty}} \frac{1}{c^k} \phi^\vee(\gamma^{-1})\Bigg( \sym^\sfd(\gamma^{-1}) \sum_{m \in \ensuremath{\mathbb{Z}}} \frac{(X - \gamma T^m \tau)^j}{(\tau + \frac{d}{c} + m)^k} \Bigg) \ensuremath{\text}{.} \end{gather*} Since~$c \ne 0$ for~$\gamma \not\in \Gamma_\infty$, we can insert \begin{gather*} \gamma T^m \tau \;=\; \frac{a}{c} - \frac{1}{c^2 (\tau + \frac{d}{c} + m)} \end{gather*} into~$X - \gamma T^m \tau$. We next expand \begin{gather*} (X - \gamma T^m \tau)^j \;=\; \sum_{r = 0}^j \mbinom{j}{r} \big( X - \tfrac{a}{c} \bigr)^{j - r} c^{-2r} (\tau + \tfrac{d}{c} + m)^{-r} \ensuremath{\text}{.} \end{gather*} When inserting these simplification, we find that \begin{gather*} E_k^{[1]}(\tau;\phi^\vee,j) \;=\; \sum_{\substack{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty\\\gamma \not\in \Gamma_\infty}} \sum_{r = 0}^j \mbinom{j}{r} \frac{1}{c^{k+2r}} \phi^\vee(\gamma^{-1})\Bigg( \sym^\sfd(\gamma^{-1}) \big( X - \tfrac{a}{c} \bigr)^{j - r} \Bigg) \sum_{m \in \ensuremath{\mathbb{Z}}} \frac{1}{(\tau + \frac{d}{c} + m)^{k+r}} \ensuremath{\text}{.} \end{gather*} The resulting expression for the Eisenstein series features \begin{gather*} \sym^\sfd(\gamma^{-1}) \big( X - \tfrac{a}{c} \big)^{j-r} \;=\; (c X + d)^{\mathsf{d}-j+r} \big( a X + b - \tfrac{a}{c} (c X + d) \big)^{j-r} \;=\; (-1)^{j-r} c^{\mathsf{d}-2j+2r} \big(X + \tfrac{d}{c} \big)^{d-j+r} \ensuremath{\text}{.} \end{gather*} After inserting the right hand side, we complete the proof by utilizing the Lipschitz summation formula in~\eqref{eq:lipschitz_factorization_summation_formula} to simplify \begin{gather*} E_k^{[1]}(\tau;\phi^\vee,j) \;=\; \sum_{\substack{\gamma \in \Gamma_\infty \backslash \SL2(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty\\\gamma \not\in \Gamma_\infty}} \sum_{r = 0}^j \mbinom{j}{r} \frac{(-1)^{j-r}}{c^{k+2j-\mathsf{d}}} \phi^\vee(\gamma^{-1})\Big( \big(X + \tfrac{d}{c} \big)^{d-j+r} \Big) \sum_{m \in \ensuremath{\mathbb{Z}}} \frac{1}{(\tau + \frac{d}{c} + m)^{k+r}} \ensuremath{\text}{.} \end{gather*} \end{proof} \subsection{Evaluation of generalized second order Eisenstein series} \label{ssec:eval_g2es} As in the case of the usual Eisenstein series, we want to employ the Fourier series expansion of~$E_k^{[1]}(\;\cdot\;; \phi, j)$ to evaluate it at~$\tau \in \mathbb{H}$. This requires two types of estimates, since the expression in Theorem~\ref{thm:fourier_expansion_second_order_eisenstein_series} features the infinite sum over~$\Gamma_\infty \backslash \SL{2}(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty$. Our first two lemmas provide a bound on cocycle values that appear in Theorem~\ref{thm:fourier_expansion_second_order_eisenstein_series}. Convexity bounds for additive twists of~$\ensuremath{\mathrm{L}}$-functions with implicit constants were previously used, for instance, by Diamantis~\cite{diamantis-2020-preprint} to establish convergence of generalized second order Poincar\'e series. \begin{lemma}% \label{la:twisted_Lfunction_estimate} Let~$f \in \ensuremath{\mathrm{M}}_k$ be a normalized Hecke eigenform of weight~$k > 3$. Then for integers~$c \ne 0$ and~$d$, and~$s \in \ensuremath{\mathbb{C}}$, $\Re(s) \ge 1$, we have \begin{gather*} \big| \ensuremath{\mathrm{L}}\big( f, \mfrac{-d}{c}; s \big) \big| \;\le\; c^{k-2} \frac{\Gamma(k-1)}{(2\pi)^{k-1}} \zeta\big( \mfrac{k-1}{2} \big)^2 \ensuremath{\text}{.} \end{gather*} \end{lemma} \begin{proof} We use the functional equation for~$\ensuremath{\mathrm{L}}(f, -\frac{d}{c}; s)$ that is given in Theorem~3.1 of~\cite{diamantis-hoffstein-kiral-lee-2020} with~$q = 1$, $\xi = \ensuremath{\mathds{1}}$, $r = 1$, $M = M_1 = c$, $\alpha = a= -d$, and~$u = 0$. Notice that the statement of that theorem features a contribution~$a(r \slash n e)$ which must be read as a Fourier coefficient of~$f$ as opposed to the product of~$a$ with~$r \slash n e$. We have \begin{gather*} \Lambda\big( f, \mfrac{-d}{c}; s \big) = i^k c^{k-2s} \Lambda\big( f, \mfrac{-d}{c}; k-s \big) \ensuremath{\text}{,} \end{gather*} where~$\Lambda( f, -d / c\mspace{1mu}; s ) = \Gamma(s) (2 \pi)^{-s}\, \ensuremath{\mathrm{L}}( f, -\frac{d}{c}; s )$ is the completed~$\ensuremath{\mathrm{L}}$-function. Since~$k > 3$ and~$f$ is a normalized Hecke eigenform, we have \begin{gather*} \big| \ensuremath{\mathrm{L}}\big( f, \mfrac{-d}{c}; k-s \big) \big| \le \sum_n \big| e\big(n \mfrac{-d}{c}\big) c(f;n) n^{s-k} \big| = \sum_n |c(f;n)| n^{1-k} \le \sum_n \sigma_0(n) n^{\frac{1-k}{2}} = \zeta\big(\mfrac{k-1}{2}\big)^2 \ensuremath{\text}{.} \end{gather*} We insert this into the right hand side of the functional equation and then apply the Phragm\'en-Lindel\"of principle to finish the proof. \end{proof} \begin{lemma} \label{la:cocycle_estimate} Let~$f \in \ensuremath{\mathrm{M}}_k$ be a normalized Hecke eigenform of weight~$k > 3$, and recall the cocycle~$\phi_{\ensuremath{\mathcal{E}}(f)}$ associated in~\eqref{eq:def:cocycle_modular_deficit} to the Eichler integral in~\eqref{eq:def:eichler_integral}. Then for~$\gamma = \begin{psmatrix} a & b \\ c & d \end{psmatrix} \in \SL{2}(\ensuremath{\mathbb{Z}})$ with~$|d| < |c|$, we have \begin{gather} \label{eq:la:cocycle_estimate} \sum_{j = 0}^{k-2} \big| \phi_{\ensuremath{\mathcal{E}}(f)}(\gamma^{-1})_j \big| \le c^{k-2}\, \frac{e^2\, \Gamma(k-1)^2}{(2 \pi)^k}\, \zeta\big(\mfrac{k-1}{2}\big)^2 \ensuremath{\text}{.} \end{gather} \end{lemma} \begin{proof} We combine the explicit expression~\eqref{eq:cocycle_explicit_expression} for~$\phi_{\ensuremath{\mathcal{E}}(f)}(\gamma^{-1})$ with the estimate in Lemma~\ref{la:twisted_Lfunction_estimate} to find that the left hand side of~\eqref{eq:la:cocycle_estimate} is bounded by \begin{align*} & \sum_{j = 0}^{k-2} \frac{(k-2)!}{(k-2-j)!} \sum_{r = 0}^j \frac{| d \slash c |^{j-r}}{(j-r)!\, (2 \pi)^{r+1}}\, c^{k-2} \frac{\Gamma(k-1)}{(2\pi)^{k-1}} \zeta\big( \mfrac{k-1}{2} \big)^2 \\ \le\;& c^{k-2} \frac{\Gamma(k-1)}{(2\pi)^{k}} \zeta\big( \mfrac{k-1}{2} \big)^2\, \sum_{j = 0}^{k-2} \sum_{r = 0}^j \frac{(k-2)!}{(k-2-j)!(j-r)!} \ensuremath{\text}{.} \end{align*} The double sum is bounded by~$e^2 \Gamma(k-1)$, which establishes the result. \end{proof} The next lemma estimates the tail of the expression for~$c(n)$ in Theorem~\ref{thm:fourier_expansion_second_order_eisenstein_series}, based on the bound in the previous lemma. \begin{lemma} \label{la:fourier_coefficient_tail_estimate} Let~$f \in \ensuremath{\mathrm{M}}_l$ be a normalized Hecke eigenform of weight~$l > 3$ and set~$\mathsf{d} = l-2$. Fix an integer~$0 \le l \le \mathsf{d}$ and an even integer~$k > 2 + 2(\mathsf{d}-j)$. Then given a positive integer~$C$, we have \begin{gather} \label{eq:la:fourier_coefficient_tail_estimate} \begin{aligned} & \Bigg| \sum_{\substack{\gamma \in \Gamma_\infty \backslash \SL{2}(\ensuremath{\mathbb{Z}}) \slash \Gamma_\infty\\|c| \ge C}} \frac{(-1)^{j-k} e(n \tfrac{d}{c})}{c^{k+2j-\mathsf{d}}} \sum_{r = 0}^j \mbinom{j}{r} \frac{(2 \pi i)^{k + r}}{(k + r - 1)!}\, \phi_{\ensuremath{\mathcal{E}}(f)}^\vee(\gamma^{-1}) \Big( \big( X + \tfrac{d}{c} \big)^{\mathsf{d}-j+r} \Big) n^{k + r - 1} \Bigg| \\ \le\;& n^{k + j - 1}\, \Big( \ensuremath{\mathds{1}}_{C = 1} + \frac{1}{(k+2j-2l+2)C^{k+2j-2l+3}} \Big)\, \frac{2^j e^2\, (l-2)!^2\, (2 \pi)^{k + j - l}}{(k - 1)! }\, \zeta\big(\mfrac{l-1}{2}\big)^2 \ensuremath{\text}{,} \end{aligned} \end{gather} where~$c$ and~$d$ on the left hand side are the bottom entries of~$\gamma$, and~$\ensuremath{\mathds{1}}_{C = 1}$ equals one if and only if\/~$C = 1$ and otherwise zero. \end{lemma} \begin{remark} A better bound for the tails of~\eqref{eq:thm:fourier_expansion_second_order_eisenstein_series:Ephij} can be achieved by intertwining the summation over~$n$ and~$\gamma$ to utilize Lambert series as in Remark~\ref{rm:la:errorbound_ekd_partial_lambert_series}. \end{remark} \begin{proof}[Proof of Lemma~\ref{la:fourier_coefficient_tail_estimate}] For simplicity, we write~$\phi^\vee$ for the cocycle in~\eqref{eq:la:fourier_coefficient_tail_estimate}. The sum over double coset can be written as a sum over integers~$c \ge C$ and~$d \pmod{c}$. We can and will assume that~$|d| < c$ as in the assumptions of Lemma~\ref{la:cocycle_estimate}. We expand the power of~$X + \frac{d}{c}$ and apply the coefficient formula for~$\phi^\vee$ in~\eqref{eq:def:dual_cocycle} to find that \begin{align*} \Big| \phi^\vee(\gamma^{-1})\Big( (X + \tfrac{d}{c})^{\mathsf{d}-j+r} \Big) \Big| \;=\; \Big| \sum_{i = 0}^\mathsf{d} (-1)^{\mathsf{d}-i} \mbinom{\mathsf{d}}{i}^{-1} \phi(\gamma^{-1})_{\mathsf{d}-i}\; \mbinom{\mathsf{d}-j+r}{i} \big(\tfrac{d}{c}\big)^{\mathsf{d}-j+r-i} \Big| \;\le\; \sum_{i = 0}^\mathsf{d} \big| \phi(\gamma^{-1})_{\mathsf{d}-i} \big| \ensuremath{\text}{.} \end{align*} We insert this into the left hand side of~\eqref{eq:la:fourier_coefficient_tail_estimate}, which is thus bounded by \begin{align*} & \sum_{c = C+1}^\infty \sum_{d = 0}^{c-1} \frac{1}{c^{k+2j-l+2}} \sum_{r = 0}^j \mbinom{j}{r} \frac{(2 \pi)^{k + j}}{(k - 1)!}\, c^{l-2}\, \frac{e^2\, \Gamma(l-1)^2}{(2 \pi)^l}\, \zeta\big(\mfrac{l-1}{2}\big)^2 n^{k + r - 1} \\ \le& n^{k + j - 1}\, \frac{2^j e^2, \Gamma(l-1)^2\, (2 \pi)^{k + j - l}}{(k - 1)!}\, \zeta\big(\mfrac{l-1}{2}\big)^2 \sum_{c = C}^\infty \frac{1}{c^{k+2j-2l+4}} \end{align*} We finish the proof by estimating the sum over~$c$ by the integral from~$C-1$ or~$C$ to~$\infty$ of~$c^{-k-2j+2l-4}$. \end{proof} Our final lemma concerns the tails of the Fourier series expansion of~$E_k(\;\cdot\;; \phi^\vee, j)$. \begin{lemma} \label{la:fourier_expansion_tail_estimate} Let~$f \in \ensuremath{\mathrm{M}}_l$ be a normalized Hecke eigenform of weight~$l > 3$ and set~$\mathsf{d} = l-2$. Fix an integer~$0 \le l \le \mathsf{d}$ and an even integer~$k > 2 + 2(\mathsf{d}-j)$. Let~$c(n)$ be the Fourier coefficients of~$E_k(\;\cdot\;; \phi^\vee_{\ensuremath{\mathcal{E}}(f)}, j)$ given in~\eqref{eq:thm:fourier_expansion_second_order_eisenstein_series:Ephij}. Given a positive integer~$N$, we have \begin{gather} \label{eq:la:fourier_expansion_tail_estimate} \Bigg| \sum_{n = N}^\infty c(n) e(n \tau) \Bigg| \;\le\; \frac{k+2j-2l+3}{k+2j-2l+2} \frac{2^j e^2\, (l-2)!^2}{(k - 1)! (2 \pi)^l}\, \zeta\big(\mfrac{l-1}{2}\big)^2 \frac{\Gamma(k+j, 2 \pi (N-1) y)}{y^{k+j}} \ensuremath{\text}{.} \end{gather} \end{lemma} \begin{proof} Lemma~\ref{la:fourier_coefficient_tail_estimate} with~$C = 1$ provides an estimate for the right hand side of~\eqref{eq:thm:fourier_expansion_second_order_eisenstein_series:Ephij}. The left hand side of~\eqref{eq:la:fourier_expansion_tail_estimate} is thus bounded by \begin{align*} & \frac{k+2j-2l+3}{k+2j-2l+2} \frac{2^j e^2\, (l-2)!^2\, (2 \pi)^{k + j - l}}{(k - 1)! }\, \zeta\big(\mfrac{l-1}{2}\big)^2 \sum_{n=N}^\infty n^{k + j - 1} \exp(-2 \pi n y) \\ \le\;& \frac{k+2j-2l+3}{k+2j-2l+2} \frac{2^j e^2\, (l-2)!^2\, (2 \pi)^{k + j - l}}{(k - 1)! }\, \zeta\big(\mfrac{l-1}{2}\big)^2 \frac{\Gamma(k+j, 2 \pi (N-1) y)}{(2 \pi y)^{k+j}} \ensuremath{\text}{.} \end{align*} \end{proof} \section{Saturation of generalized second order modular forms} \label{sec:saturation} In this section, we will examine the saturation at the Ramanujan $\Delta$\nobreakdash-\hspace{0pt} function of some~$\ensuremath{\mathrm{M}}_\bullet$\nobreakdash-\hspace{0pt} ideals generated by Eisenstein series in~$\ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}$. Recall that given a commutative ring~$R$, two $R$\nobreakdash-\hspace{0pt} modules~$N \subseteq M$, and an element $r\in R$, the saturation of~$N$ in~$M$ at~$r$ is defined as \begin{gather*} ( N : r^\infty ) \;:=\; \big\{ m \in M \,:\, \exists n \in \ensuremath{\mathbb{Z}}_{\ge 0} :\, r^n m \in N \big\} \ensuremath{\text}{.} \end{gather*} Given integers~$\mathsf{d} \ge 0$ and~$k_0 > 2 + \mathsf{d}$, we consider the~$\ensuremath{\mathrm{M}}_\bullet$\nobreakdash-\hspace{0pt} module \begin{gather} \label{eq:def:eisenstein_module_symd} \ensuremath{\mathrm{E}}_{\ge k_0,\mathsf{d}} \;:=\; \ensuremath{\mathop{\mathrm{span}}}\, \ensuremath{\mathrm{M}}_\bullet\, \big\{ E_k(\,\cdot\,; \mathsf{d}, j) \,:\, k \ge k_0,\, 0 \le j \le \mathsf{d} \big\} \;\subseteq\; \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}} \ensuremath{\text}{.} \end{gather} If~$\mathsf{d} = 0$, we suppress it from our notation and write~$\ensuremath{\mathrm{E}}_{\ge k_0}$. In our first two propositions, we describe the saturation of~\eqref{eq:def:eisenstein_module_symd}. \begin{proposition} \label{prop:saturation_at_delta_scalar_valued} Given an integer~$k_0 > 2$, we have \begin{gather*} \big( \ensuremath{\mathrm{E}}_{\ge k_0} : \Delta^\infty \big) \;=\; \ensuremath{\mathrm{M}}_\bullet \ensuremath{\text}{.} \end{gather*} \end{proposition} \begin{proof} Since~$\ensuremath{\mathrm{M}}_\bullet$ is generated as an~$\ensuremath{\mathrm{M}}_\bullet$\nobreakdash-\hspace{0pt} module by~$1$, it suffices to show that there is a non-negative integer~$m$ such that~$\Delta^m \in \ensuremath{\mathrm{E}}_{\ge k_0}$. In other words, it suffices to show that for some integer~$m$ with~$12 m \ge 2 k_0$, we have \begin{gather*} \Delta^m \in \ensuremath{\mathbb{C}} E_{12m} \,+\, \ensuremath{\mathop{\mathrm{span}}} \ensuremath{\mathbb{C}} \big\{ E_{12m - k} E_k \,:\, k_0 \le k \le 12m - 4, \big\} \;\subseteq\; \ensuremath{\mathrm{E}}_{\ge k_0} \ensuremath{\text}{.} \end{gather*} This follows by a standard argument along the lines of Kohnen--Zagier~\cite{rankin-1952,kohnen-zagier-1984}. See also~\cite{kohnen-martin-2008}. \end{proof} \begin{proposition} \label{prop:saturation_at_delta_vector_valued} Given integers~$0 \le \mathsf{d}$ and~$k_0\geq 5 + \mathsf{d}$, we have \begin{gather*} \big( \ensuremath{\mathrm{E}}_{\ge k_0,\mathsf{d}} : \Delta^\infty \big) \;=\; \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}} \ensuremath{\text}{.} \end{gather*} \end{proposition} \begin{proof} We establish the statement by showing via induction on~$0 \le j \le \mathsf{d}$ that \begin{gather} \label{eq:prop:saturation_at_delta_vector_valued:induction} \big( \ensuremath{\mathrm{E}}_{\ge k_0,\mathsf{d}} : \Delta^\infty \big) \cap \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j] \;=\; \big( \ensuremath{\mathrm{E}}_{\ge k_0,\mathsf{d}} \cap \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j] : \Delta^\infty \big) \;=\; \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j] \ensuremath{\text}{.} \end{gather} If~$j = \mathsf{d}$, then the projection~$\pi^{\mathrm{low}}_{k,\mathsf{d},\mathsf{d}}$ in~\eqref{eq:la:projection_to_lowest_symd_component} is an isomorphism. By Corollary~\ref{cor:eisenstein_series_symd_filtration_steps} it maps Eisenstein series to Eisenstein series. Thus~\eqref{eq:prop:saturation_at_delta_vector_valued:induction} follows directly from Proposition~\ref{prop:saturation_at_delta_scalar_valued}. Assume now that~$j < \mathsf{d}$ and that~\eqref{eq:prop:saturation_at_delta_vector_valued:induction} is true for~$j+1$ instead of~$j$. The projection~$\pi^{\mathrm{low}}_{k,\mathsf{d},j}$ and Corollary~\ref{cor:eisenstein_series_symd_filtration_steps} yield the following diagram: \begin{center} \begin{tikzpicture} \matrix(m)[matrix of math nodes, row sep = 2em, column sep = 3em, text height = 1.5em, text depth = 1.5ex] {% \big( \ensuremath{\mathrm{E}}_{\ge k_0,\mathsf{d}} : \Delta^\infty \big) \cap \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j+1] & \big( \ensuremath{\mathrm{E}}_{\ge k_0,\mathsf{d}} : \Delta^\infty \big) \cap \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j] & \big( \ensuremath{\mathrm{E}}_{\ge k_0+2j-\mathsf{d}} : \Delta^\infty \big) \\ \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j+1] & \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j] & \ensuremath{\mathrm{M}}_{\bullet} \\}; \path[right hook-latex] (m-1-1) edge (m-1-2) (m-2-1) edge (m-2-2); \path[-latex] (m-1-2) edge (m-1-3) (m-2-2) edge (m-2-3); \path[left hook-latex] (m-1-1) edge (m-2-1) (m-1-2) edge (m-2-2) (m-1-3) edge (m-2-3); \end{tikzpicture} \end{center} By induction and by Proposition~\ref{prop:saturation_at_delta_scalar_valued}, the left and right vertical arrows are equalities. To finish the proof by the Four-Lemma, we have to show that the co-kernel of the top right horizontal map injects into the co-kernel of the bottom right one. To prove this, we observe that there is a natural splitting~$\sigma$ to the projection from~$E_{\ge k_0,\mathsf{d}}$ to~$E_{\ge k_0 + 2j - \mathsf{d}}$. Given a modular form~$f$ and an integer~$h \ge 0$ with~$\Delta^h f \in \ensuremath{\mathrm{E}}_{\ge k_0+2j-\mathsf{d}}$, the obstruction to finding a preimage of~$f_j$ in the top center space is given by the first~$h$ Fourier coefficients of \begin{gather*} \sigma(\Delta^h f) \,+\, \big( \ensuremath{\mathrm{E}}_{\ge k_0,\mathsf{d}} : \Delta^\infty \big) \cap \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j+1] \;=\; \sigma(\Delta^h f) \,+\, \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}[j+1] \ensuremath{\text}{.} \end{gather*} The right hand side coincides with the obstruction that arises in the bottom row, and we hence conclude the proof. \end{proof} To make our statement about generalized second order modular forms more consice, we introduce the following spaces of generalized second order Eisenstein series, analogous to $\ensuremath{\mathrm{E}}_{\geq k_0}$ and $\ensuremath{\mathrm{E}}_{\geq k_0,\mathsf{d}}$. For integers~$\mathsf{d} \ge 0$ and~$k_0 \geq 5 + \mathsf{d}$, we set \begin{gather} \label{eq:def:generalized_second_order_eisenstein_modules} \begin{aligned} \ensuremath{\mathrm{E}}^{\mathrm{pure}\,[1]}_{\ge k_0} \big( \sym^\sfd(X), \ensuremath{\mathds{1}} \big) \;&{}:=\; \ensuremath{\mathop{\mathrm{span}}} \ensuremath{\mathrm{M}}_\bullet \big\{ E^{[1]}_k\big( \,\cdot\,;\phi \big)\,:\, k \ge k_0,\, 0 \le j \le \mathsf{d},\, \phi \in \rmZ^1_{\para}\big( \SL{2}(\ensuremath{\mathbb{Z}}), \sym^\sfd(X) \big) \big\} \ensuremath{\text}{,} \\ \ensuremath{\mathrm{E}}^{\mathrm{pure}\,[1]}_{\ge k_0}\big( \ensuremath{\mathds{1}}, \sym^\sfd(X) \big) \;&{}:=\; \ensuremath{\mathop{\mathrm{span}}} \ensuremath{\mathrm{M}}_\bullet \big\{ E^{[1]}_k\big( \,\cdot\,;\phi, j\big)\,:\, k \ge k_0,\, 0 \le j \le \mathsf{d},\, \phi \in \rmZ^1_{\para}\big( \SL{2}(\ensuremath{\mathbb{Z}}), \sym^\sfd(X)^\vee \big) \big\} \ensuremath{\text}{.} \end{aligned} \end{gather} For the proof of our next theorem, we leverage Proposition~\ref{prop:saturation_at_delta_scalar_valued} and Proposition~\ref{prop:saturation_at_delta_vector_valued} in the same way as we employed Proposition~\ref{prop:saturation_at_delta_scalar_valued} in the proof of Proposition~\ref{prop:saturation_at_delta_vector_valued}. \begin{theorem} \label{thm:snd_order_eisenstein_saturation} Given integers~$0 \le \mathsf{d}$ and~$k_0 \geq 5 + \mathsf{d}$, we have \begin{align*} \big( \ensuremath{\mathrm{E}}^{\mathrm{pure}\,[1]}_{\ge k_0}(\sym^\sfd(X), \ensuremath{\mathds{1}}) + \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}} \,:\, \Delta^\infty\big) \;&{}=\; \ensuremath{\mathrm{M}}^{[1]}_\bullet(\sym^\sfd(X), \ensuremath{\mathds{1}}) \quad\ensuremath{\text}{and}\\ \big( \ensuremath{\mathrm{E}}^{\mathrm{pure}\,[1]}_{\ge k_0}(\ensuremath{\mathds{1}}, \sym^\sfd(X)) + \ensuremath{\mathrm{M}}_\bullet \,:\, \Delta^\infty \big) \;&{}=\; \ensuremath{\mathrm{M}}^{[1]}_\bullet(\ensuremath{\mathds{1}}, \sym^\sfd(X)) \ensuremath{\text}{.} \end{align*} \end{theorem} \begin{remark} \label{rm:thm:snd_order_eisenstein_saturation} The proof of Theorem~\ref{thm:snd_order_eisenstein_saturation} can be translated to the language of vector-valued modular forms~\cite{mertens-raum-2021}, and then yields an induction over the socle series. In particular, when combined with~\cite{raum-xia-2020} it can be generalized to all modular forms of virtually real-arithmetic type. In this form it subsumes all iterated Eichler-Shimura integrals. \end{remark} \begin{proof} We focus on the second case, and leave the first one, whose proof proceeds analogously, to the reader. Observe that when viewing~$\ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}}$ as a trivial~$\SL{2}(\ensuremath{\mathbb{Z}})$ representation, we have an identification \begin{gather} \label{eq:thm:snd_order_eisenstein_saturation:cocycle} \rmZ^1_{\para}\big( \SL{2}(\ensuremath{\mathbb{Z}}),\, \sym^\sfd(X)^\vee \otimes \ensuremath{\mathrm{M}}_{k,\mathsf{d}} \big) \;=\; \rmZ^1_{\para}\big( \SL{2}(\ensuremath{\mathbb{Z}}),\, \sym^\sfd(X)^\vee \big) \otimes \ensuremath{\mathrm{M}}_{k,\mathsf{d}} \ensuremath{\text}{.} \end{gather} Definition~\ref{def:generalized_second_order_modular_forms} yields a map from~$\ensuremath{\mathrm{M}}_k^{[1]}(\ensuremath{\mathds{1}}, \sym^\sfd(X))$ to~\eqref{eq:thm:snd_order_eisenstein_saturation:cocycle}. From the definition of generalized second order Eisenstein series in~\eqref{eq:def:eisenstein_series_symd}, we infer that it sends~$E_k(\,\cdot\,;\phi,j)$ to~$E_k(\,\cdot\,; \mathsf{d},j)$. We assemble this into a commutative diagram akin to the one that we used in the proof of Proposition~\ref{prop:saturation_at_delta_vector_valued}. \begin{center} \begin{tikzpicture} \matrix(m)[matrix of math nodes, row sep = 2em, column sep = 3em, text height = 1.5em, text depth = 1.5ex] {% \ensuremath{\mathrm{M}}_\bullet & \big( \ensuremath{\mathrm{E}}^{\mathrm{pure}\,[1]}_{\ge k_0}(\ensuremath{\mathds{1}}, \sym^\sfd(X)) + \ensuremath{\mathrm{M}}_\bullet \,:\, \Delta^\infty \big) & \rmZ^1_{\para}\big( \SL{2}(\ensuremath{\mathbb{Z}}),\, \sym^\sfd(X)^\vee \big) \otimes \big( \ensuremath{\mathrm{E}}_{\ge k_0, \mathsf{d}} : \Delta^\infty \big) \\ \ensuremath{\mathrm{M}}_\bullet & \ensuremath{\mathrm{M}}_\bullet\big( \ensuremath{\mathds{1}}, \sym^\sfd(X) \big) & \rmZ^1_{\para}\big( \SL{2}(\ensuremath{\mathbb{Z}}),\, \sym^\sfd(X)^\vee \big) \otimes \ensuremath{\mathrm{M}}_{\bullet,\mathsf{d}} \\}; \path[right hook-latex] (m-1-1) edge (m-1-2) (m-2-1) edge (m-2-2); \path[-latex] (m-1-2) edge (m-1-3) (m-2-2) edge (m-2-3); \path[right hook-latex] (m-1-1) edge (m-2-1) (m-1-2) edge (m-2-2) (m-1-3) edge (m-2-3); \end{tikzpicture} \end{center} For clarity, note that the bottom left space arises from~$\ensuremath{\mathrm{M}}_\bullet$ in the statement of Theorem~\ref{thm:snd_order_eisenstein_saturation} and could be replaced by~$\ensuremath{\mathrm{E}}_{\ge k_0}$ without altering this proof. Now the left vertical arrow is trivially an equality, and the right one is so by Proposition~\ref{prop:saturation_at_delta_vector_valued}. We finish the proof by applying the Four-Lemma after inspecting the co-kernels of the right horizontal maps exactly as in the proof of Proposition~\ref{prop:saturation_at_delta_vector_valued}. \end{proof} \section{The Eichler integral of the discriminant function} \label{sec:bootstrap} In this section we demonstrate and compare two ways to recover the Eichler integral~$\ensuremath{\mathcal{E}}(\Delta)$ of the Ramanujan discriminant function via Theorem~\ref{thm:snd_order_eisenstein_saturation}. Calculations were performed using the Nemo computer algebra package~\cite{fieker-hart-hofmann-johansson-2017}. Recall from Section~\ref{ssec:eich_int_g2mf} that we have \begin{gather*} \ensuremath{\mathcal{E}}(\Delta) \in \ensuremath{\mathrm{M}}^{[1]}_{-10}\big( \ensuremath{\mathds{1}}, \ensuremath{\mathrm{sym}}^{10} \big) \ensuremath{\text}{.} \end{gather*} The mechanics of our example apply to any element of~$\ensuremath{\mathrm{M}}^{[1]}_k( \ensuremath{\mathds{1}}, \sym^\sfd )$. One can derive from Sections~\ref{sec:eis} and~\ref{sec:saturation} a similar procedure for generalized second order modular forms of type~$(\sym^\sfd, \ensuremath{\mathds{1}})$. Observe that in our specific case, we have a precise expression for the cusp expansion: \begin{gather*} \ensuremath{\mathcal{E}}(\Delta)(\tau) = \frac{- \Gamma(k-1)}{(2 \pi i)^{k-1}}\, \sum_{n=1}^\infty n^{1-k} c(\Delta;\,n) e(n \tau) \ensuremath{\text}{,} \end{gather*} where the~$c(\Delta; n)$ are the Fourier coefficients of~$\Delta$. Since~$\Delta$ is a level-$1$ modular form, this allows us to evaluate~$\ensuremath{\mathcal{E}}(\Delta)$ numerically in an efficient way at any point of~$\mathbb{H}$. In applications that follow the method outlined in this section such efficient evaluations are not necessarily possible, but we need to rely on the numerical values at a small number of points or alternatively some of the Fourier coefficients. Throughout this section, we write~$\varphi$ for the cocycle associated with~$\ensuremath{\mathcal{E}}(\Delta)$. Paralleling the structure of Theorem~\ref{thm:snd_order_eisenstein_saturation}, first we use~$\phi$ to express~$\Delta^h \ensuremath{\mathcal{E}}(\Delta)$ for a fixed integer~$h \ge 2$ as the sum of an~a~priori undetermined modular form~$f_h$ of weight~$12h-10$ and a linear combination of products of Eisenstein series and generalized second order Eisenstein series. In a second step we determine~$f_h$ from the numerical evaluation of~$\ensuremath{\mathcal{E}}(\Delta)$. The trade-offs are as follows: for~$h = 2$, the modular form~$f_h \in \ensuremath{\mathrm{M}}_{12h-10}$ vanishes, but the generalized second order Eisenstein series that appear converge slowly. In this case, $\Delta^h \ensuremath{\mathcal{E}}(\Delta)$ is determined by its cocycle~$\Delta^h \phi$. The larger~$h$ is, the faster the relevant generalized second order Eisenstein series converge, but the more evaluations of~$\ensuremath{\mathcal{E}}(\Delta)$ at suitable points of~$\mathbb{H}$ are needed to determine~$f_h$. This can be ``bootstapped'', that is, we can use the slowly converging but fully determined expression for~$h = 2$ to compute a faster converging expression for a different~$h$. By repeating this procedure, we get successively faster rates of convergence. However, attention must be paid to the possible accumulation of numerical errors. We give a concrete description of the above procedure in the special cases~$h = 2$ and~$h = 5$. \paragraph{An expression for $\Delta^2 \ensuremath{\mathcal{E}}(\Delta)$} In order to compute values of~$\ensuremath{\mathcal{E}}(\Delta)$, we assume the values of~$\Delta$ and consider \begin{gather*} \Delta^2\, \ensuremath{\mathcal{E}}(\Delta)(\tau) \in \ensuremath{\mathrm{M}}_{14}^{[1]}\big( \ensuremath{\mathds{1}}, \ensuremath{\mathrm{sym}}^{10} \big) \ensuremath{\text}{.} \end{gather*} The cocycle of~$\Delta^2 \ensuremath{\mathcal{E}}(\Delta)$ can coincides with the one of~$\ensuremath{\mathcal{E}}(\Delta)$. Via~\eqref{eq:prop:eichler_integral:cocycle}, we express it in terms of~$\Delta^2\, (X - \tau)^{10}$, which leads us to considering the relation \begin{gather*} \Delta^2 = c_1 E_{24} + c_2 E_4 E_{20} + c_3 E_6 E_{18} \end{gather*} with coefficients \begin{gather*} c_1 = \mfrac{70933884092880847}{655667091203604480000} \ensuremath{\text}{,}\quad c_2 = - \mfrac{1912212380581}{26083744727040000} \ensuremath{\text}{,}\quad c_3 = - \mfrac{97825033079}{2804992903544832} \ensuremath{\text}{.} \end{gather*} It allows us to conclude that for some modular form~$f\in\ensuremath{\mathrm{M}}_{14}$ we have \begin{gather} \label{eq:delta_eichler_integral_as_eisenstein_product} \Delta^2\, \ensuremath{\mathcal{E}}(\Delta) \;=\; f \,-\, c_1 E_{14}^{[1]}(\,\cdot\,;\,\phi,10) - c_2 E_4 E_{10}^{[1]}(\,\cdot\,;\,\phi,10) - c_3 E_6 E_{8}^{[1]}(\,\cdot\,;\,\phi,10) \ensuremath{\text}{.} \end{gather} The Fourier series expansions of generalized second Eisenstein series in Theorem~\ref{thm:fourier_expansion_second_order_eisenstein_series} reveals that~$f$ is a cusp form, which implies that~$f = 0$, and thus $\Delta^2\ensuremath{\mathcal{E}}(\Delta)$ is fully determined by~\eqref{eq:delta_eichler_integral_as_eisenstein_product}. \paragraph{An expression for $\Delta^5 \ensuremath{\mathcal{E}}(\Delta)$} Performing the same steps as before, we calculate that \begin{gather*} \Delta^5 \;=\; c_1 E_{60} + c_2 E_4 E_{56} + c_3 E_6 E_{54} + c_4 E_8 E_{52} + c_5 E_{10} E_{50} + c_6 E_{12} E_{48} \end{gather*} with coefficients $c_i \in \ensuremath{\mathbb{Q}}$ whose numerators and denominators are on the order of $10^{80}$. Approximatively, we have \begin{alignat*}{3} c_1 &{}\approx -2.7768336 \cdot 10^{-7} \ensuremath{\text}{,}\; & c_2 &{}\approx 1.41222683 \cdot 10^{-7} \ensuremath{\text}{,}\; & c_3 &{}\approx 9.5721307 \cdot 10^{-8} \ensuremath{\text}{,}\; \\ c_4 &{}\approx 3.3445439 \cdot 10^{-8} \ensuremath{\text}{,} & c_5 &{}\approx 6.67556586 \cdot 10^{-9} \ensuremath{\text}{,} & c_6 &{}\approx 6.1836892 \cdot 10^{-10} \ensuremath{\text}{.} \end{alignat*} Similar to the previous case, using only the cocycle associated with~$\ensuremath{\mathcal{E}}(\Delta)$, we find that there exists a cusp form~$f \in \ensuremath{\mathrm{S}}_{50}$ with \begin{multline*} \Delta^5 \ensuremath{\mathcal{E}}(\Delta) \;=\; f - c_1 E_{50}^{[1]}(\,\cdot\,;\,\phi,10) - c_2 E_4 E_{46}^{[1]}(\,\cdot\,;\,\phi,10) - c_3 E_6 E_{44}^{[1]}(\,\cdot\,;\,\phi,10) - c_4 E_8 E_{42}^{[1]}(\,\cdot\,;\,\phi,10)\\ - c_5 E_{10} E_{40}^{[1]}(\,\cdot\,;\,\phi,10) - c_6 E_{12} E_{38}^{[1]}(\,\cdot\,;\,\phi,10) \ensuremath{\text}{.} \end{multline*} For simplicity, we write~$f_E$ for the Eisenstein terms on the right hand side, so that the previous relation can be written as~$\Delta^5 \ensuremath{\mathcal{E}}(\Delta) = f - f_E$. Since~$\dim(\ensuremath{\mathrm{S}}_{50}) = 3$, it suffices to evaluate~$\Delta^5 \ensuremath{\mathcal{E}}(\Delta) + f_E$ at three suitable points on the Poincar\'e upper half plane and compare with the evaluation of an appropriate basis of~$\ensuremath{\mathrm{S}}_{50}$, to determine $f$. This is where the evaluation of~$\Delta^5 \ensuremath{\mathcal{E}}(\Delta)$ is needed, which can be obtained via the case~$h = 2$, as explained before. In the case at hand, in which we merely illustrate the application of Theorem~\ref{thm:snd_order_eisenstein_saturation}, we evaluate~$\ensuremath{\mathcal{E}}(\Delta)$ directly via its Fourier expansion in this step. For~$\ensuremath{\mathrm{S}}_{50}$, we use a basis~$f_1, f_2, f_3$ of~$\ensuremath{\mathrm{S}}_{50}$ with initial Fourier expansions \begin{gather*} f_1 = e(\tau) - 2064 e(2 \tau) + 1358532 e(3 \tau) + \ensuremath{\mathcal{O}}\big(e(4 \tau)\big) \ensuremath{\text}{,}\\ f_2 = e(2\tau) - 1080 e(3\tau) + \ensuremath{\mathcal{O}}\big(e(4 \tau)\big) \ensuremath{\text}{,}\quad f_3 = e(3\tau)q^3 + \ensuremath{\mathcal{O}}\big(e(4 \tau)\big) \ensuremath{\text}{.} \end{gather*} As points on the upper half plane, we use \begin{gather*} \tau_1 = 1 + 2 i \ensuremath{\text}{,}\quad \tau_2 = \mfrac{1}{2} + 3 i \ensuremath{\text}{,}\quad \tau_3 = \mfrac{1}{3} + 4 i \ensuremath{\text}{,} \end{gather*} which yield a matrix with entries~$f_i(\tau_j)$, $1 \le i,j \le 3$, of sufficiently large determinant, allowing for numerical stability when solving for~$f$. Theorem~\ref{thm:fourier_expansion_second_order_eisenstein_series} and the tail estimates in Lemmas~\ref{la:fourier_coefficient_tail_estimate} and~\ref{la:fourier_expansion_tail_estimate} yield \begin{align*} \Delta^5 \ensuremath{\mathcal{E}}(\Delta)(\tau_1) + f_E(\tau_1) &{}\approx 7.334 \cdot 10^{-46} + i 5.603 \cdot 10^{-25} \ensuremath{\text}{,}\\ \Delta^5 \ensuremath{\mathcal{E}}(\Delta)(\tau_2) + f_E(\tau_2) &{}\approx 1.574 \cdot 10^{-51} + i 3.940 \cdot 10^{-31} \ensuremath{\text}{,}\\ \Delta^5 \ensuremath{\mathcal{E}}(\Delta)(\tau_3) + f_E(\tau_3) &{}\approx -9.190 \cdot 10^{-37} - i 1.919 \cdot 10^{-36} \ensuremath{\text}{,} \end{align*} from which we obtain~$f = d_1 f_1 + d_2 f_2 + d_3 f_3$ with \begin{align*} d_1 &\approx -3.504686 \cdot 10^{-38} - i 1.4752509 \cdot 10^{-25} \ensuremath{\text}{,}\\ d_2 &\approx -5.371557 \cdot 10^{-30} - i 2.207136 \cdot 10^{-15} \ensuremath{\text}{,}\\ d_3 &\approx 1.5378812 \cdot 10^{-24} - i 1.0722708 \cdot 10^{-10} \ensuremath{\text}{.} \end{align*} \ifbool{nobiblatex}{% \bibliographystyle{alpha}%
f1a9b5eacd35ba86e714d526d60f4b08dcf36d20
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\subsection{Technical definitions} \label{App:def} \begin{Definition}[Admissible scheduling sequences] \label{asm:A1} A scheduling process $\p$ is called an \emph{Admissible scheduling sequence} if it satisfies the following properties: \begin{enumerate} \item \label{gen:filt:ass_new:cond1:def1} Denote by $\mathscr{F}^{\p,-}_{t}$ the $\sigma$-algebra generated by the random variables $\{\p(k) \}_{k < t}$. There exists positive numbers $\{p_{\sigma}\}_{\sigma \in \Sigma}$ such that for any $w,v \in \Sigma^{+}, \sigma, \sigma^{'} \in \Sigma$, $t \in \mathbb{Z}$: \begin{equation} \label{gen:filt:ass_new:cond1:def1:eq1} \begin{split} & E[\uw{w\sigma}(t)\uw{v\sigma^{'}}(t) \mid \mathscr{F}^{\p,-}_{t} ] = \\ & \left\{\begin{array}{rl} p_{\sigma} \uw{w}(t-1)\uw{v}(t-1) & \sigma=\sigma^{'} \\ 0 & \mbox{otherwise} \end{array}\right. \\ & E[\uw{w\sigma}(t)\uw{\sigma^{'}}(t) \mid \mathscr{F}^{\p,-}_{t}] = \\ & \left\{\begin{array}{rl} p_{\sigma} \uw{w}(t-1) & \sigma=\sigma^{'} \mbox{ and } \\ 0 & \mbox{otherwise} \end{array}\right. \\ & E[\uw{\sigma}(t)\uw{\sigma^{'}}(t) \mid \mathscr{F}^{\p,-}_{t}] = \begin{array}{rl} 0 & \mbox{if } \sigma \ne \sigma^{'} \end{array} \end{split} \end{equation} \item \label{gen:filt:ass_new:cond2:def1} There exist real numbers $\{\alpha_{\sigma}\}_{\sigma \in \Sigma}$ such that $\sum_{\sigma \in \Sigma} \alpha_{\sigma} \uw{\sigma}(t)=1$ for all $t \in \mathbb{Z}$. \item For each $w,v \in \Sigma^{+}$, the process $\begin{bmatrix} \uw{w}, \uw{v} \end{bmatrix}^T$ is wide-sense stationary. \end{enumerate} \end{Definition} Definition \ref{asm:A1} is a reformulation of \cite[Definition 1]{PetreczkyBilinear}, for $S \subseteq \Sigma \times \Sigma$. \begin{Definition}[ZMWSSI, {\cite[Definition 2]{PetreczkyBilinear}}]\label{def:ZMWSSI} A stochastic process $(\r,\p)$ is \emph{Zero Mean Wide Sense Stationary} (ZMWSSI) if \begin{enumerate} \item For $t \in \mathbb{Z}$, the $\sigma$-algebras generated by the variables $\{\mathbf{r}(k) \}_{k \leq t}$, $\{\p_{\sigma}(k) \}_{k < t, \sigma \in \Sigma}$ and $\{\p_{\sigma}(k) \}_{k \geq t, \sigma \in \Sigma},$ denoted by $\mathcal{F}_{t}^{\mathbf{r}}$, $\mathcal{F}_{t}^{\p,-}$ and $\mathcal{F}_{t}^{\p,+}$ respectively, are such that $\mathcal{F}_{t}^{\mathbf{r}}$ and $\mathcal{F}_{t}^{\p,+}$ are conditionally independent w.r.t. $\mathcal{F}_{t}^{\p,-}$. \item The processes $\{\mathbf{r}, \{\mathbf{z}^{\mathbf{r}}_{w} \}_{\wordSet{+}} \}$ are zero mean, square integrable and are jointly wide sense stationary, i.e., $\forall t,s,k \in \mathbb{Z},w,v \in \Sigma^{+}$, \begin{align*} & \expect{\mathbf{r}(t)} = 0, ~ \expect{\mathbf{z}^{\mathbf{r}}_{w} (t)} =0 \\ & \expect{\r(t+k)(\mathbf{z}^{\mathbf{r}}_{w} (s+k))^{T}} = \expect{\r(t) (\mathbf{z}^{\mathbf{r}}_{w} (s))^{T}}, \\ & \expect{\r(t+k)(\r(s+k))^{T}} = \expect{\r(t)(\r(s))^{T}}, \\ & \expect{\mathbf{z}^{\mathbf{r}}_{w} (t+k)(\mathbf{z}^{\mathbf{r}}_{v} (s+k))^{T}} = \expect{\mathbf{z}^{\mathbf{r}}_{w} (t) (\mathbf{z}^{\mathbf{r}}_{v} (s))^{T}}. \end{align*} \end{enumerate} \end{Definition} \begin{Definition}[SII process {\cite[Definition 5]{PetreczkyBilinear}} \label{Defn:SII} A process $\r$ is said to be \emph{Square Integrable w.r.t. $\p$} (abbreviated as \emph{SII} when $\p$ is clear from the context), for all $\wordSet{*}, t \in \mathbb{Z} $, the random variable $\mathbf{z}^{\r+}_w (t)= \mathbf{r}(t+|w|) \p_{w}(t+|w|-1)\frac{1}{\sqrt{p_w}}$, is square integrable. \end{Definition} \subsection{Proofs of Theorems \ref{inv:gbs:lemma} and \ref{min:forw:gbs:lemma}} \label{App:proof} First we show the following technical result, which states the following. \begin{Lemma}[Mean-square stability block-diagonal matrices] \label{proof:lemma-1} Consider matrices $\nx \times n$ $\{B_{i=1}\}_{i=1}^{\pdim}$ and $n \times n$ matrices $\{F_{i}\}_{i=1}^{\pdim}$ and $\nx \times \nx$ matrices $\{A_i\}_{i=1}^{\pdim}$ such that that $\sum_{i=1}^{\pdim} p_i (F_i \otimes F_i)$ and $\sum_{i=1}^{\pdim} p_i (A_i \otimes A_i$ are stable (all their eiegenvalues are inside the unit disk). Conside the matrix \[ \begin{split} & \tilde{F}_i=\begin{bmatrix} F_i & B_i \\ 0 & A_i \end{bmatrix} \\ \end{split} \] $\sum_{i=1}^{\pdim} p_i (\tilde{F}_i \otimes \tilde{F}_i)$ is stable. \end{Lemma} \begin{proof} Recall from \cite[Lemma 5]{PetreczkyNAHS} it follows that the stability of $\sum_{i=1}^{\pdim} p_i (\tilde{F}_i \otimes \tilde{F}_i)$ is equivalent to the existence of a matrix $P > 0$ such that $P - \sum_{i=1}^{\pdim} p_i \tilde{F}_iP\tilde{F}_i^T > 0$. We will construct such a matrix $P$. To this end, from \cite[Lemma 5]{PetreczkyNAHS} it follows that there exist $P_2 > 0$ such that $P_2-\sum_{i=1}^{\pdim} p_i A_iP_2A_i^T > 0$. Define \[ S=\sum_{i=1}^{\pdim} p_i(B_iP_2B_i^T) + \mathscr{D}(P_2-\sum_{i=1}{\pdim} p_i A_iP_2A_i^T)^{-1}\mathscr{D}^T \] where $\mathscr{D}=(\sum_{i=1}^{\pdim} p_i B_iP_2A_i^T$. It then follows that $S \ge 0$, as $(P_2-\sum_{i=1}{\pdim} p_i A_iP_2A_i^T)^{-1}$ is positive definite and $B_iP_2B_i^T$ are postive semi-definite matrices for each $i=1,\ldots,\pdim$. From \cite[Lemma 5]{PetreczkyNAHS} it follows that there exist $P_1 > 0$ such that \begin{equation} \label{proof:lemma-1:eq1} P_1-\sum_{i=1}^{\pdim} F_iP_1F_i^T - S > 0 \end{equation} Consider $P=\begin{bmatrix} P_1 & 0 \\ 0 & P_2 \end{bmatrix}$. Using standard calculation, it follows that \[ \begin{split} & P-\sum_{i=1}^{\pdim} p_i\tilde{F}_iP\tilde{F}_i^T = M(P) \\ & M(P)= \\ &\begin{bmatrix} P_1-\sum_{i=1}^{\pdim} p_i F_iP_1F_i^T - \mathcal{D}_1 & - \mathscr{D} \\ -\mathscr{D}^T & P_2-\sum_{i=1}{\pdim} p_i A_iP_2A_i^T \end{bmatrix} \end{split} \] $\mathscr{D}=\sum_{i=1}^{\pdim} p_i B_iP_2A_i^T$, $\mathcal{D}_1=\sum_{i=1}^{\pdim} p_i(B_iP_2B_i^T)$. Note that $P_2-\sum_{i=1}{\pdim} p_i A_iP_2A_i^T > 0$, hence, by using Schur complement, $M(P) > 0$ if \eqref{proof:lemma-1:eq1} holds, which is true by the choice of $P_1$. \end{proof} \begin{Lemma}[Orthogonal noises] \label{proof:lemma-3} Let $\mathbf{v}$ be a ZMWSII such that $E[\mathbf{v}(t)\mathbf{z}^{\mathbf{v}}_w(t)]=0$, $w \in \Sigma^{+}$. Then $\mathbf{z}_w(t)^{\mathbf{v}}(t), \mathbf{z}_v^{\mathbf{v}}(t)$ are uncorrelated for all $w,v \in \Sigma^{+}$, $v \ne w$. \end{Lemma} \begin{proof}[Proof Lemma \ref{proof:lemma-3}] Clearly $E[\mathbf{z}_w^{\mathbf{v}}(t)(\mathbf{z}_v^{\mathbf{v}}(t))^T]$ is either zero if $w$ is not a suffix of $v$, or if $v$ is not a suffix of $w$, as it is ZMWSII. If say $v=sw$, $s \ne \epsilon$ then $E[\mathbf{z}_w^{\mathbf{v}}(t)(\mathbf{z}_v^{\mathbf{v}}(t))^T]=E[\mathbf{v}(t)\mathbf{z}_s^{\mathbf{v}}(t)]=0$. \end{proof} \begin{Lemma}[Absolute convergence infinite sums] \label{proof:lemma-2} Consider a $p \times n$ matrix $C$ and matrices $n \times n_y$ $\{B_{i=1}\}_{i=1}^{\pdim}$ and $n \times n$ matrices $\{F_{i}\}_{i=1}^{\pdim}$ such that that $\sum_{i=1}^{n_y} p_i (F_i \otimes F_i)$ is stable. Let $\mathbf{v}$ be a ZMWSII such that $E[\mathbf{v}(t)(\mathbf{z}^{\mathbf{v}}_w(t))^T]=0$, $w \in \Sigma^{+}$. Then the infinite sum \begin{equation} \label{proof:lemma-2:eq1} \r(t)=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} \sqrt{p_{\sigma w}} CF_wB_{\sigma}\mathbf{z}_{\sigma w}^{\mathbf{v}}(t) \end{equation} is absolutely convergent in the mean-square sense, i.e., \begin{equation} \label{proof:lemma-2:eq2} \sum_{w \in \Sigma^{*},\sigma \in \Sigma} E[\|CF_wB_{\sigma}\mathbf{z}_{\sigma w}^{\mathbf{v}}(t)\|^2_2] \end{equation} and the process $\r(t)$ is ZMWSII and it the unique state process of the asLPV-SSA $(\{F_i,B_i\}_{i=1}^{\pdim},C,I,\mathbf{v})$. \end{Lemma} \begin{proof}[Proof of Lemma \ref{proof:lemma-2}] From \cite[Lemma 3]{PetreczkyBilinear} it follows that \eqref{proof:lemma-2:eq1} is convergent in mean square sense and $\r(t)$ is ZMWSII as it is the solution of the asLPV-SSA $(\{F_i,B_i\}_{i=1}^{\pdim},C,I,\mathbf{v})$. From Lemma \ref{proof:lemma-3} it follows that $\mathbf{z}_w(t)^{\mathbf{v}}(t),\mathbf{z}_v^{\mathbf{v}}(t)$ are uncorrelated. Hence \[ \begin{split} & E[\|\sum_{w \in \Sigma^{*},|w| \le N,\sigma \in \Sigma} CF_wB_{\sigma}\mathbf{z}_{\sigma w}^{\mathbf{v}}(t)\|^2_2]= \\ & trace \left(\sum_{w,v \in \Sigma^{*},|w|,|v| \le N,\sigma,\sigma_1 \in \Sigma} CA_wB_{\sigma}E[\mathbf{z}_w^{\mathbf{v}}(t)(\mathbf{z}_v^{\mathbf{v}}(t))^T](CA_vB_{\sigma_1})^T\right) = \\ & \sum_{w \in \Sigma^{*}, |w| \le N, \sigma \in \Sigma} E[\|CF_wB_{\sigma}\mathbf{z}_{\sigma w}^{\mathbf{v}}(t)\|^2_2] \end{split} \] and as $E[\|\sum_{w \in \Sigma^{*},|w| \le N,\sigma \in \Sigma} CF_wB_{\sigma}\mathbf{z}_{\sigma w}^{\mathbf{v}}(t)\|^2_2]$ is convergent by mean-square convergence of \eqref{proof:lemma-2:eq1}, it follows that \eqref{proof:lemma-2:eq2} is convergent. \end{proof} \begin{Lemma} \label{proof:lemma1} Assume that $(\textbf{y},\p)$ has a asLPV-SSA realization. Consider matrices $n \times n_y$ $\{B_{i=1}\}_{i=1}^{\pdim}$ and $n \times n$ matrices $\{F_{i}\}_{i=1}^{\pdim}$ such that that $\sum_{i=1}^{\pdim} p_i (F_i \otimes F_i)$ is stable. Then the infinite sum \begin{equation} \label{proof:lemma1:eq1} \sum_{w \in \Sigma^{*},\sigma \in \Sigma} F_wB_{\sigma}\mathbf{z}_{\sigma w}^{\textbf{y}}(t) \end{equation} converges absolutely in the mean-square sense and $\r(t)=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} F_wB_{\sigma}\mathbf{z}_{\sigma w}^{\textbf{y}}(t)$ is a ZMWSII process, and $\r$ is the unique process $\bar{\r}$ which satisfies \begin{equation} \label{proof:lemma1:eq1.5} \bar{\r}(t+1)=\sum_{i=1}^{\pdim} (F_i\bar{\r}(t)+B_i\textbf{y}(t))\p_i(t) \end{equation} and $\begin{bmatrix} \bar{\r}^T & \textbf{y}^T \end{bmatrix}$ is ZMWSII and the components of $\bar{\r}(t)$ belong to the Hilbert-space $\mathcal{H}^{\textbf{y}}_t$ generated by $\{\mathbf{z}_w^{\textbf{y}}(t)\}_{w \in \Sigma^{+}}$. \end{Lemma} \begin{proof}[Proof of Lemma \ref{proof:lemma1}] Assume that $\mathcal{S}=(\{A_i,K_i\}_{i=1}^{\pdim},C,D,\mathbf{v})$ is a minimal asLPV-SSA realization of $(\textbf{y},\p)$ in innovation form. Let us define the matrices \[ \begin{split} & \tilde{F}_i=\begin{bmatrix} F_i & B_iC \\ 0 & A_i \end{bmatrix}, \\ & \tilde{B}_i = \begin{bmatrix} B_iD \\ K_i \end{bmatrix} \\ & \tilde{C} = \begin{bmatrix} I_{n} & 0 \end{bmatrix} \end{split} \] From Lemma \ref{proof:lemma-1} it follows that $\sum_{i=1}^{\pdim} p_i (\tilde{F}_i \otimes \tilde{F}_i)$ is stable, and hence by Lemma \ref{proof:lemma-2} \begin{equation} \label{proof:lemma1:eq2} \tilde{\textbf{x}}(t)=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} \sqrt{p_\sigma w} \tilde{F}_w B_{\sigma} \mathbf{z}_{\sigma w}^{\mathbf{v}}(t) \end{equation} is absolutely convergent in the mean square sense and it is the unique state process of $(\{\tilde{F}_i,\tilde{B}_i\}_{i=1}^{\pdim},\tilde{C},I,\mathbf{v})$. % From \cite[Lemma 2 and Lemma 9]{PetreczkyBilinear} it follows that \begin{equation} \label{proof:lemma1:eq3} \mathbf{z}^{\textbf{y}}_v(t)=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} CA_w K_{\sigma} \mathbf{z}_{\sigma wv}^{\mathbf{v}}(t) + D\mathbf{z}^{\mathbf{v}}_{v}(t) \end{equation} Notice that \begin{equation} \label{proof:lemma1:eq4} \tilde{F}_{w}=\begin{bmatrix} F_w & \sum_{s_1,s_2 \in \Sigma^{*},\sigma_1 \in \Sigma, w=s_1\sigma s_2} F_{s_2}B_{\sigma_1}CA_{s_1}\\ 0 & A_w \end{bmatrix} \end{equation} and notice that $\hat{\textbf{x}}(t)=\begin{bmatrix} \bar{\textbf{x}}(t) \\ \textbf{x}(t) \end{bmatrix}$, where $\textbf{x}$ is the unique state process of the asLPV-SSA $\mathcal{S}=(\{A_i,K_i\}_{i=1}^{\pdim},C,D,\mathbf{v})$ which realizes $(\textbf{y},\p)$. In particular, $\bar{\textbf{x}}(t)$ \begin{equation} \label{proof:lemma1:eq5} \begin{split} & \bar{\textbf{x}}(t)=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} \left( F_wB_{\sigma}D\mathbf{z}^{\mathbf{v}}_{w\sigma}(t) + \right. \\ & \left. \sum_{s_1,s_2 \in \Sigma^{*},\sigma_1 \in \Sigma, w=s_1\sigma s_2} F_{s_2}B_{\sigma_1}CA_{s_1}K_{\sigma} \mathbf{z}_{\sigma w}^{\mathbf{v}}(t)\right) \end{split} \end{equation} From Lemma \ref{proof:lemma-2} it follows that $S_3=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} F_w B_{\sigma}D\mathbf{z}^{\mathbf{v}}_{w\sigma}(t)$ is absolutely convergent in the mean-square sense. Hence, \begin{equation} \label{proof:lemma1:eq6} \begin{split} & S_4:=\bar{\textbf{x}}(t)-S_3= \\ & =\sum_{w \in \Sigma^{*},\sigma_1,\in \Sigma} \left(\sum_{s_1,s_2 \in \Sigma^{*},\sigma_1 \in \Sigma, w=s_1\sigma s_2} F_{s_2}B_{\sigma_1}CA_{s_1}K_{\sigma} \mathbf{z}_{\sigma w}^{\mathbf{v}}(t)\right) \end{split} \end{equation} is absolutely convergent in the mean-square sense. It is known that for absolutely convergent series of elements Hilbert-spaces can be rearranged while preserving convergence, hence, by using \eqref{proof:lemma1:eq3} \begin{equation} \label{proof:lemma1:eq6} \begin{split} & S_4=\sum_{s_1,s_2\in \Sigma^{*} \sigma_1,\sigma \in \Sigma} \sqrt{p_{\sigma s_1\sigma_1s_2}} F_{s_2}B_{\sigma_1}CA_{s_1}K_{\sigma} \mathbf{z}_{\sigma w}^{\mathbf{v}}(t) = \\ & \sum_{s_2 \in \Sigma^{*},\sigma_1 \in \Sigma} F_{s_2}B_{\sigma_1} \underbrace{\left( \sum_{s_2 \in \Sigma^{*},\sigma \in \Sigma} CA_{s_2}K_{\sigma}\mathbf{z}_{\sigma s_2\sigma_1 s_1}^{\mathbf{v}}(t)\right)}_{\mathbf{z}^{\textbf{y}}_{\sigma_1 s_2}(t)-D\mathbf{z}_{\sigma_1 s_2}^{\mathbf{v}}(t)} \\ & \sum_{s_2 \in \Sigma^{*},\sigma_1 \in \Sigma} F_{s_2}B_{\sigma_1}\mathbf{z}_{\sigma_1s_1}^{\textbf{y}}(t)-F_{s_2} B_{\sigma_1} D\mathbf{z}_{\sigma_1 s_2}^{\mathbf{v}}(t)=\\ & \sum_{s_2 \in \Sigma^{*},\sigma_1 \in \Sigma} F_{s_2}B_{\sigma_1}\mathbf{z}_{\sigma_1s_1}^{\textbf{y}}(t) - S_3 \end{split} \end{equation} is absolutely convergent, and hence $\r(t)=\bar{\textbf{x}}(t)=S_4+S_3$ is absolutely convergent. Finally notice that $\r(t)=\bar{\textbf{x}}(t)$ is the component of the unique state process $\tilde{\textbf{x}}(t)$ of the asLPV-SSA $(\{\tilde{F}_i,\tilde{B}_i\}_{i=1}^{\pdim},\tilde{C},I,\mathbf{v})$ and hence $\tilde{\textbf{x}}$ is ZMWSII and hence so is $\r$. Finally, from $\tilde{\textbf{x}}$ being the state process of $(\{\tilde{F}_i,\tilde{B}_i\}_{i=1}^{\pdim},\tilde{C},I,\mathbf{v})$ it follows that $\r(t)$ satisfies \eqref{proof:lemma1:eq1.5}. Moreover, if $\bar{\r}(t)$ is a ZMWSII process which satisfies \eqref{proof:lemma1:eq1.5} such that $\begin{bmatrix} \bar{\r}^T & \textbf{y}^T \end{bmatrix}^T$ is ZMWSII and the components of $\bar{\r}(t)$ belong to $\mathcal{H}_t^{\textbf{y}}$. Note that since $\mathcal{S}$ is a minimal asLPV-SSA realization o$(\textbf{y},\p)$ in innovation form, $\mathbf{v}(t)=\textbf{y}(t)-C\textbf{x}(t)$ and the elements of $\mathbf{v}$ belong to the Hilbert-space $\mathcal{H}^{\textbf{y}}_{t}$. Notice that from \eqref{proof:lemma1:eq3} it follows that $\mathcal{H}^{\textbf{y}}_t$ is a subspace of the Hilbert-space $\mathcal{H}_t^{\mathbf{v}}$ generated by $\{\mathbf{z}^{\mathbf{v}}_{w}(t)\}_{w \in \Sigma^{+}}$. That is, $\mathcal{H}^{\textbf{y}}_t=\mathcal{H}_t^{\mathbf{v}}$. Then $\hat{\textbf{x}}=\begin{bmatrix} \bar{\r}^T & \textbf{x} \end{bmatrix}^T$ is such that $\hat{\textbf{x}}(t)$ satisfies the conditions of \cite[Lemma 10]{PetreczkyBilinear} for $\r=\mathbf{v}$, $\begin{bmatrix} \hat{\textbf{x}}^T & \mathbf{v}^T \end{bmatrix}^T$ is ZMWSII. Moreover, $E[\mathbf{v}(t)(\mathbf{z}_w^{\bar{\r}}(t))^T]=0$ as $\mathbf{v}(t)$ is orthogonal to $\mathcal{H}_t^{\mathbf{v}}=\mathcal{H}_t^{\textbf{y}}$ and the components of $\mathbf{z}_w^{\bar{\r}}(t)$ belongs $\mathcal{H}_t^{\textbf{y}}$ for all $w \in \Sigma^{*}$. Finally $\hat{\textbf{x}}(t+1)=\sum_{i=1}^{\pdim} (\tilde{F}_i\hat{\textbf{x}}(t)+\tilde{B}_i\mathbf{v}(t))\p_i(t)$. Hence, $\hat{\textbf{x}}(t)$ is a state process of $(\{\tilde{F}_i,\tilde{B}_i\}_{i=1}^{\pdim},\tilde{C},I,\mathbf{v})$ and hence it is unique and equals $\tilde{\textbf{x}}$ and $\bar{\r}=\r$. \end{proof} \begin{proof}[Proof of Lemma \ref{gbs:finite_filt:lemma}] From Lemma \ref{proof:lemma1} it follows that $\tilde{\textbf{x}}(t)=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} F_w K_{\sigma} \mathbf{z}_{\sigma w}^{\textbf{y}}(t)$, where $F_i=(A_i-K_iC)$, $i=1,\ldots,\pdim$ is absolutely convergent in the mean-square sense, hence $\bar{\textbf{x}}(t)-\tilde{\textbf{x}}(t)$ converges to zero in the mean square sense. It remains to show that $\tilde{\textbf{x}}(t)=\textbf{x}(t)$. To this end, notice that $\begin{bmatrix} \tilde{\textbf{x}}^T & \textbf{y}^T \end{bmatrix}^T$ is ZMWSII by Lemma \ref{proof:lemma1}, the elements of $\tilde{\textbf{x}}$ belong to $\mathcal{H}^{\textbf{y}}_t$ and it satisfies \[ \begin{split} & \tilde{\textbf{x}}(t+1)=\sum_{i=1}^{\pdim} ((A_i-K_iC)\tilde{\textbf{x}}(t)+K_i\textbf{y}(t))\p_i(t) \end{split} \] At the same time, $\begin{bmatrix} \textbf{x}^T & \textbf{y}^T \end{bmatrix}^T$ is ZMWSII. Note that the components of $\textbf{x}$ belong to $\mathcal{H}^{\textbf{y}}$: as it was pointed out in the proof of Lemma \ref{proof:lemma1}, $\mathcal{H}^{\textbf{y}}_t$ equals the Hilbert-space generated by $\{\mathbf{z}_w^{\textbf{e}}(t)\}_{w \in \Sigma^{+}}$ and the components of $\textbf{x}(t)$ belong to the latter Hilbert-space. Hence, $\textbf{x}(t)$ satisfies \eqref{gen:filt:bil:def:pred}, hence by Lemma \ref{proof:lemma1} $\textbf{x}(t)=\bar{\textbf{x}}(t)$. \end{proof} \begin{proof}[Proof of Theorem \ref{inv:gbs:lemma}] Note that we can write $\mathbf{v}(t)=\textbf{y}(t)-C\textbf{x}(t)$ and hence the first equation of \eqref{eq:aslpv} holds, i.e., $\textbf{x}(t+1) = \sum_{i=1}^{\pdim} (A_i-K_iC)\textbf{x}(t)+K_i\textbf{y}(t))\bm{\mu}_i(t)$. Since the matrix $\sum_{i=1}^{\pdim} \bm{\mu}_i (A_i-K_iC) \otimes (A_i-K_iC)$ is stable, then by repeating the steps of the proof of \cite[Lemma1]{PetreczkyBilinear} it can be shown that $\textbf{x}(t)=\sum_{w \in \Sigma^{*},i \in \Sigma} \sqrt{p_{iw}} A_wK_i\mathbf{z}^{\textbf{y}}_{iw}(t)$, and hence the elements of $\textbf{x}(t)$ belong to the Hilber-space generated by $\{\mathbf{z}^{\textbf{y}}_w(t)\}_{w \in \Sigma^{+}}$. Note that $E[\mathbf{v}(t) \mid \{\mathbf{z}^{\textbf{y}}_w(t)\}_{w \in \Sigma^{+}}]=0$, see the proof of \cite[eq. (37), proof of Theorem 4]{PetreczkyBilinear}, hence, $E[\textbf{y}(t) \mid \{\mathbf{z}^{\textbf{y}}_w(t)\}_{w \in \Sigma^{+}}]=C\textbf{x}(t)$ and therefore $\textbf{e}(t)=\mathbf{v}(t)$. \end{proof} \begin{proof}[Proof of Theorem \ref{min:forw:gbs:lemma}] Note that $\mathcal{S}$ is minimal if and only if the observability and reachability matrices satisfy the following rank conditions $\mathrm{rank}~ \mathscr{O}_{n-1}(\mathcal{S})=n$ and $\mathrm{rank}~ \mathscr{R}_{n-1}(\mathcal{S})=n$ . Note that the rows of the extended observability matrix $\mathcal{O}_{n-1}$ of the associated dLPV-SSA $\mathcal{D}_{\mathcal{S}}$ are either zero or they coincide with the rows of the observability matrix $\mathscr{O}_{n-1}(\mathcal{S})$, i.e., $\mathrm{rank}~ \mathscr{O}_{n-1}(\mathcal{S})=\mathrm{rank}~ \mathcal{O}_{n-1}$. That is, $\mathcal{S}$ satisfies the observability rank condition if and only if the dLPV-SSA $\mathcal{D}_{\mathcal{S}}$ is observable. We will show that $\bm{Im} \mathscr{R}_{n-1}(\mathcal{S})=\bm{Im} \mathcal{R}_{n-1}$, where $\mathcal{R}_{n-1}$ is the extended controllability matrix of the dLPV-SSA $\mathcal{D}_{\mathcal{S}}$. From this, it follows that $\mathcal{S}$ satisfies the reachability rank condition if and only if $\mathcal{L}_{\mathcal{S}}$ is span-reachable. Now we will show that $\bm{Im}~ \mathscr{R}_{n-1}(\mathcal{S})=\bm{Im}~ \mathcal{R}_{n-1}$. To this end, we recall that $\textbf{x}(t)$ belongs to the linear space generated by the columns of $A_{w}K_{\sigma}$, $w \in \Sigma^{*}$, $\sigma \in \Sigma$. Since $B_\sigma=E[\textbf{x}(t)(\mathbf{z}^{\textbf{y}}_{\sigma}(t))^T]$, it then follows that the columns of $B_\sigma$ also belong to the linear space generated by the columns of $A_{w}K_\sigma$, $w \in \Sigma^{*}, \sigma \in \Sigma$. Therefore, the columns of $A_vB_\sigma$, $v \in \Sigma^{*}, \sigma \in \Sigma$ also belong to the linear space generated by the columns of $A_{w}K_\sigma$, $w \in \Sigma^{*}, \sigma \in \Sigma$. In turn, it is easy to see that latter subspace equals $\bm{Im}~ \mathcal{R}_{n-1}$. That is, $\bm{Im}~ A_vB_\sigma$ is a subspace of $\bm{Im}~ \mathcal{R}_{n-1}$, and therefore $\bm{Im}~ \mathscr{R}_{n-1}(\mathcal{S}) \subseteq \bm{Im}~ \mathcal{R}_{n-1}$. Conversely, from \cite[eq. (37), proof of Theorem 4]{PetreczkyBilinear} it follows that $E[\textbf{x}(t)\mathbf{z}^{\textbf{y}}_{\sigma v}(t)]=\sqrt{p_w} A_vB_\sigma$, i.e., for every $w \in \Sigma^{+}$, the columns $E[\textbf{x}(t)(\mathbf{z}^{\textbf{y}}_{w}(t))^T]$ belong to the space generated by $A_vB_\sigma$, $\sigma \in \Sigma$, $v \in \Sigma^*$. Notice that by \cite[Theorem 2 and Remark 1]{PetreczkyRealChapter} applied to the LSS\ $\Sigma_{\mathcal{S}}$, the latter space equals $\bm{Im} \mathscr{R}_{n-1}(\mathcal{S})$. Since the elements of $\mathbf{z}^{\textbf{e}}_{\sigma}(t)$ are limits of finite linear combinations of the rows of $\{\mathbf{z}^{\textbf{y}}_{w}(t)\}_{w \in \Sigma^{+}}$, it then follows that the columns of $E[\textbf{x}(t)(\mathbf{z}^{\textbf{e}}(t))^T]$ are the limits of finite linear combinations of columns of $E[\textbf{x}(t)(\mathbf{z}^{\textbf{y}}_{w}(t))^T]$, $w \in \Sigma^{+}$, and hence the columns of $E[\textbf{x}(t)(\mathbf{z}^{\textbf{y}}_{w}(t))^T]$, $w \in \Sigma^{+}$ also belong to $\bm{Im} \mathscr{R}_{n-1}(\mathcal{S})$. From \cite[Proof of Theorem 4]{PetreczkyBilinear} it follows that $K_\sigma Q_\sigma=E[\textbf{x}(t)(\mathbf{z}^{\textbf{e}}_\sigma(t))^T]$, where $Q_\sigma=E[\textbf{e}(t)\textbf{e}^T(t)\bm{\mu}_\sigma^2(t)]$, and hence the columns of $K_\sigma Q_\sigma$ belong to $\bm{Im} \mathscr{R}_{n-1}(\mathcal{S})$. Since $Q_\sigma$ is non-singular, it then follows that the columns of $K_\sigma$ belong to $\bm{Im} \mathscr{R}_{n-1}(\mathcal{S})$. Since $\bm{Im} \mathscr{R}_{n-1}(\mathcal{S})$ is $A_\sigma$-invariant for all $\sigma \in \Sigma$ and $A_0=0$, it then follows that $\bm{Im} A_vK_\sigma \subseteq \bm{Im} \mathscr{R}_{n-1}$ for all $v \in \mathbb{I}_{0,n_p}^{*}$, $\sigma \in \mathbb{I}_{0,n_p}$, and thus $\bm{Im} \mathcal{R}_{n-1} \subseteq \bm{Im} \mathscr{R}_{n-1}(\mathcal{S})$. \end{proof} \subsection{Proof of Lemma 2} \begin{Definition}[Necessary Maps] Define, for the sequel, the following maps: $$\mathscr{Y}: (\mathbf{u},\p) \longmapsto \mathbf{y} = \mathscr{Y}(\mathbf{u},\p)$$ $$\mathscr{F}: \mathcal{D} \longmapsto \mathscr{F}(\mathcal{D})$$ $$\mathscr{D}: \mathcal{D} \longmapsto \mathscr{D}(\mathcal{D})$$ where $\mathscr{Y}$ is the input-output map, $\mathcal{D} = (\{A_i,K_i\}_{i=1}^{\pdim},C,I)$ is a dLPV-SSA and $\mathscr{F}(\mathcal{D})$ and $\mathscr{D}(\mathcal{D})$ are two transformed dLPV-SSAs with $\mathscr{F}(\mathcal{D})=(\{A_i-K_iC,K_i\}_{i=1}^{\pdim},C,I)$ and $\mathscr{D}(\mathcal{D})=(\{A_i,K_i\}_{i=1}^{\pdim},-C,I)$ \end{Definition} Note that, if $\mathcal{X}$ is a dLPV-SSA representation, then it is clear that $\mathscr{D}(\mathscr{F}(\mathscr{D}(\mathscr{F}(\mathcal{X}))))=\mathcal{X}$. \begin{Lemma} \label{new:lem} Consider the following dLPV-SSA: $\mathcal{D} = (\{A_i,K_i\}_{i=1}^{\pdim},C,I)$ where it is a realization of the sub-Markov parameters $M_\mathcal{D} = CA_wK_\sigma$ where $w \in \Sigma^{*}$, $\sigma \in \Sigma$. Subsequently, $\mathscr{F}(\mathcal{D})$ is a realization of $M_{\mathscr{F}(\mathcal{D})} = C\Tilde{A}_wK_\sigma$ with $\Tilde{A}_i = A_iK_iC$. If a dLPV-SSA $\mathcal{D}' = (\{A'_i,K'_i\}_{i=1}^{\pdim},C',I)$ is a realization of $M_\mathcal{D}$, then the $\mathscr{F}(\mathcal{D'})$ dLPV-SSA is a realization of $M_{\mathscr{F}(\mathcal{D})}$. \end{Lemma} \begin{proof}[Proof of Lemma \ref{new:lem}] Consider that $(\textbf{x},\mathbf{u},\p,\textbf{y})$ is a solution of the system $\mathcal{D}$ it then follows that \begin{align*}&\textbf{x}(t+1) = \sum_{i=1}^{\pdim}(A_i\textbf{x}(t)+K_i\mathbf{u}(t))\p_i(t) \\ &\textbf{y}(t)=C\textbf{x}(t)\end{align*} It can then be modified to $$\textbf{x}(t+1)=\sum_{i=1}^{\pdim}(A_i\textbf{x}(t)+K_i(C\textbf{x}(t) - C\textbf{x}(t) + \mathbf{u}(t)))\p_i(t)$$ $$\textbf{x}(t+1)=\sum_{i=1}^{\pdim}((A_i-K_iC)\textbf{x}(t)+K_i(\mathbf{y}(t) + \mathbf{u}(t)))\p_i(t)$$ Subsequently, it is safe to say that $(\textbf{x},\mathbf{v},\p,\textbf{y})$ is a solution of the system $\mathscr{F}(\mathcal{D})$ with $\mathbf{v} = \mathbf{y} + \mathbf{u}$. It can also be shown, with the same demonstration, that if $(\textbf{x},\mathbf{v},\p,\mathbf{y})$ is a solution of $\mathscr{F}(\mathcal{D})$, then $(\textbf{x},\mathbf{u},\p,\mathbf{y})$ is a solution of $\mathcal{D}$, with $\mathbf{u}=\mathbf{v}-\mathbf{y}$. That is, it can be said that $\mathscr{Y}_{\mathcal{D},0}(\mathbf{u},\p)=\mathbf{y}=\mathscr{Y}_{\mathscr{F}(\mathcal{D}),0}(\mathbf{v},\p)$. Consider now that $(\Tilde{\mathbf{x}},\mathbf{u},\p,\Bar{\mathbf{y}})$ is a solution of $\mathcal{D}'$, it is safe to say that $(\Tilde{\mathbf{x}},\Bar{\mathbf{v}},\p,\Bar{\mathbf{y}})$ is a solution of $\mathscr{F}(\mathcal{D}')$, with $\Bar{\mathbf{v}}=u+\Bar{\mathbf{y}})$. Lemma \ref{new:lem} assumes that $\mathcal{D}$ and $\mathcal{D}'$ are both realization of the sub-Markov parameters $M_\mathcal{D}$. This leads to the following conclusion: $$\mathscr{Y}_{\mathscr{F}(\mathcal{D}),0}(\mathbf{v},\p)=\mathscr{Y}_{\mathcal{D},0}(\mathbf{u},\p)=\mathbf{y}=\Bar{\mathbf{y}}=\mathscr{Y}_{\mathcal{D}',0}(\mathbf{u},\p)=\mathscr{Y}_{\mathscr{F}(\mathcal{D}'),0}(\bar{\mathbf{v}},\p)$$ In other words, $\mathscr{F}(\mathcal{D}')$ is a realization of $M_{\mathscr{F}(\mathcal{D})}$. \end{proof} \begin{Corollary} An dLPV-SSA representation $\Sigma$ is a minimal realization of $M_\Sigma$ if and only if $\mathscr{F}(\Sigma)$ is a minimal realization of $M_{\mathscr{F}(\Sigma)}$. \end{Corollary} \begin{proof} Suppose that $\Sigma$ is minimal and $\mathscr{F}(\Sigma)$ is not. Which means that, there exists a minimal dLPV-SSA representation $\Sigma^m$ such that $dim\Sigma^m < dim\mathscr{F}(\Sigma) = dim\Sigma$. Define a dLPV-SSA representation $\Hat{\Sigma}^m := \mathscr{D}(\mathscr{F}(\mathscr{D}(\Sigma^m)))$. It is known that $\Sigma^m$ and $\mathscr{F}(\Sigma)$ are both a realization of $M_{\Sigma^m} = M_{\mathscr{F}(\Sigma)}$, then, by applying $\mathscr{D}(\mathscr{F}(\mathscr{D}(\cdot)))$ on both sides, we will get the following: \begin{equation*} M_{\mathscr{D}(\mathscr{F}(\mathscr{D}(\Sigma^m)))} = M_{\mathscr{D}(\mathscr{F}(\mathscr{D}(\mathscr{F}(\Sigma))))} \Longrightarrow M_{\Sigma} = M_{\Hat{\Sigma}^m} \end{equation*} Which means that $\Hat{\Sigma}^m$ is a realization of $M_\Sigma$ and $dim\Sigma = dim\mathscr{F}(\Sigma) > dim\Sigma^m = dim\Hat{\Sigma}^m$, which implies that $\Sigma$ is not minimal, and results to a contradiction. \end{proof} \begin{proof}[Proof of Lemma \ref{alg:min1:lem}] In order to prove Lemma \ref{alg:min1:lem}, two steps are needed: \textbf{(1)} proving that $\mathcal{S}_m$ is stably invertable, and \textbf{(2)} proving that $\mathcal{S}_m$ is a realization of $(\mathbf{y},\p)$ in innovation form. \newline \textbf{(1)} From Lemma \ref{new:lem} it follows that $\mathscr{F}(\mathcal{D})$ and $\mathscr{F}(\mathcal{D}_m)$ are both a realization of $M_{\mathcal{F}(\mathcal{D})}$, this is due to the fact that $\mathcal{D}$ and $\mathcal{D}_m$ are both a realization of $M_\mathcal{D}$. Recall from \cite[Lemma 6]{PetreczkyNAHS}\footnote{The termenology of \cite{PetreczkyNAHS} refers to the switch systems representations not the LPV-SSA representations} that if the matrix $\sum_{i=1}^{\pdim}(\sqrt{p_i}\mathscr{A}_i^T)^T\otimes (\sqrt{p_i}\mathscr{A}_i^T)^T = \sum_{i=1}^{\pdim}p_i\mathscr{A}_i\otimes \mathscr{A}_i$ is stable then the matrix $\sum_{i=1}^{\pdim}p_i\mathscr{A}_i^m\otimes \mathscr{A}_i^m$ is also stable, where $\mathscr{A}_i$ are the state matrices of an dLPV-SSA $\Sigma_1$ and $\mathscr{A}_i^m$ are the state matrices of the minimized dLPV-SSA $\Sigma_1^m$. This said, recall that Algorithm \ref{alg:min1} assumes that its input $\mathcal{S}=(\{A_{\sigma},K_{\sigma}\}_{\sigma=1}^{\pdim},C,I_{n_y})$ is stably invertable. It follows that the matrix $\sum_{i=1}^{\pdim} p_i (A_i-K_iC) \otimes (A_i-K_iC)$ is stable, where $(A_i-K_iC)$ are the state matrices of $\mathscr{F}(\mathcal{D})$. Note that $\mathscr{F}(\mathcal{D}_m)$ is minimal due to the minimality of $\mathcal{D}_m$. It follows, from \cite[Lemma 6]{PetreczkyNAHS}, that the matrix $\sum_{i=1}^{\pdim} p_i (A_i^m-K_i^mC^m) \otimes (A_i^m-K_i^mC^m)$ is stable, where $(A_i^m-K_i^mC^m)$ are the state matrices of $\mathscr{F}(\mathcal{D}_m)$. Therefore, the algorithm's output $\mathcal{S}_m$ is indeed stably invertable. \newline \textbf{(2)} Since $\mathcal{S}$ is a realization of $(\mathbf{y},\p)$ in innovation form, then there exists a process $\mathbf{x}$ such that \eqref{eq:aslpv} holds with $\mathbf{v}=\mathbf{y}$. This said, let us apply the linear transformation $T$ as described in \cite[Corollary 1]{PetreczkyLPVSS} to $\mathcal{S}$. Let $\Hat{\mathbf{x}}(t) = T\mathbf{x}(t)$, $\Hat{A}_i = TA_i$, $\Hat{K}_i = TK_i$, for $i=1,\ldots,\pdim$, and $\Hat{C} = CT^{-1}$. Then the asLPV-SSA $\Hat{\mathcal{S}} = (\{\Hat{A}_i,\Hat{K}_i\}_{i=1}^{\pdim},\Hat{C},I,\mathbf{e})$ is also a realization of $(\mathbf{y},\p)$ in innovation form. Now, in order to get the Kalman decomposition, recall form \cite[Corollary 1]{PetreczkyLPVSS} that: \begin{equation*} \Hat{A}_i=\begin{bmatrix} A_i^m & 0 & A_i' \\ A_i'' & A_i''' & A_i'''' \\ 0 & 0 & A_i^{uc} \\ \end{bmatrix}, \quad \Hat{K}_i = \begin{bmatrix} K_i^m \\ K_i' \\ 0 \\ \end{bmatrix}, \quad \Hat{C} = \begin{bmatrix} C^m & 0 & C' \\ \end{bmatrix} \end{equation*} for $i=1,\ldots,\pdim$, and for suitable block matrices. In particular, for all $w \in \Sigma^*$ we found: \begin{equation} \label{Aw_matrix} \Hat{A}_w = \begin{bmatrix} A_w^m & 0 & \ast \\ \ast & A_w''' & \ast \\ 0 & 0 & A_w^{uc} \\ \end{bmatrix} \end{equation} where $\ast$ refers to a block matrix. Indeed, it can be shown that for $w=\epsilon$, $\Hat{A}_w = I$. Now if \eqref{Aw_matrix} holds for $w=v$, then for $w=v\sigma$: \begin{equation*} \Hat{A}_w = \begin{bmatrix} A_\sigma^m & 0 & \ast \\ \ast & A_\sigma''' & \ast \\ 0 & 0 & A_\sigma^{uc} \\ \end{bmatrix}\begin{bmatrix} A_v^m & 0 & \ast \\ \ast & A_v''' & \ast \\ 0 & 0 & A_v^{uc} \\ \end{bmatrix} = \begin{bmatrix} A_{\sigma v}^m & 0 & \ast \\ \ast & A_{\sigma v}''' & \ast \\ 0 & 0 & A_{\sigma v}^{uc} \\ \end{bmatrix} \end{equation*} Hence, by induction of the length of $w$, \eqref{Aw_matrix} holds. It the follows that: \begin{equation*} \Hat{A}_w\Hat{K}_\sigma = \begin{bmatrix} A_w^mK_\sigma^m \\ \ast \\ 0 \\ \end{bmatrix} \end{equation*} Consider the following decomposition: \begin{equation*} \Hat{\mathbf{x}}(t)=T\mathbf{x}(t)=\begin{bmatrix} \mathbf{x}^m(t) \\ \mathbf{x}^c(t) \\ \mathbf{x}^{uc}(t) \\ \end{bmatrix} \end{equation*} From Lemma \ref{proof:lemma-2}, $\Hat{\mathbf{x}}(t)$ can be expressed as: \begin{equation*} \Hat{\textbf{x}}(t)=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} \sqrt{p_\sigma w} \Hat{A}_w \Hat{K}_{\sigma} \mathbf{z}_{\sigma w}^{\mathbf{e}}(t) \end{equation*} It follows that: \begin{equation} \label{x:decomp} \Hat{\textbf{x}}(t)=\sum_{w \in \Sigma^{*},\sigma \in \Sigma} \sqrt{p_\sigma w} \begin{bmatrix} A_w^m K^m_{\sigma} \mathbf{z}_{\sigma w}^{\mathbf{e}}(t) \\ \ast \\ 0 \\ \end{bmatrix} = \begin{bmatrix} \sum_{w \in \Sigma^{*},\sigma \in \Sigma} \sqrt{p_\sigma w} A_w^m K^m_{\sigma} \mathbf{z}_{\sigma w}^{\mathbf{e}}(t) \\ \ast \\ 0 \\ \end{bmatrix} \end{equation} From \eqref{x:decomp} it follows that $\mathbf{x}^m(t)= \sum_{w \in \Sigma^{*},\sigma \in \Sigma} \sqrt{p_\sigma w} A_w^m K^m_{\sigma} \mathbf{z}_{\sigma w}^{\mathbf{e}}(t)$. Then from \cite[Lemma 3]{PetreczkyBilinear}, it follows that $\mathbf{x}^m(t)$ is the state process of $\mathcal{S}_m$. Finally, notice that, as $\Hat{\mathcal{S}}$ is a realization of $(\mathbf{y},\p)$, $\mathbf{y}(t) = C\mathbf{x}(t) + \mathbf{e}(t) = \Hat{C}T\mathbf{x}(t) + \mathbf{e}(t) = \Hat{C}\Hat{\mathbf{x}}(t) + \mathbf{e}(t)$. The output can then be expressed as: \begin{equation} \label{y(t):min} \mathbf{y}(t) = \begin{bmatrix} C^m & 0 & C' \end{bmatrix}\begin{bmatrix} \mathbf{x}^m(t) \\ \mathbf{x}^c(t) \\ \mathbf{x}^{uc}(t) \\ \end{bmatrix} + \mathbf{e}(t) \end{equation} From \eqref{x:decomp} it follows that $\mathbf{x}^{uc}(t)=0$. Hence, from \eqref{y(t):min} it follows that $y(t) = C^m\mathbf{x}^m(t) + e(t)$. Since $\mathbf{x}^m$ is the state process of $\mathcal{S}_m$, it then follows that $\mathcal{S}_m$ is a realization of $(\mathbf{y},\p)$. In addition, because $\mathcal{S}_m$ is stably invertable, as proven in \textbf{(1)}, then $\mathcal{S}_m$ is a realization of $(\mathbf{y},\p)$ in innovation form. \end{proof} \section{Conclusion} This paper formulates conditions for a LPV state-space representation to be minimal and in innovation form. These conditions depend only the matrices of the LPV representation. A minimization algorithm for transforming any LPV representation to a minimal one in innovation form is formulated too. These results are expected to be useful for system identification, in particular, for making the identification problem mathematically well-posed. In the future, we will explore the application of the proposed results to concrete system identification algorithms. \subsection{Deterministic LPV-SSA representation} \label{sect:real:red} Recall from \cite{PetreczkyLPVSS,CoxLPVSS} that a deterministic LPV state-space representation with affine dependence (abbreviated as \emph{dLPV-SSA}) is a system of the form: \begin{equation} \label{eqn:LPV_SSA:det} \mathscr{S}\left\{\begin{aligned} &\mathrm{x}(t+1)=\sum_{i=1}^{\pdim} (\mathcal{A}_i\mathrm{x}(t)+\mathcal{B}_i\mathrm{u}(t))\mu_i(t), ~ \\ &\mathrm{y}(t)=\mathcal{C}\mathrm{x}(t)+\mathcal{D}\mathrm{u}(t), \end{aligned}\right. \end{equation} where $\mathcal{A}_i, \mathcal{B}_i, \mathcal{C}, \mathcal{D}$ are matrices of suitable dimensions, $\mathrm{x}:\mathbb{Z} \rightarrow \mathbb{R}^{n_\mathrm{x}}$ is the state trajectory $\mathrm{u}:\mathbb{Z} \rightarrow \mathbb{R}^{n_\mathrm{u}}$ is the input trajectory $\mathrm{y}:\mathbb{Z} \rightarrow \mathbb{R}^{n_\mathrm{y}}$ is the output trajectory with finite support. We identify a dLPV-SSA of the form \eqref{eqn:LPV_SSA:det} with the tuple \begin{equation} \label{eqn:LPV_SSA:det_not} \mathscr{S}=(\{\mathcal{A}_{i},\mathcal{B}_{i}\}_{i=0}^{\pdim},\mathcal{C},\mathcal{D}) \end{equation} The \emph{sub-Markov function} of the dLPV-SSA $\mathscr{S}$ is the function $M_{\mathscr{S}}:\Sigma^{*} \rightarrow \mathbb{R}^{n_\mathrm{y} \times n_\mathrm{u}}$, such that for all $w \in \Sigma^{*}$, \begin{equation}\label{eqn:sub_markov} M_{\mathscr{S}}(w)=\left\{\begin{array}{ll} \mathcal{CA}_s\mathcal{B}_{\sigma}, \ \ & w=\sigma s, \, \sigma \in \Sigma, \, s \in \Sigma^{*} \\ \mathcal{D}. \ \ & w=\epsilon \end{array}\right. \end{equation} The values of $\{M_{\mathscr{S}}(w)\}_{w \in \Sigma^{*}}$ are the \emph{sub-Markov parameters} of $\mathscr{S}$. From \cite{PetreczkyLPVSS} it then follows that two dLPV-SSAs have the same input-output behavior, if and only if their sub-Markov functions are equal. For a function $M:\Sigma^{*} \rightarrow \mathbb{R}^{n_\mathrm{y} \times n_\mathrm{u}}$, we will say that the dLPV-SSA $\mathscr{S}$ is a \emph{realization} of $M$, if $M$ equals the sub-Markov function of $\mathscr{S}$, i.e., $M=M_{\mathscr{S}}$. For dLPV-SSA \eqref{eqn:LPV_SSA:det}, we call the integer $\nx$ the \emph{dimension} of $\mathscr{S}$. We will call a dLPV-SSA \emph{minimal}, if there exists no other dLPV-SSA $\mathscr{S}^{'}$ with a smaller dimension and with the same sub-Markov function. We call a dLPV-SSA $\mathscr{S}$ a \emph{minimal realization} of a function $M:\Sigma^{*} \rightarrow \mathbb{R}^{n_\mathrm{y} \times n_\mathrm{w}}$, if $\mathscr{S}$ is minimal and it is a realization of $M$. From \cite{PetreczkyLPVSS}, it follows that a dLPV-SSA is minimal if and only if it is span-reachable and observable, and the latter properties are equivalent to rank conditions of the extended $n$-step reachability and observability matrices \cite[Definition 1, Theorem 2]{PetreczkyLPVSS}. Furthermore, any dLPV-SSA can be transformed to a minimal one with the same sub-Markov function, using Kalman decomposition \cite[Corollary 1]{PetreczkyLPVSS}\footnote{\cite[Corollary 1]{PetreczkyLPVSS} should be applied with zero initial state}. For a more detailed discussion see \cite{PetreczkyLPVSS}. \section{Numerical examples} \label{sect:examp} In this section, we present numerical examples in order to illustrate the main results. \begin{Example} \label{sim:examp} Consider an asLPV-SSA of the form \eqref{eq:aslpv}, where $\pdim = 2$ and \begin{equation*} \footnotesize \begin{aligned} &A_1 = \begin{bmatrix} 0.4 & 0.4 & 0 \\ 0.2 & 0.1 & 0 \\ 0 & 0 & 0.2 \\ \end{bmatrix}, \quad K_1 = \begin{bmatrix} 0 \\ 1 \\ 1 \\ \end{bmatrix}, \quad C = \begin{bmatrix} 10 & 0 & 0 \\ \end{bmatrix} \\ &A_2 = \begin{bmatrix} 0.1 & 0.1 & 0 \\ 0.2 & 0.3 & 0 \\ 0 & 0 & 0.2 \\ \end{bmatrix}, \quad K_2 = \begin{bmatrix} 0 \\ 1 \\ 1 \\ \end{bmatrix}, \quad \text{and} \quad F = 1 \\ \end{aligned} \end{equation*} Note that this representation is not in innovation form. The scheduling signal process is defined as $\p = [\p_1 \quad \p_2]$ such that $\p_1(t) = 1$ and $\p_2(t)$ is a white-noise process with uniform distribution $\mathbf{\mathcal{U}}(-1.5,1.5)$. This corresponds to the parameters values $\{p_{\sigma}\}_{\sigma \in \{1,2\}}$ to be $p_1 = \expect{\mu_1^2(t)} = 1$ and $p_2 = \expect{\mu_2^2(t)} = 0.75$. The noise process is a white Gaussian noise with a variance equal to 1, i.e., $\mathbf{v} \sim \mathbf{\mathcal{N}}(0,1)$. Using Algorithm \ref{alg:min}, we can find a minimal representation in innovation form with the following matrices: \begin{equation*} \footnotesize \begin{aligned} &A_1^m = \begin{bmatrix} 0.4007 & 0.3997 \\ 0.1997 & 0.0993 \\ \end{bmatrix}, \quad K_1^m = \begin{bmatrix} -0.046 \\ -0.0541 \\ \end{bmatrix} \\ &A_2^m = \begin{bmatrix} 0.1003 & 0.1002 \\ 0.2002 & 0.2997 \\ \end{bmatrix}, \quad K_2^m = \begin{bmatrix} -0.0116 \\ -0.0578 \\ \end{bmatrix} \\ &C^m = \begin{bmatrix} -10 & 0.0116 \\ \end{bmatrix}, \quad \text{and} \quad F^m = 1 \\ \end{aligned} \end{equation*} Note that the two systems $\mathcal{S} =(\{A_{\sigma},K_{\sigma}\}_{\sigma=1}^{\pdim},C,F,\mathbf{v})$ and $\mathcal{S}^m =(\{A^m_{\sigma},K^m_{\sigma}\}_{\sigma=1}^{\pdim},C^m,F^m,\mathbf{e})$ have the same output trajectory when the chosen scheduling is applied. However, by changing the scheduling process to another process $\p^{'}$ with $\p_1^{'} = \p_1$ and $\p_2^{'}$ is also a white-noise with a uniform distribution $\mathbf{\mathcal{U}}(-\sqrt{3},\sqrt{3})$, we realize that the output trajectories are not the same, in other words, the two systems are not input-output equivalent. Subsequently, the two representations are not isomorphic. \end{Example} \begin{Example} \label{sim:examp2} We use the same noise process $\mathbf{v}$ and scheduling process $\p$ as in Example \ref{sim:examp}. The system matrices are as follows. \begin{equation*} \footnotesize \begin{aligned} &A_1 = \begin{bmatrix} 0.4 & 0.4 \\ 0.2 & 0.1 \\ \end{bmatrix}, \quad K_1 = \begin{bmatrix} 0 \\ 1 \\ \end{bmatrix}, \quad C = \begin{bmatrix} 10 & 0 \\ \end{bmatrix} \\ &A_2 = \begin{bmatrix} 0.1 & 0.1 \\ 0.2 & 0.3 \\ \end{bmatrix}, \quad K_2 = \begin{bmatrix} 0 \\ 1 \\ \end{bmatrix},\quad \text{and} \quad F = 1 \\ \end{aligned} \end{equation*} The system above is not in innovation form, in fact, it is not stably invertable. As before, we use Algorithm \ref{alg:min} to obtain a minimal asLPV-SSA innovation form with the following matrices \begin{equation*} \footnotesize \begin{aligned} &A_1^m = \begin{bmatrix} 0.4007 & -0.3997 \\ -0.1997 & 0.0993 \\ \end{bmatrix}, \quad K_1^m = \begin{bmatrix} -0.046 \\ 0.0541 \\ \end{bmatrix}, \\ &A_2^m = \begin{bmatrix} 0.1003 & -0.1002 \\ -0.2002 & 0.2997 \\ \end{bmatrix}, \quad K_2^m = \begin{bmatrix} -0.0116 \\ 0.0578 \\ \end{bmatrix} \\ &C^m = \begin{bmatrix} -10 & -0.0116 \\ \end{bmatrix}, \quad \text{and} \quad F^m = 1 \\ \end{aligned} \end{equation*} The two asLPV-SSA systems $\mathcal{S} = (\{A_{\sigma},K_{\sigma}\}_{\sigma=1}^{\pdim},C,F,\mathbf{v})$ and $\mathcal{S}^m =(\{A^m_{\sigma},K^m_{\sigma}\}_{\sigma=1}^{\pdim},C^m,F^m,\mathbf{e})$ are not isomorphic. In fact, they have different output trajectories, when using the scheduling process $\p^{'}$ from Example \ref{sim:examp}. This is due to the fact that the system $\mathcal{S}$ is not in innovation form. \end{Example} From Examples \ref{sim:examp} and \ref{sim:examp2}, we can conclude that minimality alone does not provide uniqueness. \begin{Example} \label{sim:examp3} We present a minimal asLPV-SSA in innovation form, where the state dimension $\nx = 2$ and its matrices are as follows: \begin{equation*} \footnotesize \begin{aligned} &A_1 = \begin{bmatrix} 0.4 & 0.4 \\ 0.2 & 0.1 \\ \end{bmatrix}, \quad A_2 = \begin{bmatrix} 0.1 & 0.1 \\ 0.2 & 0.3 \\ \end{bmatrix} \\ &K_1 = \begin{bmatrix} 0 \\ 1 \\ \end{bmatrix}, \quad K_2 = \begin{bmatrix} 0 \\ 1 \\ \end{bmatrix}, \quad C = \begin{bmatrix} 1 & 0 \\ \end{bmatrix}, \quad \text{and} \quad F = 1 \\ \end{aligned} \end{equation*} The asLPV-SSA above is stably invertable, and hence in innovation form. We use the same scheduling process $\p$ and noise process $\mathbf{v}$ as Example \ref{sim:examp}. If we apply Algorithm \ref{alg:min} to the system above, we get another asLPV-SSA with the matrices \begin{equation*} \footnotesize \begin{aligned} &A^m_1 = \begin{bmatrix} 0.4642 & -0.3581 \\ -0.1581 & 0.0358 \\ \end{bmatrix}, \quad K^m_1 = \begin{bmatrix} -0.1143 \\ 0.9934 \\ \end{bmatrix} \\ &A^m_2 = \begin{bmatrix} 0.1367 & -0.1188 \\ -0.2188 & 0.2633 \\ \end{bmatrix}, \quad K^m_2 = \begin{bmatrix} -0.1143 \\ 0.9934 \\ \end{bmatrix} \\ &C^m = \begin{bmatrix} -0.9934 & -0.1143 \\ \end{bmatrix}, \quad \text{and} \quad F^m = 1 \\ \end{aligned} \end{equation*} As expected, the two systems are isomorphic, the corresponding matrix is \begin{equation*} \footnotesize T = \begin{bmatrix} -0.9934 & -0.1143 \\ -0.1143 & 0.9934 \\ \end{bmatrix} \end{equation*} Finally, we realize that the output trajectories of both systems are indeed the same not only for the chosen scheduling sequence, but also for \emph{any} other scheduling process. \end{Example} \section{Existence and minilality of asLPV-SSAs in innovation form} \label{sect:min} In this section we review the principal results on existence and minimality of asLPV-SSA in innovation form. To this end, in Subsection \ref{sect:real:red} we recall from \cite{PetreczkyLPVSS} some results on realization theory of deterministic LPV-SSA. In Subsection \ref{sect:def:innov} we present the definition of asLPV-SSAs in innovation form, and in Subsection \ref{subsect:min} we present results on existence and uniqueness of minimal asLPV-SSAs. In Subsection \ref{Sect:algo} we present rank conditions for minimality of asLPV-SSAs and an algorithm for converting any asLPV-SSA to a minimal one in innovation form. The results presented in this section follow from \cite{PetreczkyBilinear}, but they have never been formulated explicitly for LPV-SSAs. \input{Deterministic_LPV-SSA_representation} \subsection{Definition of asLPV-SSA in innovation form} \label{sect:def:innov} Next, we define what we mean by asLPV-SSA in innovation form. To this end, we need to introduce the following notation for orthogonal projection. \begin{Notation}[Orthogonal projection $E_l$] \label{hilbert:notation} Recall that the set of square integrable random variables taking values in $\mathbb{R}$, forms a Hilbert-space with the scalar product defined as $<\mathbf{z}_1,\mathbf{z}_2>=E[\mathbf{z}_1\mathbf{z}_2]$. We denote this Hilbert-space by $\mathcal{H}_1$. Let $\mathbf{z}$ be a square integrable \emph{vector-valued} random variable taking its values in $\mathbb{R}^k$. Let $M$ be a closed subspace of $\mathcal{H}_1$. By the orthogonal projection of $\mathbf{z}$ onto the subspace $M$, \emph{denoted by $E_l[\mathbf{z} \mid M]$}, we mean the vector-valued square-integrable random variable $\mathbf{z}^{*}=\begin{bmatrix} \mathbf{z}_1^{*},\ldots,\mathbf{z}_k^{*} \end{bmatrix}^T$ such that $\mathbf{z}_i^{*} \in M$ is the orthogonal projection of the $i$th coordinate $\mathbf{z}_i$ of $\mathbf{z}$ onto $M$, as it is usually defined for Hilbert spaces. Let $\mathfrak{S}$ be a subset of square integrable random variables in $\mathbb{R}^p$ for some integer $p$, and suppose that $M$ is generated by the coordinates of the elements of $\mathfrak{S}$, i.e. $M$ is the smallest (with respect to set inclusion) closed subspace of $\mathcal{H}_1$ which contains the set $\{ \alpha^Ts \mid s \in \mathfrak{S}, \alpha \in \mathbb{R}^p\}$. Then instead of $E_l[z \mid M]$ we use \( E_{l}[\mathbf{z} \mid \mathfrak{S}] \). \end{Notation} This said, we define the \emph{innovation process $\mathbf{e}$ of $\mathbf{y}$ with respect to $\p$} as follows: \begin{equation} \label{decomp:lemma:innov2} \mathbf{e}(t)=\mathbf{y}(t)-E_l[\mathbf{y}(t) \mid \{\mathbf{z}^{\mathbf{y}}_w (t)\}_{w \in \Sigma^{+}}] \end{equation} In other words, $\mathbf{e}(t)$ is the difference between the output and its projection on its past values w.r.t. the scheduling process $\p$, i.e., $\mathbf{e}$ is the best predictor of $\mathbf{y}$ using the product of the output and scheduling past values from \eqref{eqn:zwu}. \begin{Definition}[asLPV-SSA in innovation form] An asLPV-SSA of the form \eqref{eq:aslpv} is said to be in \emph{innovation form}, if it is a realization of $(\textbf{y},\p)$, $F=I_{n_y}$, and $\mathbf{v}$ is the innovation process of $\mathbf{y}$, i.e., $\mathbf{v} = \mathbf{e}$. \end{Definition} \subsection{Existence and uniqueness of minimal asLPV-SSA in innovation form} \label{subsect:min} Let $\mathcal{S}$ be an asLPV-SSA of the form \eqref{eq:aslpv} in innovation form with $F=I_{n_y}$. Let $\widetilde{\mathcal{S}}=(\{\widetilde{A}_i,\widetilde{K}_i,\}_{i=0}^{\pdim},\widetilde{C},I_{n_y},\mathbf{e})$ be another asLPV-SSA of $(\mathbf{y},\p)$ in innovation form. We say that $\mathcal{S}$ and $\widetilde{S}$ are \emph{isomorphic}, if there exists a nonsingular matrix $T$ such that \begin{equation*} \label{lemma:min1:eq1} \widetilde{A}_i=TA_iT^{-1}, \widetilde{K}_i=TK_i, \widetilde{C}=CT^{-1} \end{equation*} We will say that the process $(\mathbf{y},\p)$ is \emph{full rank}, if for all $i=1,\ldots, \pdim$, $Q_i=E[\mathbf{e}(t)(\mathbf{e}(t))^T\p_i^2(t)]$ is invertable. This is a direct extension of the classical notion of a full rank process. Furthermore, we will say that $\mathbf{y}$ is \emph{Square Integrable} process w.r.t. $\p$, abbreviated by \emph{SII}, if it satisfies \cite[Definition 5]{PetreczkyBilinear}\footnote{with $\textbf{u}_{\sigma}=\p_{\sigma}$, $\sigma \in \Sigma$ in the terminology of \cite{PetreczkyBilinear}}. For the convenience of the reader, the definition of an SII process is presented in Appendix \ref{App:def}, Definition \ref{Defn:SII}. From \cite[Remark 2]{PetreczkyBilinear} it follows that if $\mathbf{y},\p)$ has a realization by an asLPV-SSA and $\p$ is bounded, then $\mathbf{y}$ is SII. \begin{Theorem}[Existence and uniqueness] \label{theo:min} Assume that $(\mathbf{y},\p)$ has an asLPV-SSA realization and that $\mathbf{y}$ is full rank and SII w.r.t. $\p$. It follows that: \begin{enumerate} \item \label{theo:min:1} $(\textbf{y},\p)$ has a minimal asLPV-SSA realization in innovation form \item \label{theo:min:2} Any two minimal asLPV-SSA realizations of $(\mathbf{y},\p)$ in innovation form are isomorphic. \end{enumerate} \end{Theorem} The proof of this theorem follows \cite[Theorem 2]{PetreczkyBilinear} by using the correspendence between \textbf{GBS}\ and asLPV-SSA. Theorem \ref{theo:min} implies that asLPV-SSAs in innovation form have the useful property that, when they are minimal, they are unique up to isomorphism, and assuming that the asLPV-SSA which generates the data is minimal does not restrict the class of possible output. That is, for system identificaion it is preferable to consider parameterizing the elements of minimal asLPV-SSAs in innovation form. This motivates finding conditions for an asLPV-SSA to be minimal in innovation form and formulating algorithms for transforming an asLPV-SSA to a minimal one in innovation form. To this end, in Subsection \ref{Sect:algo} we present a rank condition for minimality and a minimization algorithm based on the results of \cite{PetreczkyBilinear}. However, the results of Subsection \ref{Sect:algo} do not allow checking that an asLPV-SSA is in innovation form. Moreover, the algebraic conditions for minimality are difficult to apply. Motivated by this, in Section \ref{sect:main} we present more user-friendly characterizations of minimality and being in innovation form. \subsection{Rank conditions and minimization algorithm} \label{Sect:algo} In order to present the rank conditions for minimality of asLPV-SSA and the minimization algorithm, we need to define the \emph{dLPV-SSA associated with asLPV-SSA} as $$\mathscr{S}_{\mathcal{S}}=(\{\sqrt{p_i} A_i,\Bs_i\}_{i=1}^{\pdim},C,I_{n_y}), $$ where \begin{equation} \label{min:eq-1} \Bs_i=\frac{1}{\sqrt{p_i}}(A_iP_iC^T + K_iQ_iF^T) \end{equation} and $Q_i=E[\mathbf{v}(t)\mathbf{v}^T(t)\p_i^2(t)]$ for $i=1,\ldots,\pdim$, and $\{P_i\}_{i=1}^{\pdim}$ are the computed as follows: \( P_i = \lim_{\mathcal{I} \rightarrow \infty} P_i^{\mathcal{I}} \), and $\{P_i^N\}_{i=1}^{\pdim}$ satisfy the following recursions: \begin{equation} \label{gi:comp:eq1} P_i^{\mathcal{I}+1}=p_{i} \sum_{j=0}^{\pdim} (A_jP_j^{\mathcal{I}}A_j^T + K_jQ_jK_j^T) \end{equation} with $P_i^0 = \mathbf{O}_{n_x,n_x}$ where $\mathbf{O}_{n_x,n_x}$ denotes the $n_x \times n_x$ matrix with all zero entries. Note that the existence of the limit of $P_i^N$ when $N$ goes to infinity follows from \cite[Lemma 5]{PetreczkyBilinear}. From \cite{PetreczkyBilinear} it follows that the dLPV-SSA associated with an asLPV-SSA $\mathscr{S}$ represents a realization of Markov-function $\Psi_{\mathbf{y}}: \Sigma^{*} \rightarrow \mathbb{R}^{n_y \times n_y}$, $$\Psi_{\mathbf{y}}(w) =\left\{ \begin{array}{ll} E[\mathbf{y}(t) (\mathbf{z}^{\mathbf{y}}_{w} (t))^{T} ] & w \in \Sigma^{+}\\ I_{n_y} & w=\epsilon \\ \end{array}\right.$$ computed from covariances of $\textbf{y}$. Then from \cite{PetreczkyBilinear} we can derive the following. \begin{Theorem}[Rank conditions] \label{theo:rank_cond} An asLPV-SSA is a minimal realization of $(\textbf{y},\p)$, if and only if the associated dLPV-SSA is minimal. \end{Theorem} From \cite{PetreczkyLPVSS} it follows that minimality of the associated dLPV-SSA can be checked using rank conditions for the corresponding extended reachability and observability matrices. Note, however, that minimal asLPV-SSAs, realizing the same output, may not be isomorphic. In fact, in Section \ref{sect:examp}, Example \ref{sim:examp} presents a counter-example. Vice versa, with any dLPV-SSA realization of $\Psi_{\mathbf{y}}$ we can associate an asLPV-SSA in innovation form. This latter relationship is useful for formulating a minimization algorithm. More precisely, consider a dLPV-SSA $$\mathscr{S}=(\{\hat{A}_i, \hat{G}_i\}_{i=1}^{\pdim}, \hat{C}, I_{n_y})$$ which is a minimal realization of $\Psi_{\mathbf{y}}$. Define the \emph{asLPV-SSA $\mathcal{S}_{\mathscr{S}}$ associated with $\mathscr{S}$} as $$ \mathcal{S}_{\mathscr{S}}=(\{\frac{1}{\sqrt{p_i}} \hat{A}_i, \hat{K}_i\}_{i=1}^{\pdim},\hat{C},I_{n_y},\mathbf{e}), $$ where $\hat{K}_i=\lim_{\mathcal{I} \rightarrow \infty} \hat{K}_i^{\mathcal{I}}$, and $\{\hat{K}_{\sigma}^{\mathcal{I}} \}_{\sigma \in \Sigma, \mathcal{I} \in \mathbb{N}}$ satisfies the following recursion \begin{equation} \label{statecov:iter} \begin{split} & \hat{P}^{\mathcal{I}+1}_{\sigma} = \sum \limits_{\sigma_{1} \in \Sigma} p_{\sigma} \left(\frac{1}{p_{\sigma_1}} \hat{A}_{\sigma_{1}} \hat{P}^{\mathcal{I}}_{\sigma_{1} } (\hat{A}_{\sigma_{1}})^{T} + \hat{K}_{\sigma_{1}}^{\mathcal{I}} \hat{Q}^{\mathcal{I}}_{\sigma_{1} } (\hat{K}^{\mathcal{I}}_{\sigma_{1}})^T \right)\\ & \hat{Q}^{\mathcal{I}}_{\sigma} = p_{\sigma} T_{\sigma,\sigma}^{y} - \hat{C} \hat{P}^{\mathcal{I}}_{\sigma } (\hat{C})^{T} \\ & \hat{K}^{\mathcal{I}}_{\sigma} = \left( \hat{\Bs}_{\sigma} \sqrt{p_{\sigma}} - \frac{1}{\sqrt{p_{\sigma}}} \hat{A}_{\sigma} \hat{P}^{\mathcal{I}}_{\sigma} (\hat{C})^{T} \right) \left( \hat{Q}^{\mathcal{I}}_{\sigma} \right)^{-1} \end{split} \end{equation} where $\hat{P}^{0}_{\sigma}$ is a $\nx \times \nx$ zero matrix and $T_{\sigma,\sigma}^{y} = \expect{\textbf{y}(t) (\mathbf{z}^{\mathbf{y}}_{w} (t))^{T}}$. From \cite{PetreczkyBilinear} it follows that if $\mathscr{S}$ is a minimal dLPV-SSA realization of $\Psi_{\mathbf{y}}$, then the associated asLPV-SSA $\mathcal{S}_{\mathscr{S}}$ is an asLPV-SSA of $(\mathbf{y},\p)$. The discussion above suggests the following realization algorithm for transforming an asLPV-SSA $\mathcal{S}$ to a minimal one, which can be deduced from \cite{PetreczkyBilinear}. \begin{algorithm}[h!] \caption{Minimization algorithm \label{alg:min}} ~~\textbf{Input :} The asLPV-SSA $\mathcal{S} =(\{A_{\sigma},K_{\sigma}\}_{\sigma=1}^{\pdim},C,F,\mathbf{v})$ representation matrices. \hrule\vspace*{.1cm} \begin{enumerate} \item Compute the dLPV-SSA $\mathscr{S}_{\mathcal{S}}$ associated with $\mathcal{S}$ and compute $T_{\sigma,\sigma}^{\textbf{y}} = \frac{1}{p_{\sigma}}(CP_{\sigma} C^{T} + FQ_{\sigma} F^T)$ \item Transform the dLPV-SSA $\mathscr{S}_{\mathcal{S}}$ to a minimal dLPV-SSA $\mathscr{S}_m$ using \cite[Corollary 1]{PetreczkyLPVSS}. \item Construct the asLPV-SSA $\mathcal{S}_{{\mathscr{S}}_m}$ associated with $\mathscr{S}_m$. \end{enumerate} \hrule\vspace*{.1cm} \textbf{Output :} The asLPV-SSA $\mathcal{S}_{{\mathscr{S}}_m}$. \end{algorithm} From \cite[Theorem 3]{PetreczkyBilinear}, it follows that Algorithm \ref{alg:min} returns a minimal realization of $(\mathbf{y},\p)$, if $\mathcal{S}$ is an asLPV-SSA realization of $(\mathbf{y},\p)$ in innovation form. Note that Algorithm \ref{alg:min} requires only the knowledge of the matrices of $\mathcal{S}$ and the noise covariance matrix $Q_\sigma=E[\mathbf{v}(t)\mathbf{v}^T(t)\p_\sigma^2(t)]$. Also note that all the steps above are computationally efficient, however, they require finding the limits of $P_{\sigma}^{\mathcal{I}}$ and $\hat{K}_{\sigma}^{\mathcal{I}}$ for $\mathcal{I} \rightarrow \infty$ respectively. Also note that, in \cite{MejariCDC2019}, it exists another minimization algorithm which uses covariances matrices. \begin{Remark}[Challenges] \label{rem:motiv1} The main disadvantage of verifying the rank condition of Theorem \ref{theo:rank_cond} or applying Algorithm \ref{alg:min} is the necessity of constructing a dLPV-SSA and the necessity to find the limit of the matrices in \eqref{statecov:iter}. The latter represents an extension of algebraic Riccati equations \cite[Remark 7]{PetreczkyBilinear} and even for the linear case requires attention. Moreover, the rank conditions of Theorem \ref{theo:rank_cond} are not easy to apply to parametrizations: even if the dependence of the matrices $\{A_i,K_i\}_{i=1}^{\pdim}$ and $C$ on a parameter $\theta$ are linear or polynomial, the dependence of the matrices of the associated dLPV-SSA need not remain linear or polynomial, due to the definition of $\Bs_i$ in \eqref{min:eq-1}. For the same reason, it is difficult to analyze the result of applying Algorithm \ref{alg:min} to elements of a parametrization. Moreover, the conditions of Theorem \ref{theo:rank_cond} do not allow us to check if the elements of a parametrizations are in innovation form. These shortcomings motivate the contribution of Section \ref{sect:main}. \end{Remark} \section{Introduction} \label{sect:intro} Identification of \emph{Linear Parameter-Varying} (LPV) models has gained significant attention, see \cite{bagi,laurainrefined,MEJARIAuto,pigalpv,fewive,tanelliidentification,Wingerden09,veve,toth} and the references therein. In particular, there is a rich literature on subspace identification of LPV state-space representations, see for instance \cite{Wingerden09,fewive,Verdult02,veve,CoxTothSubspace,RamosSubspace} and the references therein. Despite these advances, the theoretical analysis of system identification algorithms, especially subspace methods, for stochastic LPV state-space representations remains challenging. As the history of LTI system identification indicates \cite{LindquistBook,Katayama:05,CHIUSO2005377} that such a theoretical analysis requires a good understanding of the notion of minimal state-space representations in innovation form \cite{LindquistBook,Katayama:05}. The latter notion is not yet fully understood for LPV state-space representations. \paragraph*{\textbf{Contribution}} In this paper LPV state-space representations with affine dependence on parameters (abbreviated by \emph{LPV-SSA}) are considered. We restrict attention to autonomous (without control input) stationary stochastic LPV-SSAs (\emph{asLPV-SSA} for short). \emph{The main technical contributions are new algebraic conditions for an asLPV-SSA to be minimal in innovation form}. These conditions depend only the the matrices of the system representation. In order to present these results, the paper also provides a \emph{systematic overview of the results on existence and minimality of asLPV-SSA in innovation form}. These results can be derived from realization theory of stochastic bilinear systems \cite{PetreczkyBilinear}, but they have not been stated explicitly for LPV-SSAs. In particular, we state that any asLPV-SSA can be converted to a minimal asLPV-SSA in innovation form while preserving the output. Moreover, any two minimal asLPV-SSA in innovation form are isomorphic, if they have the same output \paragraph*{\textbf{Motivation for studying asLPV-SSA}} Under suitable technical assumptions, any stochastic LPV-SSA can be decomposed into a noiseless deterministic LPV-SSA which is driven only by the control input, and asLPV-SSA driven by the noise, \cite{MejariLPVS2019}. Moreover, the identification of these two subsystems can be carried out separately \cite{MejariLPVS2019}. Note that minimality and uniqueness of deterministic LPV state-space representations is well understood \cite{PetreczkyLPVSS}. Hence, in order to understand the notion of minimality and innovation representation for stochastic LPV-SSA with control input, the first step is to understand these notions for asLPV-SSA. \paragraph*{\textbf{Motivation for minimal LPV-SSAs in innovation form}} In the formulation of the identification problem for LPV-SSA \cite{Wingerden09,fewive,Verdult02,veve,CoxTothSubspace} the stated goal is usually to find an LPV-SSA which is isomorphic\footnote{Often, it is required that the isomorphism does not depend on the scheduling.}, or at least which is input-output equivalent to the data generating system. However, in general there may exist LPV-SSAs which generate the same output for some scheduling signal, but which are not isomorphic (see Example \ref{sim:examp2} in Section \ref{sect:examp} or \cite{TothKulcsar}), or which are not input-output equivalent. In the latter case the systems generate different outputs when the scheduling signal is changed. See Example \ref{sim:examp} and Example \ref{sim:examp2} of Section \ref{sect:examp} of the present paper. This implies that in general the system identification problem is ill-posed. However, it becomes well-posed, if we add the assumption that the underlying data generating system is a minimal asLPV-SSA in innovation form. Indeed, if the observed output has an asLPV-SSA representation, it has a minimal one in innovation form, and all such representations are related by a constant isomorphism. The necessity of this assumption is illustrated by the examples in Section \ref{sect:examp}. From \cite{MejariCDC2019} it follows that this assumption is sufficient, as the identification algorithm in \cite{MejariCDC2019} returns a minimal asLPV-SSA in innovation form. We conjecture that the same will be true for most of the existing subspace identification algorithms \cite{Wingerden09,fewive,Verdult02,veve,CoxTothSubspace,RamosSubspace}. To deal only with minimal asLPV-SSA representations in innovation form, simple conditions to check minimality and being in innovation form are needed. The latter is necessary in order to check if the elements of a parametrization of asLPV-SSAs are minimal and in innovation form, or to construct such parametrizations. \paragraph*{\textbf{Related work}} As it was mentioned above, there is a rich literature on subspace identification methods for stochastic LPV-SSA representations \cite{RamosSubspace,FavoreelTAC,CoxTothSubspace,Wingerden09}. However, the cited papers do not deal with the problem of characterizing minimal stochastic LPV state-space representations in innovation form. In \cite{CoxLPVSS,CoxTothSubspace} the existence of an LPV state-space representation in innovation form was studied, but due to the specific assumptions (deterministic scheduling) and the definition of the innovation process, the resulting LPV state-space representation in innovation form had dynamic dependence on the scheduling parameters. Moreover, \cite{CoxLPVSS,CoxTothSubspace} do not address the issue of minimality of the stochastic part of LPV state-space representations. This paper uses realization theory of stochastic generalized bilinear systems (\emph{\textbf{GBS}\ } for short) of \cite{PetreczkyBilinear}. In particular, asLPV-SSAs correspond to \textbf{GBS}{s}. The existence and uniqueness of minimal asLPV-SSA{s} in innovation form follows from the results of \cite{PetreczkyBilinear}. The main novelty of the present paper with respect to \cite{PetreczkyBilinear} is the new algebraic characterization of minimal asLPV-SSA{s} in innovation form, and that the results on existence and uniqueness of minimal \textbf{GBS}{s} are spelled out explicitly for LPV-SSAs. The paper \cite{MejariCDC2019} used the correspondence between \textbf{GBS}{s} and asLPV-SSA{s} to state existence and uniqueness of minimal asLPV-SSA{s} in innovation form. However, \cite{MejariCDC2019} did not provide an algebraic characterization of minimality or innovation form. Moreover, it considered only scheduling signals which were zero mean white noises. In contrast, in this paper more general scheduling signals are considered. The present paper is complementary to \cite{MejariCDC2019}. This paper explains when the assumption that the data generating system is minimal asLPV-SSA in innovation form could be true, while \cite{MejariCDC2019} presents an identification algorithm which is statistically consistent under the latter assumption. \textbf{Outline of the paper} In Section \ref{sect:prelim} we introduce the notations used and we recall \cite{PetreczkyBilinear}, some technical assumptions which are necessary to define of the stationary LPV-SSA representation. In Section \ref{sect:min} some principal results on minimal asLPV-SSA{s} in innovation form are reviewed. In Section \ref{sect:main} we present the main results of the paper, namely, algebraic conditions for an asLPV-SSA to be minimal in innovation form. Finally, in Section \ref{sect:examp} numerical examples are developed to illustrate the contributions. \subsection{Necessary conditions for a representation in innovation form} \section{Main results: algebraic conditions for an asLPV-SSA to be minimal in innovation form} \label{sect:main} Motivated by the challenges explained in Remark \ref{rem:motiv1}, in this section we present sufficient conditions for an asLPV-SSA to be minimal and in innovation form. These conditions depend only on the matrices of the asLPV-SSA in question and do not require any information on the noise processes. The first result concerns an algebraic characterization of asLPV-SSA in innovation form. This characterization does not require any knowledge of the noise process, only the knowledge of system matrices. In order to streamline the discussion, we introduce the following definition. \begin{Definition}[Stably invertable w.r.t. $\p$] Assume that $\mathcal{S}$ is an asLPV-SSA of the form \eqref{eq:aslpv} and $F=I_{n_y}$. We will call $\mathcal{S}$ \emph{stably invertable with respect to $\p$}, or \emph{stably invertable} if $\p$ is clear from the context, if the matrix \begin{equation} \label{inv:gbs:lemma:eq1} \sum_{i=1}^{\pdim} p_i (A_i-K_iC) \otimes (A_i-K_iC) \end{equation} is stable (all its eigenvalues are inside the complex unit disk). \end{Definition} Note that a system can be stably invertable w.r.t. one scheduling process, and not to be stably invertable w.r.t. another one. We can now state the result relating stable invertability to asLPV-SSAs in innovation forms. \begin{Theorem}[Innovation form condition] \label{inv:gbs:lemma} Assume that $\textbf{y}$ is SII and $(\textbf{y},\p)$ is full rank. If an asLPV-SSA realization of $(\textbf{y},\p)$ is stably invertable, then it is in innovation form. \end{Theorem} The proof of Theorem \ref{inv:gbs:lemma} can be found in Appendix \ref{App:proof}. Stably invertable asLPV-SSAs can be viewed as optimal predictors. Indeed, let $\mathcal{S}$ be the asLPV-SSA of the form \eqref{eq:aslpv} which is in innovation form, and let $\textbf{x}$ be the state process of $\mathcal{S}$. It then follows \begin{equation} \label{gen:filt:bil:def:pred} \begin{split} & \textbf{x}(t+1) = \sum_{i=1}^{\pdim} (A_i-K_iC)\textbf{x}(t)+K_i\textbf{y}(t))\p_i(t), \\ & \hat{\textbf{y}}(t) = C\textbf{x}(t) \end{split} \end{equation} where $\hat{\textbf{y}}(t)=E_l[\textbf{y}(t) \mid \{\mathbf{z}_w^{\textbf{y}}(t)\}_{w \in \Sigma^{+}}]$, i.e., $\hat{\textbf{y}}$ is the best linear prediction of $\textbf{y}(t)$ based on the predictors $\{\mathbf{z}_w^{\textbf{y}}(t)\}_{w \in \Sigma^{+}}$. Intuitively, \eqref{gen:filt:bil:def:pred} could be viewed as a filter, i.e., a dynamical system driven by past values of $\textbf{y}$ and generating the best possible linear prediction $\hat{\textbf{y}}(t)$ of $\textbf{y}(t)$ based on $\{\mathbf{z}_w^{\textbf{y}}(t)\}_{w \in \Sigma^{+}}$. However, the solution of \eqref{gen:filt:bil:def:pred} is defined on the whole time axis $\mathbb{Z}$ and hence cannot be computed exactly. For stably invertable asLPV-SSA we can approximate $\hat{\textbf{y}}(t)$ as follows. \begin{Lemma} \label{gbs:finite_filt:lemma} With the assumptions of Theorem \ref{inv:gbs:lemma}, if $\mathcal{S}$ of the form \eqref{eq:aslpv} is a stably invertable realization of $(\textbf{y},\p)$, and we consider the following dynamical system: \begin{equation} \label{gbs:finite_filt:eq} \begin{split} & \bar{\textbf{x}}(t+1)= \sum_{i=1}^{\pdim} (A_i-K_iC)\bar{\textbf{x}}(t)+K_i\textbf{y}(t))\bm{\mu}_i(t), \\ & \bar{\textbf{y}}(t) = C\bar{x}(t), ~ \bar{\textbf{x}}(0)=0 \end{split} \end{equation} then \( \underset{t \rightarrow \infty}{\lim} \left(\bar{\textbf{x}}(t) - \textbf{x}(t)\right)\!\!=\!\!0 \), and \( \underset{t \rightarrow \infty}{\lim} \left(\bar{\textbf{y}}(t) - \textbf{y}(t)\right)=0 \), where the limits are understood in the mean square sense. \end{Lemma} The proof of Lemma \ref{gbs:finite_filt:lemma} is found in Appendix \ref{App:proof}. That is, the output $\bar{\textbf{y}}(t)$ of the recursive filter \eqref{gbs:finite_filt:eq} is an approximation of the optimal prediction $\hat{\textbf{y}}(t)$ of $\textbf{y}(t)$ for large enough $t$. That is, stably invertable asLPV-SSA not only result in asLPV-SSAs in innovation form, but they represent a class of asLPV-SSAs for which recursive filters of the form \eqref{gbs:finite_filt:eq} exist. % % Next, we present algebraic conditions for minimality of an asLPV-SSA in innovation form. \begin{Theorem}[Minimality condition in innovation form] \label{min:forw:gbs:lemma} Assume that $\mathcal{S}$ is an asLPV-SSA of the form \eqref{eq:aslpv} and that $\mathcal{S}$ is a realization of $(\textbf{y},\p)$ in innovation form. Assume that $(\textbf{y},\p)$ is full rank and $\textbf{y}$ is SII. Then $\mathcal{S}$ is a minimal realization of $(\textbf{y},\p)$, if and only if the dLPV-SSA $\mathcal{D}_{\mathcal{S}}=(\{A_i,K_i\}_{i=0}^{\pdim},C,I_{n_y})$ is minimal. \end{Theorem} The proof of Theorem \ref{min:forw:gbs:lemma} can be found in Appendix \ref{App:proof}. Theorem \ref{min:forw:gbs:lemma}, in combination with Theorem \ref{inv:gbs:lemma}, leads to the following corollary. \begin{Corollary}[Minimality and innovation form] \label{min:forw:gbs:lemma:col} With the assumptions of Theorem \ref{min:forw:gbs:lemma}, if $\mathcal{D}_{\mathcal{S}}$ is minimal and $\mathcal{S}$ if stably invertable, then $\mathcal{S}$ is a minimal asLPV-SSA realization of $(\textbf{y},\p)$ in innovation form. \end{Corollary} \begin{Remark}[Checking minimality and innovation form] \label{rem:check1} We recall that $\mathcal{D}_{\mathcal{S}}$ is minimal, if and only if it satisfies the rank conditions for the extended $n$-step reachability and observability matrices \cite[Theorem 2]{PetreczkyLPVSS}, which can easily be computed from the matrices of $\mathcal{S}$. Checking that $\mathcal{S}$ is stably invertable boils down to checking the eigenvalues of the matrix \eqref{inv:gbs:lemma:eq1}. That is, Corollary \ref{min:forw:gbs:lemma:col} provides effective procedure for verifying that an asLPV-SSA is minimal and in innovation form. Note that in contrast to the rank condition of Theorem \ref{theo:rank_cond}, which required computing the limit of \eqref{gi:comp:eq1}, the procedure above uses only the matrices of the system. \end{Remark} \begin{Remark}[Parametrizations of asLPV-SSAs] Below we will sketch some ideas for applying the above results to parametrizations of asLPV-SSAs. A detailed study of these issues remains a topic for future research. For all the elements of a parametrization of asLPV-SSAs to be minimal and in innovation form, by Corollary \ref{min:forw:gbs:lemma:col} it is necessary that \textbf{(A)} all elements of the parametrization, when viewed as dLPV-SSA, are minimal, and that \textbf{(B)} they are stably invertable and satisfy condition \textbf{(3)} of Definition \ref{defn:LPV_SSA_wo_u}. In order to deal with \textbf{(A)}, the techniques used in \cite{Alkhoury2016} or \cite{HSCC2010} \footnote{In order to use \cite{HSCC2010} the relationship between minimality of dLPV-SSA and that of switched systems \cite{PetreczkyLPVSS} should be epxloited}could be used. The condition \textbf{(B)} is equivalent to stability of a suitable parametrization of LTI systems, as we could view the matrices \eqref{inv:gbs:lemma:eq1} and $\sum_{q=1}^{\pdim} p_i A_i \otimes A_i$ as matrices of an LTI state-space representation. For the latter we can use standard techniques, see \cite{Ribarits2002} and the references therein. Finally, note that extension of argument of \cite[Theorem 2]{Alkhoury2016} would also lead to identifiability conditions for parametrizations which satisfy the conditions \textbf{(A)} and \textbf{(B)} described above. \end{Remark} Corollary \ref{min:forw:gbs:lemma:col} suggests the following minimization algorithm. \begin{algorithm}[H] \caption{Minimization algorithm \label{alg:min1} } ~~\textbf{Input :} A stably invertable asLPV-SSA $\mathcal{S}$ \hrule\vspace*{.1cm} \begin{enumerate} \item Transform the dLPV-SSA $\mathcal{D}_{\mathcal{S}}$ from Theorem \ref{min:forw:gbs:lemma} to a minimal dLPV-SSA $\mathcal{D}_m=(\{A_i^m,K_i^m\}_{i=1}^{\pdim},C^m,I_{n_y})$ using \cite[Corollary 1]{PetreczkyLPVSS}. \end{enumerate} \hrule\vspace*{.1cm} \textbf{Output :} asLPV-SSA $\mathcal{S}_m=(\{A_i^m,K_i^m\}_{i=1}^{\pdim},C^m,I_{n_y},\textbf{e})$. \end{algorithm} \begin{Lemma}[Correctness of Algorithm \ref{alg:min1}] \label{alg:min1:lem} The asLPV-SSA $\mathcal{S}_m$ is stably invertable and it is a minimal asLPV-SSA realization of $(\textbf{y},\p)$ in innovation form. \end{Lemma} That is, Algorithm \ref{alg:min1} is a simpler counterpart of Algorithm \ref{alg:min} which does not require computing the limits \eqref{gi:comp:eq1} and \eqref{statecov:iter}, which can create difficulties (see Remark \ref{rem:motiv1}). Lemma \ref{alg:min1:lem} implies that stable invertability is preserved by minimization. \subsection{Stationary LPV-SSA representation} \label{Subsec:assumptions3} After identifying the necessary process properties and notations, we are now ready to present the definition of the \emph{stationary autonoumous stochastic LPV-SSA}. \begin{Definition}\label{defn:LPV_SSA_wo_u} A \emph{stationary autonomous stochastic LPV-SSA}, abbreviated as \emph{asLPV-SSA}, is a system of the form \eqref{eq:aslpv}, such that: \textbf{(1)} $\begin{bmatrix} \mathbf{x}^T & \mathbf{v}^T \end{bmatrix}^T$ is a ZMWSSI process, and for all $\sigma \in \Sigma$, $ w \in \Sigma^{+}$, $E[\mathbf{z}^{\mathbf{x}}_{\sigma}(t)(\mathbf{z}^{\mathbf{v}}_{\sigma}(t))^T]=0, ~ E[\mathbf{v}(t)(\mathbf{z}^{\mathbf{x}}_w(t))^T]=0.$ \textbf{(2)} $\mathbf{v}$ is ZMWSSI and $E[\mathbf{v}(t)(\mathbf{z}^{\mathbf{v}}(t))^T]=0$ for all $w \in \Sigma^{+}$. \textbf{(3)} The eigenvalues of the matrix $\sum_{\sigma \in \Sigma} p_{\sigma} A_{\sigma} \otimes A_{\sigma}$ are inside the open unit circle. \end{Definition} Note that, condition \textbf{(2)} implies that v is a white noise. In the terminology of \cite{PetreczkyBilinear}, an asLPV-SSA corresponds to a stationary \textbf{GBS}\ w.r.t. inputs $\{\p_{\sigma}\}_{\sigma \in \Sigma}$. Note that the processes $\mathbf{x}$ and $\mathbf{y}$ are ZMWSII, in particular, they are wide-sense stationary, and that $\mathbf{x}$ is orthogonal to the future values of the noise process $\mathbf{v}$. We should mention that we concentrate on wide-sense stationary processes, because it is difficult to estimate the distribution of non-stationary processes. Also, wide-sense stationary processes solve the problem of the initial state conditions. The state of an asLPV-SSA is uniquely determined by its matrices and noise process. In order to present this relationship, we need the following notation. \begin{Notation}[Matrix Product]\label{not:product} Consider $n \times n$ square matrices $\{A_{\sigma}\}_{\sigma \in \Sigma}$. For any word $\wordSet{+}$ of the form $w = \sigma_{1}\sigma_{2}\cdots\sigma_{k}$, $k\!>\!0$ and $\sigma_{1}, \ldots, \sigma_{k} \in \Sigma$, we define $$A_{w} = A_{\sigma_{k}}A_{\sigma_{k-1}}\cdots A_{\sigma_{1}}$$. For an empty word $\epsilon$, let $A_{\epsilon} = I_n$. \end{Notation} From \cite[Lemma 2]{PetreczkyBilinear} it follows that \begin{equation*} \mathbf{x}(t)=\sum_{v \in \Sigma^{*},\sigma \in \Sigma} \sqrt{p_{\sigma v}} A_{v}K_{\sigma}\mathbf{z}^{\mathbf{v}}_{\sigma v}(t) % \\ \end{equation*} where the infinite sum on the right-hand side is absolutely convergent in the mean square sense. This prompts us to use the following notation. \begin{Notation} We identify the asLPV-SSA $\mathcal{S}$ of the form \eqref{eq:aslpv} with the tuple $\mathcal{S} =(\{A_{\sigma},K_{\sigma}\}_{\sigma=1}^{\pdim},C,F,\mathbf{v})$. \end{Notation} Finally, we need to define what we mean by an asLPV-SSA realization of a process. An asLPV-SSA $\mathcal{S}$ of the form \eqref{eq:aslpv} is a \emph{realization of a pair $(\tilde{\textbf{y}},\tilde{\p})$}, if $\tilde{\textbf{y}}=\textbf{y}$, $\tilde{\p}=\p$. If $\mathcal{S}$ is of the form \eqref{eq:aslpv}, then we call the state-space dimension $\nx$ the \emph{dimension} of $\mathcal{S}$ and we denote it by $\dim \mathcal{S}$. We say that the asLPV-SSA $\mathcal{S}$ is a \emph{minimal} realization of $(\tilde{\textbf{y}},\tilde{\p})$, if for any asLPV-SSA realization $\mathcal{S}^{'}$ of $(\tilde{\textbf{y}},\tilde{\p})$, the dimension of $\mathcal{S}^{'}$ is not smaller than $\dim \mathcal{S}$. \section{Preliminaries} \label{sect:prelim} In the sequel, we will use the standard terminology of probability theory \cite{Bilingsley}. In particular, all the random variables and stochastic processes are understood w.r.t. to a fixed probability space $\left(\Omega, \mathcal{F}, \mathcal{P}\right)$, where $\mathcal{F}$ is a $\sigma$-algebra over the sample space $\Omega$. The expected value of a random variable $\mathbf{r}$ is denoted by $E[\mathbf{x}]$ and conditional expectation w.r.t. $\sigma$- algebra $\mathcal{F}$ is denoted by $\expect{\mathbf{r} \mid \mathcal{F}}$. All the stochastic processes in this paper are discrete-time ones defined over the time-axis $\mathbb{Z}$ of the set of integers: a stochastic process $\r$ is a collection of random variables $\{\r(t)\}_{t \in \mathbb{Z}}$ taking values in some set $X$. Next, we define the class of systems studied in this paper. An \emph{autonomous stochastic linear parameter-varying state-space representation with affine dependence on scheduling parameter (aLPV-SSA)} a is system described by \begin{equation} \label{eq:aslpv} \mathcal{S} \left\{ \begin{aligned} & \mathbf{x}(t+1)=\sum_{i=1}^{\pdim} (A_i\mathbf{x}(t)+K_i\mathbf{v}(t))\p_i(t) \\ & \textbf{y}(t)=C\mathbf{x}(t)+F\mathbf{v}(t) \end{aligned}\right. \end{equation} where $A_{\sigma} \in \mathbb{R}^{n \times n}, K_{\sigma} \in \mathbb{R}^{n \times m}$, $C \in \mathbb{R}^{p \times n}$, $F \in \mathbb{R}^{n_y \times m}$, and $\mathbf{x}$ is the state process, $\p=\begin{bmatrix} \p_1,\ldots,\p_{\pdim} \end{bmatrix}^T$ is the scheduling process, $\mathbf{v}$ is the noise process and $\textbf{y}$ is the output process. Note that all the involved processes are defined for both negative and positive time. This may create technical problems for the existence of a solution and the role of initial state. In this paper we will circumvent this problem by considering LPV-SSA which are mean-square stable in a suitable sense and state process of which is stationary. In order to define this class of LPV-SSAs we will have to recall from \cite{PetreczkyBilinear} some notation and terminology. \subsection{Admissible scheduling and wide-sense stationarity (ZWSII) w.r.t. scheduling} \label{Subsec:assumptions1} Below we define the concept of admissible input processes and ZWSII processes w.r.t. scheduling. These concepts will be used to define the class of aLPV-SSAs we will work with. To this end, we will need the following notation from automata theory which will be used for other purposes too \begin{Notation}[Sequences over $\Sigma$] Consider the finite set \[ \Sigma = \{1, \ldots, \pdim\}. \ A \emph{non empty word} over $\Sigma$ is a finite sequence of letters, i.e., $w = \sigma_{1}\sigma_{2}\cdots \sigma_{k}$, where $0 < k \in \mathbb{Z}$, $\sigma_{1}, \sigma_{2}, \ldots, \sigma_{k} \in \Sigma$. The set of \emph{all} nonempty words is denoted by $\Sigma^{+}$. We denote an \emph{empty word} by $\epsilon$. Let $\Sigma^{*} = \epsilon \cup \Sigma^{+}$. The concatenation of two nonempty words $v = a_{1}a_{2}\cdots a_{m}$ and $w= b_{1}b_{2}\cdots b_{n}$ is defined as $vw = a_{1}\cdots a_{m} b_{1} \cdots b_{n}$ for some $m,n > 0$. Note that if $w = \epsilon$ or $v= \epsilon$, then $v\epsilon = v$ and $\epsilon w = w$, moreover, $\epsilon \epsilon = \epsilon$. The length of the word $w \in \Sigma^{*}$ is denoted by $|w|$, and $|\epsilon| =0$. \end{Notation} With the notation above, we can identify the process $\p$ with the collection $\{\p_{\sigma}\}_{\sigma \in \Sigma}$ of its components. We will say that $\p$ is an \emph{admissible scheduling process}, if the collection $\{\p_{\sigma}\}_{\sigma \in \Sigma}$ is an admissible collection of input processes in the sense of \cite[Definition 1]{PetreczkyBilinear} for $S=\Sigma \times \Sigma$. For the convenience of the reader, a version of \cite[Definition 1]{PetreczkyBilinear} is presented in Appendix \ref{App:def}. Before proceeding further we will present examples of admissible scheduling sequences. \begin{Example}[White noise scheduling] \label{i.i.d. input} The scheduling process $\p = [\p_1, \p_{2}, \ldots, \p_{\pdim}]^{T}$ is independent identically distributed (i.i.d.) such that for all $i,j=2,\ldots, \pdim$, $t \in \mathbb{Z}$, $\p_i(t), \p_j(t)$ are independent and $\p_i(t)$ is zero mean, then $\p$ is admissible. \end{Example} \begin{Example}[Discrete valued i.i.d process] \label{disc:input} Assume there exists an i.i.d process $\boldsymbol{\theta}$ which takes its values from a finite set $\Sigma=\{1,\ldots,\pdim\}$. Let $\p_{\sigma}(t)=\chi(\boldsymbol{\theta}(t)=\sigma)$ for all $\sigma \in \Sigma$, $t \in \mathbb{Z}$. Then $\p(t)=\begin{bmatrix} \p_1(t) & \ldots & \p_{n_{\mathrm p}} \end{bmatrix}^T$ is an admissible scheduling processes. \end{Example} For further examples, see \cite{PetreczkyBilinear}. We assume that the scheduling process $\p$ is admissible throughout the paper. Furthermore, we will use the definition of a \emph{Zero Mean Wide Sense Stationary (abbreviated by ZMWSII) process with respect to $\p$} from \cite[Definition 2]{PetreczkyBilinear}. For the convenience of the reader this definition is reformulated in Appendix \ref{App:def} as Definition \ref{def:ZMWSSI}. In order to explain the intuition behind these definitions, and because we will use them later on, we define the following products of scheduling variables along a sequence from $\Sigma^{+}$. For every word $\wordSet{+}$ where $w=\sigma_{1}\sigma_{2}\cdots \sigma_{k}$, $k \geq 1$, $\sigma_{1},\ldots, \sigma_{k} \in \Sigma$, we define the process $\uw{w}$ as follows: \begin{equation} \label{eqn:uw} \uw{w}(t) = \uw{\sigma_{1}}(t-k+1)\uw{\sigma_{2}}(t-k+2)\cdots\uw{\sigma_{k}}(t) \end{equation} For an empty word $w= \epsilon$, we set $\uw{\epsilon}(t)=1$. If $\p$ is admissible, then $\uw{w},\uw{v}$ are jointly wide-sense stationary. Moreover, $\uw{w}(t)$ and $\uw{v}(t)$ are uncorrelated, if the last letters of $w$ and $v$ are different, and $$E[\uw{w\sigma}^2(t)]=p_{\sigma} E[\uw{w}^2(t)]$$ for any $w \in \Sigma^{+}$, $\sigma \in \Sigma$. That is, $\p$ uniquely determines a collection of numbers $\{p_{\sigma}\}_{\sigma \in \Sigma}$. This latter collection will play an important role in the sequel. In particular, for $\p$ from Example \ref{i.i.d. input}, $p_i$ is the variance of $\p_i$, and for $\p$ from Example \ref{disc:input}, $p_i$ is the probability $P(\theta(t)=i)$, for all $i \in \Sigma$. In order to explain the significance of these assumptions, let $\r$ be a stochastic ZMWSII process w.r.t. $\p$, and because we will use them latter on, we define the following products. Let $\{p_{\sigma}\}_{\sigma \in \Sigma}$ be the constants determined by $\p$ as explained above, and define the products \begin{equation} \begin{aligned}\label{eqn:uw1} p_w&=p_{\sigma_1}p_{\sigma_2} \cdots p_{\sigma_k}. \end{aligned} \end{equation} For an empty word $w= \epsilon$, we set $p_{\epsilon}=1$. For a stochastic process $\mathbf{r} \in \mathbb{R}^{n_u}$ and for each $\wordSet{*}$ we define the stochastic process $\mathbf{z}^{\mathbf{r}}_{w} $ as \begin{equation}\label{eqn:zwu} \mathbf{z}^{\mathbf{r}}_{w} (t) = \mathbf{r}(t-|w|) \uw{w}(t-1)\frac{1}{\sqrt{p_{w}}}, \end{equation} where $\uw{w}$ and $p_w$ are as in \eqref{eqn:uw} and \eqref{eqn:uw1}. For $w=\epsilon$, $\mathbf{z}^{\mathbf{r}}_{w} (t)=\r(t)$. The process $\mathbf{z}^{\mathbf{r}}_{w} $ in \eqref{eqn:zwu} is interpreted as the product of the \emph{past} of $\r$ and $\p$. The process $\mathbf{z}^{\mathbf{r}}_{w} $ will be used as predictors for future values of $\r$ for various choices of $\r$. Now we will explain the motivation for the concept of ZMWSII. Assume that $\r$ is ZMWSII w.r.t. $\p$. Then $\mathbf{z}^{\mathbf{r}}_{w} (t)$ is wide-stationary and square-integrable for all $w \in \Sigma^{+}$. Moreover, the covariances $\expect{\mathbf{z}^{\mathbf{r}}_{w} (t)(\mathbf{z}^{\mathbf{r}}_{v} (t))^{T}}$ do not depend on $t$. Furthermore $\mathbf{z}^{\mathbf{r}}_{w} (t)$, $\mathbf{z}^{\mathbf{r}}_{v} (t)$ are orthogonal, if $w$ is not a suffix of $v$ or vice versa. Recall that we say that $w$ is a suffix of $v$, if $v=sw$ for some $s \in \Sigma^{*}$. Moreover, when $w$ is suffix of $v$, then \begin{align*} & \expect{\mathbf{z}^{\mathbf{r}}_{w} (t)(\mathbf{z}^{\mathbf{r}}_{v} (t))^{T}} = \left\{ \begin{array}{ll} \expect{\r(t)(\mathbf{z}^{\mathbf{r}}_{s} (t))^{T}} & \text{if } v = sw \\ \expect{\mathbf{z}^{\mathbf{r}}_{\sigma}(t)(\mathbf{z}^{\mathbf{r}}_{\sigma}(t))^{T}} & \text{if } v=w = \sigma s \\ \end{array} \right. \\ \end{align*} That is, $\expect{\mathbf{z}^{\mathbf{r}}_{w} (t)(\mathbf{z}^{\mathbf{r}}_{v} (t))^{T}}$ depends only on the difference of $w$ and $v$, i.e., on the prefix of $v$. This can be viewed as a generalization of wide-sense stationarity, if the index $w$ and $v$ are viewed as additional multidimensional time instances, and $\Sigma^{*}$ is viewed as an additional time-axis.
248942448195b7dde91defacbe17455df4dff3e8
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction}\label{sec:intro} Tracing back from the seminal work by Monderer and Shapley \cite{monderer1996potential}, potential games represent a broad class of noncooperative games characterized by the existence of a real-valued function, the \emph{potential function}, such that any collective strategy profile minimizing the underlying function coincides with a Nash equilibrium of the game. Potential games hence provide a means to naturally model many control-theoretic applications \cite{Mar09} such as routing \cite{Orda93}, complex social networks \cite{Staudigl:2011} and Cournot competition \cite{ConKluKraw04}. We consider generalized ordinal potential games in which part of the decision variables of the agents are constrained to assume integer values. Such \gls{MI} games have been recently proposed as strategic models for the distributed coordination of autonomous vehicles \cite{fabiani2018mixed,fabiani2019multi}, transportation and traffic control \cite{cenedese2021highway}, and smart grids \cite{Vujanic:2016wr,cenedese2019charging}. In addition, \gls{MI} restrictions are often encountered in market games \cite{Gabriel:2013us,Sag17} and combinatorial congestion games \cite{Rosenthal:1973wg,KleSch21} as well. For this practically relevant, yet intrinsically nonconvex, \gls{MI} game-theoretic setting the existence of equilibria follows by assuming that a certain master problem admits a solution, and we hence present two distributed, proximal-like equilibrium seeking algorithms. In particular, we consider the following scenarios: i) the underlying game is generalized ordinal and the agents update their control variables iteratively by choosing an exact proximal \gls{BR} strategy; ii) the game admits an exact potential function but we allow agents to choose an inexact proximal \gls{BR} for their updates. Similar to Bregman-versions of proximal algorithms \cite{DvuShtStaSurvey21}, we formulate the proximal best-response function using a class of norm-like regularizers, known in the \gls{MI} optimization community as \glspl{ICRF}. We choose \glspl{ICRF} as penalty terms in place of standard quadratic regularizations as we believe they could provide us with a mean to include continuous reformulations of the \gls{MI} optimization subproblems. We leave this topic for future research. Thus, by exploiting the properties of the \glspl{ICRF}, acting as penalty terms in the individual agent's \gls{BR} problems, we prove that both proposed algorithms enjoy convergence guarantees to an equilibrium of the \gls{MI-NEP}. Specifically, in the first scenario considered the computed \gls{MI-NE} is exact, while in the second one the algorithm returns an approximate \gls{MI-NE}. Since \glspl{MI-NEP} constitute a rather new class of strategic optimization problems, there are not many solution techniques available. To the best of our knowledge, this work represents a first attempt proposing proximal-like distributed algorithms for a \gls{MI} game setting. The only alternative applicable algorithm for \glspl{MI-NEP} is the Gauss--Southwell method designed in \cite{sagratella2017algorithms}. Given the practical relevance of \glspl{MI-NEP}, this is rather surprising, and completely diametric to continuous \glspl{NEP}, for which a whole arsenal of numerical solution techniques is available \cite{dreves2011solution,mertikopoulos2017convergence}. In fact, proximal \gls{BR}-based algorithms have been extensively studied in both stochastic and deterministic Nash games \cite{Scu14,Lei:2019vj}. All these schemes, however, leverage the \gls{VI} reformulation of \glspl{NEP} \cite{facchinei2007generalized}, and thus require strong (or strict) monotonicity of the \gls{VI}, assumptions that cannot be structurally satisfied in \glspl{MI-NEP}. The algorithms we develop, in particular our adaptive update of the penalty parameter regulating the proximal \gls{BR}, are inspired by the decomposition method proposed in \cite{facchinei2011decomposition}. As main contributions we show i) how a proximal-like \gls{BR}-scheme with \glspl{ICRF} can be used to compute Nash equilibria satisfying \gls{MI} restrictions, and ii) we show convergence to an approximate equilibrium even under inexact computations of \gls{BR} strategies. The rest of the paper is organized as follows. In \S \ref{sec:problem_formulation} we introduce the problem addressed, along with some preliminaries, while in \S \ref{sec:algo} we present the two methods and related convergence analysis. Finally, in \S \ref{sec:simulations}, we test our findings on a \gls{MI} Cournot oligopoly model and we conclude in \S \ref{sec:conclusion}. \section{Problem formulation and preliminaries}\label{sec:problem_formulation} Let $\mc{I} \coloneqq \{1, \ldots, N\}$ be the set indexing the $N$~agents taking part in the noncooperative game $\Gamma \coloneqq (\mc{I}, (J_i)_{i \in \mc{I}}, (\mc{X}_i)_{i \in \mc{I}})$. Each agent controls \gls{MI} variables $x_i$ belonging to a compact, nonempty set $\mc{X}_i \subseteq \mathbb{R}^{n^{c}_{i}} \times \mathbb{Z}^{n^{d}_{i}}$, and aims at minimizing a given cost function $J_i : \mc{X} \to \mathbb{R}$ with $\mc{X} \coloneqq \prod_{i \in \mc{I}} \mc{X}_i \subseteq \mathbb{R}^n$ and $n \coloneqq \sum_{i \in \mc{I}} n_i = \sum_{i \in \mc{I}}(n^{c}_{i} + n^{d}_{i})$. The resulting \gls{MI-NEP} thus reads \begin{equation}\label{eq:single_prob} \forall i \in \mc{I} : \underset{x_i \in \mc{X}_i}{\textrm{min}} \ J_i (x_i, \bs{x}_{-i}) \,, \end{equation} where $\bs{x}_{-i} \coloneqq \textrm{col}((x_{j})_{j \in \mc{I}\setminus\{i\}})$. Given the strategies of the other agents, $\bs{x}_{-i}$, the \gls{MI} \gls{BR} of agent $i\in\mc{I}$ is defined as \begin{equation}\label{eq:br_mapping} B_{i}(\bs{x}_{-i}) \coloneqq \underset{x_i \in \mc{X}_i}{\textrm{argmin}} \ J_i (x_i, \bs{x}_{-i}) \,. \end{equation} Our goal is to design distributed algorithms, able to drive the set of agents to an \gls{MI-NE} of the game $\Gamma$, according to the definition given next. \begin{definition}\textup{(Mixed-integer $\epsilon$-Nash equilibrium)}\label{def:MINE} Given some $\epsilon \geq 0$, a strategy profile $\bs{x}^{\ast} \in \mc{X}$ is an $\epsilon$-approximate \gls{MI-NE} (or $\epsilon$-\gls{MI-NE}) of the game $\Gamma$ if, for all $i \in \mc{I}$, \begin{equation} J_i(x^\ast_i, \bs{x}^\ast_{-i}) \leq J_i(y_i, \bs{x}^\ast_{-i})+\epsilon \text{ for all } y_i \in \mc{X}_i \,. \end{equation} % If $\epsilon=0$, then we call $\bs{x}^{\ast}$ an exact \gls{MI-NE}. \hfill$\square$ \end{definition} Definition~\ref{def:MINE} points out that a \gls{MI-NE} of the game (if it exists) is achieved when all the agents adopt a \gls{BR} strategy. \subsection{Generalized ordinal and exact potential games} Existence theorems for \glspl{NEP} typically require continuity of the agents' cost functions as well as compactness and convexity of the feasible sets \cite{facchinei2007generalized}. Since the \gls{NEP} in \eqref{eq:single_prob} is nonconvex, existence of Nash equilibria is, in principle, not guaranteed. We thus focus on the classes of \emph{exact} and \emph{generalized ordinal potential games}, for which existence of solutions can be guaranteed under certain assumptions. \begin{definition}\textup{(Potential game)}\label{def:pot_game} A game $\Gamma$ is called \begin{itemize} \item \emph{exact} potential game \cite{monderer1996potential } if there exists a continuous function $P:\mathbb{R}^n \to \mathbb{R}$ such that, for all $i \in \mc{I}$, $$ P(x_i, \bs{x}_{-i}) - P(y_i, \bs{x}_{-i}) = J_i(x_i, \bs{x}_{-i}) - J_i(y_i, \bs{x}_{-i}) \,, $$ for all $\bs{x}_{-i}$ and $x_i$, $y_i \in \mc{X}_i$; \item \emph{generalized ordinal} potential game \cite{facchinei2011decomposition} if, there exists a \emph{forcing function} $\phi : \mathbb{R}_{\geq 0} \to \mathbb{R}_{\geq 0}$ such that, for all $i \in \mc{I}$, $\bs{x}_{-i}$, and $x_i, y_i \in \mc{X}_i$, $$ \begin{aligned} &J_i(y_i, \bs{x}_{-i}) - J_i(x_i, \bs{x}_{-i}) > 0 \text{ implies}\\ &P(y_i, \bs{x}_{-i}) - P(x_i, \bs{x}_{-i}) \geq \phi(J_i(y_i, \bs{x}_{-i}) - J_i(x_i, \bs{x}_{-i})) \, , \end{aligned} $$ where $\lim_{t\to 0^{+}} \phi(t) = 0$. \hfill$\square$ \end{itemize} \end{definition} Note that any exact potential game is a generalized ordinal potential game. By exploiting the tight relation between first-order information of the potential function and the local cost functions of the agents, it is well-known that potential functions can be employed in the construction of a suitable master problem facilitating the computation of equilibria. \begin{proposition}\hspace{-.2em}\textup{\cite[Th.~2]{sagratella2017algorithms}} Let $P$ be a generalized ordinal potential function for the game $\Gamma$. Given some $\epsilon\geq 0$, any $\epsilon$-approximate solution of the optimization problem \begin{equation}\label{eq:Master} \underset{\bs{x}\in\mc{X}}{\textrm{min}}\ P(\bs{x}) \end{equation} yields an $\epsilon$-approximate \gls{MI-NE} of $\Gamma$. \hfill$\square$ \end{proposition} \begin{assumption}\label{standing:existence} Problem \eqref{eq:Master} is solvable, i.e., there exists an $\bs{x}^{*}\in\mc{X}$ with $P(\bs{x})\geq P(\bs{x}^{*})$ for all $\bs{x}\in\mc{X}$. \hfill$\square$ \end{assumption} This assumption guarantees that the game~$\Gamma$ admits at least one Nash equilibrium in the nonconvex domain $\mc{X}$. Clearly, the solutions to the master problem \eqref{eq:Master} may not contain all possible Nash equilibria of the game $\Gamma$ \cite[Ex.~1]{sagratella2016computing}. \subsection{Integer-compatible regularization functions} Standard regularization techniques in \glspl{NEP} are based on the proximal \gls{BR} function obtained from \eqref{eq:br_mapping} by adding a quadratic penalty term. Motivated by the proximal point interpretation of \gls{MI} optimization heuristics, we propose a regularization strategy of the individual agents' cost functions via \emph{integer-compatible regularization functions} (\glspl{ICRF}) \cite{boland2012new}. This family of functions has been introduced in the mixed-integer optimization community to control the duality gap \cite{Feizollahi2017}. They are also related to penalty methods for mixed-integer optimization \cite{lucidi2010exact}. \begin{definition} \label{def:int_comp} A continuous function $\rho : \mathbb{R}^n \to \mathbb{R}$ is an \emph{integer-compatible regularization function} (\gls{ICRF}) if \begin{enumerate} \item[i)] $\rho(\bs{t}) \geq 0$ for all $\bs{t} \in \mathbb{R}^n$ and $\rho(\bs{t}) = 0 \iff \bs{t} = 0$; \item[ii)] for $\gamma \in (0,1)$, we have $\rho(\gamma \bs{t}) < \rho(\bs{t})$ for all $\bs{t} \neq 0$; \item[iii)] there exists a continuous and strictly increasing function $s : \mathbb{R}_{\geq 0} \to \mathbb{R}_{\geq 0}$ and some $\bar{K} \in \mathbb{N}$ such that, for all $K < \bar{K}$, $\rho(\bs{t}) \leq K \implies \|\bs{t}\|_1 \leq s^{-1}(K)$, where $\|\cdot\|_1$ denotes the $\ell_1$ norm in $\mathbb{R}^n$. \hfill$\square$ \end{enumerate} \end{definition} Note that any norm defined in $\mathbb{R}^n$ is an \gls{ICRF}. A constructive way to design \glspl{ICRF} is to consider decomposable penalties of the form $\rho(\bs{t}) = \sum_{i=1}^{n} p(|t_i|)$, where $p : \mathbb{R}_{\geq 0} \to \mathbb{R}_{\geq 0}$ is a concave and strictly increasing function. Prominent examples are $p(t) = \log(t + \alpha) - \log(\alpha),\;p(t) = -(t + \alpha)^{-q} + \alpha^{-q},\;p(t)= 1 - e^{-\alpha t}$, or $p(t) = (1 + e^{-\alpha t})^{-1} - \tfrac{1}{2}$, for some $\alpha$, $q > 0$ (see e.g. \cite{lucidi2010exact,boland2012new}). With these choices, $\rho(\cdot)$ amounts to an \gls{ICRF} \cite[Prop.~3.2]{boland2012new}. In particular, for the special case of binary constraints, a sensible formulation of an \gls{ICRF} is $\rho(\bs{t})=\sum_{i=1}^{n}\textrm{min}\{p(| t_{i}|),p(|1- t_{i}|)\}$. \section{Proximal-like algorithms for \glspl{MI-NEP}}\label{sec:algo} We now propose two \gls{MI-NE} seeking algorithms. Algorithm \ref{alg:exact_ordinal} assumes that agents are able to compute an exact proximal \gls{BR} at each iteration. Algorithm \ref{alg:inexact_exact} relaxes this and instead allows for inexact BR computations. To show convergence, in the former case we rely on the fact that the \gls{MI-NEP} in \eqref{eq:single_prob} is generalized ordinal, whereas in the latter case we require the existence of an exact potential function Let $\rho_{i}$ denote the \gls{ICRF} employed by agent $i \in \mc{I}$ and let $\tau>0$ be a positive regularization parameter. We introduce the \emph{proximal augmented local cost function} as a regularized version of the local cost in \eqref{eq:single_prob}, which is given by \begin{equation}\label{eq:aug_local} \tilde{J}_{i, \tau}(y_i, x_i; \bs{x}_{-i}) \coloneqq J_i(y_i, \bs{x}_{-i}) + \tau \rho_i(y_i - x_i)\,. \end{equation} In accordance, the \emph{proximal} \gls{BR} mapping in \eqref{eq:br_mapping} turns into \begin{equation}\label{eq:perturbed_br_mapping} \beta_{i, \tau}(\bs{x}) \coloneqq \underset{y_i \in \mc{X}_i}{\textrm{argmin}} \ \tilde{J}_{i, \tau}(y_i, x_i; \bs{x}_{-i}) \,. \end{equation} Setting $\tau = 0$ allows us to recover the \gls{BR} mapping as defined in \eqref{eq:br_mapping}, i.e., $\beta_{i, 0}(\bs{x}) = B_i(\bs{x}_{-i})$. By considering these two new ingredients, in the remainder of this section we design iterative and distributed schemes in which the agents update their own action sequentially, according to $\mc{I}$. We let $k\geq 0$ denote the iteration counter of the process and $\bs{x}^{k}$ the iterate at the beginning of round $k+1$. For an arbitrary agent $i\in\mc{I}$, we also define the (local) population state as $$ \hat{\bs{x}}_i(k) \coloneqq \textrm{col}(x_1^{k+1}, \ldots, x_{i-1}^{k+1}, x_i^{k}, x_{i+1}^{k},\ldots, x_N^{k}) \,. $$ This corresponds to the collective vector of strategies at the $k$-th iteration communicated to agent $i$ when this agent has to perform an update, i.e., it computes the new strategy as a point in the \gls{MI} proximal \gls{BR} mapping, $ x^{k+1}_{i}\in \beta_{i,\tau^{k}}(\hat{\bs{x}}_{i}(k)), $ either exactly (Algorithm~\ref{alg:exact_ordinal}) or approximately (Algorithm~\ref{alg:inexact_exact}). Successively, the next internal state $\hat{\bs{x}}_{i+1}(k)$ is updated and passed to the ($i+1$)-th agent. Throughout this process, note that, for all $k\geq 0$, $\hat{\bs{x}}_{1}(k)=\bs{x}^{k}$ and $\hat{\bs{x}}_{N+1}(k)=\bs{x}^{k+1}$. We stress that the proposed algorithms leverage the adaptive update of the regularization parameter $\tau$ in \eqref{eq:tau}, which produces a monotonically decreasing sequence $\{\tau^{k}\}_{k\geq 0}$, i.e., $\tau^{k+1}\leq \tau^{k}$ for all $k \geq 0$ \cite{facchinei2011decomposition}. Note that the rate of decrease strongly depends on $d_{\rho}(\bs{x}^{k+1},\bs{x}^{k})\coloneqq\textrm{max}_{i\in\mc{I}} \ \rho_{i}(x^{k+1}_{i}-x^{k}_{i}) \geq 0$, which measures the progress the method is making in the agents' proximal steps at the $k$-th iteration. As it will be clear from the convergence analysis, this quantity decreases over time, thus inducing a step towards an \gls{MI-NE}. \subsection{Exact \gls{BR} computation in generalized ordinal potential games} \label{subsec:exactcomp_genpot} \begin{algorithm}[!t] \caption{Proximal-like method for \glspl{MI-NEP} with generalized ordinal potential and exact optimization}\label{alg:exact_ordinal} \DontPrintSemicolon \SetArgSty{} \SetKwFor{ForAll}{For all}{do}{End forall}\SetKwFor{While}{While}{do}{End while} \smallskip Set $k \coloneqq 0$, choose $\bs{x}^k\in \mc{X}$, $\tau^k > 0$ and $\omega \in (0,1)$\\ \smallskip \While{$\bs{x}^k$ is not satisfying a stopping criterion}{ \smallskip \ForAll {$i \in \mc{I}$}{ \smallskip Obtain $\hat{\bs{x}}_{i}(k)$ and set $x_i^{k+1} \in \beta_{i, \tau^k}(\hat{\bs{x}}_i(k))$\\ \smallskip Update $\hat{\bs{x}}_{i+1}(k) = (x^{k+1}_{i}, \hat{\bs{x}}_{-i}(k))$ } \smallskip Set $\bs{x}^{k+1}=(x^{k+1}_{1},\ldots,x^{k+1}_{N})$\\ \smallskip Update \begin{equation}\label{eq:tau} \hspace{-0.15cm}\tau^{k+1}=\textrm{max}\left\{\omega\tau^{k},\textrm{min}\{\tau^{k},d_{\rho}(\bs{x}^{k+1},\bs{x}^{k})\}\right\} \end{equation}\\ Set $k \coloneqq k+1$ \smallskip } \end{algorithm} Next, by focusing on \glspl{MI-NEP} as in \eqref{eq:single_prob}, we study the convergence of Algorithm \ref{alg:exact_ordinal} under the following assumption. \begin{assumption}\label{ass:generalized_potential} The game $\Gamma = (\mc{I}, (J_i)_{i \in \mc{I}}, (\mc{X}_i)_{i \in \mc{I}})$ is a generalized ordinal potential game with potential function~$P(\cdot)$. \hfill$\square$ \end{assumption} Thus, the Gauss--Seidel sequence of iterations in Algorithm~\ref{alg:exact_ordinal} has the following convergence property. We stress that, in our framework, an accumulation point for the sequence $\{\bs{x}^k\}_{k\geq 0}$ exists in view of Assumption~\ref{standing:existence}. \begin{theorem}\label{th:exact_generalized} Under Assumption~\ref{ass:generalized_potential}, any accumulation point of the sequence of strategy profiles generated by Algorithm~\ref{alg:exact_ordinal}, $\{\bs{x}^k\}_{k\geq 0}$, is an \gls{MI-NE} of the game $\Gamma$ in \eqref{eq:single_prob}. \hfill$\square$ \end{theorem} \begin{proof} We first show that, in case the sequence $\{\bs{x}^k\}_{k\geq 0}$ generated by Algorithm~\ref{alg:exact_ordinal} admits a limit point $\bar{\bs{x}} \in \mc{X}$, then the regularization parameter, adaptively updated via \eqref{eq:tau}, satisfies $\lim_{k\to\infty}\tau^{k}=0$ and there exists an infinite index set $\mc{K}$ such that $\tau^{k+1}<\tau^{k}$ for all $k \in \mc{K}$. Then, we prove that $\bar{\bs{x}} \in \mc{X}$ is actually an \gls{MI-NE} of the \gls{MI-NEP} in \eqref{eq:single_prob}. By construction of the regularization parameter sequence defined by \eqref{eq:tau}, we have $\tau^{k+1}\leq\tau^{k}$ for all $k \geq 0$. Then, for the sake of contradiction, assume that there exists some $\bar{\tau} > 0$ such that $\tau^{k}\geq \bar{\tau}$ for all $k \geq 0$. In view of the updating rule at the $k$-th iteration, for all $i \in \mc{I}$ we have \begin{equation} \label{eq:LB} \begin{split} J_i(\hat{\bs{x}}_{i}(k))-J_i(\hat{\bs{x}}_{i+1}(k)) &\geq \tau^{k} \rho_{i}(x_{i}^{k+1}-x_{i}^{k})\\ & \geq \bar{\tau}\rho_{i}(x^{k+1}_{i}-x^{k}_{i})\geq0\,. \end{split} \end{equation} By exploiting the definition of a generalized ordinal potential game provided in Definition~\ref{def:pot_game}, we hence deduce \begin{equation} \label{LB2} \begin{split} & P(\hat{\bs{x}}_{i}(k))-P(\hat{\bs{x}}_{i+1}(k)) \\ \geq \ & \phi(J_i(\hat{\bs{x}}_{i}(k))-J_i(\hat{\bs{x}}_{i+1}(k)))\geq 0\,. \end{split} \end{equation} Therefore, $ P(\bs{x}^{k+1})=P(\hat{\bs{x}}_{N+1}(k)) \leq P(\hat{\bs{x}}_{N}(k)) \leq\dotsb\leq P(\hat{\bs{x}}_{1}(k))=P(\bs{x}^{k}), $ and hence the sequence $\{P(\bs{x}^{k})\}_{k \geq 0}$ is monotonically non-increasing. By the continuity of $P$, it follows that the full sequence $\{P(\bs{x}^{k})\}_{k \geq 0}$ is convergent to a finite value $\bar{P}$. Moreover, it follows from \eqref{LB2} that $ \lim_{k\to\infty} \phi(J_i(\hat{\bs{x}}_{i}(k))-J_i(\hat{\bs{x}}_{i+1}(k)))=0 \,. $ By definition of the forcing function, we also have $$ \lim _{k\to\infty}(J_i(\hat{\bs{x}}_{i}(k))-J_i(\hat{\bs{x}}_{i+1}(k)))=0 \,. $$ From \eqref{eq:LB}, we obtain $\lim_{k\to\infty}\rho_{i}(x^{k+1}_{i}-x^{k}_{i})=0$. Let $r^{k} \to 0$ be such that $\rho_{i}(x^{k+1}_{i}-x^{k}_{i})\leq r^{k}$ for all $k$ sufficiently large. By definition of an \gls{ICRF}, we deduce $\norm{x^{k+1}_{i}-x^{k}_{i}}_{1} \leq s_{i}^{-1}(r^{k})$. We recall that the function $s_{i}^{-1}(\cdot)$ is monotonically increasing, and therefore $ \lim_{k\to\infty} \norm{x^{k+1}_{i}-x^{k}_{i}}_{1}=0. $ Consequently, for all $k$ sufficiently large, it holds that $ d_{\rho}(\bs{x}^{k+1},\bs{x}^{k})<\bar{\tau}. $ From \eqref{eq:tau}, we have $\tau^{k+1}=\textrm{max}\{\omega\tau^{k},d_{\rho}(\bs{x}^{k+1},\bs{x}^{k})\}$, and hence we need $\tau^{k+1}=\omega\tau^{k}$ for all $k$. However, this implies that $\tau^{k}\to 0$ at a geometric rate, thus contradicting the hypothesis that $\tau^{k}\geq\bar{\tau}>0$ for all $k \geq 0$ and concluding the first part of the proof. Now, let $\{\bs{x}^{k}\}_{k \geq 0}$ be a convergent subsequence with accumulation point $\bar{\bs{x}}\in\mc{X}$. The existence of such a convergent subsequence is guaranteed by the compactness of $\mc{X}$. By invoking the same arguments as in the first part of the proof, we obtain $\lim _{k\to\infty}(J_i(\hat{\bs{x}}_{i}(k))-J_i(\hat{\bs{x}}_{i+1}(k)))=0$ and $\lim_{k\to\infty} \norm{x^{k+1}_{i}-x^{k}_{i}}_{1}=0$ for all $i\in\mc{I}$. Next, we show by contradiction that the accumulation point $\bar{\bs{x}} \in \mc{X}$ coincides with an \gls{MI-NE} of \eqref{eq:single_prob} with generalized ordinal potential. To this end, let us suppose that there exists an agent $i \in \mc{I}$ that can further minimize its cost function, i.e., for some $y_{i} \in \mc{X}_{i}$, $ J_i(y_{i}, \bar{\bs{x}}_{-i})<J_i(\bar{\bs{x}}) $ holds. By relying on the update rule in Algorithm~\ref{alg:exact_ordinal}, we obtain \begin{align*} & J_i(x_{i}^{k+1}, \bs{x}_{-i}^{k})+\tau^{k} \rho_{i}(x_{i}^{k+1}-x_{i}^{k})\\ \leq \ & J_i(y_{i}, \bs{x}_{-i}^{k})+\tau^{k} \rho_{i}(y_{i}-x_{i}^{k})\,. \end{align*} Now, passing to the limit and using the fact that $\tau^{k} \rightarrow 0$, $$ J_i(\bar{\bs{x}}) \leq J_i(y_{i}, \bar{\bs{x}}_{-i})<J_i(\bar{\bs{x}})\,, $$ which denotes a contradiction, thus concluding the proof. \end{proof} In contrast to the continuous case where a constant penalty parameter can be used (see, e.g., \cite[Th.~4.3]{facchinei2011decomposition}), in a \gls{MI} setting a vanishing regularization parameter is required. In addition, note that Algorithm~\ref{alg:exact_ordinal} assumes that agents can compute an exact \gls{BR} of the proximal augmented local cost function in \eqref{eq:aug_local}. This requires that, at every single iteration, each agent solves a \gls{MI} nonlinear optimization problem to optimality. Without additional structural assumptions (e.g., individual convexity), this could render the method inefficient in practice. This reason motivates us to investigate a variant of Algorithm~\ref{alg:exact_ordinal} involving inexact computation of a point lying in the perturbed \gls{MI} \gls{BR} mapping \eqref{eq:perturbed_br_mapping} of each agent. \subsection{Inexact \gls{BR} computation in exact potential games} \label{subsec:exactpot_inexactcomp} \begin{algorithm}[!t] \caption{Proximal-like method for \glspl{MI-NEP} with exact potential and inexact optimization}\label{alg:inexact_exact} \DontPrintSemicolon \SetArgSty{} \SetKwFor{ForAll}{For all}{do}{End forall}\SetKwFor{While}{While}{do}{End while} \SetKwFor{uIf}{If}{then}{}\SetKwFor{Else}{Else}{}{End} \smallskip Set $k \coloneqq 0$, choose $\bs{x}^k \in \bs{\mc{X}}$, $\tau^k > 0$, $\omega \in (0,1)$ and error tolerance sequence $\{\delta^k\}_{k\geq 0}$\\ \smallskip \While{$\bs{x}^k$ is not satisfying a stopping criterion}{ \smallskip \ForAll {$i \in \mc{I}$}{ \smallskip Obtain $\hat{\bs{x}}_{i}(k)$ \\ \smallskip \uIf{$x_i^{k} \in\hat{\beta}_{i,\tau^{k}}(\hat{\bs{x}}_{i}(k);\delta^{k})$}{ \smallskip Set $x_i^{k+1} = x_i^{k}$ \\ \smallskip } \Else{}{ \smallskip Set $x_i^{k+1} \in\hat{\beta}_{i,\tau^{k}}(\hat{\bs{x}}_{i}(k);\delta^{k})$ \\ \smallskip } \smallskip Update $\hat{\bs{x}}_{i+1}(k) = (x^{k+1}_{i}, \hat{\bs{x}}_{-i}(k))$\\ \smallskip } \smallskip Set $\bs{x}^{k+1}=(x^{k+1}_{1},\ldots,x^{k+1}_{N})$\\ \smallskip Update $\tau^{k+1}$ as in \eqref{eq:tau} and set $k \coloneqq k+1$ \smallskip } \end{algorithm} We now consider the case in which the \gls{MI-NEP} in \eqref{eq:single_prob} admits an exact potential function. In this case, we can prove convergence even if the agents implement only \emph{approximate} \gls{BR}s at every iteration, according to the following definition: \begin{definition}($\delta$-proximal \gls{BR}) Given any $\bs{x} \in \mc{X}$ and tolerance $\delta\geq 0$, $y_i \in \mc{X}_i$ is an $\delta$-optimal response to $\bs{x}_{-i}$ if $$\tilde{J}_{i, \tau}(y_i, x_i; \bs{x}_{-i}) \leq \tilde{J}_{i, \tau}(z_i, x_i; \bs{x}_{-i}) + \delta $$ for all $z_i \in \mc{X}_i$.\hfill$\square$ \end{definition} For each agent $i \in \mc{I}$, we define $ \hat{\beta}_{i, \tau}(\bs{x}; \delta) \coloneqq \{y_i \in \mc{X}_i \mid \tilde{J}_{i, \tau}(y_i, x_i; \bs{x}_{-i}) \leq \tilde{J}_{i, \tau}(z_i, x_i; \bs{x}_{-i}) + \delta \text{ for all } z_i \in \mc{X}_i\} $ as the set of $\delta$-optimal responses, given some collective vector of strategies $\bs{x}$. For the theoretical developments of this subsection, we then make the following assumption. \begin{assumption}\label{ass:exact_potential} The game $\Gamma = (\mc{I}, (J_i)_{i \in \mc{I}}, (\mc{X}_i)_{i \in \mc{I}})$ is an exact potential game with potential function $P(\cdot)$. \hfill$\square$ \end{assumption} Algorithm~\ref{alg:inexact_exact} summarizes the main steps of the resulting distributed, Gauss--Seidel type sequence of iterations. For the considered instance, after choosing an initial strategy $\bs{x}^0 \in \mc{X}$ and a sequence of penalty parameters $\{\tau^k\}_{k\geq 0}$, the preliminary step requires to further define a certain error tolerance in computing a $\delta$-optimal response. To this end, we let $\{\delta^{k}\}_{k\geq 0}$ be a given sequence of positive numbers such that $\delta^{k}\to \epsilon$ for some $\epsilon \geq 0$. In Algorithm~\ref{alg:inexact_exact} we stick to the sequential update architecture, but instead of requiring that agents pursue an exact \gls{BR}, we allow the updating agent to choose an inexact \gls{BR}, $x^{k+1}_{i}\in \hat{\beta}_{i,\tau^{k}}(\hat{\bs{x}}_{i}(k);\delta^{k})$, only in case the inexact \gls{BR} computed at the previous step, i.e., the one obtained by considering $\hat{\bs{x}}_{i}(k-1)$, $\tau^{k-1}$ and $\delta^{k-1}$, does not belong to $\hat{\beta}_{i,\tau^{k}}(\hat{\bs{x}}_{i}(k);\delta^{k})$. The updated strategy is then sent to the agent down the line, and the procedure repeats as long as some stopping criterion is not met. \begin{theorem}\label{th:inexact_exact} Let Assumption~\ref{ass:exact_potential} holds true. Consider an error sequence $\{\delta^{k}\}_{k\geq 0}$ satisfying $\delta^k \to \epsilon$ with $\epsilon \geq 0$. Then any accumulation point of the sequence $\{\bs{x}^{k}\}_{k\geq 0}$ generated by Algorithm~\ref{alg:inexact_exact} is an $\epsilon$-\gls{MI-NE} of the game $\Gamma$ in \eqref{eq:single_prob}. \hfill$\square$ \end{theorem} \begin{proof} The proof makes use of similar arguments as the one of Theorem~\ref{th:exact_generalized}. As a starting point, by definition of the update $x_i^{k+1}$, we have $$ J_i(\hat{\bs{x}}_i(k))-J_i(\hat{\bs{x}}_{i+1}(k)) \geq \tau^{k} \rho_i(x_i^{k+1}-x_i^{k}) \,. $$ Since in this case $P$ is an exact potential function, we have $$ P(\hat{\bs{x}}_{i}(k))-P(\hat{\bs{x}}_{i+1}(k)) \geq \tau^{k} \rho_i(x_i^{k+1}-x_i^{k}) \geq 0 \,, $$ where the last inequality uses the non-negativity of the \gls{ICRF}. By summing from $i=1$ to $N$, we hence obtain $$ P(\bs{x}^{k})-P(\bs{x}^{k+1}) \geq 0 \,. $$ In view of \cite[Lemma~3.4]{franci2022convergence}, it follows that $\lim_{k\to\infty}(P(\bs{x}^{k})-\textrm{min}_{\bs{x}\in\mc{X}}P(\bs{x}))$ exists and is finite. Therefore, since $\mc{X} = \prod_{i \in \mc{I}} \mc{X}_i$ is compact, the sequence $\{\bs{x}^{k}\}_{k\geq 0}$ admits a convergent subsequence $\{\bs{x}^{k}\}_{k \in \mc{K}}$ with indices contained in some countable and infinite set $\mc{K}$, which has a limit point $\bar{\bs{x}} \in \mc{X}$. Therefore, in view of the continuity of the potential function, we have that $\lim _{k \rightarrow \infty} P(\bs{x}^{k})=P(\bar{\bs{x}})$ and $\lim _{k \rightarrow \infty}(P(\bs{x}^{k+1})-P(\bs{x}^{k}))=0$. Thus, for all $i \in \mc{I}$, $$ \lim _{k \rightarrow \infty} (P(\hat{\bs{x}}_{i+1}(k))-P(\hat{\bs{x}}_i(k)))=0 \,. $$ By definition of the potential function, it follows that $$ \lim _{k \rightarrow \infty} (J_i(\hat{\bs{x}}_{i}(k))-J_i(\hat{\bs{x}}_{i+1}(k)))=0 \,. $$ Again, by exploiting the property of the \gls{ICRF} in Definition~\ref{def:int_comp}.i), we obtain $\lim _{k \rightarrow \infty, k \in \mc{K}}\|x_i^{k+1}-x_i^{k}\|_1 = 0$ for every $i \in \mc{I}$. It then follows $ \lim _{k \rightarrow \infty} x_i^{k}=\bar{x}_i \text{ for all } i \in \mc{I}. $ Consequently, we deduce from the first part of the proof of Theorem \ref{th:exact_generalized} that also $\lim_{k\to\infty}\tau^{k}=0$. We now claim that $\bar{\bs{x}} \in \mc{X}$ is an $\epsilon$-approximate Nash equilibrium and argue by contradiction. Suppose there exists an agent $i \in \mc{I}$ such that, for some $y_i \in \mc{X}_i$, $ J_i(y_i, \bar{\bs{x}}_{-i}) + \epsilon <J_i(\bar{\bs{x}}). $ Resorting to the definition of the update mechanism yields \begin{align*} & J_i(x_i^{k+1},\hat{\bs{x}}_{-i}(k)) + \tau^{k} \rho_i(x_i^{k+1}-x_i^{k})\\ \leq \ & J_i(y_i,\hat{\bs{x}}_{-i}(k))+\tau^{k} \rho_i(y_i-x_i^{k})+\delta^{k} \,. \end{align*} Then, passing to the limit and exploiting the fact that the regularization parameter tends to zero, i.e., $\lim _{k \rightarrow \infty} \tau^{k}=0$, and that $\delta^{k} \to \epsilon$, we finally obtain $$ J_i(\bar{\bs{x}}) \leq J_i(y_i, \hat{\bs{x}}_{-i}) + \epsilon <J_i(\bar{\bs{x}}) \,. $$ This represents a contradiction and concludes the proof. \end{proof} Note that Algorithm~\ref{alg:inexact_exact} also covers the case in which the error sequence $\{\delta^k\}_{k \geq 0}$ is not forced by the designer before implementing the procedure, but it naturally arises from, e.g., a learning process. For example, consider a setting in which the agents are endowed with typical learning procedures, such as Gaussian processes or a neural network. As long as $\delta^{k} \to \epsilon$, Algorithm~\ref{alg:inexact_exact} returns an $\epsilon$-approximate \gls{MI-NE}. If the approximation error $\delta^{k}$ vanishes with the iteration index, instead, then Algorithm~\ref{alg:inexact_exact} produces a convergent sequence of strategy profiles to an exact \gls{MI-NE}. This assumption is not so stringent as it may seem. In the example considered above, i.e., agents endowed with learning procedures, asymptotic consistency bounds on the approximation error can be exploited directly \cite{simonetto2021personalized}. \section{Numerical Experiments}\label{sec:simulations} \begin{table} \caption{Simulation parameters} \label{tab:sim_val} \centering \begin{tabular}{llll} \toprule Symbol & Unit & Description & Value \\ \midrule $p_i$ & \euro/good & Selling price & $\sim\mc{U}(10, 20)\times10^{3}$\\ $m_i$ & \euro/good & Marginal cost & $\sim\mc{U}(7, 12)\times10^{3}$\\ $u_i^d$ & & Upper bound (discrete) & $\sim\mc{U}(200, 400)$\\ $u_i^c$ & & Upper bound (continuous)& $\sim\mc{U}(200, 400)$\\ $\tau^0$ & & Regularization parameter & $5000$\\ $x_i^0$ & & Initial goods vector & $\bs{0}_{100}$\\ $\{\delta^k\}$ & & Error tolerance sequence & $\tfrac{10^2 + (k^2 -1)\times10^{-6}}{k^2}$\\ $\epsilon$ & & Approximation tolerance & $10^{-6}$\\ \bottomrule \end{tabular} \end{table} We now test our theoretical findings on a numerical instance of a classic Cournot oligopoly model \cite{ConKluKraw04,Gabriel:2013us,sagratella2016computing}. Specifically, we consider a market in which $N = 20$ firms produce $n_{i} = 100$ goods each to maximize their profits. Here, the first $50$ products, $x_i^d$, are indivisible, while the other $50$, $x_i^c$, are modeled with continuous variables and hence $x_i = \mathrm{col}(x_i^d, x_i^c)$. Thus, each firm~$i \in \mc{I}$ aims at solving the following \gls{MI} quadratic program \begin{equation}\label{eq:cournot} \forall i \in \mc{I} : \left\{ \begin{aligned} &\underset{x_i}{\textrm{min}} && (m_i - p_i)^\top x_i + (\textstyle\sum_{j \in \mc{I}} C_{i,j} x_j)^\top x_i\\ &\textrm{ s.t. } && x^d_i \in \{0, u^d_i\}^{50}, \ x^c_i \in [0, u^c_i]^{50}, \end{aligned} \right. \end{equation} where the main parameters are described in Table~\ref{tab:sim_val}. Also, we define matrices $C_{i,j} \in \mathbb{R}^{100 \times 100}$, typically related with the costumers' inverse demand, according to the procedure described in \cite[\S 4]{sagratella2016computing} for all $j \geq i$, and then we impose $C_{j,i} = C^\top_{i,j}$. This degree of symmetry ensures the existence of a potential function for the \gls{MI-NEP} in \eqref{eq:cournot}, see, e.g., \cite{cenedese2019charging}, which has the form $$ P(\bs{x}) = \textstyle\sum_{i \in \mc{I}} \left( h_i(x_i) + \textstyle\sum_{j \in \mc{I}, j < i} g(x_i,x_j) \right) $$ with $h_i(x_i) \coloneqq (m_i - p_i)^\top x_i + x_i^\top C_{i,i} x_i$ and $g(x_i,x_j) \coloneqq x_j^\top C_{j,i} x_i$. In case the $(l,q)$-entry of matrix $C_{i,j}$ is nonnegative, the $q$-th product of the firm $j$ is a \emph{substitute} for the $l$-th product of firm $i$. On the other hand, if that entry is negative then the $q$-th product of the firm $j$ is a \emph{complement} for the $l$-th product of firm $i$. This framework resembles the 2-groups partitionable class in \cite{sagratella2016computing}. As an \gls{ICRF} for each agent, we adopted a piecewise affine approximation of the function $\rho_i(t_i) = \sum_{p=1}^{100} (1 - e^{0.9 |t_{i,p}|})$ applied componentwise ($t_{i,p}$ denotes the $p$-th element of $t_i \coloneqq y_i - x_i$). This is in order to handle each problem in \eqref{eq:cournot} with the solver used. \begin{figure*}[t] \begin{subfigure}{.7\columnwidth} \centering \includegraphics[width=\textwidth]{MINE_distance_2.eps} \caption{} \label{fig:MINE_distance} \end{subfigure} \begin{subfigure}{.7\columnwidth} \centering \includegraphics[width=\textwidth]{MINE_distance_approx.eps} \caption{} \label{fig:MINE_distance_approx} \end{subfigure} \begin{subfigure}{.7\columnwidth} \centering \includegraphics[width=\textwidth]{approx_error.eps} \caption{} \label{fig:approx_error} \end{subfigure} \caption{(a) Distance between the strategy profile $\bs{x}^k$ generated by Algorithm~\ref{alg:exact_ordinal} and an \gls{MI-NE}, averaged over the considered $50$ randomly generated instances of \eqref{eq:cournot}; (b) Distance between the strategy profile $\bs{x}^k$ generated by Algorithm~\ref{alg:inexact_exact} and an \gls{MI-NE} of the Cournot model in \eqref{eq:cournot}, averaged over the considered $50$ randomly generated instances. The sequence of strategy profiles $\{\bs{x}^k\}_{k \geq 0}$ converges to a $10^{-6}$-approximate \gls{MI-NE}; (c) Averaged evolution over $k$ of the approximation error measured by the solver in computing an inexact \gls{BR}, $\bs{\varrho}^k$ (red line) -- Algorithm~\ref{alg:inexact_exact}. This quantity is upper bounded by the error tolerance sequence $\{\delta^k\}_{k \geq 0}$ in Table~\ref{tab:sim_val} (blue line).} \label{fig:figures} \end{figure*} The numerical results reported in Figure~\ref{fig:figures} are obtained in Matlab by using Gurobi \cite{gurobi} as a solver on a laptop with a Quad-Core Intel Core i5 2.4\,GHz CPU and 8\,GB RAM. Specifically, we generate $50$ random instances of the considered \gls{MI-NEP} in \eqref{eq:cournot}, and test the behavior of Algorithm~\ref{alg:exact_ordinal} and \ref{alg:inexact_exact}, where each agent takes, on average, $0.0788$\,s to compute a \gls{BR} strategy. While Fig.~\ref{fig:figures}(a) shows the averaged convergence behavior of the sequence of \gls{MI} strategy profiles generated by Algorithm~\ref{alg:exact_ordinal}, which actually converge in less than $30$ iterations, Fig.~\ref{fig:figures}(b), instead, illustrates the averaged behavior of the sequence of sub-optimal \gls{MI} strategy profiles generated by Algorithm~\ref{alg:inexact_exact}, which converges to an $10^{-6}$-approximate \gls{MI-NE} of the Cournot model in \eqref{eq:cournot}. Note that the if-condition in the procedure generates a typical staircase behaviour and the convergence, in general, requires few more iterations. Finally, Fig.~\ref{fig:figures}(c) illustrates the averaged (over the agents) evolution of $\bs{\varrho}^k \coloneqq \mathrm{col}((\varrho_i^k)_{i \in \mc{I}})$, which corresponds to the approximation error actually made in computing an inexact \gls{BR}. Each $\varrho_i^k$, indeed, denotes the distance returned by the solver between the inexact and exact \gls{BR} solutions made by agent $i$ at the $k$-th iteration. The quantity $\boldsymbol{1}^\top \bs{\varrho}^k/N$ is always upper bounded by the error sequence $\{\delta^k\}_{k \geq 0}$ reported in Table~\ref{tab:sim_val}, as expected. \section{Conclusion} \label{sec:conclusion} We have presented two proximal-like equilibrium seeking algorithms for \glspl{NEP} with mixed-integer variables admitting either generalized ordinal or exact potential functions. Exploiting the properties of integer-compatible regularization functions used as penalty terms in the agents' cost functions is key to prove convergence both in case the agents pursue an exact optimal strategy or an approximated one. Future research directions include, but are not limited to, the extension of the proposed algorithms to generalized \glspl{MI-NEP} as well as developing their stochastic counterparts. There are also interesting computational questions to investigate. From the proximal-point interpretation of the feasibility pump, large penalty parameters enforce integer restrictions. One possibility to approach this within the proposed equilibrium seeking algorithms is to design a double loop procedure with large penalties at the beginning of the scheme. \balance
fec7ebd0a34822403805a78a9291aaab59bff2e7
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Gliomas are the most common primary brain malignancies and are a serious threat to public health. Accurate identification of tumors can help doctors achieve more reasonable diagnosis and treatment strategies. As a high-accuracy identification method, tumor segmentation can help in a variety of clinical applications, such as radiation therapy planning \cite{kiljunen2020deep, kuisma2020validation, agn2019modality}, tumor growth monitoring \cite{kickingereder2019automated}, intra-operative assistance \cite{hollon2020near, tanzi2021real}, etc. However, it is very time-consuming to manually label the tumor location by medical experts, and the labeling accuracy may be insufficient. Therefore, it is very important to develop an automatic segmentation method. However, the contour of the lesion area can only be determined by the change of the pixel intensity relative to the surrounding tissues. In addition, many MR images have gray offset fields such as motion artifact which may cause either ghost images or diffuse image noise, making it difficult to accurately segment the contour. The variation in size, extension, and position of tumor also makes segmentation algorithms unable to use strong prior constraints similar to normal tissue in shape and location parameters. Recently, convolutional neural networks (CNN) have made significant progress in solving challenging tasks such as classification, segmentation and object detection \cite{he2016deep, girshick2014rich, long2015fully}. Fully convolutional network (FCN) \cite{long2015fully} first achieves end-to-end semantic segmentation with satisfactory results. It also has an excellent performance in medical image segmentation. Ronneberger et al. \cite{ronneberger2015u} propose U-Net with the encoder-decoder structure to generate a dense prediction of the entire image. After that, a variety of U-Net variants based on the encoder-decoder architecture have emerged in an endless stream, and have achieved convincing results \cite{xiao2018weighted, cai2020dense, ibtehaz2020multiresunet, zhou2018unet++, huang2020unet}. For brain tumor segmentation task, the state-of-the-art methods \cite{nuechterlein20183d, chen2018s3d, isensee2018no, myronenko20183d, jiang2019two, islam2019brain, chen20193d, xu2019deep} are based on the 3D U-Net \cite{cciccek20163d} which is a 3D encoder-decoder architecture with skip connections. However, it is difficult to establish connections between long-distance voxels due to the small size of convolution kernel. Same as long-distance dependence, we attempt to capture global semantic information in medical images, which refers to the relationship between any two points in the image/matrix with no consideration of the physical distance between them. However, this limitation of convolution kernel brings difficulties to learn global semantic information which can effectively guide the model to segment. Moreover, in the process of establishing connections between distant pixels, over-segmentation or under-segmentation will be suppressed. In order to capture long-range dependency in feature map, one possible way is to repeatedly stack convolutional layers to increase the receptive field. However, this solution is computationally expensive, especially in 3D convolution and may result in model optimization difficulties. Yu et al. \cite{yu2015multi} try to solve this problem using dilated convolution, but still only expand the receptive field at the local feature scale. Stacked dilated convolution will also cause gridding effect and loss the continuity of information. This is fatal for the task of pixel-level dense prediction such as semantic segmentation. The attention mechanism \cite{vaswani2017attention} has been increasingly explored to model long-range dependency for computer vision tasks \cite{wang2018non, zhu2019asymmetric, fu2019dual, huang2019ccnet, yu2020context}. The essence of it is to get the weights that describe the similarity between features, and then re-weight the features by these weights. For instance, in semantic segmentation, Non-local neural networks \cite{wang2018non} perform two matrix multiplications, one for generating attention map and the other for updating original feature maps, which is a typical self-attention module (Figure.~\ref{fig:comparison-attention.sub1}). The attention map calculated by the first matrix multiplication represents the similarity (relationship) between each pixel in the feature map and any other pixel. In fact, this similarity matrix can be seen as a kind of auto-correlation, targeting to find the parts with high similarity in itself. In the second step, the matrix multiplication uses this similarity as a weighting coefficient to weight the original feature map to obtain a new feature map enhanced by global information. The attention mechanism is also used in medical image segmentation and previous works have proved the importance of long distance dependency \cite{oktay2018attention, zhou2020one, zhou2020multi}. Oktay et al. \cite{oktay2018attention} combined the self-attention mechanism with 3D-UNet, and successfully guided the network to model the global information through the attention gating module embedded in skip connections. However, none of these methods can escape the matrix multiplication framework, which has two problems -- instability of the attention map and high computational complexity. Tan et al. \cite{tan2020explicitly} describes the problem that the attention map is not intuitive. Their visualization results of the attention map show that content-dependent key and query play a minor role in the final attention-maps. In addition, Zheng et al. \cite{zheng2019looking} proved that it is difficult to learn multiple consistent (i.e., attending on the same part for each sample) attention maps without annotations in the attention mechanism. High computational complexity is a recognized problem for attention mechanism. CCNet \cite{huang2019ccnet} explains that for dense prediction tasks such as semantic segmentation, where high-resolution feature maps are required. However, non-local (matrix multiplication) based attention methods have a high computational complexity of $O(N^2)$ for 2D images and consume a large GPU memory footprint. This problem is more severe on 3D images. CPNet \cite{yu2020context} introduces a context prior (CP) layer based on the attention mechanism, which contains a CP map similar to attention map. Due to the lack of explicit modeling, the attention map is difficult to generate clear structural information. Therefore, the CP map is obtained via a convolution layer in a supervised manner instead of matrix multiplication, making this similarity matrix more accurate and stable. However, the CP map comes from a local feature map with only one convolution directly, which means parameters before the feature map are shared for optimizing the CP map and label prediction and will cause learning difficulties during the training process. Moreover, the size of the CP map is still large and the update method of the original feature map is remains as matrix multiplication. Although the aforementioned attention mechanisms can improve model’s capability of capturing long-range dependency, there are some challenges in the implementation process. In order to overcome these limitations, our work can be summarized as follows: 1) We propose a novel Supervised Attention Module (SAM) with an attention convolution (conv) path to construct the attention map from input images by using a series of convolutions and utilizing the accurate guidance from ground truth supervision. 2) To reduce the computational complexity, we redefine the form of attention map in SAM to have a much smaller size. Moreover, we design a new approach called “intra-class update” to reconstruct the feature map according to the category without using matrix multiplication. These two improvements significantly reduce the computational cost. 3) The general attention mechanism aggregates intra-class information through the similarity between pixels but ignores the differences between classes. To this end, we propose a novel inter-class distance optimization method to expand distances among classes, making it easier to distinguish pixels of different classes. \begin{figure}[ht] \centering \includegraphics[width=1\linewidth]{Fig1_overview.pdf} \caption{Overview of the proposed category guided attention U-Net (CGA U-Net).} \label{fig:overview} \end{figure} Our proposed segmentation approach is called Category Guided Attention U-Net (CGA U-Net) (Figure.~\ref{fig:overview}) and achieves the state-of-the-art performance on the BraTS2019 dataset. Next, we articulate CGA U-Net in the following section. \section{Related work} \subsection{Medical Image Segmentation} Medical image segmentation aims to automatically divide various areas in medical images to help doctors achieve more efficient and accurate diagnoses. Early image segmentation methods including thresholding \cite{manikandan2014multilevel}, clustering-based \cite{gomez2015fuzzy}, etc. have achieved some effects in specific circumstances. However, different from RGB images, medical images have the characteristics of a single scene, low contrast and more noise. Therefore, these methods cannot satisfactorily solve the problem of medical image segmentation. In recent years, algorithms based on convolutional neural networks have been explored in the field of medical image segmentation and have achieved good results \cite{ronneberger2015u, xiao2018weighted, cai2020dense, ibtehaz2020multiresunet, zhou2018unet++, huang2020unet, cciccek20163d, milletari2016v, nuechterlein20183d, chen2018s3d, isensee2018no, myronenko20183d, jiang2019two, islam2019brain, chen20193d, xu2019deep}. For both 2D and 3D medical image segmentation tasks, most methods adopted encoder-decoder architecture with skip connections based on U-Net \cite{ronneberger2015u}. The decoder can gradually upsample the features extracted by the encoder to the original size, thereby achieving pixel-level classification. To recover the pixel-level classification map of the image, \cite{xiao2018weighted, cai2020dense, ibtehaz2020multiresunet} try to modify the basic unit and upsampling structure in encoder-decoder. \cite{zhou2018unet++, huang2020unet} enable the model to extract richer feature representations by improving the skip connection method. \subsection{Attention Mechanism} The attention mechanism can be seen as a technique for incorporating global information by finding the relationship between any two pixels in an image. This long-range dependency is critical for pixel-level tasks like semantic segmentation. Non-local \cite{wang2018non} developed a template of two-step matrix multiplications for visual attention and was widely adopted by subsequent methods. Asymmetric non-local method \cite{zhu2019asymmetric} samples the pixels of feature maps, thereby reducing the computation and memory cost without sacrificing the performance. DANet \cite{fu2019dual} combines spatial attention with channel attention to capture long-range dependency among feature maps. CCNet \cite{huang2019ccnet} reduces the computation by decomposing the two dimensions of the attention map while retaining good results. \begin{figure}[ht] \centering \subcaptionbox{Self Attention Module \label{fig:comparison-attention.sub1}}{ \includegraphics[width=0.7\textwidth]{Fig2a_self_attention_module.pdf} } \subcaptionbox{CP Layer \label{fig:comparison-attention.sub2}}{ \includegraphics[width=0.7\textwidth]{Fig2b_cp_layer.pdf} } \subcaptionbox{Supervised Attention Module \label{fig:comparison-attention.sub3}}{ \includegraphics[width=0.7\textwidth]{Fig2c_sam.pdf} } \caption{Comparison of different attention modules. (a) classic self-attention module, (b) context prior layer \cite{yu2020context}, and (c) the proposed supervised attention module (SAM).} \label{fig:comparison-attention} \end{figure} A typical self-attention structure is shown in Figure.~\ref{fig:comparison-attention.sub1}. Without loss of generality, the module is described in 2D here for notation clarity. Extension to 3D is straightforward. Consider a local feature map $X\in\mathbb{R}^{C\times H \times W}$, where $C$, $H$ and $W$ indicate the channel number, spatial height and width, respectively. The attention module first applies three 1$\times$1 convolutions {$W_{q}$}, {$W_{k}$}, {$W_{v}$} and a reshape operation {$R$} to generate three matrices $\{Q, K, V\}\in\mathbb{R}^{C^{'}\times N}$ which can be written as \begin{equation} \small Q=R(W_{q}(X)), K=R(W_{k}(X)), V=R(W_{v}(X)), \end{equation} where $C^{'}$ is the channel number after the convolution and $N=H\times W$. Then a matrix multiplication and the softmax normalization function {$f$} are applied to $Q$ and $K^T$ to obtain the attention map $S\in\mathbb{R}^{N \times N}$ as \begin{equation} \small S=f(Q \times K^T). \end{equation} With this similarity matrix, we can reconstruct matrix $V$ using another multiplication and reshape operation. Finally, the output $Y\in\mathbb{R}^{C \times H \times W}$ is given by \begin{equation} \small Y=R(V \times S) + X. \end{equation} This attention structure has some inherent limitations. On one hand, it is computationally expensive given the large size of attention map. On the other hand, experiments implemented by CPNet \cite{yu2020context} prove that the attention map lacking an explicit modeling cannot produce effective structural information for object segmentation, which has a shortcoming of instability and may result in inaccurate description. Instead of matrix multiplication, context prior (CP) layer \cite{yu2020context} employs convolution and reshape operations to get the CP map $P$ with the same dimension as $S$, as illustrated in Figure.~\ref{fig:comparison-attention.sub2}. The process can be formulated as \begin{equation} \small P = R(Conv(X)). \end{equation} At the same time, the down-sampled ground truth $GT$ is encoded into $L \in \mathbb{R}^{C_l \times H \times W}$ with the one-hot encoding, where $C_l$ denotes the number of classes. Then the affinity map $A \in \mathbb{R}^{C_l \times H \times W}$ is produced by a multiplication between $L$ and $L^T$, i.e. \begin{equation} \small L = Onehot(GT), \quad A = L \times L^T. \end{equation} The CP layer uses the affinity map to supervise the CP map, which can correct the unstable description and improve the accuracy. However, the scale of the CP map is still quite large, and there will be a lot of redundant information when updating the local feature map using multiplication. The CP map actually attempt to establish a fully connected relationship between all pixels and the pairwise similarity measurement leads to massive consumption of computation and memory cost. In fact, describing the information among pixels of the same category does not require such a large-scale fully connected graph of pairwise relationship. There are some works \cite{huang2019ccnet, chen2020compressed} aiming to eliminate redundant information and reduce consumption of computation by compressing the attention calculation process, which is effective to a certain extent. Moreover, the CP layer converts the feature map $X\in\mathbb{R}^{C \times H \times W}$ into $P\in\mathbb{R}^{HW\times H \times W}$ through a convolution layer, which will cause the physical meaning of the feature map to change. The CP map (size of $HW \times HW$) describes the relationship between any two points in the image (a total of $H \times W$ points), but the first dimension of CP map is actually the channel dimension, which does not well represent the relationship between a certain point and other points (spatial dimensions). This may give rise to difficulties in optimizing parameters. Getting CP map from local feature map directly through a convolution will also cause conflicts between the affinity loss used for supervising CP map and the loss for class label prediction in back propagation because they share the parameters before local feature map. For medical image segmentation, there are also some methods that attempt to combine the attention mechanism with the encoder-decoder structure \cite{oktay2018attention, abraham2019novel, jiang2019ahcnet, ni2019raunet, sinha2020multi}. Attention U-Net \cite{oktay2018attention} uses the attention gate module to pay attention to target structures of varying shapes and sizes. Multi-scale self-guided attention \cite{sinha2020multi} eliminates redundant information and focuses on discriminative features by modeling richer contextual dependencies with multi-scale self-attention. The major step in the attention mechanism is to obtain the attention weight. However, due to the lack of supervision information, these aforementioned attention algorithms based on the matrix multiplication framework may cause the instablity of the attention weight. Moreover, the calculational burden of matrix multiplication also makes the implementation blocked. \subsection{Intra-class \& inter-class methods} In computer vision classification tasks, the minimization of intra-class distance is used to ensure consistency within a certain class, and the optimization method of inter-class distance is used to amplify the difference between classes. Ming et al. \cite{ming2017simple} design a class-wise triplet loss based on intra/inter-class distance metric learning. By calculating the center of the positive/negative sample, the intra-class distance of the feature is minimized and the inter-class distance is maximized. Semantic segmentation is a pixel-level classification task. It is necessary to enhance the intra-class consistency between pixels and optimize the inter-class distance to obtain more robust segmentation result. Yu et al. \cite{yu2018learning} use multi-scale information and global average pooling to implicitly solve the problem of inconsistencies within the class. Moreover, the boundary information is adopted to enhance inter-class distinction. Different from the above methods, we use global semantic information to explicitly find pixels belonging to the same category with the help of a supervised attention map. By finding the prototype vector of each category, on the one hand, the auto-correlation of the attention mechanism is realized through re-weighting, and on the other hand, the distance between classes is optimized. \section{Methodology} \subsection{Overview of the Category Guided Attention U-Net} An overview of the proposed Category Guided Attention U-Net (CGA U-Net) is presented in Figure.~\ref{fig:overview}. The baseline we used in experiments (including ablation study) is the U-Net with some modifications, and the details of our network structure are provided in Table.~\ref{tab:network_details}. Specifically, an attention convolution path is injected to generate the attention map from the input. Then the attention map is utilized to guide the intra-class update process of the feature map and optimize the inter-class distance simultaneously. There are three losses in our network. The main loss uses softmax dice loss to optimize the segmentation results and the attention map loss adopts mean squared error (MSE) loss for supervising the attention map. As mentioned before, we design $loss_{inter}$ to optimize the inter-class distance. These three losses are denoted as $L_{M}$, $L_{A}$, $L_{I}$ respectively in Figure.~\ref{fig:overview}. In the training process, the optimization of loss is divided into two stages. In the first 20 epochs, we add $L_{M}$ and $L_{A}$ together as the overall loss while after 20 epochs the overall loss is the sum of the three losses. We set a weight for $L_{I}$ to keep it at the same order of magnitude as the other two loss functions. In addition, the weights of $L_{M}$ and $L_{A}$ are the same and we fixed them in all experiments. To avoid optimizing difficulties caused by the conversion aforementioned, we redefine the form of attention map to have a smaller size and channel dimension. An independent attention convolution (conv) path is added to eliminate conflicts between the two losses. With the new form of attention map, we design new methods to update the feature map based on categories, which can reduce the computational complexity. \subsection{New Attention Map Form} In the proposed SAM, we develop an attention path to directly obtain the attention map from the original input $I$ through a series of convolutions, as demonstrated in Figure.~\ref{fig:comparison-attention.sub3}. Different from self-attention and context prior (CP) block, the size of our attention map is decreased from $N \times N$ to $C_{l} \times H \times W$ ($C_l$: the number of classes) and the attention map is represented as \begin{equation} \small S = Conv(I). \end{equation} Accordingly, we encode the down-sampled ground truth into one-hot form to get the category guided map $G$, which has the same size as $S$. Each $1 \times C_{l}$ vector in $G$ is composed of a single high value (1) while the others are low (0). Each channel of $G$ represents the pixel distribution of a single category. Then the attention map is supervised by the category guided map for learning category-based attention information. The attention map arranged by category can more accurately aggregate pixels of the same class and differentiate pixels of different classes. \begin{figure}[ht] \centering \subcaptionbox{Intra-class update method \label{fig:intra.sub1}}{ \includegraphics[width=0.45\textwidth]{Fig3a_intra_class.pdf} } \hfill \subcaptionbox{Inter-class distance optimization \label{fig:intra.sub2}}{ \includegraphics[width=0.45\textwidth]{Fig3b_inter_class.pdf} } \caption{Intra-class update method and Inter-class distance optimization.} \label{fig:intra} \end{figure} \subsection{Intra-class Update Method} After obtaining the attention map, we propose a novel category-based approach to update the local feature map called the intra-class update method. As illustrated in Figure.~\ref{fig:intra.sub1}, given a local feature map $X\in\mathbb{R}^{C\times H \times W}$, we regard each pixel as a $1 \times C$ vector, and there are a total of $H \times W$ vectors. Then the attention map is disassembled according to categories, and each category corresponds to a mask $M_k\in\mathbb{R}^{H \times W}$. For each mask, we generate the corresponding prototype vector $p_k$ through masked average pooling. Specifically, we take out the feature vectors of pixels belonging to a certain category, and calculate their average value as the prototype vector of this category: \begin{equation} \small p_k = \frac{1}{\sum_{i=1}^{H \times W} w_i} \sum_{i=1}^{H \times W}x_i \times w_i, \end{equation} where $x_i$ is the vector in feature map, $w_i$ is the weight in mask and $i$ indicates the position. Then the prototype vector of each category is mapped back to the size of the local feature map according to the mask as \begin{equation} y_i = map(p_k, M_k), \end{equation} where $y_i$ is the vector in the feature map after mapping. Finally, the regenerated feature maps of all the categories are added to obtain the final result. Through this intra-class update method, we can effectively aggregate pixels of the same category. \subsection{Inter-class Distance Optimization} Considering that there may be similar pixels among different categories, we propose an inter-class distance optimization method (Figure.~\ref{fig:intra.sub2}) to make it easier for distinguishing these pixels. Based on the existing prototype vector of each category, we compute the Euclidean distance between every two of them. The sum of all distances represents the inter-class distance of the feature map and is denoted as \begin{equation} \small D = \sum_{0<i, j\le Cl} E(p_i, p_j), \end{equation} where $E$ denotes the Euclidean distance between two vectors. Our optimization goal is to maximize the inter-class distance, so we define an inter-class loss as follows \begin{equation} loss_{inter} = \log \frac{1}{1+D}, \end{equation} where $D$ represents the inter-class distance. We can minimize $loss_{inter}$ in the training process in order to optimize the distance. \begin{table*}[h] \scriptsize \centering \caption{Detailed description of our network structure.} \label{tab:network_details} \setlength{\tabcolsep}{3mm}{ \begin{tabular}{c|c|c|c|c} \hline & Name & Details & Repeat & Size \\ \hline & Input & - & - & $4\times128\times128\times 128$ \\ \hline \multirow{8}{*}{Encoder} & InitConv & Conv3, Dropout & 1 & $16\times128\times128\times128$ \\ \cline{2-5} & EnBlock1 & BN, ReLU, Conv3, BN, ReLU, Conv3, + & 1 & $16\times128\times128\times128$ \\ \cline{2-5} & EnDown1 & Conv3 (stride 2) & 1 & $32\times64\times64\times64$ \\ \cline{2-5} & EnBlock2 & BN, ReLU, Conv3, BN, ReLU, Conv3, + & 2 & $32\times64\times64\times64$\\ \cline{2-5} & EnDown2 & Conv3 (stride 2) & 1 & $64\times32\times32\times32$ \\ \cline{2-5} & EnBlock3 & BN, ReLU, Conv3, BN, ReLU, Conv3, + & 2 & $64\times32\times32\times32$\\ \cline{2-5} & EnDown3 & Conv3 (stride 2) & 1 & $128\times16\times16\times16$ \\ \cline{2-5} & EnBlock4 & BN, ReLU, Conv3, BN, ReLU, Conv3, + & 4 & $128\times16\times16\times16$\\ \hline \multirow{8}{*}{Decoder} & DeUp3 & Conv3, ConvT, EnBlock3(Concate), Conv3& 1 & $64\times32\times32\times32$ \\ \cline{2-5} & DeBlock3 & BN, ReLU, Conv3, BN, ReLU, Conv3, + & 1 & $16\times128\times128\times128$ \\ \cline{2-5} & DeUp2 & Conv3, ConvT, EnBlock2(Concate), Conv3 & 1 & $32\times64\times64\times64$ \\ \cline{2-5} & DeBlock2 & BN, ReLU, Conv3, BN, ReLU, Conv3, + & 1 & $32\times64\times64\times64$\\ \cline{2-5} & DeUp1 & Conv3, ConvT, EnBlock2(Concate), Conv3 & 1 & $16\times128\times128\times128$ \\ \cline{2-5} & DeBlock1 & BN, ReLU, Conv3, BN, ReLU, Conv3, + & 1 & $16\times128\times128\times128$\\ \cline{2-5} & EndConv & Conv1 & 1 & $4\times128\times128\times128$ \\ \cline{2-5} & Softmax & Softmax & 1 & $4\times128\times128\times128$ \\ \hline \multirow{3}{*}{\makecell[c]{Attention \\ Conv Path}} & AttConv1 & Conv3 (stride 2) & 1 & $16\times64\times64\times64$ \\ \cline{2-5} & AttConv2 & Conv3 (stride 2) & 1 & $16\times32\times32\times32$ \\ \cline{2-5} & AttConv3 & Conv3 (stride 2) & 1 & $4\times16\times16\times16$ \\ \hline \end{tabular} } \end{table*} \section{Experiments and Results Analysis} \subsection{Datasets and Evaluation Metrics} The dataset we used in the experiment is the 3D MRI data provided by the Brain Tumor Segmentation (BraTS) 2019 challenge \cite{menze2014multimodal, bakas2017advancing, bakas2018identifying, bakas2017segmentation}. It consists of four different MR sequences, namely native T1-weighted (T1), post-contrast T1-weighted (T1ce), T2-weighted (T2) and Fluid Attenuated Inversion Recovery (FLAIR). The volume of each sequence is $240\times240\times155$, and has been aligned in the same space. The labels used for tumor segmentation include background (label 0), necrotic and non-enhancing tumors (label 1), peritumoral edema (label 2), and GD-enhancing tumors (label 4). The dataset contains 335 patients for training and 125 for validation. Although the current test set result submission channel has been closed, the performance on validation set can still be verified by the online evaluation server. Formally, the effectiveness is evaluated by the computational complexity and the segmentation accuracy. The complexity is determined by the amount of network parameters and FLOPs (i.e. multiplication and addition). The segmentation accuracy in our experiments is measured by the Dice score and the Hausdorff distance (95\%) for validation set. Moreover, We adopt Hausdorff distance (100\%) in the cross-validation experiment to show the impact of possible outliers. Each metric can be computed for the enhancing tumor region (ET, i.e. label 1), the whole tumor region (WT, i.e. labels 1, 2 and 4), and the regions of the tumor core (TC, i.e. labels 1 and 4). \subsection{Implementation Details} In our experiments, we use a batch size of 8 and train the CGA U-Net on 4 Nvidia Titan RTX GPUs (each has 24GB memory) for 500 epochs. The Adam optimizer is used with an initial learning rate of 0.001. We apply the following data augmentation techniques: (1) random cropping the MRI data from $240\times240\times155$ voxels to $128\times128\times128$ voxels; (2) random mirror flipping across the axial, coronal and sagittal planes by a probability of 0.5; (3) random intensity shift between $[-0.1, 0.1]$ and scale between $[0.9, 1.1]$. The softmax Dice loss is employed to train the network. $L2$ norm is applied for model regularization with a weight decay rate of $10^{-5}$. All of our experiments use the same initialization method and training from scratch. In addition, we fixed the seeds in all experiments to ensure that the results can be reproduced. \subsection{Experimental Results} We compare our method with the state-of-the-art approaches on the BraTS 2019 validation set. To be fair, we compare with the 3D methods and conduct experiments under the same parameter configuration. From Table.~\ref{tab:comparison}, our proposed GCA U-Net achieves dice scores of $78.83\%$, $89.29\%$, $82.32\%$ on ET, WT, TC, respectively. In particular, considerable gains ($1.73\%$ and $1.02\%$) have been achieved for the important ET and TC. Large improvements are also observed in terms of Hausdorff distance measure. Compared with Attention U-Net, our method shows great superiority in all metrics by supervising the attention map. Compared with nnU-Net, our method has a clear advantage on ET and slightly lower on TC and WT. However, the parameters and FLOPs of nnU-Net are 31.2M and 475.7G, respectively, while the corresponding values of our CGA U-Net are 4.77M and 151.12G. We obtain comparable results to nnU-Net with minimal computational complexity. \begin{table}[!t] \scriptsize \centering \caption{Performance comparison on the BraTS 2019 validation set.} \label{tab:comparison} \setlength{\tabcolsep}{3mm}{ \begin{tabular}{l|c|c|c|c|c|c} \hline \multirow{2}{*}{Method} & \multicolumn{3}{c}{Dice Score (\%) $\uparrow$} & \multicolumn{3}{|c}{Hausdorff Distance(mm) $\downarrow$} \\ \cline{2-7} & \bfseries ET & \bfseries WT & \bfseries TC & \bfseries ET & \bfseries WT & \bfseries TC\\ \hline 3D U-Net & 70.86 & 87.38 & 72.48 & 5.062 & 9.432 & 8.719\\ V-Net & 73.89 & 88.73 & 76.56 & 6.131 & 6.256 & 8.705\\ KiU-Net \cite{valanarasu2020kiu} & 73.21 & 87.60 & 73.92 & 6.323 & 8.942 & 9.893\\ Attention U-Net & 75.96 & 88.81 & 77.20 & 5.202 & 7.756 & 8.258\\ Wang et al. \cite{wang20193d} & 73.70 & 89.40 & 80.70 & 5.994 & 5.677 & 7.357\\ Li et al. \cite{li2019multi} & 77.10 & 88.60 & 81.30 & 6.033 & 6.232 & 7.409\\ nnU-Net \cite{isensee2021nnu} & 74.80 & 90.81 & 83.90 & 3.77 & 4.36 & 6.42\\ \bf{Ours} & 78.83 & 89.29 & 82.32 & 3.262 & 5.809 & 6.721\\ \hline \end{tabular} } \end{table} The parameter size and computational cost (FLOPs) of three different attention modules are compared in Table.~\ref{tab:complexity}. FLOPs generated by convolution and matrix multiplication are both taken into account. The parameters of the convolutional layer is $C_{in} \times K_h \times K_w \times K_d \times C_{out}$, where $K$ indicates the kernel size and $C$ refers to the number of channels. FLOPs generated by a convolution layer is calculated as $C_{in} \times K_h \times K_w \times K_d \times H \times W \times D \times C_{out}$, where $H, W, D$ are the size of the input feature map. Assuming that the dimensions of the two matrices are $A \times B$ and $B \times C$, then the FLOPs generated by the multiplication of these two matrices are $A \times B \times C$. The proposed SAM only has 0.675G FLOPs and 0.095M parameters, which is a very lightweight part of the whole network. Experiments show that our SAM module achieves better results with minimal computational overhead. \begin{table}[ht] \scriptsize \centering \caption{Computational complexity comparison of different attention modules.} \label{tab:complexity} \setlength{\tabcolsep}{5mm}{ \begin{tabular}{l|c|c|c} \hline \bfseries Module & \bfseries Downsampling Rate & \bfseries FLOPs(G) & \bfseries Para.(M)\\ \hline Self-Attention & 8 & \makecell[c]{4.495} & \makecell[c]{0.492}\\ CP Block & 8 & \makecell[c]{2.284} & \makecell[c]{0.328}\\ SAM(Ours) & 8 & \makecell[c]{0.675} & \makecell[c]{0.095}\\ SAM(Ours) & 4 & \makecell[c]{1.97} & \makecell[c]{0.034}\\ SAM(Ours) & 2 & \makecell[c]{2.89} & \makecell[c]{0.01}\\ \hline \end{tabular} } \end{table} In order to illustrate the sensitivity of SAM to the down-sampling rate, we calculate and analyse the parameters and FLOPs of SAM in Table.~\ref{tab:complexity}. The parameters of SAM mainly come from the convolution kernels of the attention convolution path. When the down-sampling rate of Ground Truth is reduced, the number of convolution kernels for down-sampling will be decreased, leading to a decline in the amount of SAM parameters. In order to ensure that we can learn an effective attention map, the number of convolution layers and channels can be adjusted flexibly. Therefore, the change of the parameters should be determined according to the actual situation. The main growth of FLOPs comes from the convolution part with the increase of the size of Ground Truth, but it will not boost as sharply as matrix multiplication. \begin{figure*}[ht] \centering \includegraphics[width=1\textwidth]{Fig4_vis_prediction.pdf} \begin{tabu} to 0.85\linewidth{ X[1.0c] X[1.0c] X[1.0c] X[1.0c] X[1.0c]} U-Net3D & VNet & \small{Attention U-Net} & Ours & Ground Truth \\ \end{tabu} \caption{The visual comparison of MRI brain tumor segmentation results.} \label{fig:vis-prediction} \end{figure*} In addition, we provide visualization of segmentation results of different methods in Figure.~\ref{fig:vis-prediction}. It should be noted that in the visualization experiment, we select 80\% of the data for training, and the remaining 20\% for testing and visualization. Since our method can capture stable and accurate global context information, it is very effective in repairing missing tumor details and suppressing over-segmentation. \subsection{Ablation Study} \textbf{Attention Convolution Path.} In order to compare the way the CP Layer obtains the attention map and our Attention Convolution Path, we record the attention map loss during the training process. At first, we remove the attention conv path and use a convolution layer (which CP Block used) to obtain the attention map. As shown by the blue line in Figure.~\ref{fig:attention-loss}, the change of the attention loss without attention conv path during the training process was plotted. In addition, we let the red line represent the attention loss curve using our attention conv path. It can be clearly seen that the blue line fluctuates significantly in the early stages of training and finally converges to a larger value. Our attention loss can quickly converge to the ideal state during training. This result proves that using the CP map way to obtain the attention map may have optimization problems during training process. Actually, the Main Loss is difficult to converge without the attention conv path. At the same time, the structure of the attention conv path can also be flexibly adjusted to adapt to different situations. \begin{figure*}[ht] \centering \includegraphics[width=0.65\textwidth]{Fig5_attention_loss.pdf} \caption{The visual comparison of the attention loss during training with/without attention conv path.} \label{fig:attention-loss} \end{figure*} \begin{table*}[ht] \scriptsize \centering \setlength{\tabcolsep}{3mm}{ \begin{tabular}{l|c|c|c|c|c|c} \hline \multirow{2}{*}{Method} & \multicolumn{3}{c}{Dice Score (\%) $\uparrow$} & \multicolumn{3}{|c}{100\% Hausdorff Distance(mm) $\downarrow$} \\ \cline{2-7} & \makecell[c]{\bfseries ET\\ class4} & \makecell[c]{\bfseries WT\\ class1\&2\&4} & \makecell[c]{\bfseries TC\\ class1\&2} & \makecell[c]{\bfseries ET\\ class4} & \makecell[c]{\bfseries WT\\ class1\&2\&4} & \makecell[c]{\bfseries TC\\ class1\&2}\\ \hline Baseline & 74.47 & 88.35 & 79.75 & 29.860 & 52.748 & 28.481\\ Baseline + Intra & 78.60 & \textbf{90.07} & 81.66 & 18.173 & 35.034 & 25.300\\ Baseline + Intra (class1) & 77.16 & 89.92 & 81.17 & 23.448 & 40.934 & 24.253\\ Baseline + Intra (class2) & 77.64 & 89.03 & 82.30 & 22.962 & 50.669 & 24.042\\ Baseline + Intra (class4) & 77.96 & 89.56 & 80.91 & 24.021 & 46.688 & 27.859\\ Baseline + Inter & 78.09 & 89.33 & 82.54 & 18.783 & 45.704 & 19.938\\ Baseline $-$ Inter & 73.71 & 87.57 & 78.21 & 35.674 & 53.793 & 29.140\\ Baseline + Intra + Inter & \textbf{79.21} & 89.8 & \textbf{83.46} & \textbf{17.418} & \textbf{32.440} & \textbf{19.833}\\ \hline \end{tabular} } \caption{Results of the 5-fold cross-validation on the BraTS 2019 training set.} \label{tab:ablation} \end{table*} \textbf{Intra-class and Inter-class methods.} In order to verify the effectiveness of intra-class update method and inter-class distance optimization, we conduct ablation experiments as illustrated in Table.~\ref{tab:ablation}. We make some modifications to the U-Net and use it as the baseline in our experiments. The details of the network can be found in Table.~\ref{tab:network_details}. Baseline + Intra indicates using the intra-class update method to reconstruct all the classes in feature maps. For a more detailed category update effect, we conduct three extra experiments by updating only one class in the feature map (e.g. class1, class2 or class4) with the help of intra-class update. The performance comparison with the intra-class update method for different classes demonstrates that the SAM can improve the result for each corresponding class. For example, the experiment only updating class4 has the most obvious improvement on the accuracy for ET. Moreover, the inter-class distance optimization method also boosts the Dice score for ET and TC. Using the two methods together can achieve the best result which has an improvement of $4.74\%$, $1.45\%$, $3.71\%$ for ET, WT and TC, respectively. Moreover, in order to analyze whether our inter-class distance optimization can really increase the distance between different categories, we reverse the sign of Equation 10 during the training process and performed an Baseline $-$ Inter experiment as shown in the second last row of Table.~\ref{tab:ablation}. Therefore, the optimization direction of $L_I$ is to minimize the inter-class distance. Since the $L_I$ is not used for back propagation in the first 20 epochs, the inter-class distance will gradually increase as the model learns. After 20 epochs, $L_I$ join the back propagation and make the inter-class distance decrease and converge. Under the influence of this reverse optimization, the prediction results deteriorate significantly. \begin{figure}[htb] \centering \includegraphics[width=0.9\linewidth]{Fig6_vis_feature.pdf} \begin{tabu} to 0.9\linewidth{ X[1.0c] X[1.0c] X[1.0c] X[1.0c] X[1.0c] X[1.0c] X[1.0c] X[1.0c] X[1.0c]} \small{Before} & \small{After} & \small{GT} & \small{Before} & \small{After} & \small{GT} & \small{Before} & \small{After} & \small{GT} \end{tabu} \caption{Visualization of feature map before and after update by SAM. GT: Ground Truth. Redder point indicates a larger value, and bluer point indicates a smaller value. } \label{fig:vis-feature} \end{figure} To further explore the role of SAM in reconstructing feature maps, we visualize the feature maps before and after reconstruction according to channels using both two methods in Figure.~\ref{fig:vis-feature}. These visualizations can be regarded as heatmaps, which red indicates a larger value and blue indicates a smaller value. Compared with the ‘before’ image, for all pixels belonging to the background, the value in ‘after’ image has a higher degree of similarity and confidence in this category. As a result, there will be a clearer outline in the visualization and it is also closer to the shape of the label. Moreover, the tumor regions in the feature maps have different values compared to other parts and display in different colors after visualization. We can see that the updated feature map has a clearer outline and inter-class contrast in the tumor region. In addition, the contrast between other areas of the brain (background) is decreased, which significantly reduces interference with tumor segmentation. \subsection{Attention Map \& Prediction Visualization} \begin{figure}[htb] \vspace{-\intextsep} \centering \vspace{0.5cm} \includegraphics[width=0.8\linewidth]{Fig7_vis_heatmap.pdf} \caption{Visualization of the supervised attention map. The three rows visualize the category distribution map corresponding to class 1, 2 and 4, respectively. } \label{fig:vis-heatmap} \end{figure} To verify that making the attention map under supervision has positive effects, we show a visual comparison of attention maps for different classes in Figure.~\ref{fig:vis-heatmap}. The visualization of the attention map clearly shows the position of the corresponding category, which greatly facilitates the segmentation. Even small areas like non-enhancing tumors can be captured by the SAM. These experiments validate that the supervision of the map can effectively encode stable global context information for guiding the network to predict accurate results. \subsection{Method Robustness} The reliability of deep learning systems for medical images depends on their accuracy but also on their robustness. A method that is highly accurate but fails dramatically in a few cases may lack of trust from medical experts. Therefore, we have counted the standard deviations of different methods in ablation study to compare their differences in stability as shown in Table.~\ref{tab:stddev}. \begin{table*}[ht] \scriptsize \centering \caption{Standard deviation results of the 5-fold cross-validation on the BraTS 2019 training set.} \label{tab:stddev} \setlength{\tabcolsep}{3mm}{ \begin{tabular}{l|c|c|c|c|c|c} \hline \multirow{2}{*}{Method} & \multicolumn{3}{c}{StdDev of Dice Score (\%) $\downarrow$} & \multicolumn{3}{|c}{StdDev of 100\% Hausdorff Distance(mm) $\downarrow$} \\ \cline{2-7} & \makecell[c]{\bfseries ET\\ class4} & \makecell[c]{\bfseries WT\\ class1\&2\&4} & \makecell[c]{\bfseries TC\\ class1\&2} & \makecell[c]{\bfseries ET\\ class4} & \makecell[c]{\bfseries WT\\ class1\&2\&4} & \makecell[c]{\bfseries TC\\ class1\&2}\\ \hline Baseline & 30.28 & 7.47 & 13.68 & 23.38 & 25.91 & 25.48\\ Baseline + Intra & 29.14 & 6.71 & \textbf{10.41} & 21.60 & 22.19 & 20.16\\ Baseline + Intra (class1) & 26.75 & 6.57 & 13.56 & 17.56 & 24.33 & 17.80\\ Baseline + Intra (class2) & 28.21 & 6.80 & 14.87 & 21.49 & 25.24 & 23.69\\ Baseline + Intra (class4) & 28.17 & \textbf{6.11} & 12.70 & 16.42 & 26.58 & \textbf{17.75}\\ Baseline + Inter & 29.25 & 7.23 & 12.81 & 20.17 & 25.97 & 22.26\\ Baseline + Intra + Inter & \textbf{27.71} & 6.43 & 12.11 & \textbf{16.15} & \textbf{21.49} & 20.23\\ \hline \end{tabular} } \end{table*} Since our method suppresses over-segmentation and under-segmentation to a certain extent, some extreme cases with low ET scores are avoided. Therefore, our method has a better performance in standard deviation, which makes the system more stable in the face of real complicated situation. In addition, we further analyzed the Hausdorff distance metric in the ablation study. The Hausdorff distance metric set by the challenge organizer is 95\%, which is intended to eliminate the influence of a subset of outliers. Actually, the 5\% outliers may play an important role in creating radiation therapy planing considering their size and location. Therefore, We calculated the 100\% Hausdorff distance in the cross-validation experiment as illustrated in Table.~\ref{tab:ablation}. Due to outliers, the Hausdorff distance of 100\% is numerically larger than that of 95\%. But compared to the baseline, our method has played a more obvious role in these three categories. We can see that the Hausdorff distance of ET has dramatically decreased with the help of both the two methods. \begin{figure}[htb] \centering \includegraphics[width=\linewidth]{Fig8_confidence.pdf} \caption{confidence distribution of model predictions of the 5-fold cross-validation on the BraTS 2019 training set.} \label{fig:confidence} \end{figure} The confidence of model prediction is also an important aspect of evaluating its robustness. We counted the confidence distribution of model predictions in the cross-validation experiment. Specifically, we divide the predicted probability into 10 intervals, and plot the predicted proportion of each interval in Fig \ref{fig:confidence}. Since the probability is mainly distributed in the two intervals of $[0, 0.1]$ and $[0.9, 1.0]$, we merge the middle interval into $[0.1, 0.5]$ and $[0.5, 0.9]$. Compared with the baseline, our method has more prediction probabilities that fall within the interval of $[0.9, 1.0]$, which means a higher degree of confidence. In addition, the decrease in the proportion of the $[0, 0.5]$ interval also indicates that the model discards those vacillating predictions. \section{Conclusion} We have proposed a novel framework named CGA U-Net to automatically segment brain tumor from MRI. The SAM significantly improved the segmentation results with only 0.095M parameters and around 0.675G FLOPs. To reconstruct the feature map accurately and efficiently, we designed intra-class update method and inter-class distance optimization. The experimental results on BraTS 2019 dataset show that our approach is highly effective. The final dice scores (78.83\%, 89.29\%, 82.32\% for ET, WT and TC, respectively) are superior or comparable to that of the state-of-the-art methods. \section{Future Scope} There may be some possible limitations in this study. Since we update the feature map based on the category, the computational complexity may expand as the number of categories increases. This work may consider dataset with larger number of categories and conduct more detailed intra-class update experiments. The future work can also include sensitivity analysis on the number of categories. In addition, this work may consider more datasets such as the decathlon challenge to verify the generalization of the method. \section{Reference} \bibliographystyle{iopart-num}
e65c8b8317436ebfed1ca4013ae942bdee906946
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction}\label{intro} Let $\mathbb{Z}_{p^s}$ be the ring of integers modulo $p^s$ with $p$ prime and $s\geq1$. The set of $n$-tuples over $\mathbb{Z}_{p^s}$ is denoted by $\mathbb{Z}_{p^s}^n$. In this paper, the elements of $\mathbb{Z}^n_{p^s}$ will also be called vectors. The order of a vector $\mathbf u$ over $\mathbb{Z}_{p^s}$, denoted by $o(\mathbf{u})$, is the smallest positive integer $m$ such that $m \mathbf{u} ={\mathbf{0}}$. A code over $\mathbb{Z}_p$ of length $n$ is a nonempty subset of $\mathbb{Z}_p^n$, and it is linear if it is a subspace of $\mathbb{Z}_{p}^n$. Similarly, a nonempty subset of $\mathbb{Z}_{p^s}^n$ is a $\mathbb{Z}_{p^s}$-additive if it is a subgroup of $\mathbb{Z}_{p^s}^n$. Note that, when $p=2$ and $s=1$, a $\mathbb{Z}_{p^s}$-additive code is a binary linear code and, when $p=2$ and $s=2$ , it is a quaternary linear code or a linear code over $\mathbb{Z}_4$. In \cite{Sole}, a Gray map from $\mathbb{Z}_4$ to $\mathbb{Z}_2^2$ is defined as $\phi(0)=(0,0)$, $\phi(1)=(0,1)$, $\phi(2)=(1,1)$ and $\phi(3)=(1,0)$. There exist different generalizations of this Gray map, which go from $\mathbb{Z}_{2^s}$ to $\mathbb{Z}_2^{2^{s-1}}$ \cite{Carlet,Codes2k,dougherty,Nechaev,Krotov:2007}. The one given in \cite{Nechaev} can be defined in terms of the elements of a Hadamard code \cite{Krotov:2007}, and Carlet's Gray map \cite{Carlet} is a particular case of the one given in \cite{Krotov:2007} satisfying $\sum \lambda_i \phi(2^i) =\phi(\sum \lambda_i 2^i)$ \cite{KernelZ2s}. In this paper, we focus on a generalization of Carlet's Gray map, from $\mathbb{Z}_{p^s}$ to $\mathbb{Z}_p^{p^{s-1}}$, which is also a particular case of the one given in \cite{ShiKrotov2019}. Specifically, \begin{equation}\label{genGraymap} \phi_s(u)=(u_{s-1},\dots,u_{s-1})+(u_0,\dots,u_{s-2})Y_{s-1}, \end{equation} where $u\in\mathbb{Z}_{p^s}$, $[u_0,u_1, \ldots, u_{s-1}]_p$ is the p-ary expansion of $u$, that is $u=\sum_{i=0}^{s-1}p^{i}u_i$ ($u_i \in \mathbb{Z}_p$), and $Y_{s-1}$ is a matrix of size $(s-1)\times p^{s-1}$ whose columns are the elements of $\mathbb{Z}_p^{s-1}$. Then, we define $\Phi_s:\mathbb{Z}_{p^s}^ n\rightarrow\mathbb{Z}_p^{np^{s-1}}$ as the component-wise Gray map $\phi_s$. Let ${\cal C}$ be a $\mathbb{Z}_{p^s}$-additive code of length $n$. We say that its image $C=\Phi({\cal C})$ is a $\mathbb{Z}_{p^s}$-linear code of length $p^{s-1}n$. Since ${\cal C}$ is a subgroup of $\mathbb{Z}_{p^s}^n$, it is isomorphic to an abelian structure $\mathbb{Z}_{p^s}^{t_1}\times\mathbb{Z}_{p^{s-1}}^{t_2}\times \dots\times\mathbb{Z}_{p^2}^{t_{s-1}}\times\mathbb{Z}_p^{t_s}$, and we say that ${\cal C}$, or equivalently $C=\Phi({\cal C})$, is of type $(n;t_1,\dots,t_{s})$. Note that $|{\cal C}|=p^{st_1}p^{(s-1)t_2}\cdots p^{t_s}$. Unlike linear codes over finite fields, linear codes over rings do not have a basis, but there exists a generator matrix for these codes having minimum number of rows, that is, $t_1+\cdots+t_s$ rows. A $p$-linear combination of the elements of $\mathcal{B}=\{\mathbf{b}_1,\dots,\mathbf{b}_r\}\subseteq \mathbb{Z}_{p^s}^n$ is $\sum_{i=1}^{r}\lambda_i\mathbf{b}_i$, for $\lambda_i\in\mathbb{Z}_p$. We say that $\mathcal{B}$ is a $p$-basis of ${\cal C}$ if the elements in $\mathcal{B}$ are $p$-linearly independent and any $\mathbf{c}\in{\cal C}$ is a $p$-linear combination of the elements of $\cal{B}$. Let ${\cal S}_n$ be the symmetric group of permutations on the set $\{1,\dots,n\}$. Two codes $C_1$ and $C_2$ over $\mathbb{Z}_p$, are said to be equivalent if there is a vector $\textbf{a}\in \mathbb{Z}_p^n$ and a permutation of coordinates $\pi\in {\cal S}_n$ such that $C_2=\{ \textbf{a}+\pi(\textbf{c}) : \textbf{c} \in C_1 \}$. Two $\mathbb{Z}_{p^s}$-additive codes, ${\cal C}_1$ and ${\cal C}_2$, are said to be permutation equivalent if they differ only by a permutation of coordinates, that is, if there is a permutation of coordinates $\pi\in {\cal S}_n$ such that ${\cal C}_2=\{ \pi(\textbf{c}) : \textbf{c} \in {\cal C}_1 \}$. Two structural properties of codes over $\mathbb{Z}_p$ are the rank and dimension of the kernel. The rank of a code $C$ over $\mathbb{Z}_p$ is simply the dimension of the linear span, $\langle C \rangle$, of $C$. The kernel of a code $C$ over $\mathbb{Z}_p$ is defined as $\mathrm{K}(C)=\{\textbf{x}\in \mathbb{Z}_p^n : \textbf{x}+C=C \}$ \cite{BGH83,pKernel}. If the all-zero vector belongs to $C$, then $\mathrm{K}(C)$ is a linear subcode of $C$. Note also that if $C$ is linear, then $K(C)=C=\langle C \rangle$. We denote the rank of $C$ as $\text{rank}(C)$ and the dimension of the kernel as $\text{ker}(C)$. These parameters can be used to distinguish between non-equivalent codes, since equivalent ones have the same rank and dimension of the kernel. A generalized Hadamard $(GH)$ matrix $H(p,\lambda) = (h_{i j})$ of order $n = p\lambda$ over $\mathbb{Z}_p$ is a $p\lambda \times p\lambda$ matrix with entries from $\mathbb{Z}_p$ with the property that for every $i, j$, $1 \leq i < j \leq p\lambda,$ each of the multisets $\{h_{is}- h_{js} : 1 \leq s \leq p\lambda\}$ contains every element of $\mathbb{Z}_p$ exactly $\lambda$ times \cite{jungnickel1979}. An ordinary Hadamard matrix of order $4\mu$ corresponds to $GH$ matrix $H(2,\lambda)$ over $\mathbb{Z}_2$, where $\lambda = 2\mu$ \cite{Key}. Two $GH$ matrices $H_1$ and $H_2$ of order $n$ are said to be equivalent if one can be obtained from the other by a permutation of the rows and columns and adding the same element of $\mathbb{Z}_p$ to all the coordinates in a row or in a column. We can always change the first row and column of a $GH$ matrix into zeros and we obtain an equivalent $GH$ matrix which is called normalized. From a normalized Hadamard matrix $H$, we denote by $F_H$ the code over $\mathbb{Z}_p$ consisting of the rows of $H$, and $C_H$ the one defined as $C_H = \bigcup_{\alpha \in\mathbb{Z}_p} (F_H + \alpha \textbf{1})$, where $F_H + \alpha \textbf{1} = \{\textbf{h} + \alpha \textbf{1} : \textbf{h} \in F_H\}$ and $\textbf{1}$ denotes the all-one vector. The code $C_H$ over $\mathbb{Z}_p$ is called generalized Hadamard $(GH)$ code \cite{dougherty2015ranks}. Note that $C_H$ is generally a nonlinear code over $\mathbb{Z}_p$. Let ${\cal C}$ be a $\mathbb{Z}_{p^s}$-additive code such that $\Phi({\cal C})$ is a GH code. Then, we say that ${\cal C}$ is a $\mathbb{Z}_{p^s}$-additive GH code and $\Phi({\cal C})$ is a $\mathbb{Z}_{p^s}$-linear GH code. Note that a GH code over $\mathbb{Z}_p$ of length $N$ has $pN$ codewords and minimum distance $\frac{N(p-1)}{p}$. The $\mathbb{Z}_4$-linear Hadamard codes of length $2^t$ can be classified by using either the rank or the dimension of the kernel \cite{Kro:2001:Z4_Had_Perf,PheRifVil:2006}. There are exactly $\lfloor \frac{t-1}{2}\rfloor$ such codes for all $t\geq 2$. Later, in \cite{KernelZ2s}, an iterative construction for $\mathbb{Z}_{2^s}$-linear Hadamard codes was described, and the linearity and kernel of these codes were established. It was proved that the dimension of the kernel only provides a complete classification for some values of $t$ and $s$. A partial classification by using the kernel was obtained, and the exact amount of non-equivalent such codes was given up to $t=11$ for any $s\geq 2$. Authors also give a lower bound based on the rank and dimension of the kernel. Later, in paper \cite{EquivZ2s}, for $s\geq 2$, it was established that some $\mathbb{Z}_{2^s}$-linear Hadamard codes of length $2^t$ are equivalent, once $t$ is fixed, and this fact improved the known upper bounds for the number of such nonequivalent codes. Moreover, authors show that, up to $t = 11$, this new upper bound coincides with the known lower bound (based on the rank and dimension of the kernel). Finally, for $s \in \{2,3\}$, they establish the full classification of the $\mathbb{Z}_{2^s}$-linear Hadamard codes of length $2^t$ by giving the exact number of such codes. For $s\geq 2$, and $p\geq 3$ prime, the dimension of the kernel for $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ is established in \cite{HadamardZps}, and it is proved that this invariant only provides a complete classification for certain values of $t$ and $s$. Lower and upper bounds are also established for the number of nonequivalent $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$, when both $t$ and $s$ are fixed, and when just $t$ is fixed; denoted by $\mathcal{A}_{t,s,p}$ and $\mathcal{A}_{t,p}$, respectively. From \cite{HadamardZps}, we can check that there are nonlinear codes having the same rank and dimension of the kernel for different values of $s$, once the length $p^t$ is fixed, for all $4\leq t\leq 11$. In this paper, we show that there are generalized Hadamard codes of length $p^t$, with $p\geq 3$ and $t\geq 1$, that can be seen up to permutations as $\mathbb{Z}_{p^s}$-linear codes for different values of $s$. Moreover, for $t\leq 10$, we see that the codes that are permutation equivalent are, in fact, those having the same pair of invariants, rank and dimension of the kernel. For example, in Table \ref{table:Types}, for $t=7$, the colored codes having same rank and dimension of the kernel are permutation equivalent. These equivalence results allow us to obtain a more accurate classification of the $\mathbb{Z}_{p^s}$-linear GH codes, than the one given in \cite{HadamardZps}. The paper is organized as follows. In Section \ref{Sec:construction}, we recall the recursive construction of the $\mathbb{Z}_{p^s}$-linear GH codes, the known partial classification, and some bounds on the number of nonequivalent such codes, presented in \cite{HadamardZps}. In Section \ref{sec:relations}, we prove some equivalence relations among the $\mathbb{Z}_{p^s}$-linear GH codes of the same length $p^t$. Later, in Section \ref{sec:Classification}, we improve the classification given in \cite{HadamardZps} by refining the known bounds. \section{Preliminaries and Partial classification} \label{Sec:construction} In this section, we provide some results presented in \cite{HadamardZps} and related to the recursive construction, partial classification and bounds on the number of nonequivalent $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ with $t\geq 3$ and $p\geq 3$ prime. Let $T_i=\lbrace j\cdot p^{i-1}\, :\, j\in\lbrace0,1,\dots,p^{s-i+1}-1\rbrace \rbrace$ for all $i \in \{1,\ldots,s \}$. Note that $T_1=\lbrace0,\dots,p^{s}-1\rbrace$. Let $t_1$, $t_2$,\dots,$t_s$ be nonnegative integers with $t_1\geq1$. Consider the matrix $A_p^{t_1,\dots,t_s}$ whose columns are exactly all the vectors of the form $\mathbf{z}^T$, $\mathbf{z}\in\lbrace1\rbrace\times T_1^{t_1-1}\times T_{2}^{t_2}\times\cdots\times T_s^{t_s}$. We write $A^{t_1,\dots,t_s}$ instead of $A_p^{t_1,\dots,t_s}$ when the value of $p$ is clear by the context. Let $\mathbf{0}, \mathbf{1},\mathbf{2},\ldots, \mathbf{p^{s}-1}$ be the vectors having the same element $0, 1, 2, \ldots, p^s-1$ from $\mathbb{Z}_{p^s}$ in all its coordinates, respectively. Any matrix $A^{t_1,\dots,t_s}$ can be obtained by applying the following recursive construction. We start with $A^{1,0,\dots,0}=(1)$. Then, if we have a matrix $A=A^{t_1,\dots,t_s}$, for any $i\in \{1,\ldots,s\}$, we may construct the matrix \begin{equation}\label{eq:recGenMatrix} A_i= \left(\begin{array}{cccc} A & A &\cdots & A \\ 0\cdot \mathbf{p^{i-1}} & 1\cdot \mathbf{p^{i-1}} & \cdots & (p^{s-i+1}-1)\cdot \mathbf{p^{i-1}} \\ \end{array}\right). \end{equation} Finally, permuting the rows of $A_i$, we obtain a matrix $A^{t'_1,\ldots,t'_s}$, where $t'_j=t_j$ for $j\not=i$ and $t'_i=t_i+1$. Note that any permutation of columns of $A_i$ gives also a matrix $A^{t_1',\dots,t_s'}$. Along this paper, we consider that the matrices $A^{t_1,\ldots,t_s}$ are constructed recursively starting from $A^{1,0,\ldots,0}$ in the following way. First, we add $t_1-1$ rows of order $p^s$, up to obtain $A^{t_1,0,\ldots,0}$; then $t_2$ rows of order $p^{s-1}$ up to generate $A^{t_1,t_2,\ldots,0}$; and so on, until we add $t_s$ rows of order $p$ to achieve $A^{t_1,\ldots,t_s}$. See \cite{HadamardZps} for examples. Let $\mathcal{H}^{t_1,\dots,t_s}$ be the $\mathbb{Z}_{p^s}$-additive code generated by the matrix $A^{t_1,\dots,t_s}$, where $t_1,\dots,t_s$ are nonnegative integers with $t_1\geq1$. Let $n=p^{t-s+1}$, where $t=\left(\sum_{i=1}^{s}(s-i+1)\cdot t_i\right)-1$. The code $\mathcal{H}^{t_1,\dots,t_s}$ has length $n$, and the corresponding $\mathbb{Z}_{p^s}$-linear code $H^{t_1,\dots,t_s}=\Phi(\mathcal{H}^{t_1,\dots,t_s})$ is a GH code of length $p^t$ \cite{HadamardZps}. In order to classify the $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$, we can focus on $t\geq 5$ and $2\leq s \leq t-2$ for $p=2$ (\cite{KernelZ2s}), and on $t\geq 4$ and $2\leq s \leq t-2$ for $p\geq 3$ prime (\cite{HadamardZps}). Moreover, for any $t\geq 5$ and $2\leq s \leq t-2$, there are two $\mathbb{Z}_{2^s}$-linear Hadamard codes of length $2^t$ which are linear, say $H^{1,0,\ldots,0,t+1-s}$ and $H^{1,0\dots,0,1,t-1-s}$; and for any $t\geq 4$ and $2\leq s \leq t-2$, there is a unique $\mathbb{Z}_{p^s}$-linear GH code of length $p^t$ which is linear, say $H^{1,0,\ldots,0,t+1-s}$. Tables \ref{table:Types} and \ref{table:TypesB2}, for $4\leq t\leq 10$ and $2\leq s\leq t-2$, show all possible values $(t_1,\dots,t_s)$ for which there exists a nonlinear $\mathbb{Z}_{p^s}$-linear Hadamard code $H^{t_1,\ldots,t_s}$ of length $p^t$. For each one of them, the values $(r,k)$ are shown, where $r$ is the rank (computed by using the computer algebra system Magma \cite{Magma,Qarypackage}) and $k$ is the dimension of the kernel (\cite{HadamardZps,KernelZ2s,Kro:2001:Z4_Had_Perf}). Note that if two codes have different values $(r,k)$, then they are not equivalent. Therefore, from the values of the dimension of the kernel given in these tables, it is easy to see that this invariant does not classify. Also, considering only the rank, it is not possible to fully classify these codes either. \begin{table}[ht!] \footnotesize \centering \begin{tabular}{|c||cc|cc|cc|cc|} \cline{1-9} & \multicolumn{2}{c|}{$t=4$}& \multicolumn{2}{c|}{$t=5$}& \multicolumn{2}{c|}{$t=6$}& \multicolumn{2}{c|}{$t=7$}\\ \cline{2-9} & $(t_1,\ldots,t_s)$ & $(r,k)$ & $(t_1,\ldots,t_s)$ & $(r,k)$ & $(t_1,\ldots,t_s)$ & $(r,k)$ & $(t_1,\ldots,t_s)$ & $(r,k)$\\[0.2em] \hline \multirow{2}{*}{$\mathbb{Z}_9$} &$(2,1)$ & (6,3) &$(2,2)$ &(7,4) & $(3,1)$ & (12,4) & $(3,2)$ & (13,5) \\ && & $(3,0)$ & (11,3) &$(2,3)$ &(8,5) & $(4,0)$ & (21,4)\\ && && && &$\textcolor{blue}{(2,4)}$ & \textcolor{blue}{(9,6)} \\[0.2em] \hline \multirow{5}{*}{$\mathbb{Z}_{3^3}$} &$(1,1,0)$ & (6,3) & $(2,0,0)$ & (13,2) & $(1,2,0)$ & (12,4) & $(1,2,1)$ & (13,5) \\ && &$(1,1,1)$ &(7,4) & $(2,0,1)$ & (14,3) & $(2,0,2)$ & (15,4) \\ && & & & $(1,1,2)$ &(8,5) & $(2,1,0)$ & (25,3) \\ && & & & & &$\textcolor{blue}{(1,1,3)}$ &\textcolor{blue}{(9,6)} \\[0.2em] \hline \multirow{4}{*}{$\mathbb{Z}_{3^4}$} && &$(1,0,1,0)$ & (7,4) & $(1,1,0,0)$ & (14,3) & $(1,0,2,0)$ & (13,5) \\ && & & & $(1,0,1,1)$ &(8,5) & $(1,1,0,1)$ & (15,4) \\ && & & & & & $(2,0,0,0)$ & (14,2) \\ && & & & & &$\textcolor{blue}{(1,0,1,2)}$ &\textcolor{blue}{(9,6)} \\[0.2em] \hline \multirow{3}{*}{$\mathbb{Z}_{3^5}$} && & & &$(1,0,0,1,0)$ &(8,5) & $(1,0,1,0,0)$ & (15,4) \\ && & & & & & $\textcolor{blue}{(1,0,0,1,1)}$ &\textcolor{blue}{(9,6)} \\[0.2em] \hline \multirow{1}{*}{$\mathbb{Z}_{3^6}$} && & & & & &$\textcolor{blue}{(1,0,0,0,1,0)}$ &\textcolor{blue}{(9,6)} \\[0.2em] \hline \end{tabular} \caption{Rank and kernel for all nonlinear $\mathbb{Z}_{3^s}$-linear GH codes of length $3^t$.} \label{table:Types} \end{table} Let $X_{t,s,p}$ be the number of nonnegative integer solutions $(t_1,\ldots,t_s)\in {\mathbb{N}}^s$ of the equation $t=\left(\sum_{i=1}^{s}(s-i+1)\cdot t_i\right)-1$ with $t_1\geq 1$. This gives the number of $(t_1,\ldots,t_s)$ so that $H^{t_1,\ldots,t_s}$ is a $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$. Let ${\cal A}_{t,s,p}$ be the number of nonequivalent $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ and a fixed $s\geq 2$. Then, for any $t \geq 5$ and $2 \leq s \leq t-1$, we have that ${\cal A}_{t,s,2} \leq X_{t,s,2}-1$, since there are exactly two codes which are linear \cite{KernelZ2s}. For $p\geq 3$ prime, $t \geq 4$ and $2 \leq s \leq t-1$, we have that ${\cal A}_{t,s,p} \leq X_{t,s,p}$, since there are exactly one code which is linear. Moreover, for $t \leq 10$ if $p\geq 3$ prime and for $t \leq 11$ if $p=2$ , this bound is tight. It is still an open problem to know whether this bound is tight for $t\geq 11$ if $p\geq 3$ prime and $t\geq 12$ if $p=2$. A partial classification for the $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ is given in \cite{HadamardZps} for $p\geq 3$ prime, and for $p=2$, it is given in \cite{KernelZ2s}. Specifically, lower and upper bounds on the number of nonequivalent such codes, once only $t$ is fixed, are established. We first consider the case $p=2$. \begin{theorem}\label{theo:CardinalFirstBoundY} \cite{KernelZ2s} Let ${\cal A}_{t,2}$ be the number of nonequivalent $\mathbb{Z}_{2^s}$-linear Hadamard codes of length $2^t$ with $t\geq 3$. Then, \begin{equation}\label{eq:CardinalFirstBound} {\cal A}_{t,2} \leq 1+ \sum_{s=2}^{t-2} (X_{t,s,2}-2) \end{equation} and \begin{equation}\label{eq:CardinalFirstBoundY1} {\cal A}_{t,2} \leq 1+\sum_{s=2}^{t-2} ({\cal A}_{t,s,2}-1). \end{equation} \end{theorem} For $p=2$, the upper bound of the value of ${\cal A}_{t,2}$ is improved in \cite{EquivZ2s} where it was proved that for a fixed $t$ there are $\mathbb{Z}_{2^s}$-linear Hadamard codes of length $2^t$ that are equivalent. Let $\tilde{X}_{t,s,2}=|\{ (t_1,\ldots,t_s)\in {\mathbb{N}}^s : t+1=\sum_{i=1}^{s}(s-i+1) t_i, \ t_1\geq 2 \}|$ for $s\in\{3,\dots,\lfloor (t+1)/2\rfloor\}$ and $\tilde{X}_{t,2,2}=|\{ (t_1,t_2)\in {\mathbb{N}}^2 : t+1=2t_1+t_2, \ t_1\geq 3 \}|$. \begin{theorem}[\cite{EquivZ2s}] \label{teo:numNonEquiv100} For $t \geq 3$, \begin{equation}\label{eq:BoundAtNewX} {\cal A}_{t,2} \leq1+ \sum_{s=2}^{\lfloor\frac{t+1}{2}\rfloor} \tilde{X}_{t,s,2} \end{equation} and \begin{equation}\label{eq:BoundAtNew} {\cal A}_{t,2} \leq1+ \sum_{s=2}^{\lfloor\frac{t+1}{2}\rfloor} ({{\cal A}}_{t,s,2}-1). \end{equation} Moreover, for $3 \leq t \leq 11$, first bound is tight. \end{theorem} It is also proved that, for $5\leq t \leq 11$, the improved upper bound is the exact value of ${\cal A}_{t,2}$. Now we consider the case $p\geq 3$. \begin{theorem}\label{theo:CardinalFirstBound} \cite{HadamardZps} Let ${\cal A}_{t,p}$ be the number of nonequivalent $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ with $t\geq 3$ and $p\geq 3$ prime. Then, \begin{equation}\label{eq:CardinalFirstBound-p} {\cal A}_{t,p} \leq 1+ \sum_{s=2}^{t-1} (X_{t,s,p}-1) \end{equation} and \begin{equation}\label{eq:CardinalFirstBoundX-p} {\cal A}_{t,p} \leq 1+\sum_{s=2}^{t-1} ({\cal A}_{t,s,p}-1). \end{equation} \end{theorem} In this paper, in order to improve this partial classification, we analyze the equivalence relations among the $\mathbb{Z}_{p^s}$-linear GH codes with the same length $p^t$ and different values of $s$. We prove that some of them are indeed permutation equivalent. For $5\leq t\leq 11$ if $p=2$ and for $4\leq t\leq 10$ if $p\geq 3$ prime, the ones that are permutation equivalent coincide with the ones that have the same invariants, rank and dimension of the kernel, that is, the same pair $(r,k)$ in the Tables. Finally, by using this equivalence relations, we improve the upper bounds on the number ${\cal A}_{t,p}$ of nonequivalent $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ with $p\geq 3$ prime given by Theorem \ref{theo:CardinalFirstBound}. This allows us to determine the exact value of ${\cal A}_{t,p}$ for $5\leq t\leq 11$ if $p=2$ and for $4\leq t \leq 10$ if $p\geq 3$ prime, since one of the new upper bounds coincides with the lower bound $(r,k)$ for these cases. \begin{table}[H] \footnotesize \centering \begin{tabular}{|c||cc|cc|cc|} \cline{1-7} & \multicolumn{2}{c|}{$t=8$}& \multicolumn{2}{c|}{$t=9$}& \multicolumn{2}{c|}{$t=10$}\\ \cline{2-7} & $(t_1,\ldots,t_s)$ & $(r,k)$ & $(t_1,\ldots,t_s)$ & $(r,k)$ & $(t_1,\ldots,t_s)$ & $(r,k)$ \\[0.2em] \hline \multirow{4}{*}{$\mathbb{Z}_9$} & $(3,3)$ & (14,6) & $(3,4)$ & (15,7) & $(3,5)$ & (16,8) \\ & $(4,1)$ & (22,5) & $(4,2)$ & (23,6) & $(4,3)$ & (24,7) \\ &$(2,5)$ & (10,7) & $(5,0)$ & (36,5) & $(5,1)$ & (37,6) \\[0.2em] & & &$(2,6)$ & (11,8) & $(2,7)$ & (12,9) \\[0.2em] \hline \multirow{10}{*}{$\mathbb{Z}_{3^3}$}& $(1,2,2)$ & (14,6) & $(1,2,3)$ & (15,7) & $(1,2,4)$ & (16,8) \\ & $(1,3,0)$ & (22,5) & $(1,3,1)$ & (23,6) & $(1,3,2)$ & (24,7) \\ & $(2,0,3)$ & (16,5) & $(2,0,4)$ & (17,6) & $(1,4,0)$ & (37,6) \\ & $(2,1,1)$ & (26,4) & $(2,1,2)$ & (27,5) & $(2,0,5)$ & (18,7) \\ &$(3,0,0)$ & (48,3) & $(2,2,0)$ & (43,4) & $(2,1,3)$ & (28,6) \\ &$(1,1,4)$ & (10,7) & $(3,0,1)$ & (49,4) & $(2,2,1)$ & (44,5) \\ && & $(1,1,5)$ & (11,8) & $(3,0,2)$ & (50,5) \\ && & & & $(3,1,0)$ & (82,4) \\ && & & & $(1,1,6)$ & (12,9) \\[0.2em] \hline \multirow{13}{*}{$\mathbb{Z}_{3^4}$}& $(1,0,2,1)$ & (14,6) & $(1,0,2,2)$ & (15,7) & $(1,0,2,3)$ & (16,8) \\ & $(1,1,0,2)$ & (16,5) & $(1,0,3,0)$ & (23,6) & $(1,0,3,1)$ & (24,7) \\ & $(1,1,1,0)$ & (26,4) & $(1,2,0,0)$ & (49,4) & $(1,1,0,4)$ & (18,7) \\ & $(2,0,0,1)$ & (35,3) & $(1,1,0,3)$ & (17,6) & $(1,1,1,2)$ & (28,6) \\ &$(1,0,1,3)$&(10,7) & $(1,1,1,1)$ & (27,5) & $(1,1,2,0)$ & (44,5) \\ && & $(2,0,0,2)$ & (36,4) & $(1,2,0,1)$ & (50,5) \\ && & $(2,0,1,0)$ & (64,3) & $(2,0,0,3)$ & (37,5) \\ && & $(1,0,1,4)$ & (11,8) & $(2,0,1,1)$ & (65,4) \\ && & & & $(2,1,0,0)$ & (121,3) \\ && & & & $(1,0,1,5)$ & (12,9) \\[0.2em] \hline \multirow{11}{*}{$\mathbb{Z}_{3^5}$}& $(1,0,0,2,0)$ & (14,6) & $(1,0,0,2,1)$ & (15,7) & $(1,0,0,2,2)$ & (16,8) \\ & $(1,0,1,0,1)$ & (16,5) & $(1,0,1,0,2)$ & (17,6) & $(1,0,0,3,0)$ & (24,7) \\ & $(1,1,0,0,0)$ & (35,3) & $(1,0,1,1,0)$ & (27,5) & $(1,0,1,0,3)$ & (18,7) \\ &$(1,0,0,1,2)$ &(10,7) & $(1,1,0,0,1)$ & (36,4) & $(1,0,1,1,1)$ & (28,6) \\ && & $(2,0,0,0,0)$ & (96,2) & $(1,0,2,0,0)$ & (50,5) \\ && & $(1,0,0,1,3)$ & (11,8) & $(1,1,0,0,2)$ & (37,5) \\ && & & & $(1,1,0,1,0)$ & (65,4) \\ && & & & $(2,0,0,0,1)$ & (97,3) \\ && & & & $(1,0,0,1,4)$ & (12,9) \\[0.2em] \hline \multirow{9}{*}{$\mathbb{Z}_{3^6}$} & $(1,0,0,1,0,0)$ & (16,5) & $(1,0,0,0,2,0)$ & (15,7) & $(1,0,0,0,2,1)$ & (16,8) \\ &$(1,0,0,0,1,1)$ &(10,7) & $(1,0,0,1,0,1)$ & (17,6) & $(1,0,0,1,0,2)$ & (18,7) \\ && & $(1,0,1,0,0,0)$ & (36,4) & $(1,0,0,1,1,0)$ & (28,6) \\ && & $(1,0,0,0,1,2)$ & (11,8) & $(1,0,1,0,0,1)$ & (37,5) \\ && & & & $(1,1,0,0,0,0)$ & (97,3) \\ && & & & $(1,0,0,0,1,3)$ & (12,9) \\[0.2em] \hline \multirow{5}{*}{$\mathbb{Z}_{3^7}$}&$(1,0,0,0,0,1,0)$ &(10,7)& $(1,0,0,0,1,0,0)$ & (17,6) & $(1,0,0,0,0,2,0)$ & (16,8) \\ && & $(1,0,0,0,0,1,1)$ & (11,8) & $(1,0,0,0,1,0,1)$ & (18,7) \\ && & & & $(1,0,0,1,0,0,0)$ & (37,5) \\ && & & & $(1,0,0,0,0,1,2)$ &(12,9) \\[0.2em] \hline \multirow{3}{*}{$\mathbb{Z}_{3^8}$}&& & $(1,0,0,0,0,0,1,0)$ &(11,8) & $(1,0,0,0,0,1,0,0)$ & (18,7) \\ && & & & $(1,0,0,0,0,0,1,1)$ &(12,9) \\ [0.2em] \hline \multirow{1}{*}{$\mathbb{Z}_{3^9}$}&& & & &$(1,0,0,0,0,0,0,1,0)$ &(12,9)\\[0.2em] \hline \end{tabular} \caption{Rank and kernel for all nonlinear $\mathbb{Z}_{3^s}$-linear GH codes of length $3^t$.} \label{table:TypesB2} \end{table} \section{Equivalent $\mathbb{Z}_{p^s}$-linear GH codes} \label{sec:relations} In this section, we give some properties of the generalized Gray map $\phi_s$. We also prove that, for $p\geq 3$ prime, some of the $\mathbb{Z}_{p^s}$-linear GH codes of the same length $p^t$, having different values of $s$ are permutation equivalent. Moreover, we see that they coincide with the ones having the same rank and dimension of the kernel for $4\leq t\leq 10$. \begin{lemma}\label{lema4} Let $\lambda_i\in \mathbb{Z}_p$, $i\in\lbrace0,\dots,s-2\rbrace$. Then, $$ \sum_{i=0}^{s-2}\lambda_i\phi_s(p^ i)=\phi_s(\sum_{i=0}^{s-2}\lambda_ip^i). $$ \end{lemma} \begin{proof} Straightforward form the definition of $\phi_s$. \end{proof} \bigskip Let $\gamma_s\in\mathcal{S}_{p^{s-1}}$ be the permutation defined as follows: for a coordinate $k=jp^{s-2}+i+1 \in \{1,2,\dots, p^{s-1}\}$, where $j\in \{0,\dots, p-1\}$ and $i\in \{0,\dots, p^{s-2}-1\}$, $\gamma_s$ moves coordinate $k$ to coordinate $j+ip+1$. So, we can write $\gamma_s$ as \begin{equation*}\label{eq:gamma} \tiny \left( \begin{array}{ccccccccccccc} 1 & 2& \ldots & p^{s-2} & p^{s-2}+1 & p^{s-2}+2 &\ldots & p^{s-2}+p & \ldots & p^{s-1}-p+1 &p^{s-1}-p+2 &\ldots &p^{s-1} \\ 1 & p+1& \ldots &(p^{s-2}-1)p+1 &2 & p+2 & \ldots & (p^{s-2}-1)p+2 &\ldots & p &p+p & \ldots &p^{s-1}\\ \end{array} \right). \end{equation*} \begin{example} For $p=3$ and $s=3$, \begin{equation*} \gamma_3=\left( \begin{array}{ccccccccccc} 1 & 2& 3& & 4& 5& 6& &7& 8& 9 \\ 1 & 4& 7& & 2& 5& 8& &3& 6& 9 \\ \end{array} \right)=(2,4)(3,7)(6,8) \in \mathcal{S}_9. \end{equation*} and for $p=3$ and $s=4$, \begin{multline*} \footnotesize \arraycolsep=1.4pt\def{1} \gamma_4=\left( \begin{array}{ccccccccccccccccccccccccccccc} 1 & 2& 3& 4& 5& 6& 7& 8& 9& & 10& 11& 12& 13& 14& 15& 16& 17& 18 & &19& 20& 21& 22& 23& 24& 25& 26& 27 \\ 1 & 4& 7& 10& 13& 16& 19& 22& 25& & 2& 5& 8& 11& 14& 17& 20& 23& 26 & & 3& 6& 9& 12& 15& 18& 21& 24& 27 \\ \end{array} \right)\\ =(2,4,10)(3,7,19)(5,13,11)(6,16,20)(8,22,12)(9,25,21)(15,17,23)(18,26,24)\in \mathcal{S}_{27}. \end{multline*} \end{example} \begin{lemma}\label{lem:gamma} Let $s\geq 2$, $u=({\mathbf{0}}, {\mathbf{1}}, \dots, {\mathbf{p-1}})\in \mathbb{Z}_p^{p^{s-1}}$ and $v=(0,1,\dots,p-1)\in\mathbb{Z}_p^p$. Then, \begin{enumerate}[label=(\roman*)] \item $\gamma_s(u)=(v, \stackrel{p^{s-2}}{\dots},v)$, \item $\gamma_s(v, \stackrel{p^{s-2}}{\dots},v)=u$. \end{enumerate} \end{lemma} \begin{proof} Straightforward form the definition of $\gamma_s$. \end{proof} Then, we can define the map $\tau_s:\mathbb{Z}_{p^s}\rightarrow \mathbb{Z}_{p^{s-1}}^p$ as \begin{equation}\label{eq:tau} \tau_s(u)=\Phi_{s-1}^{-1}(\gamma_s^{-1}(\phi_s(u))), \end{equation} where $u\in\mathbb{Z}_{p^s}$. \begin{example} For $p=3$ and $s=3$, we have \footnotesize \begin{equation}\label{eq:equivbase} \left.\begin{array}{cccccccl} \phi_3(0) & = & (0,0,0,0,0,0,0,0,0) & = &\gamma_3(0,0,0,0,0,0,0,0,0) = \gamma_3(\Phi_2(0,0,0))&\\ \phi_3(1) & = & (0,1,2,0,1,2,0,1,2) & = &\gamma_3(0,0,0,1,1,1,2,2,2) = \gamma_3(\Phi_2(0,3,6))&\\ \phi_3(2) & = & (0,2,1,0,2,1,0,2,1) & = &\gamma_3(0,0,0,2,2,2,1,1,1) = \gamma_3(\Phi_2(0,6,3))&\\ \phi_3(3) & = & (0,0,0,1,1,1,2,2,2) & = &\gamma_3(0,1,2,0,1,2,0,1,2) = \gamma_3(\Phi_2(1,1,1))&\\ \phi_3(4) & = & (0,1,2,1,2,0,2,0,1) & = &\gamma_3(0,1,2,1,2,0,2,0,1) = \gamma_3(\Phi_2(1,4,7))&\\ \phi_3(5) & = & (0,2,1,1,0,2,2,1,0) & = &\gamma_3(0,1,2,2,0,1,1,2,0) = \gamma_3(\Phi_2(1,7,4))&\\ \phi_3(6) & = & (0,0,0,2,2,2,1,1,1) & = &\gamma_3(0,2,1,0,2,1,0,2,1) = \gamma_3(\Phi_2(2,2,2))&\\ \phi_3(7) & = & (0,1,2,2,0,1,1,2,0) & = &\gamma_3(0,2,1,1,0,2,2,1,0) = \gamma_3(\Phi_2(2,5,8))&\\ \phi_3(8) & = & (0,2,1,2,1,0,1,0,2) & = &\gamma_3(0,2,1,2,1,0,1,0,2) = \gamma_3(\Phi_2(2,8,5))&\\ \phi_3(9) & = & (1,1,1,1,1,1,1,1,1) & = &\gamma_3(1,1,1,1,1,1,1,1,1) = \gamma_3(\Phi_2(3,3,3))&\\ \phi_3(10) & = & (1,2,0,1,2,0,1,2,0) & = &\gamma_3(1,1,1,2,2,2,0,0,0) = \gamma_3(\Phi_2(3,6,0))&\\ \phi_3(11) & = & (1,0,2,1,0,2,1,0,2) & = &\gamma_3(1,1,1,0,0,0,2,2,2) = \gamma_3(\Phi_2(3,0,6))&\\ \phi_3(12) & = & (1,1,1,2,2,2,0,0,0) & = &\gamma_3(1,2,0,1,2,0,1,2,0) = \gamma_3(\Phi_2(4,4,4))&\\ \phi_3(13) & = & (1,2,0,2,0,1,0,1,2) & = &\gamma_3(1,2,0,2,0,1,0,1,2) = \gamma_3(\Phi_2(4,7,1))&\\ \phi_3(14) & = & (1,0,2,2,1,0,0,2,1) & = &\gamma_3(1,2,0,0,1,2,2,0,1) = \gamma_3(\Phi_2(4,1,7))&\\ \phi_3(15) & = & (1,1,1,0,0,0,2,2,2) & = &\gamma_3(1,0,2,1,0,2,1,0,2) = \gamma_3(\Phi_2(5,5,5))&\\ \phi_3(16) & = & (1,2,0,0,1,2,2,0,1) & = &\gamma_3(1,0,2,2,1,0,0,2,1) = \gamma_3(\Phi_2(5,8,2))&\\ \phi_3(17) & = & (1,0,2,0,2,1,2,1,0) & = &\gamma_3(1,0,2,0,2,1,2,1,0) = \gamma_3(\Phi_2(5,2,8))&\\ \phi_3(18) & = & (2,2,2,2,2,2,2,2,2) & = &\gamma_3(2,2,2,2,2,2,2,2,2) = \gamma_3(\Phi_2(6,6,6))&\\ \phi_3(19) & = & (2,0,1,2,0,1,2,0,1) & = &\gamma_3(2,2,2,0,0,0,1,1,1) = \gamma_3(\Phi_2(6,0,3))&\\ \phi_3(20) & = & (2,1,0,2,1,0,2,1,0) & = &\gamma_3(2,2,2,1,1,1,0,0,0) = \gamma_3(\Phi_2(6,3,0))&\\ \phi_3(21) & = & (2,2,2,0,0,0,1,1,1) & = &\gamma_3(2,0,1,2,0,1,2,0,1) = \gamma_3(\Phi_2(7,7,7))&\\ \phi_3(22) & = & (2,0,1,0,1,2,1,2,0) & = &\gamma_3(2,0,1,0,1,2,1,2,0) = \gamma_3(\Phi_2(7,1,4))&\\ \phi_3(23) & = & (2,1,0,0,2,1,1,0,2) & = &\gamma_3(2,0,1,1,2,0,0,1,2) = \gamma_3(\Phi_2(7,4,1))&\\ \phi_3(24) & = & (2,2,2,1,1,1,0,0,0) & = &\gamma_3(2,1,0,2,1,0,2,1,0) = \gamma_3(\Phi_2(8,8,8))&\\ \phi_3(25) & = & (2,0,1,1,2,0,0,1,2) & = &\gamma_3(2,1,0,0,2,1,1,0,2) = \gamma_3(\Phi_2(8,2,5))&\\ \phi_3(26) & = & (2,1,0,1,0,2,0,2,1) & = &\gamma_3(2,1,0,1,0,2,0,2,1) = \gamma_3(\Phi_2(8,5,2))&\\ \end{array}\right. \end{equation} These equalities define the map $\tau_3: \mathbb{Z}_{27} \rightarrow \mathbb{Z}_9^3$ as \begin{equation*} \left.\begin{array}{cccccccccl} \tau_3(0)=(0,0,0) && \tau_3(9) =(3,3,3) && \tau_3(18) =(6,6,6))\\ \tau_3(1)=(0,3,6) && \tau_3(10) =(3,6,0) && \tau_3(19) =(6,0,3) \\ \tau_3(2) =(0,6,3) && \tau_3(11) =(3,0,6) && \tau_3(20) =(6,3,0) \\ \tau_3(3) =(1,1,1) && \tau_3(12) =(4,4,4) &&\tau_3(21) =(7,7,7) \\ \tau_3(4) =(1,4,7) && \tau_3(13) =(4,7,1) && \tau_3(22) =(7,1,4) \\ \tau_3(5) =(1,7,4) && \tau_3(14) =(4,1,7) && \tau_3(23) =(7,4,1) \\ \tau_3(6) =(2,2,2) && \tau_3(15) =(5,5,5) && \tau_3(24) =(8,8,8) \\ \tau_3(7) =(2,5,8) && \tau_3(16) =(5,8,2) && \tau_3(25) =(8,2,5) \\ \tau_3(8) =(2,8,5) && \tau_3(17) =(5,2,8) && \tau_3(26) =(8,5,2) \\ \end{array}\right. \end{equation*} \end{example} \begin{lemma}\cite{HadamardZps}\label{lem:phi} Let $\lambda \in \mathbb{Z}_p$. Then, $\phi_s(\lambda p^{s-1})= (\lambda, \stackrel{p^{s-1}}{\dots},\lambda)$. \end{lemma} \begin{lemma} \label{lem:tau} Let $s\geq 2$. Then, \begin{enumerate}[label=(\roman*)] \item $\tau_s(1)=(0,p^{s-2},\dots,(p-1)p^{s-2})$, \item $\tau_s(p^iu)=p^{i-1}(u,\stackrel{p}{\dots},u)$ for all $i\in\{1,\dots,s-1\}$ and $u\in\{0,1,\dots,p^{s-1}-1\}$. \end{enumerate} \end{lemma} \begin{proof} First, let $v=(0,1,\dots,p-1)\in\mathbb{Z}_p^p$. Then, \begin{equation*} \begin{split} \tau_s(1) &=\Phi_{s-1}^{-1}(\gamma_s^{-1}(\phi_s(1)))\\ &=\Phi_{s-1}^{-1}(\gamma_s^{-1}(v, \stackrel{p^{s-2}}{\dots},v))\\ &=\Phi_{s-1}^{-1}(\mathbf{0},\mathbf{1},\dots,\mathbf{p-1}), \textrm {by Lemma \ref{lem:gamma}}. \end{split} \end{equation*} Therefore by Lemma \ref{lem:phi}, $\tau_s(1)=(0,p^{s-2},\dots,(p-1)p^{s-2})$, and $(i)$ holds. In order to prove $(ii)$, let $u\in\mathbb{Z}_{p^s}$ and $[u_0,\dots,u_{s-1}]_p$ be its p-ary expansion. The p-ary expansion of $p^{i}u$ is $[0,\stackrel{i}{\dots},0,u_0,\dots,u_{s-i-1}]_p$ and we have that $\phi_s(p^{i}u)=(u_{s-i-1},\dots,u_{s-i-1})+(0,\dots,0,u_0,\dots,u_{s-i-2})Y_{s-1}$. Recall that the matrix $Y_{s-1}$ given in (\ref{genGraymap}), related to the definition of $\phi_s$, is a matrix of size $(s-1)\times p^{s-1}$ whose columns are the elements of $\mathbb{Z}_p^{s-1}$. Without loss of generality, we consider that $Y_{s}$ is the matrix obtained recursively from $Y_{1}=(0~1~\cdots~p-1)$ and \begin{equation}\label{eq:RecursiveYs} Y_{s}=\left(\begin{array}{cccc} Y_{s-1} & Y_{s-1} &\cdots & Y_{s-1} \\ {\mathbf{0}} & {\mathbf{1}} & \cdots & \mathbf{p-1}\\ \end{array}\right). \end{equation} By Lemma \ref{lem:gamma}, we can write \begin{equation} \gamma_s^{-1}(Y_{s-1})=\left(\begin{array}{cccc} {\mathbf{0}} & {\mathbf{1}} &\cdots & \mathbf{p-1}\\ Y_{s-2} & Y_{s-2} &\cdots &Y_{s-2} \\ \end{array}\right). \end{equation} Then, we have that \begin{equation*} \begin{split} &\gamma_s^{-1}(\phi_s(p^{i}u))\\ &=(u_{s-i-1},\stackrel{p^{s-1}}{\dots},u_{s-i-1})+(0,\stackrel{i}{\dots},0,u_0,\dots,u_{s-i-2})\left(\begin{array}{cccc} {\mathbf{0}} & {\mathbf{1}} &\cdots & \mathbf{p-1}\\ Y_{s-2} & Y_{s-2} &\cdots &Y_{s-2} \\ \end{array}\right)\\ &=(u_{s-i-1},\stackrel{p^{s-1}}{\dots},u_{s-i-1})+(0,\stackrel{i-1}{\dots},0,u_0,\dots,u_{s-i-2})\left(\begin{array}{cccc}Y_{s-2} & Y_{s-2} &\cdots &Y_{s-2} \\\end{array}\right)\\ &=(\phi_{s-1}(p^{i-1}u),\phi_{s-1}(p^{i-1}u),\dots,\phi_{s-1}(p^{i-1}u))=\Phi_{s-1}(p^{i-1}(u,\stackrel{p}{\dots},u)). \end{split} \end{equation*} Therefore, $\tau_s(p^{i}u)=\Phi_{s-1}^{-1}(\gamma_s^{-1}(\phi_s(p^{i}u)))=p^{i-1}(u,\stackrel{p}{\dots},u)$, and $(ii)$ holds. \end{proof} \begin{proposition}\label{prop:formulaPhis} Let $s\geq2$ and $\lambda_i\in \{0,1,\dots,p-1\}$, $i\in\{0,\dots,s-1\}$. Then, \begin{equation}\label{eq:sumPhi8} \phi_s(\sum_{i=0}^{s-1} \lambda_ip^i)=\gamma_s(\Phi_{s-1}(\sum_{i=0}^{s-1}\tau_s(\lambda_ip^i))). \end{equation} \end{proposition} \begin{proof} By Lemma \ref{lem:tau}, we know that for all $i\in\{1,\dots,s-1\}$, $\tau_s(p^i)=(p^{i-1},p^{i-1}, \dots, p^{i-1})$ and $\tau_s(1)=(0,p^{s-2},\dots,(p-1)p^{s-2})$. Then, by Lemma \ref{lema4}, we have that \begin{equation*} \gamma_s(\Phi_{s-1}(\sum_{i=0}^{s-1}\tau_s(\lambda_ip^i)))= \gamma_s(\sum_{i=0}^{s-1}\Phi_{s-1}(\tau_s(\lambda_ip^i))). \end{equation*} Moreover, $\gamma_s$ commutes with the addition. Therefore, by applying the definition of the map $\tau_s$ given in (\ref{eq:tau}), we obtain that $$ \gamma_s(\Phi_{s-1}(\sum_{i=0}^{s-1}\tau_s(\lambda_ip^i)))= \sum_{i=0}^{s-1}\gamma_s(\Phi_{s-1}(\tau_s(\lambda_ip^i)))= \sum_{i=0}^{s-1}\phi_s(\lambda_ip^i), $$ which is equal to $\phi_s(\sum_{i=0}^{s-1} \lambda_ip^i)$ by Lemma \ref{lema4}. \end{proof} \begin{corollary}\label{coro:formulaPhis} Let $s\geq2$ and $\lambda_i\in\{0,1,\dots,p-1\}$, $i\in\{0,\dots,s-1\}$. Then, \begin{equation} \tau_{s}(\sum_{i=0}^{s-1} \lambda_ip^i)=\sum_{i=0}^{s-1}\tau_s(\lambda_ip^i). \end{equation} \end{corollary} \begin{proof} By Proposition \ref{prop:formulaPhis}, we have that \[ \phi_s(\sum_{i=0}^{s-1} \lambda_ip^i)=\gamma_s(\Phi_{s-1}(\sum_{i=0}^{s-1}\tau_s(\lambda_ip^i))), \] \noindent and, therefore, \[ \Phi_{s-1}^{-1}(\gamma_s^{-1}(\phi_s(\sum_{i=0}^{s-1} \lambda_ip^i)))=\sum_{i=0}^{s-1}\tau_s(\lambda_ip^i),\\ \] \noindent that is, $\tau_s(\sum_{i=0}^{s-1} \lambda_i2^i)=\sum_{i=0}^{s-1}\tau_s(\lambda_ip^i)$. \end{proof} Now, we extend the permutation $\gamma_s\in\mathcal{S}_{p^{s-1}}$ to a permutation $\gamma_s\in\mathcal{S}_{p^{s-1}n}$ such that restricted to each set of $p^{s-1}$ coordinates $\{p^{s-1}i+1,p^{s-1}i+2,\dots,$ $p^{s-1}(i+1)\}$, $i \in\{0,\dots,n-1\}$, acts as $\gamma_s \in \mathcal{S}_{p^{s-1}}$. Then, we component-wise extend function $\tau_s$ defined in (\ref{eq:tau}) to $\tau_s:\mathbb{Z}_{p^s}^n\rightarrow \mathbb{Z}_{p^{s-1}}^{pn}$ and define $\tilde{\tau}_s=\rho^{-1}\circ \tau_s$, where $\rho \in{\cal S}_{pn}$ is defined as follows: for a coordinate $k=jp+i+1 \in \{1,2,\dots, pn\}$, where $i,j \in \{0,\dots, n-1\}$, $\rho$ moves coordinate $k$ to coordinate $ip+j+1$. So, we can write $\rho$ as \begin{equation*} \footnotesize \left( \begin{array}{ccccccccccccc} 1 & 2& \ldots &n & n+1 & n+2 &\ldots & 2n & \ldots & pn-p+1 &pn-p+2 &\ldots &pn \\ 1 & p+1& \ldots &(n-1)p+1 &2 & p+2 & \ldots & (n-1)p+2 &\ldots & p &p+p & \ldots &pn\\ \end{array} \right). \end{equation*} \begin{example} For $p=3$ and $n=2$, \begin{equation*} \rho=\left( \begin{array}{ccccccccccc} 1 & 2& &3 & 4& &5& 6 \\ 1 & 4& &2 & 5& &3& 6 \\ \end{array} \right) \in \mathcal{S}_6. \end{equation*} and for $p=3$ and $n=4$, \begin{equation*} \rho=\left( \begin{array}{ccccccccccccccccccccccccccccc} 1 &2 &3 &4 & &5 &6 &7 &8 & &9 &10 &11 &12\\ 1 &4 &7 &10 & &2 &5 &8 &11 & &3 &6 &9 &12\\ \end{array} \right)\in \mathcal{S}_{12}. \end{equation*} \end{example} \begin{remark} If $\mathbf{u}=(u_1,u_2,\dots,u_n)\in \mathbb{Z}_{p^s}^n$ and $\tau_s(u_i)=(u_{i,1},u_{i,2},\dots,u_{i,p})$ for all $i \in \{1,\ldots,n\}$, then $$\tau_s(\mathbf{u})=(u_{1,1},u_{1,2},\dots,u_{1,p},u_{2,1},u_{2,2},\dots,u_{2,p},\dots,u_{n,1},u_{n,2},\dots,u_{n,p}),$$ and $$\tilde{\tau}_s(\mathbf{u})=(u_{1,1},u_{2,1}\dots,u_{n,1},u_{1,2},u_{2,2}\dots,u_{n,2},\dots, u_{1,p},\\u_{2,p},\dots,u_{n,p}).$$ \end{remark} \begin{lemma} Let $s\geq 2$. Then, $\Phi_s(\mathbf{u})=\gamma_s(\Phi_{s-1}(\rho( \tilde{\tau}_s(\mathbf{u}) )))$ for all $\mathbf{u}\in \mathbb{Z}_{p^s}^n$. \end{lemma} \begin{proof} It follows from $\tilde{\tau}_s(\mathbf{u})=\rho^{-1}(\tau_s(\mathbf{u}))=\rho^{-1}(\Phi_{s-1}^{-1}(\gamma_s^{-1}(\Phi_s(\mathbf{u}))))$. \end{proof} Let $\mathbf{w}_i^{(s)}$ be the $i$th row of $A^{t_1,\ldots,t_s}$, $1\leq i\leq t_1+\cdots+t_s$. By construction, $\mathbf{w}_1^{(s)}={\mathbf{1}}$ and $\operatorname{ord}(\mathbf{w}_i^{(s)})\leq \operatorname{ord}(\mathbf{w}_j^{(s)})$ if $i>j$. Let $\sigma_i$ be the integer such that $\operatorname{ord}(\mathbf{w}_i^{(s)} )=p^{\sigma_i}$. Then, $\mathcal{B}^{t_1,\dots,t_s}=\{ p^{q_i}\mathbf{w}_i^{(s)} : 1\leq i\leq t_1+\cdots+t_s,\, 0\leq q_i\leq \sigma_i-1 \}$ is a $p$-basis of $\mathcal{H}^{t_1,\ldots,t_s}$. \begin{lemma}\label{lem:WsWs1} Let $t_s\geq1$. Let $\mathbf{w}_i^{(s)}$ and $\mathbf{w}_i^{(s+1)}$ be the $i$th row of $A^{t_1,\ldots,t_s}$ and $A^{1,t_1-1,t_2,\ldots,t_{s-1},t_s-1}$, respectively. Then, $(\mathbf{w}_i^{(s+1)},\mathbf{w}_i^{(s+1)},\dots,\mathbf{w}_i^{(s+1)})=p\mathbf{w}_i^{(s)}$ and $\operatorname{ord}(\mathbf{w}_i^{(s)})=\operatorname{ord}(\mathbf{w}_i^{(s+1)})=p^{\sigma_i}$. \end{lemma} \begin{proof} Consider $A^{t_1,\dots,t_s}$ with $t_s\geq1$, and $\mathbf{w}_i^{(s)}$ its $i$th row for $i\in\{1,\dots,t_1+\cdots+t_s\}$. Then, the matrix over $\mathbb{Z}_{p^{s+1}}$ $$ \left(\begin{array}{c} \mathbf{w}_1^{(s)}\\ p\mathbf{w}_2^{(s)}\\ \vdots\\ p\mathbf{w}_{t_1+\cdots+t_s}^{(s)}\\ \end{array}\right) $$ is, by definition, $A^{1,t_1-1,t_2,\dots,t_{s-1},t_s}$. Moreover, by construction we have that $A^{1,t_1-1,t_2,\dots,t_{s-1},t_s}$ is the matrix $$ \left(\begin{array}{cccc} A^{1,t_1-1,t_2,\dots,t_{s-1},t_s-1} & A^{1,t_1-1,t_2,\dots,t_{s-1},t_s-1}&\cdots &A^{1,t_1-1,t_2,\dots,t_{s-1},t_s-1}\\ p^s\cdot {\mathbf{0}} & p^s\cdot\mathbf{1} &\cdots &p^s \cdot \mathbf{(p-1)}\\ \end{array}\right). $$ Therefore, if $\mathbf{w}_i^{(s+1)}$ is the $i$th row of $A^{1,t_1-1,t_2,\dots,t_{s-1},t_s-1}$ for $i\in\{2,\dots,t_1+t_2+\dots+t_s-1\}$, we have that $(\mathbf{w}_i^{(s+1)},\mathbf{w}_i^{(s+1)},\dots,\mathbf{w}_i^{(s+1)})=p\mathbf{w}_i^{(s)}$ and $\operatorname{ord}(\mathbf{w}_i^{(s)})=\operatorname{ord}(\mathbf{w}_i^{(s+1)})=p^{\sigma_i}$. \end{proof} \begin{example} \label{ex:2bases} Let ${\mathcal H}^{2,1}$ and ${\mathcal H}^{1,1,0}$ be the $\mathbb{Z}_9$-additive and $\mathbb{Z}_{27}$-additive GH codes, which are generated by $$ \footnotesize A^{2,1}=\left(\begin{array}{c} \mathbf{w}_1^{(2)}\\ \mathbf{w}_2^{(2)}\\ \mathbf{w}_3^{(2)} \end{array}\right) =\left(\begin{array}{ccc} {\mathbf{1}} & {\mathbf{1}} & {\mathbf{1}}\\ v & v & v \\ {\mathbf{0}} & \mathbf{3} & \mathbf{9} \end{array}\right), $$ where $v=(0,1,2,3,4,5,6,7,8)$, and $$ A^{1,1,0}=\left(\begin{array}{c} \mathbf{w}_1^{(3)}\\ \mathbf{w}_2^{(3)} \end{array}\right) =\left(\begin{array}{ccccccccc} 1&1&1&1&1&1&1&1&1 \\ 0&3&6&9&12&15&18&21&24 \\ \end{array}\right), $$ respectively. The corresponding $3$-bases are \begin{align*} \mathcal{B}^{2,1}=\{&\mathbf{w}_1^{(2)},3\mathbf{w}_1^{(2)},\mathbf{w}_2^{(2)},3\mathbf{w}_2^{(2)},\mathbf{w}_3^{(2)}\} \\ =\{&\mathbf{1},\mathbf{3},(0,1,2,3,4,5,6,7,8,\stackrel{3}{\dots},0,1,2,3,4,5,6,7,8),\\ &(0,3,6,9,12,15,18,21,24,\stackrel{3}{\dots},0,3,6,9,12,15,18,21,24)\},~ \mbox{and} \\ \mathcal{B}^{1,1,0}=\{&\mathbf{w}_1^{(3)},3\mathbf{w}_1^{(3)},3^2\mathbf{w}_1^{(3)},\mathbf{w}_2^{(3)},3\mathbf{w}_2^{(3)} \}\\ =\{&\mathbf{1},\mathbf{3},\mathbf{9},(0,3,6,9,12,15,18,21,24),(0,9,18,0,9,18,0,9,18)\}.\\ \end{align*} \end{example} \begin{proposition} \label{prop:basis} Let $t_s\geq1$, and $\mathcal{H}^{t_1,\ldots,t_s}$ and $\mathcal{H}^{1,t_1-1,t_2,\ldots,t_{s-1},t_s-1}$ be the $\mathbb{Z}_{p^s}$-additive and $\mathbb{Z}_{p^{s+1}}$-additive GH codes with generator matrices $A^{t_1,\ldots,t_s}$ and $A^{1,t_1-1,t_2,\ldots,t_{s-1},t_s-1}$, respectively. Let $\mathbf{w}_i^{(s)}$ and $\mathbf{w}_i^{(s+1)}$ be the $i$th row of $A^{t_1,\ldots,t_s}$ and $A^{1,t_1-1,t_2,\ldots,t_{s-1},t_s-1}$, respectively. Then, we have that \begin{enumerate}[label=(\roman*)] \item $\tilde{\tau}_{s+1}(p^{q_i}\mathbf{w}^{(s+1)}_i)=p^{q_i}\mathbf{w}^{(s)}_i$, for all $i \in \{2,\dots,t_1+\cdots+t_s-1\}$ and $q_i\in\{0,\dots,\sigma_i-1\}$, where $\operatorname{ord}(\mathbf{w}_i^{(s)})=p^{\sigma_i}$; \item $\tilde{\tau}_{s+1}(p^{j+1}\mathbf{w}^{(s+1)}_1)=p^{j}\mathbf{w}^{(s)}_1$, for all $j\in\{0,\dots,s-1\}$; \item $\tilde{\tau}_{s+1}(\mathbf{w}_1^{(s+1)})=\mathbf{w}^{(s)}_{t_1+\cdots +t_{s}}.$ \end{enumerate} \end{proposition} \begin{proof} By Lemma \ref{lem:WsWs1}, we have that $(\mathbf{w}_i^{(s+1)},\mathbf{w}_i^{(s+1)},\dots,\mathbf{w}_i^{(s+1)})=p\mathbf{w}_i^{(s)}$ and $\operatorname{ord}(\mathbf{w}_i^{(s)})=\operatorname{ord}(\mathbf{w}_i^{(s+1)})=p^{\sigma_i}$. Let $\mathbf{v}_i^{(s+1)}$ be the vector over $\mathbb{Z}_{p^{s+1}}$ such that $\mathbf{w}_i^{(s+1)}=p\mathbf{v}_i^{(s+1)}$ and $\mathbf{w}_i^{(s)}=(\mathbf{v}_i^{(s+1)},\mathbf{v}_i^{(s+1)},\dots,\mathbf{v}_i^{(s+1)})$. Let $(\mathbf{v}_i^{(s+1)})_j$ be the $j$th coordinate of $\mathbf{v}_i^{(s+1)}$. By the definition of $\tilde{\tau}_{s+1}$ and Lemma \ref{lem:tau}, for $q_i\in\{0,\dots,\sigma_i-1\}$, we have that \begin{equation*} \begin{split} &\tilde{\tau}_{s+1}(p^{q_i}\mathbf{w}^{(s+1)}_i)=\rho^{-1}(\tau_{s+1}(p^{q_i}\mathbf{w}^{(s+1)}_i))=\rho^{-1}(\tau_{s+1}(p^{q_i+1}\mathbf{v}_i^{(s+1)}))\\ &=\rho^{-1}(p^{q_i}((\mathbf{v}_i^{(s+1)})_1,\dots,(\mathbf{v}_i^{(s+1)})_1,\dots,(\mathbf{v}_i^{(s+1)})_n,\dots,(\mathbf{v}_i^{(s+1)})_n))\\ &=p^{q_i}(\mathbf{v}_i^{(s+1)},\mathbf{v}_i^{(s+1)},\dots,\mathbf{v}_i^{(s+1)})=p^{q_i}\mathbf{w}_i^{(s)}, \end{split} \end{equation*} and $(i)$ holds. Since $\mathbf{w}_1^{(s)}=(\mathbf{w}_1^{(s+1)},\dots,\mathbf{w}_1^{(s+1)})={\mathbf{1}}$ and $\mathbf{w}_{t_1+\cdots+t_s}^{(s)}=(p^{s-1} \cdot {\mathbf{0}},p^{s-1} \cdot \mathbf{1},\dots,p^{s-1}\cdot \mathbf{(p-1)})$, then the equalities in items $(ii)$ and $(iii)$ hold by the definition of $\tilde{\tau}_{s+1}$ and Lemma \ref{lem:tau}. \end{proof} Note that, from the previous proposition, we have that $\tilde{\tau}_{s+1}$ is a bijection between the $p$-bases, $\mathcal{B}^{t_1,\dots,t_s}$ and $\mathcal{B}^{1,t_1-1,\dots,t_{s-1},t_s-1}$. \begin{example} Let ${\mathcal H}^{2,1}$ and ${\mathcal H}^{1,1,0}$ be the same codes considered in Example \ref{ex:2bases}. The length of ${\mathcal H}^{1,1,0}$ is $n=9$. Then, the extension of $\gamma_3= (2,4)(3,7)(6,8)$ $ \in {\cal S}_9$ is $\gamma_3=(2,4)(3,7)(6,8)(11,13)(12,16)(15,17)(20,22)\\(21,25)(24,26)(29,31)(30,34)(33,35)(38,40)(39,43)(42,44)(47,49)(48,52)\\(51,53)(56,58)(57,61)(60,62)(65,67)(66,70)(69,71)(74,76)(75,79)(78,80)\in {\cal S}_{81}$, and \begin{equation} \tiny \rho=\left( \begin{array}{cccccccccccccccccccccccccccccc} 1 & 2& 3 & 4 & 5 & 6 & 7 & 8 &9 &10 &11 &12 &13 &14 &15 &16 &17 &18 &19 &20 &21 &22 &23 &24 &25 &26 &27 \\ 1 &4 &7 &10 &13 &16 &19 &22 &25 &2 &5 &8 &11 &14 &17 &20 &23 &26 &3 &6 &9 &12 &15 &18 &21 &24 &27 \\ \end{array} \right) \in {\cal S}_{27}. \end{equation} In this case, we have that $$ \footnotesize \arraycolsep=1pt\def{} \begin{array}{lccclcc} \Phi_3(1,1,1,1,1,1,1,1,1)&=&\gamma_3(\Phi_2(0,3,6, \stackrel{9}{\dots},0,3,6))&=&\gamma_3(\Phi_2(\rho(\mathbf{0},\mathbf{3},\mathbf{6}))), \\ \Phi_3(3,3,3,3,3,3,3,3,3)&=&\gamma_3(\Phi_2(1,1,1,\stackrel{9}{\dots},1,1,1))&=&\gamma_3(\Phi_2(\rho(1,1,1,\stackrel{9}{\dots},1,1,1))), \\ \Phi_3(9,9,9,9,9,9,9,9,9)&=&\gamma_3(\Phi_2(3,3,3,\stackrel{9}{\dots},3,3,3))&=&\gamma_3(\Phi_2(\rho(3,3,3,\stackrel{9}{\dots},3,3,3))), \\ \Phi_3(0,3,6,9,12,15,18,21,24)&=&\gamma_3(\Phi_2(0,0,0,1,1,1,\dots,8,8,8))&=&\gamma_3(\Phi_2(\rho(u,\stackrel{3}{\dots},u)), \\ \Phi_3(0,9,18,0,9,18,0,9,18)&=&\gamma_3(\Phi_2(v, \stackrel{3}{\dots}, v))&=&\gamma_3(\Phi_2(\rho(0,3,6, \stackrel{9}{\dots},0,3,6))), \end{array} $$ where $u=(0,1,2,3,4,5,6,7,8)$ and $v=(0,0,0,3,3,3,6,6,6).$ Since $\Phi_3(\mathbf{u})=\gamma_3(\Phi_{2}(\rho( \tilde{\tau}_3(\mathbf{u}) )))$ for all $\mathbf{u}\in \mathbb{Z}_{27}^9$, the map $\tilde{\tau}_3$ sends the elements of the $3$-basis $\mathcal{B}^{1,1,0}$ into the elements of the $3$-basis $\mathcal{B}^{2,1}$. That is, as it is shown in Proposition~\ref{prop:basis}, \begin{equation*} \arraycolsep=1pt\def{} \begin{array}{lcccccl} \tilde{\tau}_3(\mathbf{w}_1^{(3)}) & = & \tilde{\tau}_3(1,1,1,1,1,1,1,1,1) & = & (\mathbf{0},\mathbf{3},\mathbf{6}) & = & \mathbf{w}_3^{(2)},\\ \tilde{\tau}_3(3\mathbf{w}_1^{(3)}) & = & \tilde{\tau}_3(3,3,3,3,3,3,3,3,3) & = & (1,1,1,\stackrel{9}{\dots},1,1,1) & = & \mathbf{w}_1^{(2)},\\ \tilde{\tau}_3(9\mathbf{w}_1^{(3)}) & = & \tilde{\tau}_3(9,9,9,9,9,9,9,9,9) & = & (3,3,3,\stackrel{9}{\dots},3,3,3) & = & 3\mathbf{w}_1^{(2)},\\ \tilde{\tau}_3(\mathbf{w}_2^{(3)}) & = & \tilde{\tau}_3(0,3,6,9,12,15,18,21,24) & = & (u,\stackrel{3}{\dots}, u) & = & \mathbf{w}_2^{(2)},\\ \tilde{\tau}_3(3\mathbf{w}_2^{(3)}) & = & \tilde{\tau}_3(0,9,18,0,9,18,0,9,18) & = & (0,3,6,\stackrel{9}{\dots},0,3,6) & = & 3\mathbf{w}_2^{(2)},\\ \end{array} \end{equation*} so $\tilde{\tau}_3$ is a bijection between both $3$-bases. \end{example} \begin{lemma}\label{lemma:basisEquivcodes} Let $\mathcal{H}_s=\mathcal{H}^{t_1,\ldots,t_s}$ be a $\mathbb{Z}_{p^s}$-additive GH code with $t_s\geq1$, and $\mathcal{H}_{s+1}=\mathcal{H}^{1,t_1-1,t_2,\ldots,t_{s-1},t_s-1}$ be a $\mathbb{Z}_{p^{s+1}}$-additive GH code. Then, $H_s=\Phi_s(\mathcal{H}_s)$ is permutation equivalent to $H_{s+1}=\Phi_{s+1}(\mathcal{H}_{s+1})$. \end{lemma} \begin{proof} Let $t$ be the integer such that $H_s$ and $H_{s+1}$ are of length $p^t$. Let $\mathcal{B}_s=\{\mathbf{v}_1^{(s)},\dots,\mathbf{v}_{t+1}^{(s)}\}$ and $\mathcal{B}_{s+1}=\{\mathbf{v}_1^{(s+1)},\dots,\mathbf{v}_{t+1}^{(s+1)}\}$ be the $p$-basis of $\mathcal{H}_s$ and $\mathcal{H}_{s+1}$, respectively. By Proposition \ref{prop:basis}, $\tilde{\tau}_{s+1}$ is a bijection between $\mathcal{B}_s$ and $\mathcal{B}_{s+1}$. By the definition of $\tilde{\tau}_{s+1}$ and Corollary \ref{coro:formulaPhis}, we have that $\tilde{\tau}_{s+1}$ commutes with the addition, so $\tilde{\tau}_{s+1}(\mathcal{H}_{s+1})=\mathcal{H}_{s}$. Let $\rho_*\in\mathcal{S}_{p^t}$ be a permutation such that $\Phi_s(\rho(\mathbf{u}))=\rho_*(\Phi_s(\mathbf{u}))$ for all $\mathbf{u}\in\mathcal{H}_{s}$. Since $\mathcal{H}_s=\tilde{\tau}_{s+1}(\mathcal{H}_{s+1})=\rho^{-1}(\Phi_{s}^{-1}(\gamma^{-1}_{s+1}(\Phi_{s+1}(\mathcal{H}_{s+1}))))$, we have that $\Phi_{s}(\mathcal{H}_s)=\rho_*^{-1}(\gamma^{-1}_{s+1}(\Phi_{s+1}(\mathcal{H}_{s+1})))$. Therefore, we obtain $H_s=(\gamma_{s+1}\circ\rho_*)^{-1}(H_{s+1})$, where $\gamma_{s+1}\circ\rho_*\in\mathcal{S}_{p^t}$. \end{proof} The following theorem determines which $\mathbb{Z}_{p^{s'}}$-linear GH codes are equivalent to a given $\mathbb{Z}_{p^s}$-linear Hadamard code $H^{t_1,\dots,t_s}$. We denote by ${\mathbf{0}}^j$ the all-zero vector of length $j$. Let $\sigma$ be the integer such that $\operatorname{ord}(\mathbf{w}_2^{(s)})=p^{s+1-\sigma}$. Note that $\sigma =1$ if and only if $t_1\geq 2$. Moreover, since $\sigma_2$ is the integer such that $\operatorname{ord}(\mathbf{w}_2^{(s)})=p^{\sigma_2}$, we have that $\sigma=s+1-\sigma_2$. \begin{theorem}\label{theo:equi} Let $H^{t_1,\dots,t_s}$ be a $\mathbb{Z}_{2^s}$-linear GH code with $t_s\geq 1$. Then, $H^{t_1,\dots,t_s}$ is equivalent to the $\mathbb{Z}_{p^{s+\ell}}$-linear Hadamard code $H^{1,{\mathbf{0}}^{\ell-1},t_1-1,t_2,\dots,t_{s-1},t_s-\ell}$, for all $\ell\in\{1,\dots,t_s\}$. \end{theorem} \begin{proof} Consider $\mathcal{H}_0=\mathcal{H}^{t_1,\dots,t_s}$ and $\mathcal{H}_\ell=\mathcal{H}^{1,{\mathbf{0}}^{\ell-1},t_1-1,t_2,\dots,t_{s-1},t_s-\ell}$ for $\ell\in\{1,\dots,t_s\}$. By Lemma \ref{lemma:basisEquivcodes}, we have that $H_i=\Phi(\mathcal{H}_i)$ is permutation equivalent to $H_{i+1}=\Phi(\mathcal{H}_{i+1})$ for all $i\in\{0,\dots,\ell-1\}$ and $\ell\in\{1,\dots,t_s\}$. Therefore, we have that $H_0$ and $H_{\ell}$ are permutation equivalent for all $\ell\in\{1,\dots,t_s\}$. \end{proof} \medskip Let $t_1, t_2,\dots,t_s$ be nonnegative integers with $t_1\geq 2$. Let $C_H(t_1,\dots,t_s)=[H_1=H^{t_1,\dots,t_s},H_2,\dots, H_{t_s+1}]$ be the sequence of all $\mathbb{Z}_{p^{s'}}$-linear GH codes of length $p^t$, where $t=$ $\left(\sum_{i=1}^{s'}(s'-i+1)\cdot t_i\right)-1$, that are permutation equivalent to $H^{t_1,\dots,t_s}$ by Theorem \ref{theo:equi}. We denote by $C_H(t_1,\dots,t_s)[i]$ the $i$th code $H_i$ in the sequence, for $1\leq i\leq t_s+1$. We consider that the order of the codes in $C_H(t_1,\dots,t_s)$ is the following: \begin{equation}\label{eq:defCH} C_H(t_1,\dots,t_s)[i]= \begin{cases} H^{t_1,\dots,t_{s}},& \text{if } i= 1,\\ H^{1,{\mathbf{0}}^{i-2},t_1-1,t_2,\dots,t_{s-1},t_s-i+1}, & \text{otherwise.} \end{cases} \end{equation} We refer to $C_H(t_1,\dots,t_s)$ as the {\it chain of equivalences} of $H^{t_1,\dots,t_s}$. Note that if $t_s=0$, then $C_H(t_1,\dots,t_s)=[H^{t_1,\dots,t_s}]$. \begin{corollary}\label{lemma:CH} Let $t_1, t_2,\dots,t_s$ be nonnegative integers with $t_1\geq 2$. Then, $$|C_H(t_1,\dots,t_s)|=t_s+1.$$ \end{corollary} \begin{example}\label{examples:chain1} Let $p=3$. Then the chain of equivalences of $H^{3,3}$ is the sequence $C_H(3,3)=[H^{3,3}, H^{1,2,2}, H^{1,0,2,1}, H^{1,0,0,2,0}]$ and contains exactly $t_2+1=4$ codes. Note that this sequence contains all the codes of length $3^8$ having the pair $(r,k)=(14,6)$ in Table \ref{table:TypesB2}. In the table \ref{table:Types}, we can see that there is only one code of length $3^7$ having the pair $(r,k)=(25,3)$, named $H^{2,1,0}$. The chain of equivalences of this code is $C_H(2,1,0)=[H^{2,1,0}]$, which contains just this code, since $t_3+1=1$. \end{example} \begin{proposition}\label{lemma:pos-i-in-CH} Let $t_1,t_2,\dots,t_s$ be nonnegative integers with $t_1\geq 2$. Then, the $\mathbb{Z}_{p^{s'}}$-linear Hadamard code $H^{t'_1,\dots,t'_{s'}}= C_H(t_1,\dots,t_s)[i]$, $1\leq i\leq t_s+1$, satisfies \begin{enumerate}[label=(\roman*)] \item $s'=s+i-1$, \item $\sigma'=i$, \item $t'_{s'}=t_s-i+1$, \item $ (t'_1,\dots,t'_{s'})= \begin{cases} (t_1,\dots,t_{s}),& \text{if } i= 1,\\ (1,{\mathbf{0}}^{i-2},t_1-1,t_2,\dots,t_{s-1},t_s-i+1), & \text{otherwise.} \end{cases} $ \end{enumerate} \end{proposition} \begin{proof} Straightforward from Theorem \ref{theo:equi} and the definition of the chain of equivalences $C_H(t_1,\dots,t_s)$. \end{proof} Note that the value of $s'$ is different for every code $H^{t'_1,\dots,t'_{s'}}$ belonging to the same chain of equivalences $C_H(t_1,\dots,t_s)$. \begin{corollary}\label{coro:One-ts0} Let $t_1, t_2,\dots,t_s$ be nonnegative integers with $t_1\geq 2$. \begin{enumerate}[label=(\roman*)] \item The $\mathbb{Z}_{p^{s'}}$-linear Hadamard code $H^{t'_1,\dots,t'_{s'}}= C_H(t_1,\dots,t_s)[1]$ is the only one in $C_H(t_1,\dots,t_s)$ with $\sigma'=1$, that is, the only one with $t'_1\geq 2$. \item The $\mathbb{Z}_{p^{s'}}$-linear Hadamard code $H^{t'_1,\dots,t'_{s'}}= C_H(t_1,\dots,t_s)[t_s+1]$ is the only one in $C_H(t_1,\dots,t_s)$ with $t'_{s'}=0$. \end{enumerate} \end{corollary} Now, given any $\mathbb{Z}_{p^s}$-linear Hadamard code $H^{t_1,\dots,t_s}$, we determine the chain of equivalences containing this code, as well as its position in the sequence. Therefore, note that indeed we prove that any code $H^{t_1,\dots,t_s}$ (with $t_1\geq 1$) belongs to a unique chain of equivalences $C_H(t'_1,\dots,t'_{s'})$ with $t'_1 \geq 2$. \begin{proposition}\label{lemma:codeInChain} Let $t_1, t_2,\dots,t_s$ be nonnegative integers with $t_1\geq 1$. The $\mathbb{Z}_{p^{s}}$-linear Hadamard code $H^{t_1,\dots,t_{s}}$ belongs to an unique chain of equivalences. If $t_1\geq 2$, then $\sigma=1$ and $H^{t_1,\dots,t_s}=C_H(t_1,\dots,t_s)[1]$. Otherwise, if $t_1=1$, then $\sigma >1$ and $H^{t_1,\dots,t_s}=C_H(t'_1,\dots,t'_{s'})[\sigma]$, where $(t'_1,\dots,t'_{s'})= (t_\sigma+1,t_{\sigma+1},\dots,t_{s-1},t_s+\sigma-1)$ and $s'=s-\sigma+1$. \end{proposition} \begin{proof} If $t_1\geq 2$, it is clear by the definition of chain of equivalences and Corollary \ref{coro:One-ts0}. If $t_1=1$, then $\sigma >1$. By Proposition \ref{lemma:pos-i-in-CH}, since $H^{t_1,\dots,t_s}=C_H(t'_1,\dots,t'_{s'})[\sigma]$, we have that $(t_1,\dots,t_s)=(1,{\mathbf{0}}^{\sigma-2},t'_1-1, t'_2, \ldots,t'_{s'-1}, t'_{s'}-\sigma+1)$. Therefore, $t_\sigma=t'_1-1$, $t_{\sigma+1}=t'_2$, $\ldots$, $t_{s-1}=t'_{s'-1}$, $t_s=t'_{s'}-\sigma+1$, and the result follows. \end{proof} \begin{corollary}\label{coro:count-CH} Let $H^{t_1,\dots,t_{s}}$ be a $\mathbb{Z}_{p^{s}}$-linear Hadamard code and $C_H(t'_1,\dots,t'_{s'})$ the chain of equivalences such that $H^{t_1,\dots,t_{s}}=C_H(t'_1,\dots,t'_{s'})[\sigma]$. Then, $$ |C_H(t'_1,\dots,t'_{s'})|=t_s+\sigma.$$ \end{corollary} \begin{proof} If $t_1\geq 2$, then $H^{t_1,\dots,t_s}=C_H(t_1,\dots,t_{s})[1]$ by Proposition \ref{lemma:codeInChain}. By Corollary \ref{lemma:CH}, $|C_H(t_1,\dots,t_{s})|=t_s+1=t_s+\sigma$. Otherwise, if $t_1=1$, then $H^{t_1,\dots,t_s}=C_H(t_\sigma+1,t_{\sigma+1},\dots,$ $t_{s-1},t_s+\sigma-1)[\sigma]$ by Proposition \ref{lemma:codeInChain}. Finally, $|C_H(t_\sigma+1,t_{\sigma+1},\dots,$ $t_{s-1},t_s+\sigma-1)|=t_s+\sigma-1+1=t_s+\sigma$ by Corollary \ref{lemma:CH}. \end{proof} \begin{example}\label{examples:chainpos} The $\mathbb{Z}_{3^4}$-linear GH code $H^{1,0,2,1}$ has $t_1=1$, $\sigma=3$ and $s=4$. By Proposition \ref{lemma:codeInChain}, since $\sigma=3$ and $s'=s-\sigma+1=2$, this code is placed in the third position of the chain of equivalences $C_H(t'_1,t'_2)$, where $t'_1=t_3+1=2+1=3$ and $t'_2=t_4+\sigma-1=1+3-1=3$. Therefore, $H^{1,0,2,1}=C_H(3,3)[3]$. By Corollary \ref{coro:count-CH}, $C_H(3,3)$ contains exactly $t_4+\sigma=1+3=4$ codes, which are the ones described in Example \ref{examples:chain1}. \end{example} If $H^{t_1,\dots,t_s}$ is a $\mathbb{Z}_{3^s}$-linear GH code of length $3^t$ with $t_1\geq 2$ and $t_s=0$, then $|C_H(t_1,\dots,t_s)|=1$ by Corollary \ref{coro:count-CH}. In this case, from Tables \ref{table:Types} and \ref{table:TypesB2}, we can see that $H^{t_1,\dots,t_s}$ is not equivalent to any other code $H^{t'_1,\dots,t'_{s'}}$ of the same length $3^t$, for $t\leq 10$. We conjecture that this is true for any $t\geq 11$. The values of $(t_1,\dots,t_s)$ for which the codes $H^{t_1,\dots,t_s}$ are not equivalent to any other such code of the same length $3^t$, for $t\leq 10$, can be found in Table \ref{table:Types2}. \begin{table}[h] \centering \begin{tabular}{|c||l|} \hline $t=5$ & (3,0), (2,0,0)\\ \hline $t=7$ & (4,0), (2,1,0), (2,0,0,0)\\ \hline $t=8$ & (3,0,0)\\ \hline $t=9$ & (5,0), (2,2,0), (2,0,1,0), (2,0,0,0,0)\\ \hline $t=10$ & (3,1,0), (2,1,0,0)\\ \hline \end{tabular} \caption{Type of all $\mathbb{Z}_{3^s}$-linear GH codes of length $3^t$ with $\sigma=1$ and $t_s=0$ for $t \leq 10$.} \label{table:Types2} \end{table} From Tables \ref{table:Types} and \ref{table:TypesB2}, we can also see that the $\mathbb{Z}_{3^s}$-linear GH codes of length $3^t$ with $t\leq10$ having the same values $(r,k)$ are the ones which are equivalent by Theorem \ref{theo:equi}. We conjecture that this is true for any $t\geq 11$. \section{Improvement of the partial classification} \label{sec:Classification} In this section, we improve some results on the classification of the $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$, once $t$ is fixed. More precisely, we improve the upper bounds of ${\cal A}_{t,p}$ given by Theorem \ref{theo:CardinalFirstBound} and determine the exact value of ${\cal A}_{t,p}$ for $t\leq 10$ by using the equivalence results established in Section \ref{sec:relations}. Next, we prove two corollaries of Theorem \ref{theo:equi}, which allow us to improve the known upper bounds for ${\cal A}_{t,p}$. \begin{corollary} \label{coro:t1} Let $H^{t_1,\dots,t_s}$ be a $\mathbb{Z}_{p^s}$-linear GH code. Then, $H^{t_1,\dots,t_s}$ is equivalent to $t_s + \sigma$ $\mathbb{Z}_{p^{s'}}$-linear GH codes for $s'\in \{s+1-\sigma,\dots,s+t_s\}$. Among them, there is exactly one $H^{t'_1,\dots,t'_{s'}}$ with $t'_1\geq 2$, and there is exactly one $H^{t'_1,\dots,t'_{s'}}$ with $t'_{s'}=0$. \end{corollary} \begin{proof} The code $H^{t_1,\dots,t_s}$ belongs to a chain of equivalences $C$, which can be determined by Proposition \ref{lemma:codeInChain}. We have that $H^{t_1,\dots,t_s}$ is equivalent to any code in $C$ by Theorem \ref{theo:equi}, and the number of codes in $C$ is $t_s+\sigma$ by Corollary \ref{coro:count-CH}. By Proposition \ref{lemma:codeInChain}, the first code in $C$ has $s'=s-\sigma+1$. By Proposition \ref{lemma:pos-i-in-CH}, the $i$th code $H^{t'_1,\dots,t'_{s'}}=C[i]$ has $s'=s-\sigma+i$ for $i\in\{1,\dots, t_s+\sigma\}$. Therefore, $s'\in \{ s-\sigma+1, \dots, s+t_s \}$. Finally, by Corollary \ref{coro:One-ts0}, $C[1]$ is the only code in $C$ with $t'_1\geq 2$ and $C[t_s+\sigma]$ is the only code in $C$ with $t'_{s'}=0$. \end{proof} From Corollary \ref{coro:t1}, in order to determine the number of nonequivalent $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$, ${\cal A}_{t,p}$, we just have to consider one code out of the $t_s+\sigma$ codes that are equivalent. For example, we can consider the one with $t_1\geq 2$. \begin{corollary}\label{cor:sin} Let $H$ be a nonlinear $\mathbb{Z}_{p^s}$-linear GH code of length $p^t$. If $s\in\{\lfloor(t+1)/2\rfloor+1,\dots,t+1\}$, then there is an equivalent $\mathbb{Z}_{p^{s'}}$-linear Hadamard code of length $p^t$ with $s'\in\{2,\dots,\lfloor(t+1)/2\rfloor\}$. \end{corollary} \begin{proof} Let $H^{t_1,\dots,t_s}$ be a $\mathbb{Z}_{p^s}$-linear Hadamard code with $s\in\{\lfloor(t+1)/2\rfloor+1,\dots,t+1\}$. Since $\sum_{i=1}^s(s+1-i)t_i=t+1$, then $t_1=1$ and we have that $\sigma>1$. Therefore, by Proposition \ref{lemma:codeInChain}, $H^{t_1,\dots,t_s}$ is permutation equivalent to the $\mathbb{Z}_{p^{s-\sigma+1}}$-linear Hadamard code $H=H^{t_\sigma+1,t_{\sigma+1},\dots,t_{s-1},t_s+\sigma-1}$. Now, we just need to see that $s-\sigma+1<\lfloor(t+1)/2\rfloor$. Since the length of $H$ is $p^t$, we have that $t+1=(s-\sigma+1)(t_\sigma+1)+\sum_{i=2}^{s-\sigma+1}(s-\sigma+2-i)t_{\sigma-1+i}+\sigma-1$. Therefore, $(s-\sigma+1)(t_\sigma+1)\leq t+1$ and $s-\sigma+1\leq({t+1})/({t_\sigma+1})$. By the definition of $t_\sigma$, we know that $t_\sigma\geq1$, so $s-\sigma+1\leq \lfloor (t+1)/2\rfloor$. \end{proof} Note that we can focus on the $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ with $s\in \{2,\dots,\lfloor (t+1)/2\rfloor\}$ by Corollary \ref{cor:sin}, and we can restrict ourselves to the codes having $t_1\geq 2$ by Corollary \ref{coro:t1}. With this on mind, in order to classify all such codes for a given $t\geq 3$, we define $\tilde{X}_{t,s,p}=|\{ (t_1,\ldots,t_s)\in {\mathbb{N}}^s : t+1=\sum_{i=1}^{s}(s-i+1) t_i, \ t_1\geq 2 \}|$ for $s\in\{2,\dots,\lfloor (t+1)/2\rfloor\}$. \begin{theorem} \label{teo:numNonEquiv100-p} Let ${\cal A}_{t,p}$ be the number of nonequivalent $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ with $t\geq 3$ and $p\geq 3$ prime. Then, \begin{equation}\label{eq:BoundAtNewX-p} {\cal A}_{t,p} \leq1+ \sum_{s=2}^{\lfloor\frac{t+1}{2}\rfloor} \tilde{X}_{t,s,p} \end{equation} and \begin{equation}\label{eq:BoundAtNew-p} {\cal A}_{t,p} \leq1+ \sum_{s=2}^{\lfloor\frac{t+1}{2}\rfloor} ({{\cal A}}_{t,s,p}-1). \end{equation} Moreover, for $p\geq 3$ prime and $3 \leq t \leq 10$, the upper bound (\ref{eq:BoundAtNewX-p}) is tight. \end{theorem} \begin{proof} It is proven that the codes $H^{1,0,\dots,0,t_s}$ with $s\geq2$ and $t_s\geq0$, are the only $\mathbb{Z}_{p^s}$-linear GH codes which are linear. Note that they are not included in the definition of $\tilde{X}_{t,s,p}$ for $s\in \{2,\dots,\lfloor (t+1)/2\rfloor\}$. Therefore, the new upper bounds (\ref{eq:BoundAtNewX-p}) and (\ref{eq:BoundAtNew-p}) follow by Corollaries \ref{coro:t1} and \ref{cor:sin}, after adding $1$ to take into account the linear code. In Table \ref{table:ClassificationEquiv}, for any odd prime $p$ and $3\leq t \leq 10$, these new upper bounds together with previous bounds are shown. Note that the lower bound $(r,k)$ coincides with the upper bound (\ref{eq:BoundAtNewX-p}) for $t\leq10$, so this upper bound is tight for $t\leq10$. \end{proof} \begin{table}[h] \centering \begin{tabular}{|c||c|c|c|c|c|c|c|c|} \cline{0-8} $t$ & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \cline{0-8} previous lower bound $(r,k)$ & {\bf 2} & {\bf 2} & {\bf 4} & {\bf 4} & {\bf 7} & {\bf 8} & {\bf 12} & {\bf 14} \\\cline{0-8} new upper bound (\ref{eq:BoundAtNewX-p}) & {\bf 2} & {\bf 2} & {\bf 4} & {\bf 4} & {\bf 7} & {\bf 8} & {\bf 12} & {\bf 14} \\\cline{0-8} new upper bound (\ref{eq:BoundAtNew-p}) & 2 & 2 & 5 & 6 & 11 & 15 & 26 & 33 \\\cline{0-8} previous upper bound & 2 & 2 & 6 & 9 & 15 & 22 & 33 & 46 \\\cline{0-8} \end{tabular} \caption{Bounds for the number ${\cal A}_{t,p}$ of nonequivalent $\mathbb{Z}_{p^s}$-linear GH codes of length $p^t$ for $3\leq t \leq 10$.} \label{table:ClassificationEquiv} \end{table} This last result improves the partial classification. Actually, by definition, we have that $\tilde{X}_{t,s,p}\leq X_{t,s,p}-1$, so the upper bound (\ref{eq:BoundAtNewX-p}) is clearly better than (\ref{eq:CardinalFirstBound}). It is also clear that the upper bound (\ref{eq:BoundAtNew-p}) is better than (\ref{eq:CardinalFirstBoundX-p}) since there are fewer addends. Therefore, both new upper bounds improve the previous known upper bounds. Recall that ${\cal A}_{t,s,p}=X_{t,s,p}$ for any $3\leq t\leq 10$ and $2\leq s\leq t-2$. If this equation is also true for any $t\geq 11$, then upper bounds $(\ref{eq:CardinalFirstBound-p})$ and $(\ref{eq:CardinalFirstBoundX-p})$ coincide. Moreover, upper bound (\ref{eq:BoundAtNewX-p}) would always be better than (\ref{eq:BoundAtNew-p}) since $\tilde{X}_{t,s,p}\leq X_{t,s,p}-1 = {\cal A}_{t,s,p}-1$.
7e9e30be068253ee0d0de8405e99b6ba9a681551
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} The solar corona is filled with dynamic magnetized plasma, and hosts a variety of disturbances/waves that can be driven by all motions of the ubiquitous plasma. One of the most spectacular waves is the extreme ultraviolet (EUV) wave that appears as the traveling coronal disturbance from its erupting source region in the solar atmosphere. Hints about the existence of EUV waves were initially deduced from indirect evidences of sympathetic solar activities, type II radio bursts, and H$\alpha$ Moreton waves. Later, EUV waves were finally detected directly with the Extreme Ultraviolet Imaging Telescope (EIT; Delaboudini{\`e}re et al. 1995) on-board the SOHO spacecraft (Moses et al. 1997; Thompson et al. 1998; Warmuth 2015) in 1997. EUV waves can provide potential diagnostics of the coronal magnetic field strengths and can be used to estimate coronal plasma parameters that are hard to observe directly (Ballai 2007; Kwon et al. 2013). Although there is ongoing debate about the physical nature of these waves, an EUV wave is always interpreted either as a true wave or as a pseudo wave. The interpretations of true waves include linear/nonlinear fast-mode magnetohydrodynamic (MHD) waves, slow-mode waves, and soliton-like waves (Ofman \& Thompson 2002; Wills-Davey et al. 2007, Wang et al. 2009). On the other hand, the methods of employing pseudo waves embrace e.g. the magnetic field-line stretching, Joule heating in current shells, and continuous small-scale reconnections (Chen et al. 2002; Delaboudini{\`e}re et al. 2008; Attrill et al. 2007). Benefiting from high-quality observations from the Solar Terrestrial Relations Observatory(STEREO; Kaiser et al. 2008) and the Solar Dynamics Observatory (SDO; Pesnell et al. 2012), EUV waves have been best interpreted as a bimodal composition of an outer fast-mode MHD wave and an inner non-wave component of coronal mass ejections (CMEs) in a hybrid model (Liu et al. 2010, Chen \& Wu 2011, Downs et al. 2012, Liu \& Ofman 2014, Mei et al. 2020). More details about the nature of EUV waves are in recent reviews (Gallagher \& Long 2011, Patsourakos \& Vourlidas 2012; Liu \& Ofman 2014, Warmuth 2015, Chen 2016, Long et al. 2017, Shen et al. 2020). It is widely recognized by now that the EUV waves are associated with a variety of energetic eruptions (e.g. CMEs and flares), and small-scale EUV waves are closely associated with small-scale ejections (e.g. jets and eruptions of mini-filaments) (Zheng et al. 2012a, b). In addition, it is suggested that the formation of an EUV wave strongly depends on the rapid expansion of overlying coronal loops ahead of an erupting core (Zheng et al. 2019, 2020). To date, it has only been observed that each single eruption triggered only a single EUV wave. In this study, we now provide new observational evidence for two scenarios of TEWs in a single eruption. TEWs in the first scenario were separately associated with a filament eruption and its precursor jet, while those in the second scenario were successively related to another filament eruption. Hence, we refer to these cases as "fraternal TEWs" and "identical TEWs", respectively. In the following text, the term "EUV wave" is simply abbreviated as ``wave". \section{Observations} For the first scenario, the filament eruption occurred beyond the northwest limb on 2010 August 18, and involved two EUV waves, a C4.5 flare, and a partial halo CME ({\url{https://cdaw.gsfc.nasa.gov/CME\_list/UNIVERSAL/2010\_08/univ2010\_08.html}}) with a linear speed of 1471 km s$^{-1}$. The source region, located at the mixture polarities of National Oceanic and Atmospheric Administration (NOAA) Active Region (AR) 11093 and 11099, was confirmed by the ARs on the solar disk on August 14 in Helioseismic and Magnetic Imager (Scherrer et al. 2012) magnetograms. For the second scenario, the filament eruption occurred at AR 11228 near the northeast limb on 2011 June 1. The eruption involved two EUV waves, and a C2.6 flare. During the eruption, there was a slow CME (\url{https://cdaw.gsfc.nasa.gov/CME\_list/UNIVERSAL/2011\_06/univ2011\_06.html}) with a linear speed of 259 km s$^{-1}$, which was better seen in the view of COR1 (\url{https://cor1.gsfc.nasa.gov/catalog}). However, the CME originated from another eruption in AR 11227 in the south hemisphere. Besides the view provided by SDO, the two scenarios were also captured by the spacecrafts A and B of STEREO, respectively. The positions of STEREOs (A and B) and SDO (Earth) for two cases are shown in Figure 1. We used the EUV observations from the Atmospheric Imaging Assembly (AIA; Lemen et al. 2012) on-board SDO and from the Extreme Ultraviolet Imager (EUVI; Howard et al. 2008) on the STEREO. The AIA instrument contains seven EUV wavelengths that involve a wide range of temperature coverage, and its images have a field of view (FOV) of 1.5 $R_\odot$ with a pixel resolution of 0.6$"$ and a cadence of 12 s. The EUVI images have a pixel resolution of 1.58$"$, and their cadences are 2.5 minutes for both the 195~{\AA} and 304~{\AA}. In addition, the filaments and the associated jet, observed in the first scenario, were also recorded by the H$\alpha$ filtergrams from the Solar Magnetic Activity Research Telescope (SMART; UeNo et al. 2004) with a solar imaging system of Solar Dynamics Doppler Imager (Ichimoto et al. 2017) at Hida Observatory. The H$\alpha$ images have a cadence of 1 minute and a pixel size of $\sim$1$"$. To display better the faint wavefronts in the first scenario, the EUV images are processed by the intensity-normalization method, where the value at a pixel is normalized by all the intensities at this same pixel among a set of the original images. For the diffuse wavefronts in the second scenario, the EUV images are subtracted by a fixed image and the previous image with a fixed time gap. The evolutions of the EUV waves and the associated erupting cores and loops, are analysed by the time-slice approach (Liu et al. 2010), in which a time-distance plot was constructed with a stack of slices along a selected direction for a set of images. 8 slices (S0-S8) are chosen, and their start points are indicated by triangles. In the first scenario, S0 is in the original ejection direction of the jet, and S1 is in the vertical northward direction, and S2 is an arc at the height of 0.1 $R_\odot$ over the northwest limb, and S3 is in the lateral expanding direction of the north end of L1, and S4 is an arc path with the height of 0.1 $R_\odot$ over the southwest limb, and S5 is in the direction of $20^\circ$ counted clockwise from the south in the perspective of EUVI-A. In the second scenario, S6 is in the direction of the erupting filament, and S7-S8 are in the vertical southward directions in the view of AIA and EUVI-B, respectively. The speeds are obtained by fitting with the linear ({\it linfit.pro}) function, assuming a measurement uncertainty of 4 pixels ($\sim1.74$ Mm) for the selected points. On the other hand, the coronal magnetic filed lines are also extrapolated with {\it pfss\_trace\_field.pro} and {\it pfss\_draw\_field.pro}, parts of the PFSS package of SolarSoftWare (see the template routine of {\it pfss\_sample1.pro}). \section{Results} \subsection{Fraternal TEWs} The fraternal TEWs reported here occurred on 2010 August 18, and the pre-eruption evolution is shown in SMART H$\alpha$, AIA 304~{\AA} and EUVI-A 304~{\AA} (Figure 2). Half an hour prior to the eruption ($\sim$04:41 UT), two small filaments (white arrows in panels (a)-(b)) appeared suddenly and rose slowly from the source region behind the northwest limb. The two small filaments were clearly disconnected with different chiralities, one hour earlier in the disk view of EUVI-A (white arrows and black dotted lines in panel (c)). Interestingly, a jet (marked by cyan arrows) and a new long filament (green arrows) occurred during the filament ascent, and the jet clearly originated from the junction (see the blue arrow) of two small filaments in the disk view of EUVI-A (panels (d)-(f)). It is likely that the jet and the newly-formed long filament resulted from the collision and subsequent magnetic reconnection of the two small filaments. Immediately, this newly-formed long filament lifted southwestwards in a non-radial direction (green arrows) (panels (g)-(h)). On the other hand, the jet moved northwards (cyan arrows in bottom panels), and had an initial speed of $\sim$207 km s$^{-1}$ (panel (h1)) along S0 (panel (h)). The measured jet speed is highly supersonic and is consistent with the Alfv\'en speeds (an estimated speed of $\sim$210 km s$^{-1}$, assuming the electron number density of $10^{8} cm^{-3}$ and the radial coronal magnetic field component of $1 G$ at a height of $0.06 R_\odot$). Ahead of the ejecting jet, a faint wave (W1) formed and is visualised in intensity-normalized images of AIA 211~{\AA} and EUVI-A 195~{\AA} (Figure 3 and Movie S1). W1 mainly propagated northeastwards in the lower corona, and was much clearer in the disk view of EUVI-A, due to the projection effect (red arrows in panels (a)-(b)). There is a loop-like dimming structure (the yellow arrow) propagating visualised in difference images of AIA 193~{\AA} (panel (c)), what is an indicator of the expansion of a group of overlying coronal loops (L1). On the disk view, the dimmings around the north end of L1 follows the faint wavefront (white and red arrows in panel (d)), which reflects a close relation between the propagating W1 and the expanding L1. In the time-distance plot (panel (e)) along S1, the expansion speed of L1 is estimated to be a supersonic $\sim$167 km s$^{-1}$ (dotted lines with asterisks), and there is also a close temporal and spacial relationship between the jet and the onset of the L1 expansion (the blue asterisk and the green arrow). In the time-distance plots of intensity-normalized images along S2 and S3 (panels (f)-(g)), it is shown that W1 started at $\sim$04:58 UT (blue asterisks) with a nearly constant speed of $\sim$230 km s$^{-1}$, and the wavefront in EUVI-A 195~{\AA} is stronger than its counterpart in AIA 211~{\AA}. In the meantime of the northwards propagation of W1, the newly-formed long filament also kept rising and eventually erupted (Figure 4). The filament (green arrows) lifted southwestwards and quickly vanished in AIA 171~{\AA} (panels (a)-(d)). However, a hot channel appeared in AIA 131 and 94~{\AA} (white arrows in panels (e)-(f)), which is an indicator of a high-temperature flux rope (Zhang et al. 2012). Meanwhile, there formed the current sheet containing plasma blobs beneath the flux rope (black arrows in panels (d)-(f)), which was studied in details by Takasao et al. (2012). The legs of the erupting flux rope (white arrows) remain still anchored in the solar surface, and the post-eruption cusp structure (cyan arrows) appeared in the eruption center (panels (h)-(i)). Surprisingly, the flux rope eruption was followed by another wave (W2) that mainly travelled southwards (see Figure 5 and Movie S2). W2 was much stronger than W1, which is apparent in intensity-normalized images in AIA 211~{\AA} and EUVI-A 195~{\AA}. W2 was closely associated with the expansion of another group of coronal loops (L2; cyan arrows in top panels). W2 propagated southwards along the limb, as seen in the AIA view, and displayed an arc shape in the disk view (yellow and red arrows in panels (c)-(d)). In the time-distance plots along S4 and S5 (panels (e)-(f)), W2 shows a nearly constant velocity of $\sim$390 km s$^{-1}$ (yellow and red lines with asterisks) that is highly supersonic and likely super-Alfv\'enic, and set off at $\sim$05:20 UT (blue asterisks), closely following the flux rope eruption. \subsection{Identical TEWs} The identical TEWs occurred on 2011 June 1, and the related eruption is shown in Figure 6. The eruption region (the dotted box) is comprised of a central parasitic negative polarity (N1), and surrounding positive polarities that formed a circular neutral line, and a sunspot with negative polarity (N2) located at the west boundary (panel (a)). It is apparent that the filament consisted of two branches (white arrows) that lay along the circular neutral line, and are rooted at the central N1 and the strong positive polarity (P1) in the north (panels (b)-(c)). Likely due to some disturbances from P1, the filament erupted as a jet (red arrows in panels (d)-(f)). It is noteworthy that the escaping jet was guided by a bundle of coronal loops (L3; the yellow arrow) that connected the P1 and the N2, which was best seen in AIA 94~{\AA} (panel (d)). After the eruption, there appeared a cusp structure (the orange arrow) connecting P1 and the remote N2 over the flare loops (the green arrow), as a result of the explosion of the overlying L3 (panel (g)). Interestingly, the eruption failed and left a bunch of filament threads rooted at the P1 (red arrows in panels (h)-(i)), which indicates the confinement from a higher group of coronal loops. Following the eruption, the taller group of confined loops (L4; dashed curves) is apparent in the running difference images, and interestingly, two waves successively formed in a short period (see Figure 7 and Movie S3). The first wave (W3) emerged from the expansion direction of L3, and the initially narrow wavefront then became diffuse (red arrows in panels (a)-(d)). Following the expansion of L4, the second wave (W4) formed at the south flank of the expanding L4, $\sim$150 Mm behind W3 (the red and cyan arrows in panel (d)). The front of W4 developed into an arc shape some minutes later (the cyan arrow in panel (f)). Note that a strong wave (yellow arrows) came from the south, and interacted with W3-W4 propagating southwards (panels (e)-(f)). From the intensity-normalized time-distance plot in AIA~193{\AA} along S6 (panel (g)), the erupting filament speed of $\sim$250 km s$^{-1}$, again a highly supersonic value, is estimated after extricating from the L3 confinement, what then quickly began to fall back (the pink arrow) at $\sim$02:50 UT (the blue vertical line), likely due to the restriction by L4. In the running-difference time-distance plot in AIA~193{\AA} along S7 (panel (h)), W3 and W4 started at $\sim$02:44 and $\sim$02:49 UT (blue asterisks), respectively, and the likely both supersonic and super-Alfv\'enic speed of W3 ($\sim$495 km s$^{-1}$) was higher than that ($\sim$370 km s$^{-1}$) of W4, and two waves encountered the south strong wave (the yellow arrow). Due to the lower cadence, the wavefronts of W3-W4 consisted of some discrete brightenings (red and cyan arrows) in the running-difference time-distance plot along S8 (panel (i)). \section{Conclusions and Discussion} The observational results presented above are evidences for two distinct scenarios of TEWs that successively occurred in a single eruption in a short interval ($\sim$22 minutes and $\sim$5 minutes) and TEWs were confirmed by two different viewpoints from SDO and STEREO. W1-W4 had a linear speed in the range of $\sim$230-500 km s$^{-1}$ that is highly supersonic and likely super-Alfv\'enic giving away hints about their nature, which is then consistent with the interpretation of fast-mode MHD waves. Two scenarios show two different formation situations of these TEWs. In the first scenario, W1 and W2 were separately associated with two erupting portions (the precursor jet and the first filament eruption) that simultaneously formed during the magnetic reconnection process between two small filaments. In the second scenario, both W3 and W4 were associated with the same filament eruption in the form of blowout jet (Moore et al. 2010, Li et al. 2018). Therefore, we refer two scenarios as "fraternal TEWs" and "identical TEWs", respectively. How did these TEWs formed? Firstly, we superimposed the magnetic field lines extrapolated by the potential field source surface (PFSS; Schrijver \& De Rosa 2003) model on the intensity-normalized images for the fraternal TEWs, and, on difference images for the identical TEWs (see Figure 8). For the fraternal TEWs (top panels), W1 and W2 (yellow and red arrows) appear at the flanks of the yellow and red loops at different times. For the identical TEWs (bottom panels), the loop-like dimmings (the white arrow) and remote dimmings (purple arrows) probably indicate the explosion of the orange loops and the expansion of cyan loops. Hence, the orange, red, and orange, and cyan extrapolated loops are corresponding to the observations of L1, L2, L3, and L4, respectively. Secondly, we proposed a generation sketch of the two distinct scenarios of TEWs (Figure 9), in which the selected important extrapolated coronal loops (yellow, red, orange, and cyan lines) are superimposed on the extrapolated magnetogram (top panels) and the HMI magnetogram (bottom panels). For the fraternal TEWs (top panels), two small filaments (brown and pink lines) slowly rose and interacted with each other (the yellow star symbol), which simultaneously produced a jet and a long filament. The powerful jet moved northwards (the dashed arrow) and punched the northern overlying yellow L1, and the rapid lateral expansion of L1 gave birth of W1 (the cyan shade). On the other hand, the newly-formed long filament (the purple rope) erupted and forced the southern overlying red L2 to expand suddenly, and the W2 formed (the blue shade) at the east flank of the expanding green loops. For the identical TEWs (bottom panels), the filament eruption initially pushed the lower overlying orange L3, and W3 formed (the yellow shade). After the explosion of L3, the erupting filament hit the higher overlying cyan L4, and W4 was formed (the green shade) at the south flank of the expanding L4. Therefore, we suggested that the four waves were driven by the rapid expansions of overlying loops (Figure 10 and 11 in Appendices). TEWs in a single eruption are two fast-mode MHD waves, which is different from the two components of the fast-mode wave and the coronal reconfiguration signature in the hybrid model, see e.g. Liu et al. 2014, Long et al. 2017. On the other hand, there exist reports on multiple-wave phenomena, e.g. the quasi-periodic fast-propagating (QFP) waves and the homologous waves. QFP waves propagate as wave trains at the local Alfv\'{e}n speed along open field lines, and it is believed that QFP waves are excited by repetitive flaring energy releases (Liu et al. 2011, 2012). Meanwhile, homologous waves occur successively from the same place in a few hours or days, but they are generated by a series of distinct eruptions from the same region (Kienreich et al. 2011, Zheng et al. 2012b). In this study, we report TEWs triggered by the rapid expansion of overlying loops, and both waves were closely associated with a single eruption. Hence, TEWs are also intrinsically different from the QFP waves and homologous waves. Why are TEWs rare, though they have the same physical nature and driving mechanism with that of a single wave? It is likely because the TEWs easily mixed together. Assuming that two groups of coronal loops stay near or expand in close directions, the two waves generated will mix and become hardly distinguishable from each other. If a wave-related strong eruption invokes a series of groups of coronal loops, then a series of wave segments will compose a large arc-like or circular wavefront. Hence, we further suggest that some visible wavefront consist of a series of undistinguishable wave segments that are triggered by a series of groups of coronal loops. The discovery of TEWs likely indicate that more TEWs can be detected in future. We point out that the key for the formation of TEWs is the expansion that is divided in the directions of two separate groups of coronal loops in a single eruption. Actually, it is ubiquitous for the plasma motions in the solar corona that consists of building blocks of coronal loops. Hence, the EUV wave should be prevalent in the solar corona. However, the number of detectable EUV waves is far less than the expected one, which is possibly because most weak and small EUV waves are submerged by ubiquitous coronal loops around, or due to some waves may be at lower temperatures than what the current filters can detect. \begin{acknowledgments} SDO is a mission of NASA's Living With a Star Program. We gratefully acknowledge the usage of data from the SDO, STEREO, and from the ground-based SMART project. This work is supported by grants of NSFC 11790303 and 12073016. \end{acknowledgments}
5f0da58d356fd1293ba86da9658e24c27197f3a4
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Neural image and video compression research has made great strides over the past few years. In particular, the latest models leverage advances in deep generative modeling to produce neural compression models, which outperform their state-of-the-art engineered counterparts by significant margins in rate-distortion performance when taking human perceptual quality into account \cite{mentzer2020high, mentzer2021towards}. Even larger gains can be achieved by learning a domain-specific compression model when the data domain is constrained. Designing and training compression models specific to video calls is one of the most recent breakthrough stories along these lines \cite{wang2021one,oquab2021low,konuko2021ultra}, with some works reporting an order of magnitude of bit rate reduction at a given perceptual quality compared to engineered codecs \cite{wang2021one}. In a nutshell, these face video compression algorithms rely on a source frame (view) of the face, warp this view to approximate the target frame to be transmitted, and process the warped source view (or features extracted from the source view) with a generator to compensate for imperfections in the warped source view. Thereby, the warp is parametrized using a small set of keypoints or local affine transforms, extracted from the target frame using a corresponding learned predictor, which enables highly efficient coding and transmission of the warp. While these models achieve excellent (perceptual) rate-distortion performance in the average case, they have some clear limitations due to relying on single source view. Indeed, a single view might not provide appearance details about one side of the face if the head in the source view is slightly rotated to the left or right. Similarly, a source view showing the face with a closed mouth does not provide any information about the appearance of the mouth interior. More generally, it is usually impossible to faithfully infer person-specific shape and appearance details for different facial expressions by solely relying on a single view of the face \cite{zollhofer2018state}. In this paper, we take a first step towards leveraging multiple views of the face to improve neural face video compression algorithms. Specifically, we explore two key questions of multi-view neural face compression, namely how to select different views, and how to fuse information across different views. We present ablations along these two axes, and show that our best 3-view model, which is based on a simple and computationally inexpensive backbone, outperforms the state-of-the art single frame model at significantly lower per-frame rate. Furthermore, we outline and discuss future research directions to push neural face compression algorithms to production quality. \begin{figure}[t] \vspace{-2mm} \centering \includegraphics[width=0.6\columnwidth]{rd-curve-2-small} \vspace{-2mm} \caption[rd-curve]{Rate-distortion performance comparison of our single-frame baseline, our max pooling model based random view sampling (for 3, 5, and 8 source views), and H264.} \label{fig:rd-curve} \vspace{-4mm} \end{figure} \section{Related work} While research on general neural video compression already features a rich body of literature (e.g. \cite{wu2018video,lu2019dvc,habibian2019video,rippel2021elfvc,mentzer2021towards}), there is only a handful of works on neural face video compression \cite{oquab2021low,konuko2021ultra,wang2021one}. Oquab \emph{et al.} \cite{oquab2021low} study the suitability of different talking head synthesis approaches for compression, targeting a mobile low-resource scenario. Konuko \emph{et al.} \cite{konuko2021ultra} propose a simple procedure to select one out of multiple source views used to reconstruct the target frame using exhaustive search on the reconstruction error at encoding time. Wang \emph{et al.} \cite{wang2021one} introduce a high-fidelity model which allows adapting the head pose while decoding. Closely related to neural face video compression is (2D) talking head synthesis, which uses different mechanisms for motion transfer from a source to a target view, including warping, supervised or unsupervised keypoints, conditional normalization or a combination of these to \cite{pumarola2018ganimation, wiles2018x2face, zakharov2019few, wang2019few, siarohin2019first, zakharov2020fast, ha2020marionette}. The resulting motion representations can have various forms and are often not suited for compression. One line of work attempts to overcome inaccurate modeling of subject identity by relying on multiple frames \cite{wang2019few,ha2020marionette}, but no approach considers careful frame selection beyond random sampling. \begin{figure*}[ht!] \vspace{-0.1cm} \centering \includegraphics[width=0.9\textwidth]{ablation-1-small} \vspace{-0.3cm} \caption[ablation]{How well do models trained with a fixed number of source views generalize to a different number of source views? This figure shows the performance of aggregation modules, source view sampling strategies, and number of training source views (legend format {\tt <aggregation strategy>-<sampling strategy>-<number of training source views>}) as a function of the number of testing source views. We report the L1 reconstruction error, PSNR, SSIM and MS-SSIM \cite{wang2003multiscale}, as well as LPIPS \cite{zhang2018unreasonable}. \vspace{-0.2cm} } \vspace{-0.2cm} \label{fig:ablation} \end{figure*} \section{Method} We build on top of the first order motion model (FOMM) from \cite{siarohin2019first}, which also underlies \cite{wang2021one}. We start by briefly summarizing the FOMM (cf. \cite[Fig.~2]{siarohin2019first}), which consists of a keypoint detector, a dense motion predictor, a generator and a corresponding encoder. Given a target frame $f$ and a source frame (view) $v$, the FOMM first extracts sparse keypoints and corresponding local affine transformations from $f$ and $v$, which together define a coarse flow field. The keypoints and transformations are then processed with the dense motion predictor, which refines the coarse flow field and also predicts an occlusion map. Finally, the flow is used to warp features extracted from $v$, mask them using the occlusion map, and to reconstruct $\hat f$ with the generator. Note that the keypoint extractor and the encoder only have to be applied once to $v$. In a video call, the source view is transmitted first, and all subsequent frames are encoded and transmitted via their corresponding keypoints and affines. The transmission cost of the source view is amortized across the entire call. To extend the FOMM to multiple source views $\{v_k\}_{k=1}^K$ we apply the keypoint detector to every view $v_k$ to obtain a coarse flow for every $k$ and corresponding refined flow by applying the dense motion predictor to every coarse flow. We then obtain warped and masked features for every view and pass them to an aggregation module (discussed in more detail below) whose output is fed to the generator to reconstruct the target frame $f$ (see Fig.~\ref{fig:schematic} for an overview). Preliminary experiments showed that when using multiple source views, predicting local affine transformations does not improve performance, so we rely on keypoints only. Note that as for the single frame model we transmit only the keypoints for the current target frame; each view only has to be transmitted once (and corresponding keypoints only have to be extracted once) so that transmission costs are again amortized for reasonably long video sequences. The only additional cost we incur compared to the single frame model is computational, namely we need to compute dense flow fields occlusion maps for $K$ source views instead of one, and apply the aggregation module to fuse the warped features from the $K$ source views. Given the architecture described in the preceding paragraph, the following two questions arise naturally. \begin{itemize} \item What is an effective and efficient architecture design for the aggregation module? \item How to select the source views in order to achieve substantial improvements over just using a single source view? \end{itemize} In this paper, we take a first step in exploring these questions, as described next. \subsection{View aggregation module \label{sec:aggregation}} The view aggregation module should have two properties, namely 1) it should be invariant to the order in which the views are aggregated, and 2) it should be able to aggregate a changing number of views as more views will arrive over time. Indeed, as discussed below, we are interested in having diverse views with complementary information, which will only become available over time, as the caller moves their head and shows different facial expressions. We consider two different architectures. The first one amounts to simple, permutation-invariant pooling such as max pooling and average pooling \cite{zaheer2017deep}. In order to facilitate fusion of the features, we first apply the same stack of two residual blocks to the features extracted from every view after warping/masking, and pool the features across views. \newcommand{\mathbb R}{\mathbb R} The second pooling architecture we consider is based on self-attention (SA) as formulated in \cite{wang2018non} between identical spatial locations in feature space, across views. This is in contrast to the more common SA across different spatial locations within one image. The motivation for attending to the same location across views is to allow our model to pixel-wise attend to the most useful (pre-warped) source view for reconstructing the target frame. In more detail, let $z_{i,j}^{(k)} \in \mathbb R^c$ be the feature extracted from view $k$ after warping and masking at spatial location $i,j$, and $Z_{i,j} = [z_{i,j}^{(1)}, \dots, z_{i,j}^{(K)}]^\top \in \mathbb R^{K \times c}$ the matrix obtained by stacking the $z_{i,j}^{(k)}$. We obtain query, key and value matrices as $Q_{i,j} = Z_{i,j} W_q$, $K_{i,j} = Z_{i,j} W_k$, and $V_{i,j} = Z_{i,j} W_v$, respectively, where $W_q, W_k \in \mathbb R^{c \times d}, W_v \in \mathbb R^{c \times c}$. The SA output at spatial location $i,j$ in feature space, for all $K$ views, is then computed as \begin{equation} A_{i,j} = \text{softmax}(Q_{i,j} K_{i,j}^\top / \sqrt{d}) V_{i,j}. \end{equation} Note that computing $Q_{i,j}$, $K_{i,j}$, and $V_{i,j}$ over all spatial locations amounts to $1 \times 1$ convolution. To build a SA block, we add a residual branch to the SA output, apply ChannelNorm \cite{mentzer2020high}, and append another $3 \times 3$ convolution layer (maintaining the number of channels) followed by ChannelNorm. We stack two such blocks and apply a convolution producing a $W \times H \times K$ output, which we normalize along the channel dimension using softmax. Finally, we average the $z_{i,j}^{(k)}$ across views with the softmax output as weights. \subsection{View selection strategies \label{sec:sampling}} We consider two different sampling strategies: Random sampling (RS) and furthest point sampling (FPS) based on facial landmarks. RS amounts to picking the first frame as well as $K-1$ frames at random among the remaining frames in the video sequence. For FPS \cite{katsavounidis1994new} we first extract 2D facial landmarks from each frame using a simple and efficient landmark detector similar to \cite{trigeorgis2016mnemonic}, and use the stacked coordinates of the landmarks as feature vectors for each frame. We then sample frames, selecting first the initial frame, and then at each iteration selecting the frame whose feature vector maximizes the minimal Euclidean distance to the feature vectors of the previously selected frames. For this initial study we focus on batch (per-video) sampling algorithms for simplicity, and note that online algorithms are necessary to enable a real-time video call scenario. Online uniform RS can be realized using reservoir sampling \cite{li1994reservoir}; a similar reservoir-based streaming algorithm can be derived for FPS. Note that these online approaches likely require careful tuning to ensure a small enough (amortized) bit rate increase. \section{Experiments} \paragraph{Experimental setup} We use the VoxCeleb2 data set \cite{chung2018voxceleb2} which contains 150k videos of 6k celebrities, split into 1.1M individual speech sequences, cropped and scaled to $224 \times 224$ pixels, and split into a train and test set with disjoint subject identities. As we are interested in modeling real-world scenarios where video calls can span several minutes to hours, unless stated otherwise, we concatenate speech sequences of every video and use the resulting videos for our evaluations. These videos are generally harder to compress than individual speech sequences as the target frames may deviate more from a given set of source views as the video length increases. Our baseline model is a precise re-implementation of the FOMM from \cite{siarohin2019first} without local affine transformations (as these did not significantly reduce reconstruction errors in our experiments). To obtain multi-frame models, we extend the baseline model with one of the view aggregation modules described in Sec.~\ref{sec:aggregation} and select views according to the strategies described in Sec.~\ref{sec:sampling}. We employ the multi-scale VGG-based perceptual loss from \cite{johnson2016perceptual} (following the implementation of \cite{siarohin2019first}) and the Adam optimizer, and select for every model the learning rate from $\{3\cdot10^{-6}, 1\cdot10^{-5},3\cdot10^{-5}\}$ that leads to the lowest training loss. We train our models on 4 V100 GPUs for 300k iterations with a batch size of 48 (we increase the number of iterations for smaller batch sizes such that the total number of training frames seen by all models is identical). \paragraph{Comparison of aggregation / view selection strategies} We combine the max pooling and SA view aggregation modules each with RS and FPS, and train the so-obtained models using 3 or 8 source views. We then evaluate these models with a number of source views in the range $\{3, \ldots, 12\}$. The results are shown in Fig.~\ref{fig:ablation}. It can be seen that, while all models obtain smaller reconstruction errors as the number of source views increases at evaluation time, the model MAX-RS-3 (i.e. the model with view aggregation based on max pooling combined with RS, trained on 3 source views) performs best. Upon visually inspecting the models that were trained with 8 source views, we observe that these models do not generalize well in situations where the target frame semantics differ significantly from those in the source views. Thus, it seems that the 8-view models do not see a diverse enough set of source views during training to learn to interpolate/aggregate the source views when the target frame semantics differ significantly from those in the source views. In contrast, models trained with 3 source views are forced to predict larger semantic changes during training. One possible explanation for RS performing better than facial landmark-based FPS could be that while FPS is beneficial for reconstruction the face region, it might lead to an increase in reconstruction error in the background region, and thereby of the overall reconstruction error. As for the simple max pooling outperforming the more complex SA-based aggregation, we speculate that SA might lead to larger benefits in scenarios where the source views are not pre-aligned with the keypoint-based warp so that the SA module is applied to the unmodified source view features as in \cite{ha2020marionette}, handling both feature alignment and aggregation. \paragraph{Comparison with prior work} We compare our single-view baseline model and our best 3-view model (MAX-RS-3) with \cite{wang2021one, zakharov2020fast, siarohin2019first, wang2019few} in Table~\ref{tab:rel-work} when evaluated on single speech sequences rather than concatenated speech sequences (as this is the evaluation protocol in the referenced papers). \emph{Our MAX-RS-3 outperforms the closest competitor \cite{wang2021one} in three out of four metrics while using one third of the (uncoded) bits to encode the keypoints (our model uses 10 2D keypoints resulting in 20 floats per frame while \cite{wang2021one} uses 20 3D keypoints resulting in 60 floats) and arguably a simpler model}. Note however, that the model from \cite{wang2021one} allows re-rendering the head from a different (angular) viewpoint, which our model cannot do. Further \cite{wang2021one} attain substantial reduction in the bits transmitted per frame by making the number of keypoints used adaptive and by using entropy coding. Both techniques can be applied to our model as well and are expected to achieve similar reductions. \paragraph{Comparison with H264} Work \cite{wang2021one} reports an order of magnitude rate reduction of their model over H264 at the same reconstruction quality in terms of learned perceptual image patch similarity (LPIPS) \cite{zhang2018unreasonable}, when trained and evaluated on a proprietary data set. Here, we compare the rate-distortion performance of our single view baseline as well as our best multi-view models MAX-RS-3/5/8 to H264 in Fig.~\ref{fig:rd-curve}. All of our models transmit the same information on a per-frame basis, namely 10 2D keypoints encoded as 16 bit floats. The only rate overhead incurred is due to the transmission of multiple source views. This rate overhead, even when amortized over hundreds of frames, still affects the rate distortion tradeoff quite significantly. However, asymptotically this overhead vanishes leaving a pure distortion complexity tradeoff, i.e., the blue marker and the orange curve would align vertically in Fig.~\ref{fig:rd-curve}. Further, our method obtains a rate reduction of only about $2\times$ over H264 which is a substantially smaller reduction than what is reported by \cite{wang2021one}. We reiterate that \cite{wang2021one} uses an adaptive number of keypoints as well as entropy coding, and evaluates on a higher-resolution data set. \begin{table}[t] \centering \small \begin{tabular}{lcccc} \toprule & L1 & PSNR & SSIM & MS-SSIM \\ \midrule fs-vid2vid \cite{wang2019few} & 17.10 & 20.36 & 0.710 & -- \\ FOMM \cite{siarohin2019first} & 12.66 & 23.25 & 0.770 & 0.830 \\ Bi-Layer \cite{zakharov2020fast} & 23.95 & 16.98 & 0.660 & 0.660 \\ NVIDIA \cite{wang2021one} & 10.74 & 24.37 & {\bf 0.800} & 0.850 \\ \midrule single-frame & 13.16 & 22.79 & 0.758 & 0.828 \\ MAX-RS-3 & {\bf 10.00} & {\bf 24.87} & 0.795 & {\bf 0.872} \\ \bottomrule \end{tabular} \vspace{-1mm} \caption[tab-rel-work]{ \label{tab:rel-work}Comparison of our single-view baseline and best performing 3 view model with prior work on VoxCeleb2; the prior work values are taken from \cite[Table 1]{wang2021one}.} \vspace{-4mm} \end{table} \section{Conclusions} We presented a first exploration and evaluation of different approaches to selecting and aggregating information across views in the context of neural face video compression. Our best 3-view model outperforms the state-of-the-art single view model at a significantly lower per-frame bit rate. Furthermore, we identified multi-view models as an effective means to navigate the tradeoff between distortion and decoding complexity. We conclude by outlining future research directions. \paragraph{Computationally efficient models} Neural models have excellent rate-distortion performance but still consume orders of magnitude more power than engineered codecs with dedicated hardware accelerators. Particularly important in the context of real-time on-device compression scenarios, such as video calls, is therefore to substantially improve the computational efficiency of neural compression models. We believe that relying on multiple views can help along these lines as less of the face modeling work needs to be done by the decoder model. \paragraph{Online view selection} Developing more sophisticated view selection mechanisms is important to gradually gather fine-grained appearance information about the caller in order to produce faithful reconstructions reflecting person-specific expression details. This selection mechanism should be computationally inexpensive (it could e.g. rely on the learned keypoints underlying the warp) and should potentially allow updating views, e.g. when the background or the lighting situation changes. Online updates of source views will, however, incur a transmission overhead so they cannot occur often. As a consequence the neural codec will need to model uncertainty about the face regions or expressions it has not seen and reliably identify frames that provide additional information. Work \cite{konuko2021ultra} proposes an online selection mechanism, but incurs a large increase in encoding complexity and is not suited for real-time scenarios. \paragraph{Better data sets} Whereas celebrity interview videos as abundantly available on the web and collected in the VoxCeleb2 data set present a good starting point, they are certainly not representative of all video call scenarios. To develop neural face codecs tailored to everyday situations data sets, featuring a broader set of video call situations (including e.g. calls from handheld devices while walking, and recorded with a large range of different cameras) are necessary. A corresponding public data set could greatly accelerate development of robust and product grade algorithms. {\small \bibliographystyle{ieee_fullname}
169d00383addae57ddee6097ef54d45fd0974c0d
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} $\ \ \ $ \textsc{Firefighter} Problem on a graph is broadly described by saving vertices of a graph from fire by placing fire fighters on them, given a source vertex of fire and fire spreading to every neighbour of a burning vertex unless fire fighters are placed on them. Firefighter Problem can be classified in two main categories depending on the set of vertices to be saved by it, i.e. \textsc{Max-Save} and \textsc{Min-Budget}. In the \textsc{ Max-Save} version, the goal is to save maximum number of vertices possible. In contrast, in the \textsc{ Min-Budget} version, the goal is to save a given set of vertices using minimum number of fire fighters at each time step. Firefighter Problem has very important relevance to many real life problems. Suppose a virus is spreading through a network and our goal is to prevent some nodes in the network from this virus by using some preventive measure at some nodes, then this can be seen as a firefighter problem on this network where the virus is like the spreading fire and the preventive measure can be thought as firefighters. In another case, suppose a sensitive data or information has been leaked in a communication network and we need to restrict the flow of the information to some vulnerable or less secured nodes. This scenario also can be modeled as a firefighter problem, where the information can be seen as the spreading fire and the vulnerable nodes as the vertices to be saved using firefighters. \textsc{Unit Disk} Graph represents the intersection of disk graph and interval graph. For each vertex $u$ in the graph, there is a disk of radius $1$ in the Euclidean plane. There is an edge between vertex $u$ and $v$, if $v$ is inside the unit disk centered at $u$. Unit Disk Graphs are relevant to communication network as in almost all practical communication networks the towers or routers have same communicating range which can be modeled as disks of coverage area similar to unit disk graph and to prevent any virus or sensitive information from reaching a node we have to take preventive measures which is same as using some firefighters at some nodes in the firefighter problem case. In most of the practical scenario in a communication network the goal is to keep the sensitive data away from some specific nodes in the network given the network topology. This case resembles Firefighter \textsc{Min-Budget Problem}, where we are given the source of fire and a set of vertices to be saved from fire by putting firefighters in some node at different time instances and minimize our cost while doing so. The cost here is the number of firefighters required at each time instant to achieve our goal. \subsection{Our Results} In this paper, we prove the following two results. \begin{theorem} The Firefighter MIN-BUDGET problem on unit disk graph is NP hard. \end{theorem} \begin{theorem} There exists an approximate solution to Fighter MIN-BUDGET problem on unit disk graph with a constant approximation factor. \end{theorem} \subsection{Previous Works} The Freighter problem has a rich history of work. We mention some results which are most relevant to our work. For a detailed account, we refer the reader to the survey on results, directions and open questions related to firefighter problem by \cite{finbow2009firefighter}. The firefighter problem was introduced by \cite{hartnell1995firefighter} who studied the way to protect an infinite graph from a spreading virus. \cite{hartnell2000firefighting} showed that a simple 2-approximation algorithm exists for Firefighter Max-Save Problem. \cite{wang2002fire} showed 2 firefighters are required to control the fire in an finite 2 dimensional grid with minimum 8 steps and for (r-1) firefighters are required to save a r-regular graph . \cite{develin2007fire} further added that at least 18 vertices will burn to do so and (2d-1) firefighters can hold a fire in an n-dimensional grid if fire breaks out in a single vertex .\cite{macgillivray2003firefighter} proved NP-hardness of firefighter problem on Bipartite graphs and gave a polynomial time algorithm for the same problem on P-trees and also gave an integer programming to determine an optimal sequence of vaccinating the vertices . This work was followed by the work by \cite{hartke2004attempting} to narrow the integrality gap between the integer programming optimal and the optimal of the linear programming relaxation. \cite{finbow2007firefighter} showed that the firefighter problem is NP-hard on trees with maximum degree 3. However if fire breaks out at a vertex with degree 2, the problem is in P. \cite{king2010firefighter} showed that Resource Minimization for Fire Containment(RMFC) is NP-hard on full trees of degree 3. They also showed that the 2-approximation is hard as well, but on graphs of maximum degree 3, if fire breaks out at a vertex of degree 2, the problem is in P. In a follow-up work of \cite{chalermsook2010resource}, the authors showed an $O(\log n)$-approximation LP-rounding algorithm for RMFC on trees. \cite{chlebikova2014firefighter} showed that, the complexity of firefighter problem is governed by path width and maximum degree of a graph. Work on parameterized complexity of firefighter problem can be found in the works by \cite{bazgan2011parameterized,cygan2011parameterized}. \cite{anshelevich2009approximation} considered both spreading and non-spreading vaccination models of firefighter problem to show the NP-hardness of approximation of the problem within $n^{1-\epsilon}$ for any $\epsilon$. \cite{fomin2012making,fomin2016firefighter} considered the Max-Save Firefighter problem and gave polynomial time algorithm for interval graphs, split graphs, permutation graphs, and proved NP-hardness of the problem on Unit Disk Graphs. Online firefighter problem and fractional firefighter problem were introduced by \cite{coupechoux2019firefighting} and they also gave the optimal competitive ratio and asymptotic comparison of number of firefighters and the size of the tree levels. NP-completeness of different graph problems on unit disk graphs have been discussed by \cite{clark1990unit}. \section{Notation and Preliminaries} We use the following notations. If $S$ is a set, $|S|$ denotes size of the set. $d_{\ell_2}(u,v)$ denotes the $\ell_2$ distance of two points $u$ and $v$. An instance of the firefighter problem is denoted by $(G,s)$ where $G$ is an undirected, connected, simple graph, and the fire starts from the vertex $s$. $V_G$ and $E_G$ denote the vertex set and the edge set of $G$ respectively. \subsubsection*{{\sc Min-Budget} Firefighter Problem } \label{sec:min-budg-firef} The {\sc Min-Budget} Firefighter Problem is defined in the following way. {\em Given a undirected, connected, simple graph $G$, a vertex $s\in V_G$, $T\subseteq V_G$, find the minimum number of firefighters needs to be placed at every step to save $T$.} \subsubsection*{Decision Version of Min-Budget Firefighter Problem in Unit Disk Graph.} \begin{itemize} \item \textbf{Input}: A unit disk graph $G(V,E)$, a vertex $s\in V$, a subset $T\subseteq V$ \item \textbf{Question}: If the fire starts from $s$, can all vertices of $T$ be saved if at most $B$ number of firefighter can be placed at each step? \end{itemize} \subsubsection*{Interval Graph} \label{sec:interval-graph} Our approximation algorithm extends the exact algorithm for interval graphs. An interval Graph is an undirected graph formed by correspondence with a set of intervals on real line, where each interval corresponds to a vertex in the graph and two vertices have an edge in between them if their corresponding intervals intersect. \subsubsection*{Unit Disk Graph} \label{sec:unit-disk-graph} Unit Disk Graph is an undirected graph formed by correspondence with a set of disks of unit radius on euclidean plane, where each disk correspond to a vertex in the graph and two vertices have edge in between them if their corresponding disks intersect. \section{Proof of theorem 1.1: the Reduction} \label{sec:proof-hard} We show a reduction from the Firefighter Problem for Trees with maximum degree three which has been shown to be NP hard. The proof idea is similar to the one of the MAX-SAVE version due to \cite{fomin2016firefighter}. The first step is to transform an instance of the MIN-BUDGET Firefighter problem on Trees with maximum degree Three to an instance of the MIN-BUDGET firefighter problem on an Unit disk graph. In order to do that we show an embedding of any full rooted degree three tree into an unit disk graph. \subsection{The Construction} \label{sec:construction} Let $(T,\Gamma,B)$ be the input instance of the firefighter problem on Trees with maximum degree three. $\Gamma$ denotes the set of vertices to be saved and $B$ denotes the budget. The first step is embed $T$ into a unit disk graph $T_G$. \textsc{Rectilinear Embedding.} Let $T$ be a full rooted tree of maximum degree three and $r$ be the root of $T$. Let $m$ be the number of vertices in $T$. We add a new vertex $s$ in the tree and connect it to $r$. Let us call the new graph $T'$ rooted at $s$ with $N=m+1$ vertices. We number the leaves of the new graph $T'$ according to their appearance in the pre-order traversal starting from $s$. Then, for each non-leaf vertex, number it with the median of the numbers corresponding to its children. If any of them is having two children, then number it with the maximum number belonging to its children. We denote the number corresponding to the vertex $v$ after numbering in this fashion by $n(v)$. The embedding works in the following way. Put the vertex $s$ at the coordinate $(2n(s), 0)$. Let $v$ be any other vertex. Suppose the parent of $v$, say $u$, has been placed at $(X_u,Y_u)$. We place $v$ at $(X_v,Y_v)$, where $X_v=X_u+ 2\left(n(u)-n(v)\right)$, and $Y_v= Y_u+ 2 \left(N- \left|n(u)-n(v)\right|\right)$. The edges are mapped to paths parallel to axis. We draw the edge between $u$ and $v$ as follows. Draw a line of length $\left(N- \left|n(u)-n(v)\right|\right)$ in the positive $Y$ direction from $u$ and then a line of length $2|n(u) - n(v)|$ in the positive/negative direction of $X$ axis, according to the positive/negative values of $n(u) - n(v)$. By construction this embedding is indeed a rectilinear embedding. Moreover, in this embedding each edge is of length exactly $2N$ and has at most one bend. The final step of our transformation is the following. On each edge starting from a parent $u$ to a child $v$ in $T'$, we put $2N - 1$ new vertices, one at every point in the path joining $u$ to $v$. $W_v^1$ to $W_v^{2N-1}$ denotes these new vertices, where $W_v^1$ is adjacent to $u$ and $W_v^{2N-1}$ is adjacent to $v$. Finally, for each vertex $v$ in $T'$, we split $W_v^1$, $2N - 1$ times and split $W_v^2,W_v^3,....,W_v^{2N-1},v$, $4N - 1$ times. We call this graph $T_G$. \begin{lemma} \label{lemma:const} $T_G$ is a unit disk graph. \end{lemma} \begin{proof} Consider any edge $(w_1,w_2)$ in $T_G$. By construction, $w_1,w_2$ are two adjacent vertices in the path joining vertex $u$ and vertex $v$ of $T$. As all the paths are drawn parallel to one of the axis, $d_{\ell_2}(w_1,w_2)=1$.\\ For the other direction, consider any non-adjacent pair of vertices $w_1,w_2$ of $T_G$. If the vertices are in the same path (joining two vertices of $T$ in the embedding), then there is at least one vertex between $w_1$ and $w_2$ in the path. As the vertices are placed at distance $1$, and each path has only one bend, $d_{\ell_2}(w_1,w_2)\geq \sqrt{2}>1$. Suppose, $w_1$ and $w_2$ are in different paths. By construction, distance between two completely different paths in $T_G$ is at least $2$. If some part of the paths are same, then $d_{\ell_2}(w_1,w_2)\geq \sqrt{2}>1$. Hence, all the non adjacent vertices in $T_G$ are more than unit distance away from each other. \end{proof} The last step of the above construction produces $4N$ images of every vertex $v\in T$. Let $\Gamma_G$ be the set of all $4n$ images for each of the vertices $\Gamma$. The constructed instance of the firefighter problem is $(T_G,\Gamma_G,B)$. The following lemma proves the correctness of the reduction. \begin{lemma} \label{lemma:red} $(T_G ,\Gamma_G)$ is a YES instance for the Decision version of the Minimum Budget Firefighter Problem on unit disk graph, if and only if $(T,\Gamma)$ is a yes instance of the Minimum Budget Firefighter problem on tree. \end{lemma} \subsubsection{Proof of Lemma \ref{lemma:red}} \label{sec:proof-lemma-refl} The proof of Lemma \ref{lemma:red} follows from following two lemmas. \begin{lemma} There is a strategy to save all $4N$ images of some vertex $v$ of $T_G$ in firefighter game if and only if there is a strategy to save all $2N$ images of $W_v^1$ of $T_G$. \end{lemma} \begin{proof} If in the graph $T_G$ all the $4N$ images of some vertex $v$ is saved then it means at least one of the vertices $W_v^2,W_v^3,....,W_v^{2N-1},v$ had all its $4N$ images vaccinated till fire came to that level or all the $2N$ images of $W_v^1$ were vaccinated before fire came to it. Now, if the first case is true for $v$ or some $W_v^k$ where $k \in \{2, 3, . . . . . . , 2N - 1\}$ then at least $2N$ images of $W_v^k$ were vaccinated when fire reached to $W_v^1$. Then, in spite of vaccinating $2N$ images of $W_v^k$, we could have vaccinated all the images of $W_v^1$. Also in a contra-positive sense if by any optimal strategy we can't save all the $4N$ images of $v$ before it reaches that level, then at least one vertex of $W_v^1$ must be infected when fire reached its level. So in $T_G$, saving $v$ means saving $W_v^1$ and vice-versa. To make this argument valid for $W_t^1$, where $t$ is the child of $r$ in $T$, we added the extra vertex $s$ to $T$ in the construction. \end{proof} \begin{lemma} There is a strategy to save $W_v^1$ where $W_u^1$ can't be saved in $T_G$ in firefighter game, if and only if there is a strategy to save $v$ where $u$ can't be saved in $T$ given $v$ is the child of $u$ in $T$. \end{lemma} \begin{proof} Now to correspond unit disk graph problem to the case of full rooted tree of maximum degree three problem, it is sufficient to prove that \begin{enumerate} \item \label{en:1} If it is possible to save vertex $v$ while its parent $u$ can't be saved in a full rooted tree then it is possible to save $W_v^1$ when $W_u^1$ can't be saved in $T_G$. \item \label{en:2} In a contra-positive sense if there is no strategy to save $v$ while its parent $u$ is infected in $T$ then there is no strategy in $T_G$ to save $W_v^1$ when $W_u^1$ is infected and fire came ahead of it. \end{enumerate} Now, for case \ref{en:1}, when $u$ just gets infected and the fire is about to come towards $v$, we vaccinate $v$. The similar case in $T_G$ will be when fire reaches $W_u^1$ and affects some of its images, we start vaccinating the images of $W_v^1$ and it takes $2N$ time steps to reach $W_v^1$ by then we vaccinate all the images of it and save $W_v^1$. For case \ref{en:2}, when $u$ is infected and fire started to move towards $v$ and by no strategy we can vaccinate $v$, the similar case in $T_G$ will be when $W_u^1$ is already infected and fire moved towards $u$ and affected $W_u^2$ and none of the images of $W_v^1$ is vaccinated. Then by the time fire reaches $W_v^1$, we can't save all the images of it as it will take $2N - 1$ time steps and we have to vaccinate $2N$ vertices. So, $W_v^1$ can't be saved. \end{proof} In \textbf{Lemma 3}, the equivalence in terms of burning or saving between vertices $v$ and $W^1_v$ of graph $T_G$ has been shown and in \textbf{Lemma 4}, the equivalence of saving strategies of vertex $W^1_v$ in graph $T_G$ and vertex $v$ in graph $T$ has been shown. These two lemmas together prove that saving or burning of vertex $v$ in graphs $T_G$ and $T$ are equivalent and thus prove \textbf{Lemma 2}. \textbf{Lemma 1} and \textbf{Lemma 2} together proves \textbf{Theorem 1}. \section{Approximation Algorithm for MIN-BUDGET problem} $\ \ \ $ Firefighter problem on interval graphs are polynomial time solvable. Keeping this fact in mind, the underlying geometry of unit disk graph in Euclidean plane can be modified a bit to get another geometry which has a polynomial time solution. Following is a polynomial time algorithm for the firefighter problem on interval graphs, which will be extended later for an approximation algorithm for the same problem on unit disk graph. \subsection{Exact Algorithm for Interval Graph} \label{sec:min-budget-problem} Let $(G,s,T)$ be an instance of the MIN-BUDGET Firefighter problem where $s$ is the source vertex and $T \subset V_G$ is the set of vertices to be saved. Algorithm 1 formally describes algorithm. Algorithm \ref{alg:interval} is an exact algorithm. \begin{algorithm}[htb] \caption{Algorithm for Firefighter Min-Budget Problem on Interval Graph} \label{alg:interval} \begin{algorithmic} \STATE \textbf{INPUT}: $G(V,E),v,T|$ where $G$ is an Interval Graph, $v \in V$ be the source vertex of fire and $T \subseteq V$ be the set of vertices to save. \STATE $T_{1}=T \cap N(v)$ \STATE $T'=T \setminus T_{1}$ \STATE $V_{1}=V$ \STATE $A_{1}=|n(v)|$ \STATE $B_{1}=|T_{1}|$ \FOR{$i=2:n:1$} \IF{$|T'| \neq 0$} \STATE $V_{i}=V_{i-1} \setminus T_{i-1}$. \STATE $G_{i}(V_{i},E_{i})| \forall u,v \in V_{i}, (u,v) \in E \Rightarrow (u,v) \in E_{i}$ \STATE $T_{i}=\{t \in T'| Dist_{G_{i}}(v,t)=i\}$ \STATE $K_{i}=$ Minimum Cut-set of $T_{i}$ in $G_{i}$ \STATE $B_{i}=\Bigl\lceil\frac{\sum_{k=1}^{i}|T_{k}|}{i}\Bigr\rceil$ \STATE $A_{i}=\Bigl\lceil\frac{\sum_{k=1}^{i-1}|T_{k}|+|K_{i}|}{i}\Bigr\rceil$ \ENDIF \ENDFOR \IF{$\max_{i}B_{i} \leq \min_{i}A_{i}$} \STATE Then Budget is $\max_{i}B_{i}$ and firefighters are to be placed on $T$ \ELSE \STATE Let $\min_{i}A_{i}=A_{m}$, Then Budget is $\max(A_{m},\max_{k}B_{k}|k < m)$ and firefighters are to be placed on $\cup_{i=1}^{m-1} T_{i} \cup K_{m}$ \ENDIF \end{algorithmic} \end{algorithm} \paragraph{Correctness of Algorithm \ref{alg:interval}} $\ $ \begin{lemma} In the optimal strategy, Firefighters have to be placed on $T_{i}$, if not placed on all the vertices of $K_{i}$ at $i^{th}$ time instant. \end{lemma} \begin{proof} Consider the $i^{th}$ time instance. Suppose, there are some unprotected vertices of $T_i$. Moreover suppose there are some vertices in $K_{i}$ where no firefighter is placed. Then $\exists u_{i} \in T_{i}$, where fire reaches to the unprotected vertices of $T_{i}$ at $i^{th}$ or $(i+1)^{th}$ time instant, which is not permitted. So, we have to place firefighters on the unprotected vertices of $T_{i}$ at $i^{th}$ or $(i+1)^{th}$ time instant. So, placing the firefighters on $K_{i} \setminus T_{i}$ at $i^{th}$ time instant will be waste of firefighters and will also increase the budget. So, it will be wise to place the firefighters either on $K_{i}$ or on $T_{i}$ at $i^{th}$ time instant. \end{proof} \begin{lemma} If at $i^{th}$ time instant firefighters are placed on $K_{i}$ then fire will never reach to $T_{k} \forall k \geq i$. \end{lemma} \begin{proof} Suppose at $i^{th}$ time instant firefighters are placed on all vertices of $K_{i}$, then fire can never reach to any of the vertices of $W_{i}|W_{i}=T_{i} \setminus K_{i}$. The span of $W_{i} \geq 1$ as the intervals are of unit length. So, fire will never reach to $T_{k} \forall k \geq i$. \end{proof} \paragraph{} If at some level $i$, the better strategy is to put firefighters on $K_{i}$ then the fire fighting process will stop at that time instant. So, either we have to place fire fighter on $K_{i}$ at $i^{th}$ time instant and on $T_{k}$'s at corresponding time instant for $k < i$ or we have to put fire fighters on $T_{i}$'s $\forall i$. Now, if the optimum strategy is to place fire fighters on $K_{i}$ at $i^{th}$ step then the budget must be greater than both $A_{m}$ and $\max_{k}B_{k}|k < m$, where $\min_{i}A_{i}=A_{m}$ as both are the necessary conditions. But, if $\max_{i}B_{i} \leq \min_{i}A_{i}$, then $\max_{i}B_{i}$ gives the optimum budget as a necessary condition. This proves the correctness of the algorithm. \subsection{Approximation Algorithm for Unit Disk Graph} \label{sec:appr-algor-unit} \begin{lemma} Firefighter MIN-BUDGET problem on Unit Disk Graph has an approximate solution using the algorithm for MIN-BUDGET problem on Unit Interval Graph. \end{lemma} \begin{proof} Let, there be $n$ vertices in the unit disk graph $G(V,E)$. \textit{v} be the source vertex of fire and $T \subset V$ be the set of vertices to be saved. We first replace the disks with their circumscribing squares with sides parallel to the coordinate axes. Now, this problem can be seen as four firefighter MIN-BUDGET problems on Unit interval graphs by observing that fire can spread in the up, down, left or right direction accordingly starting from \textit{v}. So, we can use our algorithm for MIN-BUDGET problem on Unit Interval Graph simultaneously in the four direction around \textit{v}. Due to this modification in this solution an approximation factor will be introduced in the result. For a square(say $S_u$) in the Euclidean plane corresponding to a vertex(say $u$) of the graph, the leftmost boundary of $S_1^u$ is given by $x=X_l^u$ and the down most boundary is given by $y=Y_d^u$. Algorithm for solving firefighter MIN-BUDGET problem on this modified graph is given in Algorithm \ref{alg:unitdisk}. \begin{lemma} Due to approximating the firefighter MIN-BUDGET problem on Unit Disk Graph as combination of four firefighter MIN-BUDGET problem on Unit Interval Graph the solution introduces a constant approximation factor of $2$. \end{lemma} \begin{proof} Firstly, we eliminate the effect of modifying the disks into circumscribing squares by checking at each time step of the spread of fire whether the new disks are having any intersection with the disks defining the boundaries of the burning rectangle. In the algorithm a forced assumption is that the region in fire at any instant of time forms a rectangle in the Euclidean plane in not always true.Due to the burning rectangle approximation, a vertex corresponding to an unit disk centered at $(X,Y)$ can burn as early as at Max$(X,Y)$ time instant, while in actual case it can take at most $2(X+Y)$ time. As the fire has to travel at most $2k$ squares to reach $(k,0)$ point starting from $(0,0)$ (limiting case when every square has an neighbor square slightly shifted in $X$ direction). Due to this effect the partial average at each time instant can be as big as $2(X+Y)/$max$(X,Y)$ times of the actual. Here the approximation factor becomes $2(X+Y)/$ max$(X,Y)$, which is less than $2$. \end{proof} \textbf{Lemma 7} and \textbf{Lemma 8} together proves \textbf{Theorem 2}. \begin{algorithm}[] \small \caption{Firefighter Min-Budget Problem on Unit Disk Graph} \label{alg:unitdisk} \begin{algorithmic}[1] \STATE \textbf{INPUT}: $G(V,E),v,T|$ where $G$ is an Unit Disk Graph, $v \in V$ be the source vertex of fire and $T \subseteq V$ be the set of vertices to save. \STATE Replace all the disks by their circumscribing squares with sides parallel to coordinate axes and $G(V,E)$ becomes an Unit Square Graph. \STATE $\forall v_{i} \in V$ sort them according to the $X_{l}^{i}$ values of their corresponding Square $S_{i}$ in increasing order. If $X_{l}^{i}=X_{l}^{j}$ then sort them according to their increasing order of $Y_{d}^{i}$ and $Y_{d}^{j}$. \STATE $\forall v_{i} \in V$ sort them according to the $Y_{d}^{i}$ values of their corresponding Square $S_{i}$ in increasing order. If $Y_{d}^{i}=Y_{d}^{j}$ then sort them according to their increasing order of $X_{l}^{i}$ and $X_{l}^{j}$. \STATE The boundaries of the burning rectangle ($R$) be, $R_l^0=X_l^v, R_r^0=X_r^v, R_u^0=Y_u^v, R_d^0=Y_d^v$. \STATE $T^0=\phi$. \STATE $T'=T \setminus T^0$. \STATE $V_{0}=V$. \STATE $C_m^0=\{v\} \forall m \in \{l,r,u,d\}$. \FOR{$i=1:n:1$} \IF{$T' \neq \phi$} \STATE $V_r^i=W\ |\ \forall w \in W \subset V, R_r^{i-1}-1<S_l^w<R_r^{i-1} \ \& \ R_d^{i-1}-1<S_d^w<R_u^{i-1} \ \& \ \exists v \in C_r^{i-1}|(S_l^w-S_l^v)^2+(S_d^w-S_d^v)^2 \leq 1$. \STATE $V_l^i=W\ |\ \forall w \in W \subset V, R_l^{i-1}+1>S_r^w>R_l^{i-1} \ \& \ R_d^{i-1}-1<S_d^w<R_u^{i-1} \ \& \ \exists v \in C_l^{i-1}|(S_r^w-S_r^v)^2+(S_d^w-S_d^v)^2 \leq 1$. \STATE $V_u^i=W\ |\ \forall w \in W \subset V, R_u^{i-1}>S_d^w>R_u^{i-1}-1 \ \& \ R_l^{i-1}-1<S_l^w<R_r^{i-1} \ \& \ \exists v \in C_u^{i-1}|(S_l^w-S_l^v)^2+(S_d^w-S_d^v)^2 \leq 1$. \STATE $V_d^i=W\ |\ \forall w \in W \subset V, R_d^{i-1}<S_u^w<R_d^{i-1}+1 \ \& \ R_l^{i-1}-1<S_l^w<R_r^{i-1} \ \& \ \exists v \in C_d^{i-1}|(S_l^w-S_l^v)^2+(S_u^w-S_u^v)^2 \leq 1$. \FOR {$m \in \{l,r,u,d\}$} \STATE $T_m^i=T \cap V_m^i$. \IF{$V_m^i \setminus T_m^i \neq \phi$} \STATE $C_m^i=V_m^i \setminus T_m^i$ \ELSE \STATE $C_m^i=C_m^{i-1}$ \ENDIF \STATE $R_m^i=X_m^v||X_m^v|=\max_{w}|X_m^w|\forall w \in C_m^i$ \ENDFOR \STATE $T^i=T_r^i \cup T_l^i \cup T_u^i \cup T_d^i$. \STATE $T'=T'\setminus T^i$. \STATE $V_{i}=V_{i-1} \setminus T^i$. \STATE $G_{i}(V_{i},E_{i})| \forall u,v \in V_{i}, (u,v) \in E \Rightarrow (u,v) \in E_{i}$. \STATE $K_m^i=$ Minimum Cut-set of $V_m^i$ in $G_i$ where, $m \in \{r,l,u,d\}$. \STATE $B_m^i=\Bigl\lceil\frac{\sum_{k=1}^{i}|T_m^k|}{i}\Bigr\rceil$ where, $m \in \{r,l,u,d\}$. \STATE $A_m^i=\Bigl\lceil\frac{\sum_{k=1}^{i-1}|T_m^k|+|K_m^i|}{i}\Bigr\rceil$ where, $m \in \{r,l,u,d\}$. \ENDIF \ENDFOR \STATE $\mathfrak{B}=0, \mathcal{V}=\phi$. \FOR {each $m \in \{r,l,u,d\}$} \STATE $T_m= \cup_{i=1}^{n} T_m^i$. \STATE $\mathfrak{B}_m=0, \mathcal{V}_m=\phi$. \IF{$\max_{i}B_m^i \leq \min_{i}A_m^i$} \STATE Then Budget $\mathfrak{B}_m$ is $\max_{i}B_m^i$ and firefighters are to be placed on $\mathcal{V}_m=T_m$ \ELSE \STATE Let $\min_{i}A_m^i=A_m^t$, Then Budget $\mathfrak{B}_m$ is $\max(A_m^t,\max_{k}B_m^k|k < t)$ and firefighters are to be placed on $\mathcal{V}_m=\cup_{i=1}^{t-1} T_m^i \cup K_m^t$. \ENDIF \STATE $\mathfrak{B}=\mathfrak{B}+\mathfrak{B}_m$. \STATE $\mathcal{V}=\mathcal{V} \cup \mathcal{V}_m$. \ENDFOR \end{algorithmic} \end{algorithm} \end{proof} \subsection{Analysis of Algorithm \ref{alg:unitdisk}} The algorithm for minimum budget firefighter problem on unit disk graph is based on the algorithm for minimum budget firefighter problem on unit interval graph described in Algorithm \ref{alg:interval}. We consider the problem on unit disk graph as a combination of four simultaneous interval graph problems in four different directions, i.e. left($l$), right($r$), up($u$), down($d$). For a given graph $G(V,E)$ and a fire break-out point $v \in V$, we have to find the minimum budget of firefighters to be placed at each time step to save a given set of vertices $T \subseteq V$. As a first step, we replace all the unit disks corresponding to the vertices of $G$ with their circumscribing squares with sides parallel to the rectilinear axes of the plane. Then we sort the vertices of $G$ in two different arrays one according to the X-coordinates of the centers of their corresponding squares and the other according to the Y-coordinates of the centers of their corresponding squares. These two sorted arrays are for use in different stages of the algorithm later. Afterwards, we define and initialize a number of variables namely Squares corresponding to the disk $v$ i.e. $(S^v)$and its boundaries$(S^v_m)$, boundaries of the burning rectangle$(R^i_m)$ at $i^{th}$ iteration and direction $m$, Set of vertices saved$(T^i_m)$ at $i^{th}$ iteration and direction $m$, vertices saved in $i^{th}$ iteration$(T^i)$ and in each direction$(T^i_m)$, vertices at the boundary of the burning rectangle at $i^{th}$ iteration in each direction$(C^i_m)$, Budget required at each direction$(\mathfrak{B})_m$ and set of vertices on which firefighters to be placed$(\mathcal{V}_m)$. Now at each iteration, we find the new set of vertices whose corresponding squares have inter section with burning rectangle and also filter them depending on whether their corresponding disks have intersection with any of the disks corresponding to the set of vertices constituting the boundary of the burning rectangle at previous iteration. From this we update the burning rectangle and its boundary, vertices to be saved at current iteration, set of vertices constituting the new boundary of the burning rectangle and the minimum cut set of the vertices that completely holds the fire at current iteration. Depending on the cut set and the saved vertices at each iteration, we fix the budget for each direction along with the final budget and the set of vertices to be placed firefighter on. \subsection{Correctness of the Algorithm} In the algorithm for Minimum Budget Firefighter Problem on Unit Disk Graph, the algorithm for Minimum Budget Firefighter Problem on Unit Interval Graph has been applied simultaneously in four directions namely, upwards, downwards, left and right using the subscript $m$. So the correctness of the algorithm in each of these four directions is guaranteed by the correctness of the algorithm for interval graph that is already proved in this paper(section 4.1). It should also be noted that due to geometric assumption of burning rectangle an approximation factor of $2$ has been introduced by this algorithm as described in \textbf{Lemma 8}. \bibliographystyle{unsrt}
a9c143e23cef7afe89a4c935a50d15c2a43622d1
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:introduction} A precise understanding of hadronic interactions over a wide energy range is among the most important parameters for solving the problem of ultra-high-energy cosmic rays (UHECRs). The Pierre Auger Observatory and Telescope Array observe UHECRs with energies above $10^{18}$ eV using the extensive air shower technique, and they have reported their observation results with high-statistics data~\cite{PAO_spectrum, PAO_Composition_2014_1, TA_Composition_2018}. However, their observation results of chemical composition, which is an important parameter for studying the acceleration mechanism of UHECRs at the sources, strongly depend on the selection of the hadronic interaction model used in their air shower simulation. The uncertainty of the models is primarily a result of the lack of calibration data from the accelerator experiments. Particles produced in the very forward region of interactions carry most of the projectile particle energy, and are crucial to air shower development. The LHC forward~(LHCf) experiment measured the production cross-sections of very forward photons, $\pi^{0}$, and neutrons at LHC~\cite{LHCf_Photon_0.9TeVpp, LHCf_Photon_7TeVpp, LHCf_Photon_13TeVpp, LHCf_Pi0_Run1, LHCf_Neutron_7TeVpp, LHCf_13TeVpp_Neutron2}. The maximum center-of-mass collision energy of $\sqrt{s}$ = 13 TeV corresponds to $10^{17}$ eV in cosmic ray interactions. In addition to their measurement, experimental data at lower collision energies are necessary because an air shower is caused by complex interactions with various interaction energies ranging from GeV to the UHECR energy. The RHIC forward~(RHICf) experiment was designed to perform a measurement similar to the LHCf at RHIC located in Brookhaven National Laboratory and investigate the collision-energy scaling law of forward particle production proposed in Ref.~\cite{FeynmanScaling}, so-called the Feynman scaling, via comparisons of the LHCf results. Whereas the LHCf reported the scaling of forward $\pi^{0}$$\;$ production between $\sqrt{s}$ 2.76 and 7 TeV~\cite{LHCf_Pi0_Run1}, the scaling can be tested by a LHCf--RHICf comparison in more than 10 times wider energy range than that. This study analyzed the data acquired with the RHICf detector in June 2017 with $pp$ collisions at $\sqrt{s}$ = 510 GeV and presented the measured inclusive differential production cross-section of photons in the six pseudorapidity regions covering $\eta$ $>$ 6.1 as a function of Feynman $x$ (hereafter $x_{\mathrm{F}}$ \footnote{It is calculated as $x_{\mathrm{F}}$ = $E_{\gamma} / E_{\mathrm{beam}}$, where $E_{\gamma}$ and $E_{\mathrm{beam}}$ are the energies of photons and beams (255 GeV).} ). Furthermore, the results in three additional regions covering the same $x_{\mathrm{F}}$-$p_{\mathrm{T}}$~phase spaces as the LHCf result at $\sqrt{s}$ = 7 and 13 TeV were obtained and subsequently compared to test the Feynman scaling. \section{Detector and Data} \label{sec:rhicf} The RHICf detector comprises two compact sampling and positioning calorimeters composed of tungsten, 16 GSO scintillator plates, and 4 XY horoscopes of GSO bars. Two calorimeter tower have diamond-shaped acceptances transverse to the beam directions of 20\,mm\,$\times$\,20\,mm and 40\,mm\,$\times$\,40\,mm, which are referred to as the TS and TL, respectively. It is the former LHCf-Arm1 detector \cite{LHCf_TDR} and its performance has been well studied via beam tests using electron and proton beams at CERN-SPS~\cite{LHCf_Photon_Performance_Makino}. The energy and position resolutions of photons with energies greater than 30 GeV are better than 5\% and 0.2 mm, respectively, ~\cite{RHICf_performance}. The detector was installed 18\,m west of the Solenoidal Tracker at the RHIC (STAR) interaction point~(IP) during the low-luminosity operation period from 24th to 27th June 2017. Because of the magnetic field of the dipole magnet located between the IP and detector, only neutral particles, photons, and neurons hit the detector. Further, the acceptance at the location was restricted because of the shadow of the beam pipe structure located in front of the detector, which corresponded to a pseudorapidity coverage greater than 6.1. The detector was moved vertically to cover full acceptance, and the data acquisition was performed in three detector positions: BOTTOM~($\Delta y$ = -47.4 mm), MIDDLE~($\Delta y$ = 0 mm), and TOP~($\Delta y$ = +24.04 mm), where $\Delta y$ corresponds to the relative vertical position to MIDDLE. In this analysis, the data acquired with the two trigger modes, {\it Shower} and {\it High-EM} ~\cite{RHICf_performance} was used. The {\it Shower} trigger was the baseline trigger designed to detect both electromagnetic and hadronic showers induced by photons and neutrons, and a large prescale factor of 8--30 was applied. The trigger efficiency was 100\% for photons with energies greater than 20 GeV. Further, {\it High-EM} triggers were generated only for events with high-energy deposits in the 4th layer of the GSO scintillator to enrich high-energy photon events in the sample. The prescale factor for the {\it High-EM} trigger was approximately 10 times smaller than that for the {\it Shower} trigger. In addition, the trigger efficiencies of the {\it High-EM} trigger were 96\% for photons with energies over 100 GeV. The beam energy was 255 GeV, and the proton beams were radially polarized. The direction of beam polarization was rotated by 90 degrees from vertical polarization around the beam direction. The luminosity during the operation period was measured at $L$ = $(0.7-1.5) \, \times 10^{31} \mathrm{cm^{-2}{s^{-1}}}$ using the coincidence rate of signals from the STAR-ZDC detectors~\cite{star_ZDC} located on both the east and west sides of the IP. The recorded integral luminosities of the Shower (High-EM) trigger sample were 4.5~(27.6), 12.0~(96.0), and 20.2~(120.0) $\mathrm{nb^{-1}}$ for the BOTTOM, MIDDLE, and TOP detector positions, respectively. \section{Analysis} \label{sec:analysis} \subsection{Event reconstruction and selection} For the analysis, the event reconstruction algorithm reported in Ref.~\cite{LHCf_Photon_13TeVpp} was employed; further details can be found in Ref.~\cite{RHICf_performance}. The criteria in this analysis were reoptimized for the RHICf configuration using a detector simulation implemented with the GEANT4 library. Events that satisfied the criteria of particle identification~(PID) for photons and a single hit were selected, corresponding to only one particle hit in a calorimeter tower. The energy scale of the calorimeters was calibrated using the factor estimated in a study using $\pi^{0}$$\;$ events where photon pairs were observed in the calorimeters. Thereafter, the invariant mass was calculated from the energies and hit positions of a photon pair, assuming a decay vertex at the IP. The factor was calculated to shift the peak of the mass distribution to the rest mass of $\pi^{0}$. Analysis regions were defined for the production cross-section measurement through the division of the pseudorapidity coverage at the location from 6.1 to infinity by six; \etaregion{6.1}{6.5}, \etaregion{6.5}{7.0}, \etaregion{7.0}{7.5} \etaregion{7.5}{8.0}, \etaregion{8.0}{8.5}, and $\eta \, > 8.5$. The region is a sector-shape area defined by the range of the distance from the beam center\footnote{ The beam center was defined as the projection of the beam direction at the IP on the detector surface, which was measured using data~\cite{RHICf_performance}.} $R$ and the azimuthal angle $\phi$, whereas the region for $\eta$ $>$ 8.5 is a disk shape with $R$ $<$ 7.25 mm. In addition to these regions, three analysis regions were defined to test the Feynman scaling law. Each region covered the same $x_{\mathrm{F}}$-$p_{\mathrm{T}}$$\;$ phase space as one of LHCf measurements; $p_{\mathrm{T}}$$\;$$<$ 0.124 $x_{\mathrm{F}}$, 0.87 $x_{\mathrm{F}}$$\;$$<$ $p_{\mathrm{T}}$$\;$$<$ 1.04 $x_{\mathrm{F}}$$\;$for $\eta\,>\,10.94$ and $8.81\,<\,\eta\,<\,8.99$ at $\sqrt{s}$ = 7 TeV~\cite{LHCf_Photon_7TeVpp}, respectively, and $p_{\mathrm{T}}$$\;$$<$ 0.23 $x_{\mathrm{F}}$$\;$for $\eta\,>\,10.94$ at $\sqrt{s}$ = 13 TeV~\cite{LHCf_Photon_13TeVpp}. The $R$ and $\phi$ ranges of each region and the data set~(detector position and calorimeter tower) used for the analysis regions are listed in Tab.~\ref{tab:dataset}. However, region \etaregion{7.0}{7.5} was not covered by a single dataset. Therefore, subregions corresponding to \etaregion{7.00}{7.25} and \etaregion{7.25}{7.50} were defined, which were combined to obtain the final result. The measurement performed discovered a large transverse single-spin asymmetry of forward $\pi^{0}$$\;$production using the same dataset~\cite{RHICf_pi0_An}. Owing to the $\pi^{0}$$\;$asymmetry inducing dependency of the photon spectrum on the spin direction of the incoming beams to the detector, the events were categorized with the spin direction {\it inward} or {\it outward} of the bunch associated with each event. The difference of the integral luminosity between the {\it spin} samples was only 1--4\%. \begin{table}[hbtp] \caption{ Analysis regions and data sets used for this analysis. } \label{tab:dataset} \centering \begin{tabular}{lccc} \hline Region & R [mm] & $\phi$ [degrees] & Dataset \\ \hline \hline $\eta \, > 8.5$ & $<$ 7.3 & 0 - 360 & BOTTOM-TL \\ \etaregion{8.0}{8.5} & 7.3 - 12.0 & 50 - 130, 230 - 310 & BOTTOM-TL \\ \etaregion{7.5}{8.0} & 12.0 - 19.7 & 75 - 105, 255 - 285 & BOTTOM-TL \\ \etaregion{7.0}{7.5} & & \\ \quad \etaregion{7.25}{7.50} & 19.7 - 25.3 & 75 - 105 & TOP-TS \\ \quad \etaregion{7.00}{7.25} & 25.3 - 32.5 & 80 - 100 & MIDDLE-TL \\ \etaregion{6.5}{7.0} & 32.5 - 53.6 & 80 - 100 & MIDDLE-TL \\ \etaregion{6.1}{6.5} & 53.6 - 79.9 & 80 - 100 & TOP-TL \\ \hline $p_{\mathrm{T}}$ $<$ 0.124 $x_{\mathrm{F}}$ & $<$ 8.7 & 45 - 135, 225 - 315 & MIDDLE-TL \\ $p_{\mathrm{T}}$ $<$ 0.23 $x_{\mathrm{F}}$ & $<$ 16.1 & 70 - 110, 250 - 290 & MIDDLE-TL \\ 0.87 $x_{\mathrm{F}}$ $<$ $p_{\mathrm{T}}$ $<$ 1.04 $x_{\mathrm{F}}$ & 60.7 - 72.8 & 80 - 100 & TOP-TL \\ \hline \end{tabular} \end{table} \subsection{Corrections} \label{sec:correction} The final result of the inclusive differential production cross-section of photons $\mathrm{d}\,\sigma_{\gamma}/ \mathrm{d}\,x_{\mathrm{F}}$ was obtained considering the number of events passing the event selection $N^{\mathrm{single-\gamma}}_{spin}$ with a bin-by-bin correction procedure. \begin{equation} \frac{\mathrm{d}\,\sigma_{\gamma}}{\mathrm{d}\,x_{\mathrm{F}}} = C^{\mathrm{geo.}} C^{c\tau} C^{\mathrm{MC}} \sum_{spin} \frac {C^{\mathrm{PID}}_{spin} ( 1 - R^{BKG}_{spin} ) } {2 \, {L_{spin}}\, } \dot \frac{ \Delta N^{\mathrm{single-\gamma}}_{spin}}{\Delta x_{\mathrm{F}}}, \end{equation} where $C^{\mathrm{geo.}}$, $C^{c\tau}$, $C^{\mathrm{MC}}$, $C^{\mathrm{PID}}_{spin}$, and $R^{BKG}_{spin}$ are the correction factors described below, and $L_{spin}$ is the recorded integral luminosity of the beams in the {\it spin} direction. Subsequently, the PID purity correction $C^{\mathrm{PID}}_{spin}$ and the beam-gas background $R^{BKG}_{spin}$ were estimated for each {\it spin} sample, whereas the other correction factors were common. The difference of photon cross-sections between the two {\it spin} samples was 20\% at maximum, which originated from the $\pi^{0}$$\;$asymmetry. Consequently, upon combining the two {\it spin} samples, the effect of spin asymmetry was expected to be negligible in the final result even considering the systematic uncertainty of the integral luminosity. \begin{itemize} \item Beam-gas background $R^{BKG}_{spin}$; \\ The background photons produced at collisions between the beam protons and residual gas in the beam pipe were estimated using the events associated with the non-colliding bunches of the incoming beam to the detector. Further, the background fraction $R^{BKG}_{spin}$ was calculated for each spin-direction sample by considering the difference in the total beam intensities between the colliding and non-colliding bunches~\cite{RHICf_performance}. However, owing to the limited statistics of non-colliding samples and little energy dependency, the correction was applied as a photon energy-independent factor. The estimated factors were 1.5 -- 2.5\%. In addition, the observed energy dependency was considered a systematic uncertainty. \item PID purity correction $C^{\mathrm{PID}}_{spin}$; \\ In this analysis, particle identification was performed by introducing a PID estimator $L_{90\%}$, which was defined as the longitudinal depth at which the energy deposit integral measured by the sampling layers reached 90\% of the total energy deposition. Subsequently, the purity of the photons in the selected events for each energy bin was estimated from the template-fit results of the $L_{90\%}$ distribution with MC distributions for photons and hadrons~\cite{RHICf_performance}. The correction factor $C^{\mathrm{PID}}_{spin}$~(=~1/purity) was typically 0.9 -- 1.0. \item MC based correction factor $C^{\mathrm{MC}}$; \\ This factor was introduced as an overall correction of several contributions related to event reconstruction: inefficiencies of the trigger, PID selection and single-hit selection, misreconstruction of multi-hit events (two particles hit in a tower) as single-hit events, and recovery of photon yield in the multi-hit events rejected by the single-hit selection. The total of these contributions was estimated using the detector simulation with $pp$ event generation by the interaction model of EPOS-LHC$\;$or QGSJET-I\hspace{-.1em}I-04$\;$ as \begin{equation} C^{\mathrm{MC}} = N^{\mathrm{\gamma}}_{\mathrm{MC,true}}/N^{\mathrm{single-\gamma}}_{\mathrm{MC,rec}}, \end{equation} where $N^{\mathrm{\gamma}}_{\mathrm{MC,true}}$ is the number of photons hitting the analysis region and $N^{\mathrm{single-\gamma}}_{\mathrm{MC,rec}}$ is the number of events reconstructed as single photons with the reconstructed hit position in the region. It is noted that hadron contamination was not considered in $N^{\mathrm{single-\gamma}}_{\mathrm{MC,rec}}$ because it should be corrected using PID correction. Thus, the average of the results obtained using the two interaction models was used as the correction factor. The typical value of the factor was 1.1 -- 1.2. The difference from one mainly originates from the inefficiency of PID selection (~0.1) and the recovery of photon yield in multi-hit events (0.02 -- 0.08). Moreover, the interaction-model dependency of the factor is primarily caused by the difference in multi-hit events, and it was assigned as systematic uncertainty. \item Correction of long-life particle contribution $C^{c\tau}$; \\ The dominant source of photons measured by the detector is the $\pi^{0}$ decay produced at collisions, while decays of long-life particles such as $K^0$ and $\Lambda$ along the beam pipe located between the IP and the detector contribute to the photon yield. The contribution of long-life particles was estimated using an MC simulation by comparing the photon flux at the IP with that after transportation from the IP to the detector location. It was removed via the application of the correction factor. The contribution was relatively large in low $x_{\mathrm{F}}$$\;$regions, typically 8\% of the total yield at $x_{\mathrm{F}}$$\;$ approximately 0.1, whereas it was less than 1\% in the high $x_{\mathrm{F}}$$\;$region of more than 0.5. The correction factors were calculated as the average of the results obtained using the four interaction models: EPOS-LHC~\cite{EPOSLHC}, QGSJET-I\hspace{-.1em}I-04~\cite{QGSJET}, Sibyll~2.3d~\cite{Sibyll2.3d}, and DPMjet-I\hspace{-.1em}I\hspace{-.1em}I~2019.1~\cite{DPMJET}. Furthermore, the systematic uncertainty of the factor was estimated as the maximum deviation from the average of each model result. \item Geometrical correction factor $C^{\mathrm{geo.}}$; \\ A correction factor was introduced to correct the limitation of the $\phi$ range, and it was calculated as $C^{\mathrm{geo.}} = 360^\circ / \Delta \phi$. \end{itemize} \subsection{Systematic uncertainties} \label{sec:systematic} The following contributions were considered as systematic uncertainties of the measured production cross-section, in addition to those related to the correction factors $R^{BKG}$, $C^{\mathrm{MC}}$, and $C^{c\tau}$ described in Sec.~\ref{sec:correction}). Fig.~\ref{fig:syserr} shows the estimated systematic uncertainties for the pseudorapidity region \etaregion{8.0}{8.5} as a typical example. \begin{figure}[tb] \centering \includegraphics[width=0.5 \textwidth]{./systematicerror_forpaper.pdf} \caption{Systematic uncertainties of the photon production cross-section measurement for the pseudorapidity region \etaregion{8.0}{8.5}. The colored and dashed lines indicate the estimated systematic uncertainties after normalization based on the mean values of the experimental data. The black line indicates the total systematic uncertainties, calculated as the quadratic summations of all uncertainties. } \label{fig:syserr} \end{figure} \begin{itemize} \item Energy scale \\ Three components were considered as the systematic uncertainty of the energy scale. The first was the stability of the energy scale during the operation, which was monitored using the peak position of the $\pi^{0}$$\;$ mass on the reconstructed mass distribution, and it was stable within $\pm1\%$~\cite{RHICf_performance}. The second was the nonlinearity. It was observed that the peak mass value of $\pi^{0}$$\;$ was shifted with increasing $\pi^{0}$$\;$ energy corresponding to the total energy of the photon pair ~\cite{RHICf_performance}. Assuming that the shift originates only from the nonlinearity of the energy scale conservatively, the corrected photon energy $E'$ was obtained as $E' = (1.03 - 0.025\,(E/100 \mathrm{GeV})) E$, where $E$ is the original value of the reconstructed energy. The last factor is the nonuniformity of the energy scale, which was evaluated from the consistency test of the spectra obtained by dividing the $\phi$ range. The impact of each energy-scale uncertainty on the final result was estimated by repeating the analysis by artificially changing the energy scale. Owing to the steep slope of the spectrum, large systematic uncertainties of over 50\% were induced in the highest energy bin. \item PID selection \\ The experimental distribution of the PID estimator $L_{90\%}$ was not perfectly reproduced by the template distributions obtained from the MC. The systematic effect of the difference on the final result through the purity and efficiency estimation of PID was estimated using a method similar to that used in Ref.~\cite{LHCf_Photon_7TeVpp, LHCf_Neutron_7TeVpp}; Another template-fitting method that allowed artificial displacement and widening of the template distributions was performed. Consequently, the difference in the results between the methods was assigned as systematic uncertainty. \item Beam center \\ The effect of the uncertainty of the beam-center determination was evaluated via repeating the analysis procedure by shifting the beam center by $\pm$1 mm vertically or horizontally. The maximum deviation in these results from the original results was assigned as the systematic uncertainty. \item Luminosity \\ The uncertainty of the integral luminosity is $\pm5\%$, which is due to the uncertainty of the conversion factor from the ZDC signal rate to the absolute luminosity determined from the Vernier scans using the method similar to that described in Ref.~\cite{Luminosity}. \end{itemize} \section{Results} \label{sec:results} \subsection{differential production cross-section} Fig.~\ref{fig:spectra} presents the differential production cross-section of photons as a function of $x_{\mathrm{F}}$, $\mathrm{d}\,\sigma_{\gamma}/\mathrm{d}\,x_{\mathrm{F}}$, for the six pseudorapidity intervals measured by the RHICf detector. The data points in the $x_{\mathrm{F}}$$\;$range below 0.45 were obtained from the Shower trigger samples, while those in the higher $x_{\mathrm{F}}$$\;$region were obtained from the High-EM trigger samples because of large statistics. The colored lines in Fig.~\ref{fig:spectra} show the prediction of the interaction models, EPOS-LHC, QGSJET-I\hspace{-.1em}I-04, Sibyll~2.3d, DPMjet-I\hspace{-.1em}I\hspace{-.1em}I~2019.1, that were calculated using the event generator CRMC version 1.8.0 \cite{CRMC}. Fig.~\ref{fig:spectra_ratio} presents the ratios of these predictions to the experimental results. EPOS-LHC$\;$and DPMjet-I\hspace{-.1em}I\hspace{-.1em}I~2019.1$\;$ were consistent with the experimental result in the low $x_{\mathrm{F}}$$\;$region below 0.6 and 0.3, respectively, for any pseudorapidity regions, although it predicted larger flux than the data in the higher $x_{\mathrm{F}}$$\;$region. QGSJET-I\hspace{-.1em}I-04$\;$and Sibyll~2.3d$\;$well reproduced the shape of $x_{\mathrm{F}}$$\;$spectra in the highest pseudorapidity regions; however, the slope of their spectra became progressively softer and harder, respectively, than that of the data in the lower pseudorapidity regions. They can be interpreted as the difference in $p_{\mathrm{T}}$$\;$distributions between the data and the model. Thus, these features of the data-model comparisons are very similar to those at the LHC energies reported by LHCf~\cite{LHCf_Photon_0.9TeVpp, LHCf_Photon_7TeVpp,LHCf_Photon_13TeVpp}, thereby suggesting that the source of the difference is common to wide collision energies. \begin{figure}[tb] \centering \includegraphics[width=1.0 \textwidth]{./finalspectra.pdf} \caption{Inclusive photon production cross-section measured by the RHICf detector. Each figure represents that for one of the pseudorapidity regions: $\eta$ $>$ 8.5, 8.0 $<$ $\eta$ $<$ 8.5, 7.5 $<$ $\eta$ $<$ 8.0, 7.0 $<$ $\eta$ $<$ 7.5, 6.5 $<$ $\eta$ $<$ 7.0, and 6.1 $<$ $\eta$ $<$ 6.5. The bars and hatched areas correspond to the statistical and systematic uncertainties, respectively. Colored lines indicate the MC predictions of DPMjet-I\hspace{-.1em}I\hspace{-.1em}I~2019.1, EPOS-LHC, QGSJET-I\hspace{-.1em}I-04, and Sibyll~2.3d.} \label{fig:spectra} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=1.0 \textwidth]{./finalspectra_mcratio.pdf} \caption{Ratio of inclusive photon production cross-sections predicted by hadronic interaction models to the experimental result. The bars and hatched areas around one correspond to the normalized statistical and systematic uncertainties of the data, respectively. }. \label{fig:spectra_ratio} \end{figure} \subsection{Collision-energy scaling} The measured cross-sections were compared with the results of LHCf at $pp$ collisions at $\sqrt{s}$ = 7 and 13 TeV to test the collision energy dependency of forward photon production. Fig.~\ref{fig:escalespe} shows the results obtained for the same coverage of $x_{\mathrm{F}}$-$p_{\mathrm{T}}$$\;$phase space as that of the LHCf results. In this comparison, an additional normalization factor $1/\sigma_{\mathrm{inela}}$ was introduced, where $\sigma_{\mathrm{inela}}$ was the inelastic cross section. For normalization of the LHCf results, the values of $\sigma_{\mathrm{inela}}$ = $(72.9\,\pm\,1.5)$ mb and $(79.5\,\pm\,1.8)$ mb reported in Ref.~\cite{TOTEM_7TeV, TOTEM_13TeV} were used\footnote{A slightly lower value $\sigma_{\mathrm{inela}}$ = 71.5 mb was used in Ref.~\cite{LHCf_Photon_7TeVpp}. Their results were rescaled using this ratio.}. The $pp$ inelastic cross section at $\sqrt{s}$ = 510 GeV was estimated to be $(48.3\,\pm\,1.1)$ mb using the fit results of total and elastic cross-sections by the COMPETE~\cite{COMPETEfit} and TOTEM~\cite{TOTEM_13TeV} collaborations, respectively. The RHICf result was consistent with the LHCf results within the uncertainties, and the ratios are shown in Fig.~\ref{fig:escale}. The values of the ratios were slightly lower than those in the middle panel, which can be interpreted as the difference in analysis methods: corrections of photon yield in the rejected multi-hit events and photons from long-life particle decays were not performed in the LHCf 7 TeV result, whereas they were performed in both the RHICf and LHCf 13 TeV results. The correction increased the ratio by 0 -- 15\% in $x_{\mathrm{F}}$$\;$below 0.6. All four models reproduced the ratio obtained, as shown in Fig.~\ref{fig:escale}. Certain models predicted a weak $x_{\mathrm{F}}$$\;$dependency of the ratio; however, the dependency could not be confirmed owing to the large uncertainties in the results. \begin{figure}[tb] \centering \includegraphics[width=1.0 \textwidth]{./finalspectra_escale_nor.pdf} \caption{Comparison of the measured cross-section with the results of LHCf at $\sqrt{s}$ = 7 and 13 TeV~\cite{LHCf_Photon_7TeVpp,LHCf_Photon_13TeVpp}. The two left panels show the comparison with the LHCf result at $\sqrt{s}$ = 7 TeV and the pseudorapidity region of $\eta\,>\,10.94$ (left) and $8.81\,<\,\eta\,<\,8.99$ (middle). The right panel shows a comparison between $\sqrt{s}$ = 13 TeV and $\eta\,>\,10.94$. The bars and hatched areas correspond to statistical uncertainties and quadratic summation of statistics and systematic uncertainties, respectively.}. \label{fig:escalespe} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=1.0 \textwidth]{./finalspectra_escale_ratio_nor.pdf} \caption{Ratios of the RHICf results to the LHCf results~\cite{LHCf_Photon_7TeVpp,LHCf_Photon_13TeVpp}. The error bars represent the uncertainties calculated as a quadratic summation of the uncertainties in these results. Colored lines indicate MC predictions.}. \label{fig:escale} \end{figure} \afterpage{\clearpage} \section{Summary} \label{sec:summary} This study measured the inclusive differential production cross-section of photons in the very forward region $\eta\,>\,6.1$ with $pp$ collisions at $\sqrt{s}$ = 510 GeV. Through comparisons of the obtained results with the LHCf, the Feynman scaling law of forward photon production in a wide energy range from 510 GeV to 13 TeV was confirmed within the uncertainties. However, the precision is not sufficient to discuss the weak $x_{\mathrm{F}}$$\;$dependency predicted by certain models, and future studies must focus on reducing the uncertainties together with LHCf collaboration. Moreover, tests of the Feynman scaling law with other neutral hadrons $\pi^{0}$ and neutrons are an interesting concept and will be addressed in future publications. They will contribute to improving the predictions of models with intermediate and even higher collision energies than LHC. \section*{Acknowledgements} We thank the staff at BNL, STAR Collaboration, and PHENIX Collaboration for supporting the experiments. Further, we acknowledge the essential contributions of STAR members toward the successful operation of RHICf. We are also grateful to BNL Collider-Accelerator Department for smooth commissioning and operation of beams, and providing beam parameters used in this analysis such as luminosity. This work was partly supported by the U.S.--Japan Science and Technology Cooperation Program in High-Energy Physics, JSPS KAKENHI (No. JP26247037 and No. JP18H01227), the joint research program of the Institute for Cosmic Ray Research (ICRR), University of Tokyo, and the National Research Foundation of Korea (No. 2016R1A2B2008505 and No. 2018R1A5A1025563), and “UNICT 2020-22 Linea 2” program, University of Catania. \afterpage{\clearpage}
1c13b014a94dd652312f65ae812b48fd741f80d1
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \noindent Let $\mathbf{M}=(c_{i,j})_{i,j=0}^{\infty}$ be an infinite Hermitian matrix, i.e., $c_{i,j}= \overline{c_{j,i}}$ for all $i,j$ non-negative integers. Following \cite{EGT1} we say that an infinite hermitian matrix $\mathbf{M}$ is positive definite, in short an HPD matrix (resp. positive semidefinite, in short HSPD matrix) if $\vert \mathbf{M}_n \vert >0$ (resp. $\vert \mathbf{M}_n \vert \geq 0$ for all $n\geq 0$), where $\mathbf{M}_n$ is the truncated matrix of size $(n+1)\times (n+1)$ of $\mathbf{M}$. Following the notation in \cite{EGT1} and \cite{EGT5} an infinite HPD matrix defines an inner product, denoted by $\langle \cdot, \cdot \rangle_{\mathbf{M}}$, in the space $\mathbb{P}[z]$ of all polynomials with complex coefficientes in the following way: if $p(z)=\sum_{k=0}^{n}v_kz^k$ y $q(z)=\sum_{k=0}^{m}w_kz^k$ then \begin{equation} \label{uno} \langle p(z) ,q(z) \rangle_{\mathbf{M}}=v\mathbf{M}w^{*} \end{equation} \noindent being $v=(v_0,\dots,v_n,0,0, \dots), w=(w_0,\dots,w_m,0,0, \dots) \in c_{00}$ where $c_{00}$ is the space of all complex sequences with only finitely many non-zero entries and the symbol $*$ denotes the conjugate transpose for matrices of any sice. The associated norm is denoted by $\Vert p(z) \Vert_{\mathbf{M}}^2 = \langle p(z),p(z)\rangle_{\mathbf{M}} $ for every $p(z)\in \mathbb{P}[z]$, and the vector space $\mathbb{P}[z]$ is a pre-hilbertian space endowed with such norm and its completion will be denoted by $P^{2}_{\mathbf{M}}$. In this way, $P^{2}_{\mathbf{M}}$ is a Hilbert space associated to the inner product $\langle \cdot ,\cdot \rangle_{\mathbf{M}}$. \medskip \noindent Of course, the most interesting class of infinite HPD (and also HSPD) matrices are those which are moment matrices with respect to a certain positive measure (see e.g. \cite{Van Assche}), i.e., matrices $\mathbf{M}=(c_{i,j})_{i,j=0}^{\infty}$ such that there exists a positive Borel measure $\mu$ with support in the complex plane, which is called a {\it representating measure} of $\mathbf{M}$, with finite moments for all $i,j\geq 0$ \begin{equation} \label{dos} c_{i,j}= \int z^{i} \overline{z}^jd\mu. \end{equation} \noindent Thorough the paper we always consider positive Borel measures $\mu$ supported in the complex plane and with finite moments. The associated moment matrix to a measure $\mu$, denoted by $\mathbf{M}(\mu)$, is always an infinite HSPD, being an HPD matrix if and only if the support of $\mu$ is an infinite set. For more information concerning the characterization of infinite HPD matrices which are moment matrices with respect to a certain measure $\mu$ with support in $\CC$ see among others \cite{Atzmon}, \cite{Berg-Maserik} and \cite{Szafraniec}. \bigskip \noindent Our aim here is to study certain geometrical and localization properties of the support of measures thorough their associated moment matrices. This will be done in the context of matrix algebra using as essential tool the infinite matrices and the generalizations of some well known notions as generalized eigenvalues. The approach is the same as in \cite{Szego}, \cite{Berg}, \cite{EGT1} and \cite{EGT5} and the essential key is the following identity: if $p(z)=v_0+v_1z+\dots+v_nz^n \in \mathbb{P}[z]$ and $(v_0, v_1, \dots,v_n,0,0,0,\dots)\in c_{00}$, \begin{equation} \label{identification} v\mathbf{M}(\mu)v^{*}=\int \vert p(z) \vert^2 \; d\mu . \qquad \qquad \qquad \end{equation} \noindent In the case of Toeptliz definite positive matrices, which are moment matrices associated to measures with support in the unit circle, the behaviour of various spectral characteristics, in particular eigenvalues, eigenvectors, and extreme eigenvalues, has been an object of active investigation (see e.g. the classical Szego's paper \cite{Szego} or \cite{Grenader-Szego}). In the case of Hankel positive moment matrices in \cite{Berg-Chen-Ismail} a characterization of the uniqueness of the representing measure is given in terms of the asymptotic behaviour of the smallest eigenvalues of the truncated matrices of the moment matrix. The analysis of the largest and smallest eigenvalues plays an important role since they provide useful information about the nature of Hankel matrices generated for weight functions and is a topic of great interest and activity (see e.g. \cite{Berg}, \cite{Berg1}, and \cite{Wang} among others). We here are concerned with general moment matrices associated with measures supported in the complex plane. In this direction in \cite{EGT1} a sufficient condition is given to assure polynomial approximation in the corresponding space of measure $L^{2}({\mu})$ (for compactly supported measures ) also in terms of the asymptotic behaviour of the smallest eigenvalues. With the same approach in \cite{EGT5}, for measures supported in Jordan curves, a characterization of polynomial approximation is given. \bigskip \noindent The main novelty in this work is the analysis of {\it generalized} eigenvalues of large hermitian matrices as a new tool in order to compare two different measures or even sets ( suggested in \cite{Szego}). Our motivation was to realize that the analysis of eigenvalues can be seen as a way to compare any infinite hermitian matrix with the identity matrix $\mathbf{I}$, which is indeed the moment matrix associated with the uniform Lebesgue measure in the unit circle. Such comparison does not provide, in general, any information concerning density polynomial when we consider measures supported in other disks. Nevertheless, we can make such comparison between any two measures via {\it generalized eigenvalues} as we will do; with this approach we may describe the support of one measure in relation with the support of another. \bigskip \noindent In the first section, given two infinite HPD matrices we introduce two indexes that describe the assymptotic behaviour of the smallest and largest generalized eigenvalues of large hermitian matrices. In the particular case of moment matrices these indexes provide an algebraic tool to compare measures. Some properties of these indexes will be given. \bigskip \noindent In the second section we see the impact of the largest generalized eigenvalue of a measure with respect to other in the support of the first in relation with the support of the second. The main result of this section asserts that if such largest generalized eigenvalue is finite then the support of the first measure is contained in the polynomially convex hull of the support of the second. In particular, for measures with polynomially convex support, that means without {\it holes} in their supports, that are {\it well comparable} between them (with positive smallest generalized eigenvalue and finite largest generalized eigenvalue ) the supports coincide. In the particular case of a good comparison of a certain measure with a measure supported in a Jordan curve we obtain that the Jordan curve must be contained in the support of such measure; this lets to find Jordan curves in the supports of a measure using this algebraic approach. \bigskip \noindent The third section is devoted to the description of the convex envelope of the support of a measure. Our main result is that the convex hull of the support of a measure can be obtained using Rayleigh quotients of a certain infinite matrix (mainly, the moment matrix without the first row) with the moment matrix. In order to prove this result we use theory of normal operators in Hilbert spaces and results concerning Hessemberg matrices in the theory of orthogonal polynomials. \bigskip \noindent In the last section we generalize the results of polynomial approximation in mean square in \cite{EGT1}. This generalization is obtained when we replace the uniform Lebesgue measures for other uniform Lebesgue measures in circles, which are, in particular, non complete . We do not know if we can replace these measures by any measure for which there is no polynomial approximation in mean square. In this direction, we give a partial answer when the first measure is supported in a Jordan curve. \bigskip \noindent We begin with some notation and definitions: \bigskip \noindent Thorough all the paper we denote by $\mathbb{D}=\{z\in \CC\; \vert z \vert <1\}$ and $\mathbb{T}=\{z\in \CC\; \vert z \vert=1\}$. For general disks we denote $\mathbb{D}_{r}(z_0)=\{ z\in \CC : \; \vert z-z_0 \vert <r\}$ and $\mathbb{S}_{r}(z_0)= \{ z\in \CC : \; \vert z-z_0 \vert =r\}$. We denote by ${\bf m}$ the uniform Lebesgue measure in the unit sphere; for general spheres we denote by ${\bf m}_{z_0;r}$ the uniform Lebesgue measure in the sphere $\mathbb{S}_{r}(z_0)$ and by simplicity in the particular case of spheres with center $0$ we denote ${\bf m}_r={\bf m}_{0,r}$. \section{Generalized eigenvalues associated to infinite SHPD matrices.} \noindent Our aim in this section is to extend the notion of generalized eigenvalues in the context of infinite dimensional matrices. Recall that (see e.g. \cite{Bhatia}) \begin{definition} Given two finite matrices of size $n\times n$, $\mathbf{A}$ and $\mathbf{B}$, we say that $\lambda$ is an eigenvalue of $\mathbf{A}$ with respect to $\mathbf{B}$ if there exists a nonzero vector $v\in \CC^{n}$ such that $\mathbf{A}v= \lambda \mathbf{B}v$. These are called the {\it generalized eigenvalues} of $\mathbf{A}$ with respect $\mathbf{B}$ . \end{definition} \noindent It is well known that in the case of hermitian matrices the generalized eigenvalues are real numbers. This lets to define the following indexes: \begin{definition} Let $\mathbf{A},\mathbf{B}$ be Hermitian matrices of size $n$, we define $\lambda_n(\mathbf{A},\mathbf{B})$ as the smallest eigenvalue of $\mathbf{A}$ with respect to $\mathbf{B}$ and $\beta_n(\mathbf{A},\mathbf{B})$ as the largest eigenvalue of $\mathbf{A}$ with respect to $\mathbf{B}$. \end{definition} \medskip \noindent It is obvious that $\lambda_n(\mathbf{A},\mathbf{B}) \leq \beta_n(\mathbf{A},\mathbf{B})$. Moreover, in the case of Hermitian semi-definite positive matrices $\lambda_n(\mathbf{A},\mathbf{B}) \geq 0$. \bigskip \noindent Of course, the notion of generalized eigenvalue is a generalization of the notion of eigenvalues. Indeed, in the particular case of $\mathbf{B}=\mathbf{I}$ (the identity matrix of size n ) it is obvious that $\lambda_n(\mathbf{A},\mathbf{I})=\lambda_n(\mathbf{A})$ and $\beta_n(\mathbf{A},\mathbf{I})=\beta_n(\mathbf{A})$ with the notation introduced in \cite{EGT1}. It is well known by the classical Rayleigh quotient that for finite hermitian matrices it follows \begin{eqnarray*} \lambda_{n}(\mathbf{A})& =& \inf\{ \dfrac{ v\mathbf{A}v^{*}}{vv^{*}}, v\in \CC^{n}\setminus\{0\}\}= \inf\{ v\mathbf{A}v^{*}: \; v\in \CC^{n}, vv^{*}=1\},\\ \beta_n(\mathbf{A}) & =& \sup \{ \dfrac{ v\mathbf{A}v^{*}}{vv^{*}} : v\in \CC^{n}\setminus\{0\}\} = \sup \{v\mathbf{A}v^{*}: \; v\in \CC^{n}, vv^{*}=1\}. \end{eqnarray*} \bigskip \noindent This criteria also holds for the generalized eigenvalues replacing the identity matrix by an HPD matrix $\mathbf{B}$ ( see e.g. \cite{Gantmacher}). \bigskip \noindent ({\it Generalized Rayleigh criteria}) Let $\mathbf{A}, \mathbf{B}$ be HSPD matrices of size $n$ being $\mathbf{B}$ positive definite, then: \begin{eqnarray*} \lambda_{n}(\mathbf{A},\mathbf{B}) & = & \inf \{ v\mathbf{A}v^{*}: \;v\in \CC^{n}, v\mathbf{B}v^{*}=1\}=\inf\{ \dfrac{ v\mathbf{A}v^{*}}{v\mathbf{B}v^{*}} : v\in\CC^{n}\setminus\{0\} \; \},\\ \beta_n(\mathbf{A},\mathbf{B}) & =& \sup \{v\mathbf{A}v^{*}: \; v\in \CC^{n}, v\mathbf{B}v^{*}=1\}=\sup \{ \dfrac{ v\mathbf{A}v^{*}}{v\mathbf{B}v^{*}} : v\in \CC^{n}\setminus\{0\} \; \}. \end{eqnarray*} \bigskip \noindent The definition of the Rayleigh quotients can be given in the more general context of infinite matrices (not necessarily hermitian ) in the following way: \begin{definition} \label{definicion4} Given an infinite matrix $\mathbf{A}$ and an infinite HPD matrix $\mathbf{B}$ a Rayleigh quotient of $\mathbf{A}$ related to $\mathbf{B}$ is $\dfrac{v\mathbf{A}v^{*}}{v\mathbf{B}v^{*}}$ with $v \in c_{00}\setminus \{0\}$ and the set of Rayleigh quotients is the following set in the complex plane: $$ \{\; \dfrac{v\mathbf{A}v^{*}}{v\mathbf{B}v^{*}}: \; v\in c_{00} \setminus\{0\} \; \}=\{v\mathbf{A}v^{*} : \; v\in c_{00}, \; v\mathbf{B}v^{*}=1\}. $$ \end{definition} \bigskip \noindent We generalize the indexes $\lambda$ and $\beta$ introduced for finite matrices in the context of infinite dimensional matrices in the same lines as in \cite{EGT1}, \cite{EGT5}. In order to do it, consider two HSPD matrices $\mathbf{A}, \mathbf{B}$ with $\mathbf{B}$ being positive definite, and let $\mathbf{A}_n, \mathbf{B}_n$ the their truncated matrices of size $(n+1)\times (n+1)$. It is easy to check that the sequence of real numbers $\{\lambda_{n}(\mathbf{A}_n,\mathbf{B}_n)\}_{n=0}^{\infty}$ is a non increasing sequence and the sequence $\{\beta_n(\mathbf{A}_n,\mathbf{B}_n)\}_{n=0}^{\infty}$ is a non decreasing sequence. Therefore, $\displaystyle{\lim_{n\to \infty}\lambda_{n}(\mathbf{A}_n,\mathbf{B}_n)}$ exists, and either is zero or a positive number. On the other hand, $\displaystyle{\lim_{n\to \infty}\beta_{n}(\mathbf{A}_n,\mathbf{B}_n)}$ exists (is a real number) or it is infinite. Thus, we introduce the following indexes \bigskip \begin{definition} Let $\mathbf{A},\mathbf{B}$ two infinite HSPD matrices with $\mathbf{B}>0$. We define: \begin{eqnarray*} 0 \leq \lambda(\mathbf{A},\mathbf{B})&:=&\lim_{n\to \infty} \lambda_{n}(\mathbf{A}_n,\mathbf{B}_n)\\ \beta(\mathbf{A},\mathbf{B})& := & \lim_{n\to \infty}\beta_{n}(\mathbf{A}_n,\mathbf{B}_n) \leq \infty \end{eqnarray*} \noindent where $\mathbf{A}_n, \mathbf{B}_n$ are the corresponding truncated matrices of size $(n+1)\times (n+1)$ of $\mathbf{A},\mathbf{B}$ respectively. \end{definition} \bigskip \noindent Moreover, using the generalized Rayleigh criteria it follows: \begin{eqnarray*} \lambda(\mathbf{A},\mathbf{B})& = & \inf \{\; \dfrac{v\mathbf{A}v^{*}}{v\mathbf{B}v^{*}}: \; v\in c_{00} \setminus \{0\} \; \}=\inf \{v\mathbf{A}v^{*} : \; v\in c_{00}, \; v\mathbf{B}v^{*}=1\},\\ \beta(\mathbf{A},\mathbf{B}) & = & \sup\{\; \dfrac{v\mathbf{A}v^{*}}{v\mathbf{B}v^{*}}: \; v\in c_{00} \setminus \{0\} \; \} = \sup \{v\mathbf{A}v^{*} : \; v\in c_{00}, \; v\mathbf{B}v^{*}=1\}. \end{eqnarray*} \bigskip \begin{remark} In the case that $\mathbf{A}>0$ and $\mathbf{B}>0$ the following relationship between these indexes is given: \begin{equation} \label{tres} \lambda(\mathbf{A},\mathbf{B})=\frac{1} {\beta(\mathbf{B},\mathbf{A})} \end{equation} \end{remark} \bigskip \smallskip \noindent The particularization of the indexes $\lambda$ and $\beta$ for infinite moment matrices lets to introduce these indexes between measures in the following way: \begin{definition} \label{definicion7} Given two supported in the complex plane measures $\mu_{1},\mu_{2}$ with $\mu_{2}$ infinitely supported we define the following indexes \[ \lambda(\mu_1,\mu_2):= \lambda\left(\mathbf{M}(\mu_1),\mathbf{M}(\mu_2)\right) \qquad \beta(\mu_1,\mu_2):=\beta(\mathbf{M}(\mu_1),\mathbf{M}(\mu_2)). \] \end{definition} \bigskip \begin{remark} By remark $1$ in the case that both measures $\mu_1,\mu_2$ have infinite support the following relationship between the indexes follows: $$ \lambda(\mu_1, \mu_2)=\frac{1}{\beta(\mu_2,\mu_1)}. $$ \end{remark} \bigskip \begin{ejem} \label{ejemplo1} For uniform Lebesgue measures ${\bf m}_r$ with $r>0$ it holds \begin{enumerate} \item[i)] If $r<1$, $ \lambda({\bf m_{r}},{\bf m})=0, \qquad \beta({\bf m_{r}},{\bf m})=1. $ \medskip \item[ii)] If $r>1$, $ \lambda({\bf m_{r}},{\bf m})=1, \qquad \beta({\bf m_{r}},{\bf m})=\infty . $ \end{enumerate} \noindent Indeed, denote by ${\bf M}_{r}$ the associated moment matrix with ${\bf m}_r$ which is given by: $$ \mathbf{M}_{r}= \left( \begin{array}{cccc} 1 & 0 & 0 & \hdots \\ 0 & r^2 & 0 & \hdots \\ 0 & 0 & r^4 & \hdots \\ \vdots & \vdots & \vdots & \ddots \\ \end{array} \right). $$ \noindent Then the truncated matrices of size $(n+1)\times(n+1)$ are diagonals and the result follows easily. \end{ejem} \bigskip \begin{ejem} \label{ejemplo2} The Pascal matrix $\mathbf{P}$ is the moment matrix associated with the normalized Lebesgue measure ${\bf m}_{1,1}$ in $\mathbb{S}_{1}(1)$ ( see e.g. \cite{EGT1}) $$ \mathbf{P}= \left( \begin{array}{ccccc} 1 & 1 & 1 & 1 & \hdots \\ 1 & 2 & 3 & 4 & \hdots \\ 1 & 3 & 6 & 10 & \hdots \\ 1 & 4 & 10 & 20 & \hdots \\ \vdots & \vdots & \vdots & \vdots & \ddots \\ \end{array} \right). $$ \noindent As it was pointed out in \cite{EGT1} $\displaystyle{\lim_{n\to \infty} \lambda_n(\mathbf{P})=\lambda({\bf m}_{1,1},{\bf m})=0}$. On the other hand, $\beta({\bf m}_{1,1},{\bf m})=\infty$; indeed, by Rayleigh criterion $\beta(\mu,{\bf m}) =\beta(\mathbf{P},\mathbf{I}) \geq e_n \mathbf{P}e_n^{*}=c_{n,n} \to \infty$ whenever $n\to \infty$ (where $e_n$ is the usual basis in the space $c_{00}$). \end{ejem} \noindent The following result, which is a generalization of the results in \cite{EGT1}, is the key to establish the comparison of measures via generalized eigenvalues of the associated moment matrices: \begin{prop} \label{proposicion1} Let $\mu_{1},\mu_{2}$ be two measures supported in the complex plane with $\mu_2$ infinitely supported and let $\mathbf{M}_i=\mathbf{M}(\mu_{i}),i=1,2,$ their associated moment matrices. Then, \begin{itemize} \item[(i)] $\beta(\mu_1,\mu_2)<\infty$ if and only if there exists a constant $c>0$ such that for every polynomial $p(z)$ $$ \int \vert p(z) \vert^2 d\mu_1 \leq c\int \vert p(z) \vert^2 d\mu_2. $$ \item[(ii)] $\lambda(\mu_1,\mu_2)>0$ if and only if there is a constant $c>0$ such that for every polynomial $p(z)$ $$ \int \vert p(z) \vert^2 d\mu_1 \geq c\int \vert p(z) \vert^2 d\mu_2. $$ \end{itemize} \end{prop} \begin{proof} \noindent Assume $\beta(\mu_{1}, \mu_{2})< \infty$ is true, then for every polynomial $p(z)=\sum_{k=0}^{n}v_kz^k$ and $v=(v_0,v_1,\dots,v_n,0,0,0,\dots)\in c_{00}$, with $n\in \NN$, via the identification (\ref{identification}) we have that $$ v\mathbf{M}_iv^{*}=\int \vert p(z) \vert^2 d\mu_i, \qquad i=1,2. $$ \noindent and therefore $$ \beta(\mu_1,\mu_2)= \sup \{ \; \dfrac{v\mathbf{M}_1v^{*}}{v\mathbf{M}_2v^{*}}, v\in c_{00}\setminus \{0\} \; \}. $$ \noindent By taking $c= \beta(\mu_1,\mu_2)>0$, it follows that for every $p(z)\in \mathbb{P}[z]$ $$ \dfrac{\int \vert p(z) \vert^2 d\mu_1}{\int \vert p(z) \vert^2 d\mu_2} \leq c. $$ \noindent Then, for every $p(z)\in \mathbb{P}[z]$, $$ \int \vert p(z) \vert^2 d\mu_1 \leq c \int \vert p(z) \vert^2 d\mu_2, $$ \noindent On the other hand, assume now that there exists $c>0$ verifying that for every $p(z)\in \mathbb{P}[z]$, $$ \int \vert p(z) \vert^2 d\mu_1 \leq c \int \vert p(z) \vert^2 d\mu_2. $$ \noindent By using again the identification (\ref{identification}) we have \begin{eqnarray*} \beta(\mu_1,\mu_2)&=& \sup \{ v\mathbf{M}_1v^{*} : v\mathbf{M}_2v^{*}=1,v\in c_{00}\} =\\ \mbox{} & = & \sup \{\int \vert p(z)\vert^2 d\mu_1 : \int \vert p(z) \vert^2 d\mu_2=1, p(z)\in \mathbb{P}[z]\} \leq c; \end{eqnarray*} \noindent consequently $\beta(\mu_1,\mu_2)<\infty$ as we required. \bigskip \noindent The proof for the index $\lambda$ is analogous. \end{proof} \bigskip \section{Impact of generalized eigenvalues in the support of the measures} \noindent First of all we begin with an easy result that shows the impact of the behaviour of the diagonal sequence $\{c_{n,n}\}_{n=0}^{\infty}$ of a certain moment matrix $\mathbf{M}=(c_{i,j})_{i,j=0}^{\infty}$ in the boundedness of the support of the representing measure $\mu$. Note that the sequence $\{c_{n,n}\}_{n=0}^{\infty}$ verifies the property: \begin{equation} \label{C-S} c_{n,n}^2 \leq c_{n-1,n-1}c_{n+1,n+1} \qquad n\geq 1 \end{equation} \noindent Indeed, this is a consequence of the Cauchy-Schwartz inequality of the inner product in the Hilbert space $L^{2}(\mu)$. In this case, $\{\frac{c_{n,n}}{c_{n+1,n+1}}\}_{n=0}^{\infty}$ is a non decreasing sequence and consequently, by elementary results either $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{n}}}<\infty$ or $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{n}}}=\infty$. The following characterization of boundedness of the support of the measure is proved in \cite{Tomeo}. We prove it for the sake of completeness. \begin{prop} \cite{Tomeo} \label{proposicion2} Let $\mathbf{M}=(c_{i,j})_{i,j=0}^{\infty} $ be a positive definite moment matrix and let $\mu$ be any representing measure. Then, the following are equivalent: \begin{enumerate} \item[i)] $\sop(\mu)$ is compact. \item[ii)] $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{2n}} < \infty}$ \end{enumerate} \noindent Moreover, in this case if $R=\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{2n}}}$ then $R= \sup \{ \vert z \vert: \; z\in \sop(\mu)\}$. \end{prop}\begin{proof} Assume first that $\sop(\mu)$ is a bounded set and $R= \sup \{ \vert z \vert: \; z\in \sop(\mu)\}$ (note that $R>0$ since the support is infinite). Then $\sop(\mu) \subset \overline{\mathbb{D}}_{R}(0)$ and $$ \vert c_{n,n} \vert=\int \vert z \vert^{2n} \; d\mu \leq R^{2n} \mu\left(\overline{\mathbb{D}}_{R}(0)\right)=c_{00}R^{2n} $$ \noindent Therefore, $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{2n}}\leq R <\infty}$. \noindent On the other hand, assume that $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{2n}} =R}$, we prove that $\sop(\mu)\subset \overline{\mathbb{D}}_{R}(0)$. Assume the contrary, then there exists $z_0\in \sop(\mu)$ such that $\vert z_0 \vert>R$. Thus thus we may choose $r>0$ and $\epsilon>0$ such that $\vert z \vert \geq R+\epsilon$ for every $z\in \mathbb{D}_r(z_0)$. Therefore, for all $n\in \NN$ $$ \int \vert z \vert^{2n} \; d\mu \geq \int_{\mathbb{D}_r(z_0)} \vert z \vert^{2n} \; d\mu \geq (R+\epsilon)^{2n}\mu(\mathbb{D}_r(z_0))=c(R+\epsilon)^{2n}. $$ \noindent Then, $\displaystyle{\lim_{n\to \infty}\vert c_{n,n}\vert^{\frac{1}{2n}} \geq R+\epsilon}$ which is not possible. \end{proof} \noindent As a consequence of the above result we obtain the following result: \noindent \begin{corollary} \label{corolario1} Let $\mu$ be a measure such that $\beta(\mu,{\bf m}_r)<\infty$ for some $r>0$. Then, $\displaystyle{\lim_{n\to \infty} \vert c_{n,n} \vert^{\frac{1}{2n}}\leq r}$ and consequently $\sop(\mu) \subset \overline{\mathbb{D}}_{r}(0)$. \end{corollary} \begin{proof} Assume $\beta(\mu,{\bf m}_r)<\infty$, by Proposition \ref{proposicion1} there exists a constant $c>0$ verifying that for every polynomial, and in particular for polynomials $z^n$ with $n\in \NN_{0}$ $$ c_{n,n} = \int \vert z \vert^{2n} \; d\mu \leq c \int \vert z \vert^{2n} \; d{\bf m}_{r}= c \; r^{2n}. $$ \noindent Therefore $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{2n}} \leq r}$ and by Proposition \ref{proposicion2} $\sop(\mu) \subset \overline{\mathbb{D}}_{r}(0)$. \end{proof} \begin{remark} Note that $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{2n}} =r}$ is a weaker condition than $\beta(\mu,{\bf m}_{r})<\infty$. Indeed, consider a measure with support in $\mathbb{T}$ given by $d\mu(\theta)=w(\theta)d\theta$ with $w(\theta) \in L^{1}(-\pi,\pi)$ with $\essupp w(\theta)=\infty$ being $\essupp w(\theta)$ the essential upper bound, that is, the smallest number $C>0$ such that $w(\theta)\leq C$ a.e. By proposition $2$ it follows that $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{2n}} =1}$. Nevertheless, $\beta(\mu,{\bf m})=\infty$; indeed, by the results in \cite{Grenader-Szego} $\displaystyle{\lim_{n\to \infty} \beta_n=\essupp w(\theta)=\infty}$ being $\beta_n$ the largest eigenvalue of the truncated matrix of $\mathbf{M}(\mu)$ of size $(n+1)\times (n+1)$. \end{remark} \noindent As it is established in Corollary \ref{corolario1} if $\beta(\mu , {\bf m}_{r})<\infty$ then $\sop(\mu) \subset \overline{\mathbb{D}}_{r}(0)$ which is not the support of ${\bf m}_r$ although it is, in particular, its convex envelope. This result motivates the following problem: Consider two compactly supported $\mu_1,\mu_2$ measures verifying that $\beta(\mu_1,\mu_2)<\infty $, we wonder if there is a relationship between the corresponding supports of $\mu_1,\mu_2$. Of course, it is not true in general that $\sop(\mu_1) \subset \sop(\mu_2)$. Indeed, consider the Lebesgue measures ${\bf m}$ and ${\bf m}_{\frac{1}{2}}$ in Example 2 verifying $\beta({\bf m}_{\frac{1}{2}}, {\bf m})=1$, nevertheless $\sop({\bf m}_{\frac{1}{2}})= \frac{1}{2}\mathbb{T} $. \noindent \bigskip \noindent As an answer of the above problem our main result in this section establishes the following relationship: if $\beta(\mu_1,\mu_2)<\infty$ then the support of $\mu_1$ must be contained in the {\it polynomially convex hull} of the support of $\mu_2$. \bigskip \noindent We recall that ( see e.g. \cite{Conwayfuncional}) for a compact set $K$ in the complex plane the {\it polynomially convex hull } of $K$, denoted $\Pc{(K)}$, is defined as: $$ \Pc(K):=\{ z\in \CC: \; \vert p(z) \vert \leq \max_{\xi \in K}\vert p(\xi) \vert, \; \text{for all } p(z)\in \mathbb{P}[z] \}. $$ \noindent A compact set is said to be {\it polynomially convex} if $K=\Pc(K)$. Obviously, $K \subset \Pc(K)$. In the complex plane polynomial convexity turns to be a purely topological notion. Indeed, using the maximum modulus principle and the Runge approximation theorem, one proves that a compact set is polynomially convex if and only if $\CC \setminus K$ is connected \begin{theorem} \label{teorema1}Let $\mu_1,\mu_2$ be compactly supported measures verifying $\beta(\mu_1,\mu_2)<\infty$. Then, the support of $\mu_1$ is contained in the {\it polynomially convex hull} of the support of $\mu_2$, i.e., $$ \sop(\mu_1) \subset \Pc(\sop(\mu_2)). $$ \end{theorem} \begin{proof} Denote by $K_i={\it supp}(\mu_i)$, $i=1,2$. By \ref{proposicion1} it follows that for every polynomial $p(z)$ it follows that \begin{equation} \label{pol} \int \vert p(z) \vert^2 d\mu_{1} \leq \int \vert p(z) \vert^2 d\mu_{2} . \end{equation} \noindent Assume that $K_1$ is not a subset of $\Pc(K_2)$. Then, there exists $z_1\in K_1$ such that $z_1 \notin \Pc(K_2)$. Since $ \Pc(K_{2})$ is polynomially convex from the results in \cite{Forstneric} it follows that there is a polynomial $p_0(z)\in \mathbb{P}[z]$ such that $p_0(z_1)=1$ and $ \vert p_0(z) \vert <1$ for every $z\in \Pc(K_{2})$. By compactness of $\Pc(K_{2})$ there exists $0 \leq \alpha <1$ such that $\vert p_0(z) \vert \leq \alpha$ for all $z\in \Pc(K_{2})$. Next, since $p(z_1)=1$ there exists $r>0$ such that $\vert p_0(z) \vert > \frac{1+\alpha}{2}$ for all $z\in B_{r}(z_1)$. On the other hand, since $z_1 \in K_1$ it follows that $\mu_1(B_{r}(z_1))>0$. Therefore, by applying inequality (\ref{pol}) to the polynomials $p_0^n(z)$ with $n\in \NN$ we obtain that $$ \left(\frac{1+\alpha}{2}\right)^n \mu_1(B_{r}(z_1)) \leq \int_{K_1} \vert p_0(z)\vert^n d\mu_1 \leq \int_{K_2} \vert p_0(z)\vert^n d\mu_2 \leq \alpha^{n}\mu_2(K_2). $$ \noindent That means that there exists $C>0$ such that $ \left(\frac{(1+\alpha)/2}{\alpha}\right)^n \leq C $ for every $n\in \NN$, which is not possible since $\frac{1+\alpha}{2}>\alpha$. \end{proof} \bigskip \begin{remark} The converse of this result is not true. Indeed, consider $\mu_1={\bf m}$ and the measure in the unit circle $\mu_2 (\theta)=(1+\cos \theta)d\theta$ which apperars in \cite{EGT1}. It is clear that $\sop(\mu_1) \subset \Pc(\sop(\mu_2))$ and nevertheless $\beta(\mu_1,\mu_2)=\infty$. Indeed, by \cite{EGT1} if $\mathbf{T}$ is the Toeplitz matrix associated with $\mu_2$ then $\lambda(\mu_2,\mu_1)=\displaystyle{\lim_{n\to \infty} \lambda_n(\mathbf{T}_n)}=0$ and therefore $\beta(\mu_1,\mu_2)=\infty$ by Remark 2. \end{remark} \noindent As a consequence of theorem \ref{teorema1} and remark 2 we have the following result \begin{corollary} Let $\mu_1,\mu_2$ two compactly supported measures with infinite support with polynomially convex supports. If $0<\lambda(\mu_1,\mu_2)\leq \beta(\mu_1,\mu_2)<\infty$ then the supports of both measures coincide. \end{corollary} \noindent It is interesting to point out that this result provides a tool to recognize the support of a measure comparing this measure, with our indexes, with another well known measure. In particular, we obtain an application to find Jordan curves in the support of a measure: \begin{corollary} Let $\Gamma$ be a Jordan curve and $\nu_{\Gamma}$ any measure such that $\sop(\nu_{\Gamma})=\Gamma$. Let $\mu$ be other measure such that verifies $$ 0< \lambda(\mu,\nu_{\Gamma}) \leq \beta(\mu,\nu_{\Gamma})<\infty. $$ \noindent Then, $\Gamma \subset \sop(\mu) \subset \Pc{(\Gamma)}.$ \end{corollary} \smallskip \begin{proof} Since $\beta(\mu,\nu_{\Gamma})<\infty$ by Theorem 1 it follows that $\sop(\mu) \subset \Pc(\nu_{\Gamma})= \mathring{\Gamma}\cup \Gamma$. On the other hand by Remark 2 it follows that $\beta(\nu_{\Gamma},\mu)=\dfrac{1}{\lambda(\mu,\nu_{\Gamma})}<\infty$, and again by using Theorem 1 $$ \Gamma = \sop(\nu_{\Gamma}) \subset \Pc(\sop(\mu)). $$ \noindent Assume that $\Gamma$ is not contained in $\sop(\mu)$. Then there existe $z_1\in \Gamma$ such that $z_1\notin \sop(\mu)$. Then, $\sop(\mu)\subset \Gamma \setminus \mathbb{D}_s(z_1)$ for some $s>0$. Then, by the definition of the polinomially convex hull $$\Gamma \subset \Pc(\sop(\mu))\subset \Pc\left((\mathring{\Gamma}\cup\Gamma) \setminus \mathbb{D}_s(z_1)\right)= (\mathring{\Gamma}\cup\Gamma) \setminus \mathbb{D}_s(z_1) $$ \noindent which is not possible. \end{proof} \section{An algebraical approach of the convex envelope of a measure} \noindent In the sequel we are concerned with the convex hull of the support of a measure. We obtain an algebraic description of such set in terms of Rayleigh quotients of a certain matrix (not necessarily Hermitian) related with the associated moment matrix. In order to obtain the main result in this section we need some definitions and lemmas. \begin{definition} Let $T$ be a bounded operator in a Hilbert space $\mathcal{H}$. The {\sl numerical range} of $T$ is defined as $$ W(T)=\{<Tx,x>: \; x\in \mathcal{H}, \Vert x \Vert=1\}$$ \end{definition} \begin{lem} Let $T$ be a bounded operator in a Hilbert space $\mathcal{H}$. Assume that $Y$ is dense set in $\mathcal {H}$, then \[ \overline{W}(T) =\overline{ \{\langle T y, y\rangle: \; y \in Y, \|y\|=1\} }.\] \end{lem} \begin{proof} Obviously \[ \overline{ \{\langle T y, y\rangle: \; y \in Y, \|y\|=1\}} \subset \overline{W}(T).\] On the other hand, assume $z_{0} \in \overline{W}(T)$, then there is a sequence $\{x_{n}\}_{n=1}^{\infty}$ with $\Vert x_n \Vert=1$, such that $z_{0}=\displaystyle{ \lim_{n\to \infty} \langle Tx_{n}, x_{n} \rangle}$. Since $Y$ is a dense set in $\mathcal {H}$, there is a sequence $\{y_{n}\}_{n=1}^{\infty}$ such that $\displaystyle{\lim_{n \to \infty} \|x_{n}-y_{n}\|=0}$; in particular, $\{y_n\}_{n=1}^{\infty}$ is a bounded sequence. Therefore, \begin{multline*} |\langle Tx_{n},x_{n} \rangle - \langle Ty_{n},y_{n}\rangle | = |\langle Tx_{n},x_{n}-y_{n} \rangle + \langle Tx_{n}-Ty_{n},y_{n} \rangle |\leq \\ \leq \|T\| \; \|x_{n}\| \; \|x_{n}-y_{n}\|+\|T\|\; \|x_{n}-y_{n}\| \; \|y_{n}\| \to 0 \mbox{ if } n \to \infty. \end{multline*} Consequently, $z_{0}= \displaystyle{\lim_{n \to \infty} \langle Ty_{n}, y_{n} \rangle} \in \overline{ \{\langle T y, y\rangle: \; y \in Y, \|y\|=1\}}$. \end{proof} \bigskip \begin{theorem} Let $\mathbf{M}=(c_{i,j})_{i,j=0}^{\infty}$ be a moment matrix with $\displaystyle{\lim_{n\to \infty} \vert c_{n,n}\vert^{\frac{1}{2n}} < \infty}$ and let $\mu$ be the representing measure. Let ${\bf M}^{\prime}$ be the infinite matrix obtained by removing the first row in ${\bf M}$, then \begin{equation} \label{1} \overline{\left \{ \frac{v {\bf M}^{\prime}v^{*}}{v {\bf M} v^{*}} : v \in c_{00} \setminus \{0\}\right\}} =Co(\sup(\mu)). \end{equation} \end{theorem} \begin{proof} Let's see first in (\ref{1}) the inclusion from left to right. We will call $\Omega \subset \CC$ the set of complex numbers of the form \[ \Omega = \left \{ \frac{v {\bf M}^{\prime}v^{*}}{v {\bf M} v^{*}}: v \in c_{00} \setminus \{0\}\right\}\]. \noindent By using (\ref{identification}), if $p(z)=v_0+v_1z+\dots+v_nz^n$, and $v=(v_0,v_1,\dots,0,\dots)\in c_{00}$, $$ \int z\vert p(z)\vert^{2}\; d\mu= \int zp(z)\overline{p(z)}\; d\mu = v\mathbf{S}_{L} \mathbf{M}v^{*}=v\mathbf{M}'v^{*} $$ \noindent where $\mathbf{S}_{L}$ is the shift left matrix and $\mathbf{M}'=\mathbf{S}_{L} \mathbf{M}$ is the infinite matrix obtained by removing the first row in $\mathbf{M}$. Therefore, $ \Omega$ can be rewritten as \[ \Omega = \left \{ \frac{\int z |q(z)|^2 d\mu}{\int |q(z)|^2 d\mu}: q(z) \in \mathbb{P}[z] \setminus \{0\} \right \}. \] Let be $z_{0} \in \Omega$, by definition there exists a polynomial $q(z) \in \mathbb{P}[z] $ such that \[ z_{0} = \frac{\int z |q(z)|^2 d\mu}{\int |q(z)|^2 d\mu}.\] This means that $z_{0}$ can be interpreted as the center of gravity of the weight function $w_{q}(z)=|q(z)|^2 d\mu$. In particular, if we consider the associated moment matrix with respect to such measure denoted by $\mathbf{M}(w_{q})=(\widetilde{c}_{i,j})_{i,j=0}^{\infty}$ it follows that $z_{0}$ is the zero of the orthogonal polynomial of degree one associated to the measure $w_{q}$ which is \[ \det \left ( \begin{array}{cc} \widetilde{c}_{00} & 1 \\ \widetilde{c}_{10} & z \end{array} \right ) = z \widetilde{c}_{00}- \widetilde{c}_{10} = 0,\] \noindent being \[ z_{0} = \frac{\widetilde{c}_{10}}{\widetilde{c}_{00}}= \frac{\int z |q(z)|^2 d\mu}{\int |q(z)|^2 d\mu}.\] As it is well known by Fejer's Theorem ( see e.g. \cite{gaier}) the zeros of the orthogonal polynomials are included in the convex envelope of the support of the measure, and this proves the inclusion $\overline{\Omega} \subset \Co(\sop(\mu))$. \noindent It remains to prove the reverse inclusion. Consider the multiplication by $z$-operator $\Delta_{z}:L^{2}(\mu) \to L^{2}(\mu)$, given by $\Delta_{z}(p(z))=zp(z)$. This is a normal operator and it is well known (see e.g. \cite{Conway}) that the spectrum of this operator is the support of the measure $\mu$; i.e. $\sigma(\Delta_{z})= \sop(\mu)$. \noindent Consider now the restriction operator of $\Delta_{z}$ to $P^{2}(\mu)$, $\mathcal {D}: P^{2}(\mu) \to P^{2}(\mu)$; this is a subnormal operator which minimal normal extension is $\Delta_{z}$. By one of the basic properties relating the spectrum of a subnormal operator (see e.g. \cite{Conway}), the spectrum of the normal extension of an operator is contained in the spectrum of the operator, consequently \[ \sop(\mu) \subset \sigma(\Delta_{z}) \subset \sigma(\mathcal {D}).\] \noindent Now we use that spectrum of an operator lies in the closure of its numerical range, that is $\sigma(\mathcal {D}) \subset \overline{W}(\mathcal {D})$. On the other hand, the famous Toeplitz-Hausdorff theorem (see e.g. \cite{halmos}) asserts that the numerical range of a bounded operator is always a convex set (no necessarily closed). Thus, the convex hull of the spectrum of an operator lies in the closure of the numerical range, therefore \[ \Co(\sop(\mu)) \subset \Co(\sigma(\mathcal {D}) )\subset \overline{W}(\mathcal {D}).\] Then, by lemma above, since $\mathbb{P}[z]$ is dense in the Hilbert space $P^{2}(\mu)$ it follows that \begin{multline*} \qquad \qquad \overline{W}(\mathcal {D}) = \overline{\{ \langle \mathcal {D}(p),p \rangle :\; \langle p, p\rangle=1 , p \in P^{2}(\mu)\}}= \\ =\overline{ \{ \langle zp,p \rangle: \; p \in \mathbb{P}[z], \langle p,p\rangle =1\}},\qquad \qquad \end{multline*} and again via the identification (\ref{identification}) it follows \[\overline{W}(\mathcal {D}) = \overline{ \left \{ \frac{v {\bf M^{\prime}} v^{*}}{v{\bf M} v^{*}}: v \in c_{00} \setminus \{0\} \right \}}.\] Consequently \[ \Co(\sop(\mu)) \subset \overline{W}(\mathcal {D})= \overline{ \left \{ \frac{v {\bf M^{\prime}} v^{*}}{v{\bf M}v^{*}}: v \in c_{00} \setminus \{0\} \right \}}.\] as we required. \end{proof} \bigskip \noindent Given a certain compactly supported measure $\mu$ the matrix representation of the operator $\mathcal{D}$, introduced in the proof of Theorem 2, in the space $P^{2}(\mu)$ with respect to the associated basis of orthonormal polynomials is an upper Hessemberg matrix (see e.g. \cite{EGT-hessemberg}). The following result provides a way to obtain the convex envelope of the support of a measure via such upper Hessemberg matrix \begin{corollary} Let $\mu$ be a compactly supported measure and let $\mathbf{D}$ be the Hessenberg matrix associated to $\mu$. Then: $$ \Co(\sop(\mu)) = \overline{ \{v {\bf D} v^{*}: v \in c_{00}, vv^{*}=1\}}= \overline{\bigcup_{n=0}^{\infty} W(\mathbf{D_n})} $$ \noindent where $\mathbf{D}_n$ is the $n+1$-section of the matrix $\mathbf{D}$. \end{corollary} \begin{ejem} As it is known the identity matrix is the moment matrix associated with ${\bf m}$. On the other hand the matrix representation of the multiplication operator by $ z $, in the canonical basis of $\ell^2$, is \[ {\bf D}= \left ( \begin{array}{cccc} 0 & 0 & 0 & \ldots \\ 1 & 0 & 0 & \ldots \\ 0 & 1 & 0 & \ldots \\ \vdots & \vdots & \vdots & \ddots \end{array} \right ).\] We will get the value of $W({\bf D}_{n})$. The projection on $\RR$ of field of values $W({\bf D}_{n})$ is \[ \Re({\bf D}_{n})=\frac{{\bf D}_{n}+{\bf D}^{*}_{n}}{2}=\left ( \begin{array}{cccccc} 0 & \frac{1}{2} & 0 & \ldots &0 & 0 \\ \frac{1}{2} & 0 & \frac{1}{2} & \ldots & 0 & 0 \\ 0 & \frac{1}{2} & 0 & \ldots & 0 & 0 \\ \vdots & \vdots & \vdots & \mbox{} & \vdots & \vdots \\ 0 & 0 & 0& \ldots & 0 & \frac{1}{2} \\ 0 & 0 & 0 & \ldots & \frac{1}{2} & 0 \\ \end{array} \right ).\] It is well known that $\Re({\bf D}_{n})$ is the $n \times n$ tridiagonal secction of $U_{n}(x)$, i.e. the Jacobi matrix of orthogonal Tchebyschev polynomials of the second class on $[-1,1]$. We have that the eigenvalues of $\Re({\bf D}_{n})$ are the zeros of $U_{n}(x)$. It is well known that $U_{n}(x) = \sin((n+1) \arccos(x))/\sin( n \arccos(x))$. We set $n \in \NN$, and obtain \begin{multline*} \qquad \lambda_{\max}(\Re({\bf D}_{n})) = \max \{ U_{n}(x)=0 \} = \\ = \max \{\sin((n+1)\arccos(x)) =0\}= \max \{ \cos(\frac{\pi}{n+1}) \}. \qquad \end{multline*} $\Re({\bf D}_{n})$ is a symmetric matrix hence $W(\Re({\bf D}_{n}))=[-\cos (\frac{\pi}{n+1}), \cos(\frac{\pi}{n+1})]$, and by the symmetry with respect to the origin we finally have \[W({\bf D}_{n})=\{z \in \mathbb{C} : |z|\leq \cos(\frac{\pi}{n+1})\}. \] Therefore \[ \overline{\bigcup_{n=1}^{\infty} W(\bf{D}_{n})} = \{ z \in \mathbb{C} : |z| \leq 1\},\] and the corollary is fulfilled since the convex envelope of support of the Lebesgue measure in the unit circumference, $\sop({\bf m})=\mathbb{T}$ and $\Co( \sop({\bf m}))= \overline{\mathbb{D}}_1(0)$. \end{ejem} \noindent As a consequence of the above results we obtain the following identity that verifies infinite moment matrices and which provides a necessary condition to be a moment matrix: \begin{corollary} Let $\mathbf{M}=(c_{i,j})_{i,j=0}^{\infty}$ be a positive definite moment matrix and let $\widehat{\mathbf{M}}$ be the matrix obtained by removing the first row and the first column. Then, $$ \beta(\widehat{\mathbf{M}},\mathbf{M})=\lim_{n\to \infty} \vert c_{n,n} \vert^{1/n} $$ \end{corollary} \begin{proof} First of all we show that the matrix $\widehat{\mathbf{M}} $ is also a moment matrix. Indeed, if $\mu$ is a representing measure for $\mathbf{M}$ and we compute the moments of the measure $\vert z \vert^{2}\mu$ we have $$ c_{i,j}(\vert z \vert^{2}\mu)= \int \vert z \vert^2z^{i} \overline{z}^{j}d\mu= \int z^{i+1}\overline{z}^{j+1}d\mu . $$ \noindent This means that the matrix obtained by removing the first row and column in $\mathbf{M}$, that we denote $\widehat{\mathbf{M}}$, is the moment matrix associated with the measure $\vert z \vert^{2}\mu$. Therefore, if $\Delta_{z}:P^{2}(\mu) \to P^{2}(\mu)$ is the multiplication by-$z$-operator, \begin{eqnarray*} \Vert \Delta_{z} \Vert^{2} & = & \sup \{\int z p(z) \overline{zp(z)} d\mu : \int p(z) \overline{p(z)} d\mu =1, p\in \mathbb{P}[z]\}=\\ \mbox{} & = & \sup \{ \int \vert p(z) \vert^{2} \vert z \vert^{2} d\mu : \int \vert p(z) \vert^{2} d\mu =1, p\in \mathbb{P}[z]\}. \end{eqnarray*} \noindent By using (\ref{identification}) we have \begin{eqnarray*} \Vert \Delta_{z} \Vert^{2} & = & \sup \{ v\widehat{\mathbf{M}}v^{*}: v\in c_{00}, v\mathbf{M}v^{*}=1\} \\ \mbox{} & = & \beta(\vert z \vert^{2} d\mu, d\mu)=\sup \{\vert z \vert^2: \; z\in \sop(\mu)\} = \beta(\widehat{\mathbf{M}},\mathbf{M}). \end{eqnarray*} \noindent Now the result follows from Proposition $1$. \end{proof} \begin{remark} \noindent Note that for an HPD Toeplitz matrix $\mathbf{T}$ it is obvious that $ \beta (\widehat {\mathbf{T}}, \mathbf{T}) = 1 $. Nevertheless, this identity is not true in general for infinite HPD matrices; indeed, consider the infinite diagonal matrix $\mathbf{M}={\sl diag }(1,2,1,2^2,1,2^3,1,2^4, \ldots)$ which is an HPD matrix such that $\displaystyle{\lim_{n\to \infty} \vert c_{n,n} \vert^{1/n}}$ does not exist. Note that $\mathbf{M}$ is not a moment matrix since the elements of the diagonal does not fullfile Cauchy-Schwarz inequality since $(2^n)^2 \not \leq 1 \cdot 1$. \end{remark} \noindent \section{A generalization of a sufficient condition for completeness of polynomials.} \noindent In \cite{EGT1} a sufficient condition for completeness of polynomials is given in the following terms: if polynomials are dense in a certain measure space $L^{2}(\mu)$ for a compactly supported measure then the smallest eigenvalue of the truncated matrices of the moment matrices $\lambda_n\to 0$, as $n\to \infty$; using our notation $\lambda(\mu,{\bf m})=0$. There is proved that this is not necessary condition for completeness of polynomials. Indeed, consider the measures ${\bf m}_{r}$ with $r<1$; by (\ref{ejemplo1}) $\lambda({\bf m}_{r},{\bf m})= 0$ and nevertheless polynomials are not dense in $L^{2}({\bf m}_{r})$. We here generalize this result comparing with the Lebesgue measures in circles with different center and radios. The proof is based in the following matrix version of the change of variable theorem: \noindent Recall that if $\varphi(z)=\alpha z + z_0$ is a similarity map onto $\mathbb{C}$ with $\alpha,z_0\in \CC$ it is proved in \cite{EGT5} and \cite{EST} that the moment matrix of the image measure $\mu \circ \varphi^{-1}$, denoted by $\mathbf{M}^{\varphi}(\mu)$, has finite section of size $(n+1)\times(n+1)$ \begin{equation} \label{semejanza} \mathbf{M}^{\varphi}_n(\mu) = {\bf A}_{n}(\alpha,\beta) {\bf M}_{n}(\mu){\bf A}_{n}^{*} (\alpha,\beta ) \end{equation} where ${\bf A}_{n}(\alpha, \beta)$ is defined as in \cite{EST} ( with certain modifications due to the different expression for the inner product) \begin{equation} {\bf A}_{n}(\alpha, \beta) = \left ( \begin{array}{lllll} {\binom 0 0} \alpha^{0} \beta^{0} & 0 & 0 & \ldots & 0 \\ {\binom 1 0} \alpha^{0} \beta^{1} & {\binom 1 1} \alpha^{1} \beta^{0} & 0 & \ldots & 0 \\ {\binom 2 0} \alpha^{0} \beta^{2} & {\binom 2 1} \alpha^{1} \beta^{1} & {\binom 2 2} \alpha^{2} \beta^{0} & \ldots & 0\\ \quad\vdots & \quad \vdots & \quad \vdots & \mbox{} & \quad \vdots \\ {\binom n 0} \alpha^{0} \beta^{n} & {\binom n 1} \alpha^{1} \beta^{n-1} & {\binom n 2} \alpha^{2} \beta^{n-2} & \ldots & {\binom n n} \alpha^{n} \beta^{0} \end{array} \right ). \end{equation} \smallskip \noindent In the particular case of $\alpha =r\in \RR$ we obtain the folllowing result: \begin{lem} \label{lema2} Let $\varphi(z)=r z +z_0$ be a certain similarity map with $r>0$ and $\mu$ a measure. Consider the image measure $\mu\circ \varphi^{-1}$ obtained after similarity map. Then, $$ \lambda(\mu,{\bf m})=\lambda( \mu\circ \varphi^{-1} ,{\bf m}_{z_0; r}),\qquad \qquad \beta (\mu,{\bf m})=\beta ( \mu\circ \varphi^{-1} ,{\bf m}_{z_0; r}) $$ \end{lem} \begin{proof} We prove the result for the index $\lambda$ (for the other index the proof is analogous). Denote by $\mathbf{M}_{1}=\mathbf{M}(\mu)$ and $\mathbf{M}_{2}=\mathbf{M}^{\varphi}(\mu)$. We have seen in (\ref{semejanza}) that for all $n\in \NN_{0}$ $$ \mathbf{M}^{\varphi}_n=\mathbf{A}_{n}(r;z_0) \mathbf{M}_{n} \mathbf{A}_{n}^{*}(r;z_0). $$ \noindent Consequently for every $v\in \CC^{n+1}$ it follows $$ v \mathbf{M}^{\varphi}_nv^{*}=v\mathbf{A}_{n}(r;z_0) \mathbf{M}_{n} \mathbf{A}_{n}^{*}(r;z_0)v^{*} $$ \noindent and we have \begin{eqnarray*} \lambda_{n}(\mu\circ \varphi^{-1},{\bf m}_{z_0;r})& = & \inf \{ v \mathbf{M}^{\varphi}_{n} v^{*} : v \mathbf{M}_n({\bf m}_{z_0;r}) v^{*}=1\}\\ \mbox{} & = & \inf \{ v\mathbf{A}_{n}(r;z_0) \mathbf{M}_{1,n} \mathbf{A}_{n}^{*}(r;z_0) v^{*} : v \mathbf{A}_{n}(r;z_{0}) \mathbf{I}_{n} \mathbf{A}_{n}^{*}(r;z_{0}) v^{*}=1\}. \end{eqnarray*} \noindent By making the change $w=v\mathbf{A}_{n}(r;z_0)$ in the last equality, it follows \[ \lambda_{n}(\mu\circ \varphi^{-1},{\bf m}_{z_0;r})= \inf (w \mathbf{M}_{n} w^{*}: w \mathbf{I}_{n} w^{*}=1\}, \] and by taking limits we obtain $$ \lambda(\mu\circ \varphi^{-1},{\bf m}_{z_0;r})= \inf \{ w \mathbf{M}(\mu) w^{*} :ww^{*}=1\} =\lambda(\mu,{\bf m}) $$ \noindent as we required. \end{proof} \begin{remark} The above lemma can be obviously extended for any infinitely supported measures in the complex plane $\mu_1,\mu_2$ in the following way: let $\varphi$ be a similarity map then $$ \lambda(\mu_1,\mu_2)=\lambda(\mu_1\circ \varphi^{-1} ,\mu_2\circ \varphi^{-1})\;, \qquad \beta(\mu_1,\mu_2)=\beta(\mu_1\circ \varphi^{-1} ,\mu_2\circ \varphi^{-1}). $$ \end{remark} \bigskip \begin{theorem} \label{teorema4} Let $\mu$ be a compactly supported measure. If $P^{2}(\mu)=L^{2}(\mu)$, then for every $z_0\in \CC$ and $r>0$, it holds $$ \lambda \left(\mu,{\bf m}_{z_0;r} \right )=0. $$ \end{theorem} \begin{proof} Assume the contrary. Then, there exists $z_0\in \CC$ and $r>0$ such that $$ \lambda(\mu,{\bf m}_{z_0;r})>0. $$ \noindent Then, consider the similarity $\varphi(z)=\frac{1}{r}z-z_0$ and the image measure $\mu \circ \varphi^{-1}$ obtained by applying the similarity $\varphi$ to $\mu$. Then, by lemma (\ref{lema2}) it follows that $$ \lambda(\mu \circ \varphi^{-1},{\bf m})=\lambda(\mu,{\bf m}_{z_0;r})>0 $$ \noindent Then by the results in \cite{EGT1} it follows that $P^{2}(\mu \circ \varphi^{-1}) \neq L^{2}(\mu \circ \varphi^{-1})$ and consequently $L^{2}(\mu)\neq P^{2}(\mu)$. \end{proof} \noindent Above theorem can be rewritten as follows: if a measure $\mu$ verifies that $\lambda(\mu,{\bf m}_{z_0;r})>0 $ for a certain Lebesgue measure ${\bf m}_{z_0;r}$, obviously non complete (i.e. polynomaials are not dense) then also $\mu$ is not complete. One can wonder if we may replace measures ${\bf m}_{z_0;r}$ by any non complete measure and this motivates the following problem: \smallskip \noindent {\bf Problem:} Assume $\mu_1,\mu_2$ two compactly supported measures verifying: \begin{enumerate} \item $\mu_2$ is not complete, i.e., $P^{2}(\mu_2)\neq L^{2}(\mu_2)$. \item $\lambda(\mu_1,\mu_2)>0$. \end{enumerate} \noindent Is it true that $L^{2}(\mu_1)\neq P^{2}(\mu_1)$? \bigskip \noindent We obtain a partial answer when the first measure is supported in a Jordan curve: \begin{prop} Let $\mu_1,\mu_2$ be infinitely supported measures in the complex plane such that $P^{2}(\mu_2)\neq L^{2}(\mu_2)$ and $\lambda(\mu_1,\mu_2)>0$. Then, the following holds: \smallskip \begin{center} If $\mu_1$ is supported on a Jordan curve $\Gamma$, then $P^{2}(\mu_1) \neq L^{2}(\mu_1)$. \end{center} \end{prop} \begin{proof} By Thomson's theorem \cite{Thomson} since $L^{2}(\mu_2) \neq P^{2}(\mu_2)$ it follows the existence of a bounded point evaluation for $\mu_2$, say $\xi$. Recall that $\xi\in \CC$ is a bounded point evaluation for the measure $\mu_2$ if there exists a constant $c>0$ such that for every $p(z)\in \mathbb{P}[z]$, $$ \vert p(\xi) \vert^2 \leq c \int \vert p(z)\vert^2 d\mu_2. $$ \noindent Since $\lambda(\mu_1,\mu_2)>0$ it easily follows that $\xi$ is a bounded point evaluation of $\mu_1$. Indeed, by Proposition \ref{proposicion1} there exists $C>0$ such that for every polynomial $p(z)$ $$ \int \vert p(z) \vert^2 d \mu_1 \geq C \int \vert p(z) \vert^2 d \mu_2. $$ \noindent Consequently, combining both inequalities we have that for every polynomial $p(z)$ $$ \vert p(\xi)\vert^2 \leq C\int \vert p(z) \vert^2 d\mu_2 \leq \dfrac{c}{C} \int \vert p(z) \vert^2 d\mu_1 $$ \noindent and $\xi$ is a bounded point evaluation for $\mu_1$. The conclusion now follows by \cite{EGT5} since for supported in Jordan curves measures the existence of a bounded point evaluation implies that the measure is not complete. \end{proof} \bigskip
a202c08a6cc0af71edc076d9a1c767540f2f54f4
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Mimicking human capability to recognize things never seen before, zero-shot video classification (ZSVC) only trains models on videos of seen classes and makes predictions on unobserved ones \cite{liu2011recognizing,vgan,multi,mettes2017spatial,mettes2021object,gao2020learning,kim2021daszl,zhu2018towards}. Correspondingly, existing ZSVC models map visual and semantic features into a unified representation, and hope the association can be generalized to unseen classes \cite{zhu2018towards,hahn2019action2vec,bishay2019tarn,brattoli2020rethinking,qiu2021boosting,chen2021elaborative}. However, these methods learn associated representations within limited classes, thus facing the following two critical problems \cite{fu2015transductive,gao2020learning}: (1) semantic-gap: manifolds inconsistency between visual and semantics features, and (2) domain-shift: the representations learned from training sets are biased when applied to the target sets due to disjoint classes between two groups. In ZSVC, these two problems cause side effects on model generalizability. \begin{figure} \centering \includegraphics[width=0.45\textwidth]{fig1} \caption{ {\bf Visual-semantic representations:} Comparisons of the learned representations between the SoTA \cite{brattoli2020rethinking} and our method. \protect\scalebox{1}{\textbullet} and \protect$\bigtriangleup$ represent visual and semantic features separately; colors are for different classes. Besides, we use two metrics to quantify feature qualities on alignment (closeness$\downarrow$ better) and uniformity (dispersion$\uparrow$ better). We observe that ours show better closeness within classes and more separations among semantic clusters.} \label{fig:fig1} \vspace{\figsep} \end{figure} Reviewing the literature, we observe that most methods focus on tackling the semantic-gap by learning alignment-aware representations, which ensure visual and semantic features of the same class close. To improve the alignment, MSE loss \cite{brattoli2020rethinking}, ranking loss \cite{hahn2019action2vec}, and center loss \cite{gao2020learning} are commonly used to optimize the similarity between visual and semantic features. Apart from the loss, improvements for alignment are attributed mainly to the designs of architectures. For instance, \cite{jain2015objects2action,gao2020learning,mettes2021object} first project global visual features to local object attributes, then optimize similarity between the attributes and final semantics. In contrast, URL \cite{zhu2018towards}, Action2Vec \cite{hahn2019action2vec}, and TARN \cite{bishay2019tarn} directly align visual and final semantic features, which are improved via attention modules. Since video features are hard to learn, the above methods utilize pre-trained models to extract visual features. The recent model \cite{brattoli2020rethinking} benefits from the efficient R(2+1)D module \cite{tran2018closer} in video classification and achieves the state-of-the-art (SoTA) results in ZSVC. However, the SoTA \cite{brattoli2020rethinking} neglects to learn semantic features; thus, it is still not a true end-to-end (e2e) framework for visual-semantic feature learning. We claim that e2e is critical for alignment since fixed visual/semantic features will bring obstacles to adjusting one to approach another. Noteworthily, the latest MUFI \cite{qiu2021boosting} and ER \cite{chen2021elaborative} get down to addressing the domain-shift problem by involving more semantic information, thus consuming extra resources. In particular, MUFI \cite{qiu2021boosting} augments semantics by training multi-stream models on multiple datasets. ER \cite{chen2021elaborative} expands class names by annotating amount of augmented words crawled from the website. Freeing complex models or additional annotations, we will design a compact model that preserves maximal semantic info of existing classes while synthesizing features of unseen classes. To tackle the two problems with one stone, we present an end-to-end framework that jointly preserves alignment and uniformity properties for representations on both seen and unseen classes. Here, alignment ensures closeness of visual-semantic features; uniformity encourages the features to distribute uniformly (maximal-info preserving), which improves the possibility that unseen features stand around seen features, mitigating the domain-shift implicitly. Specifically, we formulate a supervised contrastive loss as a combination of two separate terms: one regularizes alignment of features within classes, and the other guides uniformity between semantic clusters. To alleviate the domain-shift explicitly, we generate new features of unseen synthetic classes by our class generator that interpolates and extrapolates features of seen classes. In addition, we introduce closeness and dispersion scores to quantify the two properties and provide new measurements of model generalizability. Fig.~\ref{fig:fig1} illustrates the representations of our method and the SoTA alternative \cite{brattoli2020rethinking}. We train the two models on ten classes sampled from Kinetics-700 \cite{carreira2017quo} and map features on 3D hyperspheres. We observe that our representation shows better closeness within classes and preserves more dispersion between semantic clusters. Experiments validate that our method significantly outperforms SoTA by relative improvements of 28.1\% on UCF101 and 27.0\% on HMDB51. \section{Related Work} \label{sec:relatedwork} {\bf Supervised video classification (SVC):} SVC tackles general classes initially (\eg, YouTube-8M dataset \cite{abu2016youtube}), then specific to action recognition recently (\eg, large-scale Kinetics-700 dataset\cite{carreira2017quo}). Learning temporal features is the main task of SVC. In the beginning, video features are generated via NetVLAD \cite{miech2017learnable,lin2018nextvlad} that fuses static features of multiple frames. Then, temporal/motion features of videos are optimized directly. We categorize the methods into two-stream 2D-CNN and 3D-CNN based. Two-stream models \cite{simonyan2014two,wang2016temporal,lin2019tsm} extract spatial and temporal features by performing separate 2D-CNN modules. \cite{jiang2019stm,liu2020teinet} extracts motion features by computing 2D-CNN features' difference between neighboring frames. Furthermore, \cite{tran2015learning} proposes C3D to fuse spatial and temporal features via an independent 3D-CNN module. Even C3D helps achieve promising results \cite{feichtenhofer2019slowfast,sudhakaran2020gate}, its large parameters bring burdens to model optimization. Instead, I3D \cite{carreira2017quo} and P3D \cite{qiu2017learning} design 3D-CNN-like modules by combining 1D temporal and 2D spatial filters. Recently, a more efficient R(2+1)D module \cite{tran2018closer} has been widely used, which includes a pseudo-3D kernel (2D spatial + 1D temporal) in residual networks. In this paper, we apply our model in action recognition and perform R(2+1)D for better spatial-temporal feature extraction. \begin{figure*} \centering \includegraphics[width=0.9\textwidth]{fig2} \caption{ {\bf Architecture of AURL:} From left to right, we map a video sequence $I$ and the class name set $\mathcal{Y}$ to a unified representation ($f_v(g(I))$, $f_s(c(\mathcal{Y}))$). During training, to learn representations of seen classes, we introduce $\mathcal{L}_\text{S}$ to preserve {\em alignment} and {\em uniformity} properties. For synthetic unseen classes, we introduce $\mathcal{L}_\text{US}$ to learn the two properties on synthetic visual-semantic features ($\Theta, Z$). To synthesize features of unseen classes, we first utilize $\mathcal{L}_\text{C}$ to learn {\em visual centers} $W$, then propose {\em Class Generator} to transform $W$ and existing semantics $f_s(c(\mathcal{Y}))$ into the representation ($\Theta, Z$). During inference, we perform an NNS strategy to obtain the final class. } \label{fig:fig2} \vspace{\figsep} \end{figure*} {\bf Zero-shot video classification (ZSVC):} Existing ZSVC methods align visual and semantic features on a unified representation and hope the alignment can be generalized to unseen classes. Most methods design various frameworks to optimize the alignment. Similar to zero-shot image classification \cite{xian2018zero}, some methods \cite{liu2011recognizing,gan2016learning,jain2015objects2action,mettes2021object,kim2021daszl} learn video attributes first, then design stage-wise framework. Given input videos, \cite{liu2011recognizing,gan2016learning} learn classifiers for video attributes, then compare the predicted attributes and final class names. However, they cost intensive annotations of video attributes. Instead, \cite{jain2015objects2action,mettes2021object,kim2021daszl} utilize pre-trained object detectors to determine object-level class names, then compute similarities between object-level and final class names. Recent work directly computes the similarity between visual and semantic features, and their contributions focus on enhancing visual features. URL \cite{zhu2018towards}, TARN \cite{bishay2019tarn} and Action2Vec \cite{hahn2019action2vec} extract spatial-temporal features using a pre-trained C3D and then improve the features via attention modules. The latest model \cite{brattoli2020rethinking} learns visual embeddings by an efficient R(2+1)D module and achieves SoTA results. However, the above methods are not true end-to-end (e2e) models because those utilize Word2vec \cite{mikolov2013efficient} to extract semantic features. We will justify that lacking e2e learning weakens the alignment since fixed visual/semantic features will bring obstacles to adjusting one to approach another. Except for the above designs, MSE loss \cite{brattoli2020rethinking}, ranking loss \cite{hahn2019action2vec}, and center loss \cite{gao2020learning} are commonly used to regularize the alignment of features. In this paper, we propose a true e2e framework and formulate a supervised contrastive loss, which first considers both alignment and uniformity properties in ZSVC. {\bf Representation learning:} In self-supervised and zero-shot learning, representation learning learns features of observed data, which can extract helpful info when applied to downstream tasks. In self-supervised learning, given pairs of positive and negative images/videos, contrastive learning regularizes representations where positives stand close while negatives keep apart. The pioneering work, SimCLR \cite{chen2020simple} utilizes data augmentation to generate positive instances and maintains a large batch for choosing relatively enough negatives. \cite{qian2021spatiotemporal} applies SimCLR to the video domain. To save memory, MoCo \cite{he2020momentum} presents momentum update to cache a large number of negative instances, then \cite{kuang2021video, pan2021videomoco} extends MoCo to video understanding. \cite{zhu2021improving} introduces feature transformation on existing samples to obtain broader and diversified positives and negatives, thus enhancing discrimination. However, the above models learn instance pairs from the same domain, \eg, images or videos. Instead, CLIP \cite{radford2021learning} exploits features of two domains (\ie, images and texts) guided by a contrastive loss. Motivated by CLIP, the latest models in ZSVC, MUFI \cite{qiu2021boosting} and ER \cite{chen2021elaborative}, extend the self-supervised contrastive loss to a fully-supervised loss that contrasts visual and semantic features. However, MUFI and ER neglect the difference and similarities of the self-supervised and supervised contrastive losses. Considering alignment and uniformity properties, we build connections between the two losses and analyze the advantages of the supervised loss. Besides, MUFI and ER both require extra resources to improve model generalizability. We propose a compact model using a class generator to explicitly synthesize new features of synthetic unseen classes. \section{Alignment-Uniformity aware Representation Learning (AURL)} This section describes Alignment-Uniformity aware Representation Learning (AURL) involving a unified architecture, loss functions, class generator, and two novel metrics, followed by its training and inference strategy, and then discusses similarities and differences against alternatives. \subsection{Architecture} Fig. \ref{fig:fig2} shows the AURL architecture. Given complete $K$ class names $\mathcal{Y}=\{y_1, \dots, y_K\}$, and an input video $I$ of class $y_i\in \mathcal{Y}$ (\eg, playing basketball), we by end-to-end learn visual and semantic embeddings. We introduce R(2+1)D \cite{tran2018closer} as the backbone to generate visual features $g(I)$, and utilize a video projector $f_v$ to implement 3-layer MLP projection (2 fc+bn+ReLU and 1 fc+bn), thus obtain visual embeddings $f_v(g(I))\in\mathbb{R}^{d}$. Parallelly, we perform Word2vec $c$ \cite{mikolov2013efficient} to extract the initial word embeddings $c(\mathcal{Y})$, then learn semantic embeddings $f_s(c(\mathcal{Y}))\in\mathbb{R}^{K\times d}$ by a word projector $f_s$ that has one fc (\#node=512) and the 3-layer MLP projection. For convenience, we note $f_v(g(I))$ and $f_s(c(y_i))$ of $i$-th class as $v_{y_i}$ and $s_{y_i}$ for the below discussions. Compared with SoTA methods \cite{brattoli2020rethinking,qiu2021boosting} that only learn video parts, our AURL end-to-end trains the backbone, video and word projectors, providing more feature flexibility under the regularization of loss functions. \begin{comment} \begin{figure*} \centering \begin{minipage}{0.4\textwidth} \centering \includegraphics[width=0.9\linewidth]{mixup} \caption{Illustration of {\em mixup transformation}. We obtain unseen classes \protect\scalebox{1}{\color{red}{\textbullet}} by linearly combining all seen classes \protect\scalebox{0.75}{$\triangle$}; $\blacktriangle$ means classes appearing in test.} \label{fig:mixup} \vspace{\figsep} \end{minipage}% \hspace{8pt} \begin{minipage}{0.55\textwidth} \centering \includegraphics[width=0.9\linewidth]{alpha} \caption{Illustration of {\em mixup transformation}. We obtain unseen classes \protect\scalebox{1}{\color{red}{\textbullet}} by linearly combining all seen classes \protect\scalebox{0.75}{$\triangle$}; $\blacktriangle$ means classes appearing in test} \label{fig:fig3} \vspace{\figsep} \end{minipage} \end{figure*} \end{comment} \subsection{Alignment-uniformity aware Loss} {\em Can alignment and uniformity properties be preserved in supervised contrastive loss?} For self-supervised learning, \cite{chen2020intriguing} claims that contrastive loss \cite{chen2020simple,qian2021spatiotemporal} (see Eq.~\ref{eq:self} and {\em supplementary}) preserves alignment and uniformity properties. Alignment indicates that positive samples should be mapped to nearby features and thus be invariant to unneeded noises. Uniformity \cite{wang2020understanding} means feature vectors should be roughly uniformly distributed on the unit hypersphere, thus bringing better generalization to downstream tasks. \noindent \begin{align} \mathcal{L}^{self} \!=& \!-\! \log[\frac{\exp{[\lambda \text{sim}(f, f_+)]}}{\sum_{f_- \in \mathcal{N} }\exp{[\lambda \text{sim}(f, f_-)]}}]. \label{eq:self} \vspace{\eqsep} \end{align} Here, $(f, f_+), (f, f_-)$ are positive and negative pairs of images/videos, $\mathcal{N}$ is negative set; sim means a similarity function (thus in [-1, +1]); and $\lambda$ is a temperature parameter. Closeness in alignment and maximal-info preserving in uniformity are also essential properties of the unified representation learning in ZSVC. However, existing work mainly focuses on the alignment of visual-semantic features \cite{zhu2018towards,bishay2019tarn,hahn2019action2vec,brattoli2020rethinking}, the uniformity that improves generalization has not been discussed yet. Here, by leveraging video labels, we formulate a supervised contrastive loss as the combination of alignment and uniformity terms: \begin{align} \label{eq:sup} \mathcal{L}^{sup}\! =& \!-\! \log[\frac{\exp{[\lambda \text{sim}(v_{y_i}, s_{y_i})]}}{\sum_{y_j \in \mathcal{Y} }\exp{[\lambda \text{sim}(v_{y_i}, s_{y_j})]}}],\\ \nonumber \!=&\lambda \text{SP}_\lambda [ \underbrace{-\text{sim}(v_{y_i}, s_{y_i})}_\text{alignment} \!+ \frac{1}{\lambda} \underbrace{\text{LSE}(\lambda\text{sim}(v_{y_i}, s_{y_j})_{y_j \in \mathcal{Y}\setminus y_i})}_\text{uniformity} ],\\ \nonumber &\text{where,}\quad \;\text{SP}_\lambda(x)\! =\! \frac{1}{\lambda}\log(1\!+\!\exp(\lambda x)),\\ \nonumber & \quad\quad\quad\quad \text{LSE}(x) \!=\! \log(\sum_{x\in\mathcal{X}}\exp(x)). \vspace{\eqsep} \end{align} $v_{y_i}$ and $s_{y_i}$ are visual and semantic features of class $y_i$, and the complete class set is $\mathcal{Y}$. $\text{SP}_\lambda$ means the SoftPlus function and LSE is LogSumExp. Since Eq.~\ref{eq:sup} favors $\text{sim}(v_{y_i}, s_{y_i})$ larger, visual and semantic features of the same class will be aligned. The uniformity term tends to maximize the distances between features of different classes using a LogSumExp function, thus spreading features as much as possible. To sum up, our $\mathcal{L}^{sup}$ preserves the alignment and uniformity properties simultaneously. {\bf $\mathcal{L}^{sup}$ performs better:} Comparing $\mathcal{L}^{sup}$ with $\mathcal{L}^{self}$, we observe that $\mathcal{L}^{sup}$ includes positive pair $\text{sim}(v_{y_i}, s_{y_i})$ in the denominator. Even recent work MUFI \cite{qiu2021boosting} and ER \cite{chen2021elaborative} also utilize supervised contrastive loss, not only do they neglect the alignment and uniformity properties, but also miss the similarity and difference between the two losses. Here, we show that $\mathcal{L}^{sup}$ maintains advantages of both $\mathcal{L}^{self}$ and triplet loss \cite{schroff2015facenet}. We derive upper bounds of $\mathcal{L}^{sup}$ and $\mathcal{L}^{self}$ as follows (the full derivation in {\em supplementary}): \begin{align} \label{eq:bound} \mathcal{L}^{self} \!&\leq\!\lambda(\text{sim}_\text{max}\!-\!\text{sim}(v_{y_i}, s_{y_i})+\frac{\log(K\!-\!1)}{\lambda}),\\\nonumber \mathcal{L}^{sup} \!&\leq\! \lambda\max[\text{sim}_\text{max}\!-\!\text{sim}(v_{y_i}, s_{y_i})\!+\!\frac{\log(K\!-\!1)}{\lambda}, 0] \!+\!\log(2), \vspace{\eqsep} \end{align} where $K$ is the number of classes, $\text{sim}_\text{max}$ is the maximal similarity among all negative pairs ($\text{sim}_\text{max} = \max_{y_j \in \mathcal{Y}\setminus{y}}\text{sim}(v_{y_i},s_{y_j})$). For a fair comparison, we also reformulate $\mathcal{L}^{self}$ with class labels and obtain its upper bound in Eq.~\ref{eq:bound}. With the upper bounds, we summarize the advantages of $\mathcal{L}^{sup}$ as follows: \begin{compactenum} \item When $\frac{\log (K-1)}{\lambda}\geq 2$, the two upper bounds will be similar. At this time, $\mathcal{L}^{sup}$ performs as well as $\mathcal{L}^{self}$ in a representation learning task. \item When $0\leq\frac{\log(K-1)}{\lambda}\textless 2$, the upper bound of $\mathcal{L}^{sup}$ has a similar form as triplet loss \cite{schroff2015facenet} that facilitates intrinsic ability to perform hard positive/negative mining. \item $\mathcal{L}^{sup}$ preserves the summation over all negatives in the denominator, thus improving discrimination among classes \cite{sohn2016improved}, which has the same motivation with contrastive learning that makes the embedding distribution uniform by increasing the number of negatives \cite{chen2020simple}. \end{compactenum} In this paper, we take advantage of $\mathcal{L}^{sup}$ to regularize the representations of both seen and synthetic unseen classes. \begin{figure*} \centering \includegraphics[width=0.95\textwidth]{mixup} \caption{ {\bf Illustration of Class Generator:} (a) Synthetic classes \protect\scalebox{1}{\color{red}{\textbullet}} are generated by linearly combining features of seen classes (\protect\scalebox{0.75}{$\triangle$} with colors); $\blacktriangle$ means test classes. (b) Feature transformation w/ different $\alpha$ synthesizes semantics covering various size of regions.} \label{fig:generator} \vspace{\figsep} \end{figure*} {\bf $\mathcal{L}^{sup}$ for seen and unseen classes:} We learn $\mathcal{L}^{sup}$ for both seen and unseen classes (see $\mathcal{L}_\text{contrast}$ in Eq.~\ref{eq:contrast} where we utilize $\cos$ as a cosine function and map features on the hypersphere.). Specifically, we learn $\mathcal{L}_\text{S}$ on visual-semantic features (\ie, $v_{y_i}$ and $s_{y_i}\in\mathbb{R}^{1\times d}, y_i\in\mathcal{Y}$) for seen classes set $\mathcal{Y}$. From the formulation of $\mathcal{L}_\text{S}$, we jointly align features of the same class and introduce uniformity that encourages semantic clusters to spread as much as possible, improving the possibility that features of unseen classes fall around existing ones. To offer effective positive/negative visual and semantic pairs that enhance the feature embedding \cite{zhu2021improving}, we propose a {\em class generator} to generate visual and semantic features of synthetic classes $\mathcal{U}$, which are considered as ``unseen classes" in comparison with seen classes $\mathcal{Y}$. To retain the {\em alignment-uniformity} properties, we utilize $\mathcal{L}_\text{US}$ to regularize visual and semantic features of $K_u$ unseen classes (\ie, the synthetic features $\Theta $ and $Z \in \mathbb{R}^{K_u\times d}$). \begin{align} \label{eq:contrast} \mathcal{L}_\text{contrast} \!= &\mathcal{L}_\text{S} + \mathcal{L}_\text{US}\\\nonumber =&\!-\! \log[\frac{\exp{[\lambda \text{cos}(v_{y_i}, s_{y_i})]}}{\sum_{y_j \in \mathcal{Y} }\exp{[\lambda \text{cos}(v_{y_i}, s_{y_j})]}}] + \\ \nonumber & \frac{1}{K_u}\sum_{u_i\in\mathcal{U}}\!-\! \log[\frac{\exp{[\lambda \text{cos}(\Theta_{u_i}, Z_{u_i})]}}{\sum_{u_j \in \mathcal{U} }\exp{[\lambda \text{cos}(\Theta_{u_i}, Z_{u_j})]}}]. \vspace{\eqsep} \end{align} \subsection{Class Generator} To synthesize visual and semantic pairs ($\Theta, Z$), we propose a class generator that applies a uniformly sampled linear transformation to all pairs of visual/semantic features of seen classes. Especially, instead of using single visual feature as the transformed features, we select representative ``visual centers" learned from a supervised video classifier that interprets the parameter matrix of fc layer as the centers, as commonly used in \cite{wang2017normface,wang2018additive,du2019explicit,press2016using}. We propose to exploit $\mathcal{L}_\text{C}$ as the classification loss, which is an angular softmax loss, helping push all visual features towards their visual centers on the unit hyperspher \cite{Deepcosine}. \begin{align} \label{eq:visual} \mathcal{L}_\text{C} = -\log \frac{\exp[\lambda\cos (v_{y_i}, w_{y_i})]}{\sum_{y_j \in \mathcal{Y}}\exp[\lambda\cos(v_{y_i}, w_{y_j})]}. \vspace{\eqsep} \end{align} Here, $v_{y_i}$ and $w_{y_i}$ indicate a single visual feature and the learned visual center, respectively. With the visual centers $w_{y_i}$ and the corresponding semantic features $s_{y_i}$, we inter-and extra-polates (\ie, linearly combine) these features to fill in incomplete class points on the hypersphere: \begin{align} \vspace{-10cm} \label{eq:generator} \Theta &= M \times \text{norm}(W),\\\nonumber Z &= M \times \text{norm}(s_{\mathcal{Y}}),\\\nonumber \text{norm}(W) &= [\frac{w_{y_1}}{\left\|w_{y_1}\right\|},\dots,\frac{w_{y_D}}{\left\|w_{y_D}\right\|}],\\\nonumber \text{norm}(s_{\mathcal{Y}}) &=[\frac{s_{y_1}}{\left\|s_{y_1}\right\|},\dots,\frac{s_{y_{D}}}{\left\|s_{y_{D}}\right\|}]. \vspace{\eqsep} \end{align} Here, $\Theta$ and $Z$ $\in\mathbb{R}^{K_u\times d}$ separately represent the synthetic visual centers and semantic features of unseen classes; $K_u$ represents the number of unseen classes and $d$ is the feature dimension. Besides, we apply normalization on $W$ and $s_\mathcal{Y}$ (both are $D\times d$ matrix) because learning on a unit hypersphere helps model optimization \cite{wang2020understanding}; $D$ is a hyper-parameter that means how many classes are sampled for unseen-class generator. The matrix $M\in\mathbb{R}^{K_u\times D}$ is used for inter- and extra-polations, whose elements are randomly sampled from a uniform distribution $U(\alpha, 1)$, and $-1\leq\alpha\textless 1$. $\alpha$ is another hyper-parameter that controls the distributed range of the synthetic points. It is worth noting that the settings of hyper-parameters $D$ and $\alpha$ are non-trivial. For $D$, we prefer $D \geq d$, \ie, the number of seen classes should be larger than the dimension of a hypersphere. Because for a full rank matrix $W$, a linear combination of the column vector of $W$ can express any vector on the transformed space. We aim to generate as diverse unseen classes as possible to improve the possibility that the synthesized points can cover the classes in the test set. Thus, in experiments, we will select features of {\em all} seen classes for feature transformation. For $\alpha$, we choose positive values for interpolation where the synthetic clusters locate inside of seen points (see Fig.~\ref{fig:generator}(b)), and gradually enlarge the cluster regions by decreasing $\alpha$ where the negative value is for extrapolation. Fig.~\ref{fig:generator} (a) illustrates our {\em Class Generator} with $D=10, d=3, \alpha=-1$ on the Kinetics-700 dataset \cite{kay2017kinetics}. We can see our transformation not only provides unseen classes but also approaches test classes (\eg, UCF101 dataset \cite{soomro2012dataset}). \subsection{Closeness and Dispersion} To quantify the alignment and uniformity, we introduce two metrics: closeness and dispersion. Closeness measures the mean distance of features within the same class, reflecting the alignment of visual and semantic features. \begin{align} \label{eq:closeness} \text{Closeness} = \frac{1}{K}\sum_{y_i\in\mathcal{Y}}[\frac{1}{N_{y_i}}\sum_{n=1}^{N_{y_i}}(1-\cos{(v^{n}_{y_i},s^{n}_{y_i}}))], \vspace{\eqsep} \end{align} where, $N_{y_i}$ is the \# of training videos of class $y_i$. Besides, to evaluate the uniformity/separation of semantic clusters, we adopt minimal distances among all clusters to compute dispersion. Here, we consider all visual features within the same class as a semantic cluster instead of using one single semantic vector $s_{y_i}$. For example, $\bar{v}_{y_i}$ is the mean of visual features of the class $y_i$, and indicates one semantic cluster. \begin{align} \label{eq:dispersion} \text{Dispersion} &= \frac{1}{K}\sum_{y_i\in\mathcal{Y}}\min_{y_k\in\mathcal{Y}\setminus{y_i}}(1-\cos(\bar{v}_{y_i},\bar{v}_{y_k})). \vspace{\eqsep} \end{align} The experiments in Sec.~\ref{sec:ablation} show that models tested with higher accuracy preserve the lower closeness and higher dispersion in representations. We conclude our two metrics can serve as new measurements of model generalizability. \subsection{Training \& Inference} {\bf Training}: We end-to-end train visual and semantic features and jointly learn the contrastive loss $\mathcal{L}_\text{contrast}$ and classification loss $\mathcal{L}_\text{C}$, thus obtaining the following overall loss: \begin{align} \mathcal{L}_\text{AURL} = &\mathcal{L}_\text{S} + \mathcal{L}_\text{US} + \mathcal{L}_\text{C}. \end{align} We will justify our end-to-end training is critical for alignment and uniformity properties, and validate our compact model with $\mathcal{L}_\text{AURL}$ outperforms SoTA alternatives. {\bf Inference:} we train AURL on source dataset $\mathcal{I}$ with $K$ seen classes $\mathcal{Y}=\{y_1, \dots, y_K\}$, and evaluate the model on target dataset $\mathcal{I}^{t}$ with $T$ unseen classes $\mathcal{Y}^{t}=\{y^{t}_1, \dots, y^{t}_T\}$. In this paper, we follow the strict problem setting in \cite{brattoli2020rethinking}, which requires training classes $\mathcal{Y}$ have no overlap with test classes $\mathcal{Y}^{t}$. Mathematically, we re-write the requirement as: \begin{align} \forall {y \in \mathcal{Y}}, \; \min_{y^{t} \in \mathcal{Y}^{t}} (1-\cos(c_y, c_{y^{t}})) > \tau, \label{eq:label} \vspace{\eqsep} \end{align} where $c_i$ means Word2vec features of class i, $\tau$ is the distance threshold. We utilize the Nearest Neighbor Search (NNS) strategy to obtain the final label of query video $I^{t}$: \begin{align} \underset{y^{t} \in \mathcal{Y}^{t}}{\mathrm{argmax}} \cos(f_v(g(I^t)), s_{y^{t}}). \vspace{\eqsep} \label{eq:nns} \end{align} \subsection{Comparisons with Related Work} The closest studies to our AURL are SoTA \cite{brattoli2020rethinking}, MUFI \cite{qiu2021boosting}, and ER \cite{chen2021elaborative}. Table \ref{tab:related} summarizes their similarities and differences. SoTA only utilizes MSE loss to regularize feature alignment within seen classes, limiting model generalizability. MUFI and ER both implicitly increase semantic info to improve the generalization. MUFI trains multi-stream models across multiple datasets. ER crawls and annotates a number of web words to expand existing class names. Unlike that MUFI and ER both require extra resources, our AURL is a compact model to utilize the uniformity that helps preserve maximal info of existing features, and introduce a class generator to synthesize more semantics explicitly. Even MUFI and ER adopt the supervised contrastive loss, they neglect how alignment and uniformity properties affect ZSVC. Besides, our AURL follows the strict label requirement (in Eq.~\ref{eq:label}) that classes of training and test sets are far away from each other, which manifests the nature of ZSVC. At last, compared with ER that only trains the last fc layers, AURL utilizes a true e2e training strategy that is critical to realize the two properties. \begin{table} \centering\small \def\hspace{5pt}{\hspace{2.2pt}} \newcommand{\mv}[1]{\hspace{5pt} #1 \hspace{5pt}} \caption{Comparisons between AURL and alternative methods.} \rowcolors{1}{}{lightgray!80} \label{tab:related} \begin{tabular}{l*{5}{c}} \toprule {\bf Methods} & \mv{\bf{ET}} & \mv{\bf{AUL}} & \mv{\bf{ERF}} & \mv{\bf{UCG}} & \mv{\bf{SLR}}\\ \midrule SoTA \cite{brattoli2020rethinking} &$\times$ &$\times$ &$\checkmark$ & $\times$&$\checkmark$\\ MUFI \cite{qiu2021boosting} &$\times$ &$\times$ &$\times$ &$\times$&$\times$\\ ER \cite{chen2021elaborative}&$\checkmark$ &$\times$ &$\times$ &$\times$&$\times$\\ AURL (ours) & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$&$\checkmark$\\ \bottomrule \end{tabular} \vspace{-6pt} \flushleft{*{\bf ET}: end-to-end trainable, {\bf AUL}: alignment-uniformity learning, {\bf ERF}: extra resources free, {\bf UCG}: unseen class generator, {\bf SLR}: strict label requirement.} \vspace{\figsep} \end{table} \section{Experiments} \subsection{Settings} {\bf Datasets:} We train our AURL on the Kinetics-700 dataset \cite{kay2017kinetics} and evaluate it on UCF101 \cite{soomro2012dataset} and HMDB51 \cite{kuehne2011hmdb} datasets. The Kinetics-700 provides download links of YouTube videos annotated with 700 categories of human actions. We collect 555,774 videos using these links. The UCF101 contains 13,320 videos with 101 actions and the HMDB51 has 6,767 videos annotated with 51 actions. {\bf Training protocol:} For fair comparisons with the SoTA \cite{brattoli2020rethinking}, we select the training videos in Kinetics-700 whose classes have non-overlap with UCF101 and HMDB51 as described in Eq. \ref{eq:label}, and set the same $\tau$ = 0.05, thus obtaining 662 classes. AURL is inductive zero-shot learning, thus does not include any test data during training. {\bf Evaluation protocol:} Existing ZSVC methods adopt various evaluation protocols to report experimental results. For complete comparisons, we perform three protocols: 1, 3, and N test splits. 1 {\em test split} reports an accuracy on all videos of UCF101 or HMDB51 set. 3 {\em test splits} reports an average accuracy by averaging 3 accuracies that are separately evaluated on 3 test sets provided by the UCF101 or HMDB51. N {\em test splits} also reports the average by averaging N accuracies that are obtained by running N (10 in our method) times testing, in each, m classes are randomly selected (m=50 for UCF101 and m=25 for HMDB51). {\bf Implementation details:} We adopt one or multiple {\em video clips} as one input video of models. We follow the same SoTA settings \cite{brattoli2020rethinking} (\ie, 1 or 25 video clips and 16 frames/clip with size of $1\times16\times112\times112\times3$) for fair comparisons. If multiple video clips are used, we take the mean of multiple visual embeddings as the representative embedding. Besides, if a class name contains multiple words, we average the corresponding Word2vec features to represent the class prototype. For the AURL architecture, we set feature dimension of the R(2+1)D backbone as 512 (\ie, $g(I)\in\mathbb{R}^{512}$) and dimension of Word2vec as 300 (\ie, $c(\mathcal{Y})\in\mathbb{R}^{K\times300}$), and set the number of nodes in 3-layer MLP of the projector as 2048, 2048, and 2048 separately. During training, we empirically set $K_u$ as 662, $\lambda$ as 10, $D$ as 662, and $\alpha$ as 0. We deploy the training on 8 Nvidia Tesla V100 GPUs. We set batch size as 256 and synchronize all batch normalization across GPUs following \cite{chen2020simple,caron2020unsupervised}. We implement experiments using PyTorch and Horovod. SGD is our optimizer and a learning rate of 0.05 with a cosine decay schedule \cite{chen2020simple,loshchilov2016sgdr} is adopted. Then, we set the weight decay as 0.0001 and the SGD momentum as 0.9. The number of training iterations is 58,500 which takes 45 hours. \begin{figure*} \centering \includegraphics[width=0.95\textwidth]{loss} \caption{ {\bf Ablations:} The representations of ablations w/ MSE loss, our $\mathcal{L}_\text{S}$, e2e training, and the AURL. \protect\scalebox{1}{\textbullet} and \protect$\bigtriangleup$ represent visual and semantic features separately; colors are for different classes. Here, we randomly sample 10 classes from Kinetics-700 for visualization. } \label{fig:loss} \vspace{\figsep} \end{figure*} \subsection{Ablation Study} \label{sec:ablation} To analyze AURL, we performed extensive ablations that were trained on the Kinetics-700 and evaluated on UCF101 and HMDB51 using 1 {\em video clip} and 1 {\em test split} of evaluation protocols. Table~\ref{tab:ablations} summarizes the quantitative results. Fig.~\ref{fig:loss} visualizes the visual-semantic representation of ablations by sampling 10 classes from Kinetics-700 dataset and setting the features as 3-D for better visualization. We will justify: (1) our model that preserves alignment-uniformity properties performs better than the SoTA method \cite{brattoli2020rethinking} that focuses on alignment only; (2) end-to-end (e2e) training is critical to realize the two properties; (3) our AURL involving the class generator performs the best. From the justifications, we will show that our closeness and dispersion metrics can serve as new measurements of model generalizability. Here, we take the architecture of the SoTA \cite{brattoli2020rethinking} as our {\bf Base} model (\ie, base backbone + fc only for video parts). Per (1), we compare {\bf Base w/ MSE} (\ie, the SoTA) and {\bf Base w/ $\mathbf{\mathcal{L}_\text{S}}$}. From the accuracy in Table~\ref{tab:ablations}, {\bf Base w/ $\mathbf{\mathcal{L}_\text{S}}$} largely improves the results by (14.8\%, 35.1$\rightarrow$40.3) on UCF101 and by (13.6\%, 21.3$\rightarrow$24.2) on HMDB. Comparing the learned representation in Fig.~\ref{fig:loss} (a) {\bf w/ MSE} and (b) {\bf w/ $\mathbf{\mathcal{L}_\text{S}}$} , we observe the semantic clusters of (b) spread more than (a), but the alignment within classes gets worse, for example, visual and semantic features are not calibrated for classes ``skipping rope" and ``abseiling". Similarly, we find the same trend in closeness and dispersion metrics shown in Fig.~\ref{fig:loss} and Table~\ref{tab:ablations}, where closeness gets worse (0.029$\rightarrow$0.065, 0.30$\rightarrow$0.45) but dispersion becomes much better (0.330$\rightarrow$0.414, 0.09$\rightarrow$0.29). We can see our {\bf Base w/ $\mathbf{\mathcal{L}_\text{S}}$} presesrving higher uniformity in the trained representation can achieve better generalization when making inference on the test set, even scarify a little alignment. Per (2), we involve {\bf e2e} training strategy (\ie, base backbone + video projector for video parts; word projector for semantic parts) to the {\bf Base w/ $\mathbf{\mathcal{L}_\text{S}}$}, and get the {\bf Base w/ $\mathbf{\mathcal{L}_\text{S}}$ + e2e}, which further improves the accuracy from 40.3 to 43.2 on UCF-101 and from 24.2 to 26.2 on HMDB. Not surprisingly, we observe the alignment is tuned better and uniformity is maintained in good quality, thus obtaining a better trade-off. Referring to Fig.~\ref{fig:loss} (b) and (c), we see {\bf Base w/ $\mathbf{\mathcal{L}_\text{S}}$ + e2e} encourages better uniformity that semantic clusters are relatively distributed uniformly across the hypersphere while achieves a satisfying alignment that visual and semantic features are apparently aligned (see classes ``skipping rope" and ``abseiling" again for comparisons). The similar trends also occur in closeness and dispersion metrics, \ie, (0.024 and 0.340; 0.30 and 0.29) in Fig.~\ref{fig:loss} and Table~\ref{tab:ablations}. We conclude that e2e is critical for adjusting features to meet the regularizations of alignment and uniformity. Per (3), we apply {\bf $\mathbf{\mathcal{L}_\text{US}}$} to unseen classes coupling with the class generator ({\bf CG}), \ie, our {\bf AURL}. Compared {\bf AURL} with {\bf Base w/ $\mathbf{\mathcal{L}_\text{S}}$ + e2e}, {\bf AURL} steadily improves 2.8\% on UCF and 4.6\% on HMDB, achieving the best accuracy. Quantitatively, closeness and dispersion reach the best scores, such as (0.29, 0.32) in Table~\ref{tab:ablations} and (0.020, 0.354) in Fig.~\ref{fig:loss}. From the representation of Fig.~\ref{fig:loss} (d), we see the semantic clusters cover most regions of the hypersphere, which improves the possibility that unseen features fall around existing points, thus bringing a better generalization. Furthermore, we remove {\bf CG} from AURL (\ie, {\bf AURL w/o CG}) to validate the effectiveness of the class generator. Comparing {\bf AURL} and {\bf AURL w/o CG}, we find that the performances of {\bf AURL w/o CG} on UCF and HMDB both decrease, and the accuracy on HMDB even degrades lower than {\bf Base w/ $\mathbf{\mathcal{L}_\text{S}}$ + e2e}. Thus, we conclude the {\bf CG} is a critical module to enhance the generalization. Last but not least, from the above justifications, we summarize that our models consistently improve the accuracy by involving the proposed modules; closeness/dispersion measured on the learned representations have agreements with the accuracy evaluated on test sets, providing model evaluations even prior to making inference. \def\hspace{5pt}{\hspace{3pt}} \begin{table}[t] \small \centering \caption{ Ablations of our modules using 1 video clip under the {\em 1 test split} protocol ($\tau$=0.05). {\color{red}{Red}} numbers indicate the best. Closeness$\downarrow$ better, dispersion$\uparrow$ better, and top-1 accuracy $\uparrow$ better.} \label{tab:ablations} \begin{tabular}{@{}l@{\hspace{5pt}}|c@{\hspace{5pt}}c@{\hspace{5pt}}c@{\hspace{5pt}}|c@{\hspace{7pt}}c@{\hspace{7pt}}|c@{\hspace{5pt}}c@{}} \toprule {\bf Method} & {\bf $\mathbf{\mathcal{L}_\text{S}}$} &\bf{e2e} & \shortstack{{\bf $\mathbf{\mathcal{L}_\text{US}}$}\\ +{\bf CG}} &\shortstack{\bf{Clo-} \\ \bf{se.}}&\shortstack{\bf{Dis-} \\ \bf{per.}} &\shortstack{\bf{UCF} \\ \bf{top-1}}& \shortstack{\bf{HMDB} \\ \bf{top-1}}\\ \midrule \bf{Base w/ MSE} && & &0.30&0.09&35.1&21.3\\ \bf{Base w/ $\mathbf{\mathcal{L}_\text{S}}$} &\checkmark&&&0.45&0.29&40.3&24.2\\ \bf{Base w/ $\mathbf{\mathcal{L}_\text{S}}$ + e2e} &\checkmark& \checkmark &&0.30&0.29&43.2&26.2\\ \rowcolor{gray!10} \bf{AURL (ours)} &\checkmark&\checkmark &\checkmark &{\color{red} 0.29}&\color{red}{0.32}&\color{red}{44.4}&\color{red}{27.4}\\ \bf{AURL w/o CG} &\checkmark&\checkmark &$\bcancel{\text{CG}}$ & 0.33 &0.32&43.7&25.8\\ \bottomrule \end{tabular} \vspace{\figsep} \end{table} \subsection{Comparisons with the Closest SoTA} The closest SoTA to our AURL is the recent work \cite{brattoli2020rethinking}, which utilizes a compact model that achieves the SoTA results even under a strict setting (\ie, Eq.~\ref{eq:label}). Table \ref{tab:related} summarizes the similarity and difference between the SoTA and our AURL. Table \ref{tab:closest} shows the comprehensive comparisons quantitatively. We reported the SoTA results using the same settings and the authors’ released code. For comprehensive comparisons, we include various evaluation protocols including Pre-training, Video clips, and Test splits. Pre-training means that SoTA fine-tunes the pre-trained models on the SUN dataset \cite{xiao2010sun}. From the comparisons, we see our AURL consistently surpasses the SoTA under each evaluation protocol. Specifically, the smallest improvements happen at (25 Video clips, 1 Test splits) by (17.6, 16.5)\% improvements on UCF top-1 and HMDB top-1, and the largest comes at (1 Video clip, 10 Test split) by (28.1, 27.0)\% increases on UCF top-1 and HMDB top-1. {\bf To conclude, AURL outperforms the SoTA by a large margin.} \def\hspace{5pt}{\hspace{3.1pt}} \begin{table}[t] \small \centering \caption{ Comparisons with the closest SoTA \cite{brattoli2020rethinking} on both UCF and HMDB datasets. {\color{red}{Red}} numbers indicate the best.} \label{tab:closest} \begin{tabular}{@{}l@{\hspace{2pt}}|c@{\hspace{5pt}}c@{\hspace{5pt}}c@{\hspace{5pt}}|c@{\hspace{5.2pt}}c@{\hspace{5.2pt}}c@{\hspace{5pt}}c@{}} \toprule \rb{4}{\ {\bf Method}\ } & {\shortstack{{\bf Pre-}\\{\bf training}}} &{\shortstack{{\bf Video}\\{\bf clips}}} &{\shortstack{{\bf Test}\\{\bf splits}}} &{\shortstack{{\bf UCF}\\{\bf top-1}}}&{\shortstack{{\bf UCF}\\{\bf top-5}}}&{\shortstack{{\bf HMDB}\\{\bf top-1}}}&{\shortstack{{\bf HMDB}\\{\bf top-5}}}\\ \midrule &~ &1 &10 &43.0 &68.2 &27.0&54.4\\ \multirow{-2}{*}{SoTA}&\checkmark &1 &10 &45.6 &73.1 &28.1 &51.8 \\ \rowcolor{gray!10} AURL & &1 &10 & {\color{red} 55.1} &{\color{red} 79.3} &{\color{red} 34.3} &{\color{red} 65.1}\\ \midrule & &25 &10 &48.0 &74.2 &31.2 &58.3\\ \multirow{-2}{*}{SoTA} &$\checkmark$ &25 &10 &49.2 &77.0 &32.6 &57.1 \\ \rowcolor{gray!10} AURL & &25 &10 &{\color{red} 58.0} &{\color{red} 82.0} &{\color{red} 39.0} &{\color{red} 69.5}\\ \midrule & &1 &1 &35.1 &56.4 &21.3 &42.2\\ \multirow{-2}{*}{SoTA}&\checkmark &1 &1 &36.8 &61.7 &23.0 &41.3\\ \rowcolor{gray!10} AURL & &1 &1 &{\color{red} 44.4} &{\color{red} 70.0} &{\color{red} 27.4} &{\color{red} 53.2}\\ \midrule & &25 &1 &37.6 &62.5 &26.9 &49.8\\ \multirow{-2}{*}{SoTA} &$\checkmark$ &25 &1 &39.8 &65.6 &27.2 &47.4\\ \rowcolor{gray!10} AURL & &25 &1 &{\color{red} 46.8} &{\color{red} 73.1} &{\color{red} 31.7} &{\color{red} 58.9}\\ \bottomrule \end{tabular} \vspace{\figsep} \end{table} \subsection{Comparisons with the Alternatives} Table \ref{tab:comparisons} shows the comparisons with the alternatives. The SoTA \cite{brattoli2020rethinking} and our AURL with $\star$ mean the two methods follow the strict label requirement in Eq.\ref{eq:label}. From the results, we observe that our AURL surpasses all the alternatives in various challenging situations. Specifically, we summarize the challenges: first, fewer test splits are harder testing situations, \eg, for SAOE \cite{mettes2017spatial}, 3 \vs 10 splits corresponds to 32.8 \vs 40.4 on UCF; second, strict label requirement ($\star$) serves more difficult situation, \eg, our AURL$^\star$ w/ 10 (the more) test splits achieves even worse results than AURL w/ 3 splits; third, some methods acquire extra training datasets (\eg, Kinetics + extra 5 datasets trained in MUFI \cite{qiu2021boosting}), additional semantic classes (\eg, web words used in ER \cite{chen2021elaborative} ), and even training videos sampled from the same domain as the test set (\eg, tr/te are both UCF or HMDB in TARN \cite{bishay2019tarn}, Act2Vec \cite{hahn2019action2vec}, PSGNN \cite{gao2020learning}, and ER \cite{chen2021elaborative}), which provide more difficulties to be competed against for other methods. Correspondingly, we find the superiority of our AURL as below: (1) AURL w/ 1 (the fewest) test split outperforms most methods w/ 3 or 50 splits, \eg, (46.8, 31.7) of AURL \vs (36.3, -) of OPCL and (43.0, 32.6) of PSGNN on (UCF, HMDB) dataset; (2) AURL$^\star$ w/ more strict requirements but w/o extra datasets competes against all the SoTA alternatives, \eg, (58.0, 39.0) of AURL \vs (51.8, 35.3) of ER, and (56.3, 31.0) of MUFI on (UCF, HMDB) dataset. {\bf To sum up, our AURL reaches the new SoTA in ZSVC}. Finally, we conduct AURL$^\star$ with pre-extracted features (trained only on video and word projectors). We observe AURL w/ pre-extracted features achieves comparable performance with the e2e AURL -- (59.5, 38.2) \vs (58.0, 39.0) on UCF and HMDB. This suggests AURL can achieve high performance without carefully finetuning video features. {\bf Limitations and possible solutions.} Even our AURL achieves promising results, there are still two problems to be concerned. (1) Uniformity of visual features within classes could be included to further increase info-preserving, introducing contrastive learning between videos may be a possible solution. (2) It will be helpful to study how the class generator affects the overall optimization during training. \def\hspace{5pt}{\hspace{5pt}} \begin{table}[t] \small \centering \caption{ Comparisons with SoTA alternatives on both UCF and HMDB datasets. Results of alternatives were obtained from original papers, and the higher, the better. {\color{red}{Red}} and {\color{blue}{blue}} numbers indicate the best and second best. $\star$ means using $\tau$=0.05 in Eq.\ref{eq:label}.} \label{tab:comparisons} \begin{tabular}{@{\hspace{10pt}}l@{\hspace{5pt}}|c@{\hspace{5pt}}|c@{\hspace{5pt}}c@{\hspace{5pt}}|c@{\hspace{5pt}}c@{\hspace{5pt}}} \toprule {\bf Method} &{\shortstack{{\bf Test}\\{\bf splits}}}&{\shortstack{{\bf Train}\\{\bf dataset}}}&{\shortstack{{\bf UCF}\\{\bf top-1}}} &{\shortstack{{\bf Train}\\{\bf dataset}}}&{\shortstack{{\bf HMDB}\\{\bf top-1}}}\\ \midrule SoTA$^{\star}$ \cite{brattoli2020rethinking} &1 &Kinetics&37.6 &Kinetics&26.9\\ \rowcolor{gray!10} AURL$^{\star}$ & 1 &Kinetics&{\color{red} 46.8} &Kinetics&{\color{red} 31.7}\\ \midrule Obj2act \cite{jain2015objects2action}&3 &-&30.3 &-&15.6\\ SAOE \cite{mettes2017spatial}&3 &-&32.8 &-&-\\ OPCL \cite{gao2020learning}&3 &-&36.3 &-&-\\ MUFI\cite{qiu2021boosting} &3 &Kinetics+&{\color{blue} 56.3} &Kinetics+&{\color{blue} 31.0}\\ \rowcolor{gray!10} AURL &3 &Kinetics&{\color{red} 60.9} &Kinetics&{\color{red} 40.4}\\ \midrule TARN \cite{bishay2019tarn} &30 &UCF&23.2 &HMDB&19.5\\ Act2Vec \cite{hahn2019action2vec}&- &UCF&22.1 &HMDB&23.5\\ SAOE\cite{mettes2017spatial} &10 &-&40.4 &-&-\\ PSGNN \cite{gao2020learning} &50 &UCF&43.0 &HMDB&32.6\\ OPCL \cite{gao2020learning}&10 &-&47.3 &-&-\\ SoTA$^{\star}$\cite{brattoli2020rethinking} &10 &Kinetics&48.0 &Kinetics&{32.7}\\ DASZL \cite{kim2021daszl} &10 &-&{48.9} &-&-\\ ER \cite{chen2021elaborative} &50 &UCF&\color{blue}{51.8}&HMDB&\color{blue}{35.3}\\ \rowcolor{gray!10} AURL$^{\star}$ &10 &Kinetics&{\color{red} 58.0} &Kinetics&{\color{red} 39.0}\\ \bottomrule \end{tabular} \vspace{\figsep} \end{table} \section{Conclusion} This paper learns representation awareness of both alignment and uniformity properties for seen and unseen classes. We reformulate a supervised contrastive loss to jointly align visual-semantic features and encourage semantic clusters to distribute uniformly. To explicitly synthesize features of unseen semantics, we propose a class generator that performs feature transformation on features of seen classes. Besides, we introduce closeness and dispersion to quantify the two properties, providing new measurements for generalization. Extensive ablations justify the effectiveness of each module in our model. Comparisons with the SoTA alternatives validate our model reaches the new SoTA results. {\bf Acknowledgement.} Research was supported by Natural Science Foundation of China under grant 62076036. {\small \bibliographystyle{ieee_fullname}
5987be0b3f7fa43ad13ce37ad96440de5d388d66
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction}\label{sec:introduction} According to \cite{Corbett:2000:Number}, grammatical number in English can be conceptualized as a `feature' \citep[see also][]{Jakobson:1928} with two opposing values: singular and plural. For English, the formal realization of the nominal plural is the addition of the suffix \textit{-s}, a marker whose absence signals the nominal singular. Textbooks such as \citet{Lieber:2010} and \citet{aronoff2011morphology} take the semantics of plurality for granted and call attention to the way in which the plural is realized. According to \citet[][p. 156]{aronoff2011morphology}, number is generally not marked in the English lexicon, with the exception of pluralia tantum such as {\em pants}. Two major approaches to morphology, compositional and realizational morphology, analyze English pluralization in subtly different ways. In compositional models, pluralization is argued to be a process that operates on the less complex word (the singular) and results in the more complex word (the plural). The \textit{morpheme} \textit{-s} is concatenated with the stem, and in parallel, the abstract meaning `plural' that is registered in the \textit{lexical entry} of the \textit{morpheme} \textit{-s} overrides the singular meaning associated with the stem. In realizational models, the semantic part of the \textit{word-schema} for plural nouns contains the description `plurality of $x$s' to capture the semantic similarity of all things plural while abstracting away from their differences; hence the use of the variable `$x$'. The schema for plural nouns stands in correspondence to a schema for singular words with the same semantic symbol `$x$' \citep{Haspelmath:Sims:2010,Booij:2010}. The operator `plurality of' is assumed to implement the same semantic change for all instances `$x$' to which it is applied. While compositional models and realizational models are rather different with respect to how they view the relationship between form and meaning at the level of sub-word units, they are in remarkable agreement when it comes to how the semantics of number for nouns is understood. Both models assume that English plural formation amounts to a change in form that goes hand in hand with the addition of an abstract semantic feature of plurality to a singular word, shifting its denotation from one entity to more than one entity. As a matter of fact, formal semantics also has assumed a simple theory of plural meaning. \cite{Lasersohn:1995} opens with ``Plurality is a simple notion -- it just means `more than one'.'' Similarly, \cite{Link:1983} in his study of the logical analysis of plurals restricts the domain of entities from which singular nominals take values to atoms (or, ordinary individuals), and plural nominals to non-atomic summations of more than one atom. This interpretation of the plural nominal is often called \textit{exclusive} since it excludes atoms from its denotation \citep{Farkas:deSwart:2010}. It applies to the example \ref{ex:1-a} below. Although an exclusive interpretation of plural meaning is often fine, there are cases where a plural can refer inclusively to one or more entities, as in \ref{ex:1-b}. Here, \textit{children} in \ref{ex:1-b} is number neutral -- it can mean `one' child or `more than one' children. This is an \textit{inclusive} interpretation that includes atoms and non-atomic sums in its denotation. \ex. \a. You're welcome to bring your two children. \label{ex:1-a} \b. You're welcome to bring your children. \label{ex:1-b} \z. \citep[adapted from][]{Sauerland:Anderssen:Yatsushiro:2005} Following the maximize presupposition principle in pragmatics \citep{Heim:1991}, \citet{Sauerland:Anderssen:Yatsushiro:2005} and \citet{Liter:Heffner:Schmitt:2017} argue that an exclusive interpretation of a plural form is a consequence of pragmatic inference, which depends on a range of contextual factors \citep{Chemla:2008}. In a situation where the speaker is unsure of the addressee's number of children, \ref{ex:1-b} is appropriate and \ref{ex:2-a} is odd. Assuming that these two sentences are in competition, the use of the singular \textit{child} in \ref{ex:2-a} is blocked because we know from experience that people may have more than one child and the sentence in \ref{ex:1-b} with stronger presuppositions is preferred. \ex. \textbf{Context}: People can have more than one child. \a. *You're welcome to bring your child. \label{ex:2-a} \z. \citep[adapted from][]{Sauerland:Anderssen:Yatsushiro:2005} In other words, a plural form can be used to denote an unspecified quantity (one, more than one, one or more than one) \citep[see also][]{Mattens:1970} and the exact quantity has to be resolved through interpretation from context. A principal presupposition that underlies this approach to plurality is that the conceptualization of the number feature is orthogonal to the meaning of the nominal phrase. \cite{Sauerland:2003} argues for an additional syntactic (zero) head above the determiner phrase which contains the number feature and its semantic content. In what follows, we question this presupposition by using distributional semantics (DS). DS represents words' meanings with high-dimensional numeric vectors, which we will refer to primarily as `semantic vectors' and alternatively as `word embeddings'---as they are known in Natural Language Processing (NLP). Distributional semantics builds on the hypotheses that words that are similar in meaning occur in similar contexts \citep{Rubenstein:Goodenough:1965} and ``words that occur in the same contexts tend to have similar meaning'' \citep{Pantel:2005}. There are many different ways in which semantic vectors for words can be constructed. Early implementations made use of word by document contingency tables \citep{Landauer:Dumais:1997} or word by context-word contingency tables \citep{Lund:Burgess:1996,Shaoul:Westbury:2010}. These tables typically yield very high-dimensional vectors with thousands or tens of thousands of dimensions. By means of dimensionality reduction techniques such as singular value decomposition, the dimensionality of semantic vectors is substantially reduced. \citet{Landauer:Dumais:1997} recommended 300-dimensional vectors, as in their experience lower-dimensional vectors performed with higher accuracy in a range of tasks such as synonymy detection. More recent models make use of artificial neural networks that are trained to predict target words from the words in their immediate context \citep[e.g., CBOW;][]{Mikolov:Chen:Corrado:Dean:2013} or to predict the words in the immediate context of a target word from that target word \citep[e.g., Skip-gram;][]{Mikolov:Chen:Corrado:Dean:2013}. A simple three-layer neural network for the Skip-gram model was implemented by \cite{Mikolov:Sutskever:Chen:Corrado:Dean:2013}, using stochastic gradient descent and back-propagation of error. The model was trained on 100 billion words from the Google News corpus, and the resulting {\tt word2vec} semantic vectors were made available at \url{https://code.google.com/archive/p/word2vec/}. Other word embeddings extend the word2vec methodology by incorporating character n-grams of words \citep[fastText;][]{Bojanowski:2017:fastText} or by modifying the objective function being optimized \citep[GloVe;][]{Pennington:2014:GloVe}. All these methods extract the semantic vectors purely from textual information. Other studies integrate visual information on top of that and create multi-modal embeddings \citep[e.g.,][]{Shahmohammadi:Lensch:Baayen:2021}. Word embeddings are employed advantageously in several tasks within NLP such as named entity recognition, part of speech tagging, sentiment analysis, word sense disambiguation \citep{Wang:Wang:Chen:Wang:Kuo:2019}, and in many areas of psychology and psycholinguistics \citep{Gunther:Rinaldi:Marelli:2019}. \cite{Boleda:2020} discusses their relevance for theoretical linguistics in the areas of diachronic semantic change, polysemy, and the interface between semantics and syntax or semantics and morphology. The traditional demarcation of morphology and semantics in linguistics is less prominent in DS models. Nevertheless, the statistics used in these models have been shown to encode morphological and syntactic information besides semantic information \citep{Westbury:Hollis:2019}. For morphologically related words, measurements from DS models, such as vector similarity, are consistent with human semantic similarity ratings and lexical decision latencies \citep{Rastle:Davis:Marslen-Wilson:Lorraine:2000, Rastle:Davis:New:2004,MoscosodelPradoMartin:Deutsch:Frost:Schreuder:Jong:Baayen:2005, Milin:Kuperman:Kostic:Baayen:2009}. The degree of semantic transparency in English derivation \citep{Marelli:Baroni:2015} and Dutch compounds \citep{Heylen:DeHertog:2012} were explained by DS similarity measures. Findings of \cite{Smolka:Preller:Eulitz:2014} regarding the effect of semantic transparency on morphological priming of German complex verbs were replicated with DS similarity measures by \cite{Pado:Zeller:Snajder:2015} \citep[although][could not fully replicate the latter study]{Shafaei:2017:thesis} \citep[see also][]{Baayen:Smolka:2020}. \cite{Shen:Baayen:2021} find that semantic transparency measured by DS is linked to the productivity of adjective–noun compounds in Mandarin. DS models used in investigating the paradigmatic relation between two Indonesian prefixes \citep{Denistia:Shafaei:Baayen:2021} corroborated the findings of earlier corpus-based analyses. The discriminative lexicon model of \cite{Baayen:Chuang:Shafaei:Blevins:2019} is a computational model of lexical processing, including morphologically complex words, that incorporates insights from distributional semantics for the representation of word meanings. In what follows, we utilize word embeddings to study the meaning of English nominal pluralization. DS models from machine learning produce semantic vectors for both singular and plural word forms. However, in order to be useful for the study of morphology, we need to consider additional questions: What does the process of English pluralization, i.e., going from the singular to the plural semantics, mean in this context? How can we model this process? Given a singular meaning, can we conceptualize the plural, and conversely, given the plural meaning, can we conceptualize the singular? As it is more likely that we encounter previously unseen plurals of known singulars, than previously unseen singulars given known plurals, we focus specifically on the productivity of the conceptualization of plural forms and ask: How well can we estimate the semantics of previously unseen plural words? And how does form relate to the estimations for meaning? In the following section, we first introduce the corpus used in the present study. Sections \ref{sec:realizational-morphology} and \ref{sec:compositional-morphology} investigate the aforementioned questions using methods inspired by realizational morphology and compositional morphology, respectively. In doing so, we illustrate that the widespread assumption in morphology about plural meaning is too simplistic, and we study alternative approaches that stay closer to the actual complexity of noun pluralization in English. In section \ref{sec:ldl}, the semantic vectors developed by the best-performing methods (formalizing realizational and compositional morphological theories) are put to use in a word comprehension model \citep[based on the discriminative lexicon model by][]{Baayen:Chuang:Shafaei:Blevins:2019} to study which kind of vectors are optimal for the recognition of previously unseen plural words. A discussion of the findings concludes the study. \section{Data}\label{sec:data} The corpus data used in this study is taken from the NewsScape English Corpus \citep{Uhrig:2018, Uhrig:Habil}. The corpus consists of 269 million tokens from the subtitles of more than 35,000 hours of recordings of US-American TV news collected in the UCLA Library Broadcast NewsScape \citep{Steen:etal:2018}. After capture, the recordings undergo compression, during which the audio channel is recoded into a 96 kbit/sec AAC stream with the Fraunhofer FDK library. For this project, the subtitles collected in the NewsScape text files were processed in an NLP pipeline. In a first step of this pipeline, sentence splitting was carried out with a purpose-built splitter that takes into account the fact that captions are transmitted in upper case. The resulting sentences were processed with Stanford CoreNLP \citep{Manning:etal:2014:CoreNLP} version 3.7.0, i.e. with PTB3 tokenization. The caseless model included in CoreNLP1 was used to tag every word with a Penn Treebank part-of-speech tag.\footnote{Note that the caseless mode is only available for the left3distsim model but not for the slower but usually better bidirectional tagger model.} Then CoreNLP’s TrueCase annotator was deployed, which overwrites the original text for further processing (preserving the original on a separate level). Dependency Parsing, Named-Entity Recognition and any further processing steps are then based on the case-restored text to ensure consistent results from tools that do not offer caseless models. After the NLP pipeline, the data was run through a modified version of the forced alignment system Gentle \citep{Ochshorn:Hawkins:2015:Gentle}, which basically runs an automatic speech recognition process with a language model created from the subtitles and then attempts to match the recognized words with the words in the subtitles. The quality of the forced alignment results crucially depends on the accurateness of the transcript it is fed. However, TV subtitles are not exact transcripts. Not only do they often ignore disfluencies such as false starts, but they also omit words and sometimes even change them. The commercials included in the recordings do not systematically come with subtitles either. Thus, Gentle only aligns between 90 and 95 percent of the words in the subtitles successfully, and of these, 92.5\% in a manual evaluation were deemed to be aligned correctly by a human annotator listening to them \citep{Uhrig:Habil}. We have to bear in mind, though that the cutoff points may not have been exact on these words. To increase the quality of the dataset used in the present study, only files where Gentle reported at least 97\% of successfully aligned words were used. Words' meanings are represented with semantic vectors of word2vec, which is widely used within NLP and theoretical linguistics. The nearest neighbors of a target word in this semantic space are often semantically similar (e.g., \textit{good} and \textit{great}) or related (\textit{good} and \textit{bad}) words. The top 10 closest neighbors to \textit{Germany} are \textit{German}, \textit{Europe}, \textit{European}, \textit{Sweden}, \textit{Switzerland}, \textit{Austria}, \textit{France}, \textit{Spain}, \textit{Poland}, and \textit{Russia}. \cite{Wang:Wang:Chen:Wang:Kuo:2019} show that similarities computed between pairs of word2vec vectors are highly correlated ($r(2998)=0.72$) with similarity ratings between word pairs obtained from human subjects in the MEN data set \citep{Bruni:Tran:Baroni:2014}, and that word2vec vectors are best performing on syntactic word analogy tasks (see section \ref{sec:realizational-morphology}) juxtaposed with 5 other semantic spaces. \cite{Westbury:Hollis:2019} argue that \cite{Mikolov:Chen:Corrado:Dean:2013}'s approach for training of the word2vec vectors is closely related to the cognitively plausible learning rule of \cite{Rescorla:Wagner:1972}. We compiled a \textit{noun pluralization} dataset with 14,699 singular-plural noun pairs from the NewsScape English Corpus with a word2vec vector. Proper names, plurals endings with anything other than an \textit{-s}, plural-singular pairs with the same word-form, and named entities were excluded from the dataset. A second set brought together 500,000 tokens of 14,640 orthographic word types from more than 100 television programs in the NewsScape English Corpus with no restriction on their morphological and syntactic categories. The 13,902 words from this set that have a vector available in word2vec compose a \textit{vocabulary} dataset. \section{Pluralization with realizational morphology} \label{sec:realizational-morphology} Realizational morphology \citep[also known as word and paradigm morphology;][]{Matthews:1991:Morphology,Stump:2001} posits whole words rather than morphemes as the basic units. A central notion in this theory is the paradigm. In English, the inflectional paradigm for the verb \textit{talk} is \{\textit{talk, talks, talked, talking}\} and for the noun \textit{talk} is \{\textit{talk, talks}\}. Productivity of the lexicon as a system emerges from proportional analogies between words within paradigms, such as $talk:talks :: walk:walks$ (\textit{talk} is to \textit{talks} as \textit{walk} is to \textit{walks}). \subsection{Proportional analogies with word embeddings} Analogical reasoning using word embeddings has been studied for different types of analogical relations including semantic analogies, such as $$man:king::woman:queen,$$ derivational analogies, as in $$quiet:quietly::happy:happily,$$ and inflectional analogies similar to \begin{equation}\label{eq:inflectional-analogy-example} pen:pens::table:tables. \end{equation} \noindent Various implementations of proportional analogies with word embeddings have been worked out, such as 3CosAdd \citep{Mikolov:Yih:Zweig:2013}, 3CosMul \citep{Levy:Goldberg:2014}, LRCos, and 3CosAvg \citep{Drozd:Gladkova:Matsuoka:2016}. Performance varies extensively for the different methods and the different types of analogical relations. \cite{Rogers:Drozd:Li:2017} report that, for English, analogical reasoning with embeddings is most successful for inflectional analogies across different methods. These methods are considered below in the context of plural formation. Most of the aforementioned methods operate on three input vectors to estimate a vector for the target word in a given analogy. For instance, to implement the analogy in (\ref{eq:inflectional-analogy-example}), 3CosAdd predicts a vector for \textit{tables}, labeled $\overrightarrow{tables}_p$, by computing \begin{equation} \overrightarrow{tables}_p= \overrightarrow{pens}-\overrightarrow{pen}+\overrightarrow{table}. \end{equation} The word selected as the predicted plural is the word the vector of which is closest to the composed vector, $\overrightarrow{tables}_p$ in (\theequation), in terms of cosine similarity. As a consequence, evaluation of these methods is restricted to predefined analogy test sets such as Google's \citep{Mikolov:Chen:Corrado:Dean:2013} which provide a series of analogies similar to the examples above. Another limitation of these methods is that their prediction for the target word \textit{tables} highly depends on the prime word pair, here \textit{pen} and \textit{pens}, and not on just the singular word \textit{table} \citep{Rogers:Drozd:Li:2017}. Thus, the predicted plural vector for \textit{tables} is different when the prediction builds on another analogy such as $$banana:bananas::table:tables.$$ \noindent 3CosAvg, on the other hand, operates on just one input vector, the vector of the base word. Given the input word \textit{table}, the predicted plural vector by 3CosAvg is $$ \overrightarrow{tables}_p=\overrightarrow{table}+\overrightarrow{\textsc{avg shift}}. $$ \noindent The word selected as the plural form is again, exactly as for 3CosAdd, that word the vector of which is closest to the assembled vector. For plural analogies, \cite{Drozd:Gladkova:Matsuoka:2016} define the average shift vector as \begin{equation} \overrightarrow{\textsc{avg shift}} = \frac{1}{m} \sum_{i=1}^m \Vec{p_i} - \frac{1}{n} \sum_{i=1}^n \Vec{s_i}, \end{equation} assuming there are $m$ plural word-forms with vectors $\Vec{p_i}$ and $n$ singular word-forms with vectors $\Vec{s_i}$. The average shift vector is fixed given the data, and represents the semantics of pluralization, just as the plural vector in the discriminative lexicon model \citep{Baayen:Chuang:Shafaei:Blevins:2019} provides a fixed representation for plurality. For a dataset with $m$ plural and $m$ singular word-forms, the average shift vector, i.e., the difference vector between the average vector of plurals and the average vector of singulars, formulated in (\ref{eq:linear-property-of-offset-vector-line1}), is equal to the average vector of the difference vectors between plurals and singulars, formulated in (\ref{eq:linear-property-of-offset-vector-line3}): \begin{align} \overrightarrow{\textsc{avg shift}} &= \frac{1}{m} \sum_{i=1}^m \Vec{p_i} - \frac{1}{m} \sum_{i=1}^m \Vec{s_i} \label{eq:linear-property-of-offset-vector-line1}\\ &= \frac{1}{m} (\sum_{i=1}^m \Vec{p_i} -\sum_{i=1}^m \Vec{s_i})\nonumber\\ &= \frac{1}{m} \sum_{i=1}^m (\Vec{p_i} - \Vec{s_i}). \label{eq:linear-property-of-offset-vector-line3} \end{align} \noindent Henceforth, we refer to the vector $\Vec{p_i} - \Vec{s_i}$ for word $i$ as this word's individual \textit{shift vector}. Such a shift vector is exemplified in Figure~\ref{fig:shift-vector}. Importantly, if plural and singular forms for different lexemes are consistently used across similar contexts, as captured by word embeddings, then the difference between individual shift vectors and the average shift vector is expected to be small. \begin{figure}[th] \centering \includegraphics{shift-vector.pdf} \caption{Individual shift vector for the lexeme \textit{pen} is calculated as $\protect\overrightarrow{\text{pens}} - \protect\overrightarrow{\text{pen}}$.} \label{fig:shift-vector} \end{figure} A range of studies have adopted shift vectors to study the semantics of various lexical relations. For instance, \cite{Roller:Erk:Boleda:Gemma:2014} and \cite{Weeds:2014} used shift vectors for hypernymy detection. \cite{Bonami:Paperno:2018} used shift vectors to model inflectional and derivational contrasts in French, and \cite{Mickus:Bonami:Paperno:2019} made use of shift vectors for tracing contrasts in grammatical gender of nouns and adjectives. \subsection{Individual and average shift vectors} \label{subsec:shift-vectors} How well does an average shift vector approximate the shifts between individual singulars and their plurals? To address this question, we investigated what the individual shift vectors look like and whether the average shift vector is representative for the individual shift vectors. For each noun pair in the pluralization dataset represented by word2vec semantic vectors, we first calculated its individual shift vector by subtracting the singular vector from the plural vector. As a next step, we calculated the length (or magnitude), the direction, and the neighborhood structure of the shift vectors. We gauged the length of vectors with the $\ell _{2}$ norm, i.e., the Euclidean distance of a vector from the origin. Fig.~\ref{fig:boxplot-len-sg-pl-shift} shows notched box and whiskers plots for the length of singular, plural, and individual shift vectors. Vector lengths differed in the mean for singular, plural and shift vectors (Friedman test, $\tilde{\chi}^2(2) = 7201$, $p\ll 0.0001$). Pairwise Wilcoxon signed-rank test between groups with Bonferroni correction revealed significant differences in length for all pairwise comparisons (all $p\ll 0.0001$). Plural vectors are, on average, longer than singular vectors (the difference between the medians $\Delta \mathrm{MD}$ is 0.13). This fits well with the intuition that English plurals are semantically more complex than their corresponding singulars. Shift vectors are, on average, smaller than the singular ($\Delta \mathrm{MD}=0.43$) and the plural vectors ($\Delta \mathrm{MD}=0.56$), which is only to be expected given that the shift vectors are, by definition, difference vectors. Although the average length of the shift vectors is smaller than the average lengths of singular or plural vectors, shift vectors turn out to nevertheless be surprisingly long. Their range ($1.1-6.8$, $\mathrm{MD}=2.88$) is nearly as wide as the ranges of the singular vectors and the plural vectors. \begin{figure} \centering \includegraphics[width=0.8\textwidth]{w2v-len-sg-pl-shift.png} \caption Box plots for the length of 14,699 word2vec's singular, plural, and individual shift vectors. } \label{fig:boxplot-len-sg-pl-shift} \end{figure} We quantified the angles of vectors in word2vec's 300-dimensional vector space with respect to the standard unit vector $\Vec{e}_{300}$ in degrees, using (\ref{eq:theta}). This 300-dimensional unit vector has a 1 as the last element and zeros elsewhere. Notched boxplots for angle are presented in Fig.~\ref{fig:boxplot-angle-sg-pl-shift}. The range of angles for shift vectors is even more similar to the ranges of angles of the singular and plural vectors, compared to vector lengths. \begin{align}\label{eq:theta} \theta(\Vec{v}) &= \frac{180}{\pi} (\arccos { \frac{\Vec{v} \cdot \Vec{e}_{300}}{ \left\lVert \Vec{v}\right\rVert_2 \left\lVert \Vec{e}_{300}\right\rVert_2 }) } \nonumber \\ &= \frac{180}{\pi} (\arccos {\frac {v_{300}}{{\sqrt {\sum \limits _{i=1}^{300}{v_{i}^{2}}}}}}) \end{align} \begin{figure} \centering \includegraphics[width=0.8\textwidth]{w2v-angle-sg-pl-shift.png} \caption{Box plots for the angle of 14,699 word2vec's singular, plural, and individual shift vectors. } \label{fig:boxplot-angle-sg-pl-shift} \end{figure} Fig.~\ref{fig:scatter-r-theta-shift} plots the length of shift vectors against their angle. Considerable variability is visible in the length and the angle of individual shift vectors. The average of a set of vectors radiating from the origin that point in various directions and have various lengths will inevitably end up close to the origin of that vector space. The average shift vector, in red, at (89.25, 0.64) is smaller than all of the individual shift vectors, and has an $\ell _2$ norm of only 0.64. When such a small vector is added to the singular, it is hardly distinguishable from the singular vector, and at a large distance from the actual corresponding plural vector. \begin{figure} \centering \includegraphics[width=0.85\textwidth]{w2v-scatter-angle-length2.png} \caption{Scatter plot visualizing the relationship between the length, on the y-axis, and angle, on the x-axis, for the individual shift vectors. The isolated red dot below the cloud of all other data points at (89.25, 0.64) belongs to the average shift vector.} \label{fig:scatter-r-theta-shift} \end{figure} Upon closer inspection, it turns out that, rather than being random, the set of individual shift vectors exhibits structure. The length of plural vectors increases with the length of their singular vectors, and likewise, the length of shift vectors increases with the length of the singular vectors, as illustrated in Fig.~\ref{fig:len-shift-depends-len-sg}. From this, we can draw the conclusion that the semantics of shift vectors is changing in close association with the semantics of the singular and plural words. \begin{figure} \centering \includegraphics[width=\textwidth]{w2v-scatter-len-pl-shift-against-sg-xEqy-14699.png} \caption{Scatterplots for the length of plural vectors (vertical axis in the left panel) and length of shift vectors (vertical axis in the right panel) against the length of singular vectors (horizontal axis in both plots), with Locally WEighted Scatterplot Smoothing (LOWESS) trend lines in red. The dashed black lines represent the identity line $y=x$.} \label{fig:len-shift-depends-len-sg} \end{figure} Given that singular words that have similar semantics have closer vectors, and singular words with less similar meanings have more diverging vectors, we now consider the question of whether the shift vectors themselves show structuring that goes beyond the structure provided at the level of individual lexemes. To address this question, we made use of the t-SNE algorithm for visualizing high-dimensional data \citep{Maaten:Hinton:2008} as implemented in the \texttt{scikit-learn} Python library \citep{scikit-learn}, version 1.0.1, to plot the 300-dimensional shift vectors in a two-dimensional plane.\footnote{Following the recommendations of \cite{vanderMaaten:2021}, we searched the t-SNE's parameter space between possible combinations of \textit{perplexity} (either 10, 15, 20, 25, 30, or 35), \textit{number of iterations} (either 500, 1000, 2000, 3000, or 4000), \textit{random state} (either 1, 12, or 123), and \textit{initialization} method (either random or PCA) for the t-SNE with the lowest Kullback-Leibler divergence. The lowest KL-divergence was obtained with the following setting: perplexity $=$ 35, number of iterations = 4000, early exaggeration = 12, random state = 1, learning rate = `auto', metric=`euclidean', and initialization = `random'.} This visualization technique is known to have a very high chance of recovering the clustering structure present in the input space in the reduced output space \citep{Linderman2019, Arora2018}. Fig.~\ref{fig:tsne-shift-w2v} presents the scatter of data points in this plane, coloured with the label of the first synset in WordNet \citep{Fellbaum:1998,Miller:1995} for the singular word form. From the 14,699 pairs in our pluralization dataset, 11,749 pairs are found in WordNet and used in the remainder of this study. The labels, indicated in the figure's legend, often referred to as supersenses, include 26 broad semantic categories for nouns \citep{Ciaramita:Johnson:2003}. Interestingly, the individual shift vectors form clusters that are reasonably well approximated by the WordNet supersenses. Some supersenses show well-defined clusters, such as \textit{person} towards the bottom right corner of the plane and \textit{animal} towards the top right corner. This indicates that pluralization is similar for nouns denoting animal nouns and is different for nouns denoting persons. Importantly, the average shift vector (highlighted by a red cross) is located near the origin of this space at $(0.4,\, -1.8)$. Interpretation of the t-SNE dimensions is not very straightforward. Preliminary investigation suggests that the first dimension is to a very large extent differentiating between concrete and abstract words (see supplementary materials for details). The second dimension is less interpretable, and rather similar to the first dimension. \begin{figure} \centering \includegraphics[width=\textwidth]{w2v-tsne-shift-bestKL2.png} \caption{A projection of shift vectors onto a two-dimensional plane using t-SNE reveals semantic clustering. Colors correspond to WordNet supersenses. The average shift vector marked with a red cross, which is located very close to the origin at $(0.4,\, -1.8)$, is blind to this rich structure. This figure is available as an interactive plot in the supplementary materials. } \label{fig:tsne-shift-w2v} \end{figure} Although some well-defined clusters are present in Fig.~\ref{fig:tsne-shift-w2v}, other clusters show considerable overlap. This is due to two problems. The first problem is that nouns can have multiple senses. We selected the first sense listed in WordNet, which, according to \citet{Jurafsky:Martin:2021}, is the most frequent sense and hence a strong baseline. However, inaccuracies are inevitable. For instance, \textit{strawberry} is assigned the food category while \textit{blueberry} is labeled as a plant. A related problem is that we have one embedding for all senses, instead of sense-specific embeddings. The second problem is that the supersenses are often too broad and too over-populated to form semantically coherent groups. For instance, the supersense \textit{artifact} brings together musical instruments, vehicles, clothes, guns, and buildings among others. In the t-SNE plane, this supersense is found in two distinct regions. The fuzziness of the 26 supersenses is clearly demonstrated by Linear Discriminant Analysis (LDA) given the task of assigning shift vectors to supersenses. From an evaluation of the LDA on all of the data points ($N=11749)$, accuracy and weighted average F-score were both 58.4\% . To put the multiclass classification performance of the LDA into perspective, the weighted average F-score by the LDA is 7 times greater than the weighted average F-score of a baseline classifier that always predicts the most frequent superset. The LDA's performance indicates that on the one hand there is structure and the structure is captured by both a supervised algorithm, i.e., LDA, and an unsupervised algorithm, i.e., t-SNE. On the other hand, it indicates that there is also considerable uncertainty about superset membership. To address the first problem, one would have to make use of techniques for word-sense disambiguation. Word sense disambiguation has a very long history in computational linguistics and there are many supervised and unsupervised algorithms designed for this task. One might combine WordNet and FrameNet \citep{Baker:Fillmore:Lowe:1998} annotations as proposed by \cite{Baker:Fellbaum:2009}, train a supervised model \citep[e.g.,][]{Zhong:Ng:2010}, or search for words' nearest neighbors in a contextual word embeddings space \citep{Loureiro:Jorge:2019}. Given a high-accuracy word sense disambiguation pipeline, one could then apply word sense disambiguation before calculating embeddings using word2vec. Such a programme, if at all feasible, is outside the scope of the present study. The second problem is more straightforward to address. Instead of using the 26 supersenses shown in Fig.~\ref{fig:tsne-shift-w2v}, we can zoom in on smaller, more semantically homogeneous sense sets. For instance, the supersense \textit{person} covers 2725 lexemes in our data. By moving to semantic classes one level below this supersense, we obtain more coherent subsets such as \textit{relative}, \textit{scientist}, and \textit{lover}. For our pluralization dataset, we constructed a total of 411 classes, by moving zero steps or one step down from the supersenses. On average, a class has 28.6 ($SD=39.8$) members. No class has fewer than 5 members. The most populous class has 481 members. These new semantic classes are more semantically cohesive, as can be seen in Figure~\ref{fig:extra} for a number of sub-classes within the supersense \textit{artifact} as an example. Furthermore, the performance of LDA increased despite the substantial increase in the number of classes. Accuracy and weighted average F-score are both 61\% from an evaluation of an LDA that predicts 411 classes given the shift vectors. In comparison, the weighted average F-score by this model is 189 times greater than the weighted average F-score of a baseline classifier that always predicts the most frequent class. \begin{figure} \centering \includegraphics[width=0.9\textwidth]{w2v-tsne-shift-bestKL-411classes-artifact-subset.png} \caption{A projection of shift vectors onto a two-dimensional plane using t-SNE for a subset of data points within the supersense \textit{artifact} that form rudimentary sub-clusters such as \textit{clothing} and \textit{musical instruments}.} \label{fig:extra} \end{figure} Although the idea of an abstract semantic representation is appealing, it turns out that a simple average shift vector fails to do justice to the intricate semantic structure that characterizes nominal pluralization in English. Apparently, English pluralization is substantially more subtle, and varies systematically with the semantic category (supersense) of a noun. \subsection{CosClassAvg}\label{subsec:cosclassavg} This new set of 411 classes, or a similarly cohesive set of classes of semantically highly related words, makes it possible to formalize a new model for plural semantics. We first calculated the average shift vector for each of the 411 classes. The mean length of these average shift vectors is 1.2, and its standard deviation was 0.3. Compared to the distribution of shift vectors shown in Fig.~\ref{fig:boxplot-len-sg-pl-shift}, both mean and standard deviation are substantially reduced. The same holds for their angles ($M=89.1$, $\mathrm{SD}=2.6$). This clarifies that by-class shift vectors are more similar to each other than is the case for the shift vectors in the undifferentiated set of all nouns. We can now introduce our `CosClassAvg' theory for noun plurals. Given an input word and its semantic class, the plural vector predicted by CosClassAvg is obtained by taking the singular vector and adding to it the average shift vector for that class. Thus, the vector for \textit{bananas} is predicted using $$\overrightarrow{bananas}_p=\overrightarrow{banana}+\overrightarrow{\textsc{avg-shift}}_{\textsc{fruit}},$$ while the vector for \textit{cars} is predicted based on $$\overrightarrow{cars}_p=\overrightarrow{car}+\overrightarrow{\textsc{avg-shift}}_{\textsc{vehicle}}.$$ We can assess the quality of predicted vectors by inspecting the cosine similarities of a predicted vector with the vectors of all words. Ideally, the vector that is closest to the predicted vector represents the meaning of the targeted plural. How well does CosClassAvg perform? To address this question, we first investigated whether predicted plurals are better differentiated from their singular counterparts. As our baseline for comparisons, we used the \textsc{Only-b} method introduced in \cite{Linzen:2016}, where \textsc{b} represents the vector for the base word. This method simply returns the input singular vector, without adding anything to it, as the predicted plural vector. As a consequence, this method will always predict the nearest neighbor in terms of cosine similarity, i.e. the word that is most similar to the base word in the vocabulary. We calculated the predicted plural vectors for all singular words in our pluralization dataset ($N=11,749$) using 3CosAvg, CosClassAvg, and the baseline method. Many implementations of proportional analogies with word embeddings exclude the input words such as the singular word from the vocabulary as a potential predicted word. However, in an ``honest'' practice, as \cite{Rogers:Drozd:Li:2017} put it, we do not exclude any words from the vocabulary. We therefore compared predicted vectors with a broader set of words covering all 30,497 word-form types in our pluralization and our vocabulary datasets. The notched boxplots in Fig.~\ref{fig:3methods-similarity-hatpl-pl} summarize the distributions of cosine similarities (left) and Euclidean distances (right), for the baseline model (Only-B), the 3CosAvg model, and the new CosClassAvg model, of the predicted vectors and the corresponding plural vectors provided by word2vec. The lowest boxplots in blue produced by the baseline method, indicate that the singular and the plural vectors in word2vec are already astonishingly similar. Both 3CosAvg and CosClassAvg improve on the baseline and generate more similar and less distant vectors to the actual plural vector, with CosClassAvg in the lead. \begin{figure} \centering \includegraphics[width=\textwidth]{hatpl_pl2.png} \caption{Comparison between the predicted plural vectors and the corpus-extracted plural vectors using cosine similarity (left panel) and Euclidean distance (right) for the Only-B, the 3CosAvg, and the CosClassAvg method. } \label{fig:3methods-similarity-hatpl-pl} \end{figure} For predicted vectors to well approximate the true plural vectors, they should be less close to their corresponding singular vectors. Fig.~\ref{fig:3methods-similarity-hatpl-sg} visualizes cosine similarity to singular vectors and Euclidean distance from singular vectors of the predicted plural vectors. Similarity decreases from one and distance increases from zero with 3CosAvg and CosClassAvg plural vectors. The Euclidean distance between 3CosAvg plural vectors and their singular vectors is always equal to the length of the average shift vector. The length of this overall average shift vector is smaller than the length of any CosClassAvg class-specific shift vector. \begin{figure} \centering \includegraphics[width=\textwidth]{hatpl_sg2.png} \caption{Comparison between the predicted plural vectors and the singular vectors using cosine similarity (left panel) and Euclidean distance (right) for the Only-B, the 3CosAvg, and the CosClassAvg method. } \label{fig:3methods-similarity-hatpl-sg} \end{figure} When we use the stringent criterion that any word, including the singular, can be a neighbor of the predicted plural, then performance of both 3CosAvg and CosClassAvg is disappointing. 3CosAvg always selects the singular as closest neighbor, and CosClassAvg only correctly selects 42 plurals (0.4\%). Although CosClassAvg yields predicted vectors that are further away from their singulars and closer to their plurals, compared to 3CosAvg, predicted plural vectors remain very close to their singular vectors. Table.~\ref{tab:CosClassAvg-predicts-pl-better} lists the percentages of lexemes for which the targeted plural vector is among the top-n neighbors. Of the three methods, CosClassAvg clearly outperforms the other two, with percentages ranging from 79\% to 95\%. In other words, if we relax our criterion and filter out singular vectors as candidates, the accuracy of CosClassAvg is at 79\%. \begin{table}[ht] \begin{center} \begin{minipage}{197pt} \caption{Percentage of the lexemes ($N=11,749$) for which the plural vector is among the 2 (Top 2), 3 (Top 3), 10 (Top 10), and 20 nearest neighbors (Top 20) of the predicted plural vector.} \label{tab:CosClassAvg-predicts-pl-better}% \begin{tabular}{@{}lrrrr@{}} \toprule Method & Top 2 & Top 3 & Top 10 & Top 20 \\ \midrule Only-B & 61 & 74 & 88 & 92 \\ 3CosAvg & 70 & 80 & 91 & 93 \\ CosClassAvg & 79 & 86 & 93 & 95 \\ \botrule \end{tabular} \end{minipage} \end{center} \end{table} \subsection{Discussion} According to the 3CosAvg method proposed by \citet{Drozd:Gladkova:Matsuoka:2016}, pluralization can be formalized as a function adding an \textit{average shift vector} to the singular vector: $$ \bm{v}_{\text{pl}} = f_{\text{\tiny{3CosAvg}}}(\bm{v}_{\text{sg}}) = \bm{v}_{\text{sg}} +\bm{v}_{\textsc{pl}}. $$ We have shown that this formalization of plurality is too simple: shift vectors form semantically motivated clusters. CosClassAvg brings these classes into a modified function $$ \bm{v}_{\text{pl}} = g_{\text{\tiny{CosClassAvg}}}(\bm{v}_{\text{sg}}) = \bm{v}_{\text{sg}} +\bm{v}_{\textsc{pl} \mid \text{semantic class}}. $$ The meaning shift in pluralization is similar for lexemes within a semantic class and is different for lexemes from different semantic classes. CosClassAvg capitalizes on this observation, computes several average shift vectors, one per semantic class, which enables it to generate improved predictions for plurals. Pluralization with CosClassAvg requires two pieces of information to make a prediction, namely, information on the semantic clusters (and their centroids) and information on the semantic class membership of a given singular noun. The current study shows that, given this information, more precise predictions for plural vectors are obtained. Although outside the scope of this contribution, it may well be possible to develop an end-to-end model that does class induction and pluralization jointly. To that end, semantically cohesive clusters within the shift space may be obtained using unsupervised clustering algorithms. We have shown that clusters found by the unsupervised t-SNE algorithm independently of the WordNet tags, are well-supported by the supervised LDA classification using WordNet tags. In the present approach, we accept the 411 classes as given, leaving it to further research to address the question of how these classes might be grounded in unsupervised learning. Regarding the second source of information, we gauged how straightforward it is to classify singular nouns according to their semantics. From a 5-fold stratified cross-validation evaluation of an LDA predicting the 411 semantic classes from \textit{singular} vectors, the mean weighted average F-score was 61\% ($\mathrm{SD} = 0.1$) on the training sets and 32\% ($\mathrm{SD} = 0.5$) on the test sets. The weighted average F-scores by the LDA from the 5 evaluations are on average 190.3 times ($\mathrm{SD} = 0.5$) greater on the training sets and on average 100.1 times ($\mathrm{SD} = 2.3$) greater on the the test sets than the weighted average F-scores of a baseline classifier that always predicts the most frequent class. A straightforward LDA performs quite well under cross-validation. Thus, the classes that we derived from WordNet are to a large extent implicit in the word embeddings. The CosClassAvg method may also provide enhanced predictivity for human lexical processing, compared to the 3CosAvg method. For instance, \cite{Westbury:Hollis:2019} calculated average vectors for words belonging to different syntactic categories, or containing different derivational affixes, and showed that these average vectors can be leveraged to model human categorization decisions. Following their approach, we computed the average vector of plural nouns ($\frac{1}{m} \sum_{i=0}^m \Vec{p_i}$ in equation \ref{eq:linear-property-of-offset-vector-line1}) using the 14,699 plural words in our pluralization dataset introduced in section \ref{sec:data}. Nearest neighbors to the average plural were retrieved among our vocabulary dataset. We replicated \cite{Westbury:Hollis:2019}'s findings for the average plural vector. Within the closest neighbors of the average plural vector, 79\% are plural nouns. However, other than being plural, these nouns are semantically highly heterogeneous. If human category decisions are also influenced by the lexical semantics of nouns, more precise predictions can perhaps be obtained by further conditioning on the semantic class of the noun. We leave this issue to further research. The clustering of plural shift vectors by semantic class likely reflects differences in how plural objects configure in our (culture-specific) constructions of the world. Multiple cars occur in different configurations which tend to share alignments, as in parking lots or traffic jams. Multiple oranges or multiple cherries occur in very different configurations, typically piled up in boxes or on plates, and bananas occur in hands on banana plants and fruit stands. Apparently, the different properties of the objects that we refer to in the plural are reflected in our language use, as captured by distributional semantics. However, apples and oranges are more similar than apples and bananas. As a consequence, the vectors predicted by CosClassAvg will always be a bit off for individual words. This observation necessitates updating the plural semantic function $g$ with an error term, as follows $$ \bm{v}_{\text{pl}} = g_{\text{\tiny{CosClassAvg}}}(\bm{v}_{\text{sg}}) = \bm{v}_{\text{sg}} +\bm{v}_{\textsc{pl} \mid \text{semantic class}} + \bm{\epsilon}_\text{lexeme}. $$ The error vector $\bm{\epsilon}_\text{lexeme}$ represents the lexeme-specific semantics that cannot be captured by the semantic commonalities of the lexeme's semantic class. In usage-based grammar and corpus linguistics, individual words, including inflected words, have been argued to have their own highly specific usage profiles \citep[see, e.g.,][]{Sinclair:1991}. `Error' components such as $\bm{\epsilon}_\text{lexeme}$ formalize this important insight. However, since semantic vectors themselves are measurements, and as such subject to measurement error, we need to add a second error vector representing measurement noise: $$ \bm{v}_{\text{pl}} = g_{\text{\tiny{CosClassAvg}}}(\bm{v}_{\text{sg}}) = \bm{v}_{\text{sg}} +\bm{v}_{\textsc{pl} \mid \text{semantic class}} + \bm{\epsilon}_\text{lexeme} + \bm{\epsilon}. $$ Since CosClassAvg decomposes semantic vectors into constituent semantic vectors, it constitutes a `decompositional' or `analytical' method for accounting for inflectional semantics. In the next section, we compare decompositional CosClassAvg with a compositional method, FRACCS \citep{Marelli:Baroni:2015}. \section{Pluralization with FRACSS}\label{sec:compositional-morphology} \cite{Marelli:Baroni:2015}, building on previous research on compositional semantics \citep{Mitchell:Lapata:2008,Baroni:Zamparelli:2010,Lazaridou:Marelli:Zamparelli:Baroni:2013}, proposed to model derivational semantics with the help of a linear transformation that takes the semantic vector of the base word as input, and maps it onto the semantic vector of the corresponding plural using a linear mapping $\bm{B}$: $$ \bm{v}_{\text{pl}} = h_{\text{\tiny{FRACSS}}}(\bm{v}_{\text{sg}}) = \bm{v}_{\text{sg}}\bm{B}. $$ This model, known as the FRACSS model, has been applied to German complex verbs \citep{Gunther:Smolka:Marelli:2019}, and an extended version has been used to study compounding in English and German \citep{Gunther:Marelli:2016, Gunther:Marelli:2019, Marelli:Gagne:Spalding:2017, Gunther:Marelli:Bolte:2020}. In the following, we apply FRACSS to English plural inflection, and compare its predictions with those of CosClassAvg. FRACSS transforms singular vectors into plural vectors using straightforward matrix multiplication. Let $\bm{X}$ denote a matrix with as row vectors the word embeddings of singulars, and let $\bm{Y}$ denote a matrix with the same number of row and column vectors representing the meanings of the corresponding plurals: \begin{equation*} {\displaystyle \bm{X = {\begin{pmatrix} x_{1,1} & x_{1,2} & \cdots & x_{1,n}\\ x_{2,1} & x_{2,2} & \cdots & x_{2,n}\\ \vdots &\vdots &\ddots & \vdots\\ x_{t,1}&x_{t,2}&\cdots & x_{t,n}\\ \end{pmatrix}}, \quad \bm{Y = {\begin{pmatrix} y_{1,1} & y_{1,2} & \cdots & y_{1,n}\\ y_{2,1} & y_{2,2} & \cdots & y_{2,n}\\ \vdots & \vdots & \ddots & \vdots\\ y_{t,1} & y_{t,2} & \cdots & y_{t,n}\\ \end{pmatrix}}. } \end{equation*} \noindent The mapping $\bm{B}$ is a $n\times n$ dimensional matrix that satisfies $$ \bm{X} \bm{B} = \bm{Y}. $$ We estimate $\bm{B}$ as follows: $$ \bm{B} = \bm{X}^+ \bm{Y} = (\bm{X}^T \bm{X})^{-1} \bm{X}^T \bm{Y}, $$ where $\bm{X}^+$ is the pseudo-inverse of $\bm{X}$ and $\bm{X}^T$ is its transpose, and $(.)^{-1}$ denotes a matrix inverse operation. Given $\bm{B}$ and the vector of a singular, the predicted plural vector is given by \begin{equation*}\label{eq:matrix-multiplication-1vec} {\displaystyle {\begin{bmatrix} x_1 & x_2 & \cdots & x_{n} \end{bmatrix}} {\begin{pmatrix} b_{1,1} & b_{1,2} & \cdots &b_{1,m}\\ b_{2,1} & b_{2,2} & \cdots &b_{2,m}\\ \vdots &\vdots &\ddots &\vdots\\ b_{n,1} &b_{n,2}&\cdots &b_{n,m}\\ \end{pmatrix}} = {\begin{bmatrix} \hat{y}_1 & \hat{y}_2 & \cdots & \hat{y}_{m} \end{bmatrix}}, } \end{equation*} which, according to the definition of matrix multiplication, implies that \begin{equation* \hat{y}_j = \sum_{i=1}^{n} b_{i,j} \cdot x_{i}, \qquad {\small \text{for } 1\leq j \leq m }. \end{equation*} In other words, the $j$-th element of the semantic vector of a given plural is a weighted sum of the values of its singular vector. \subsection{Conceptualizing noun plurals with FRACSS} \label{subsec:fracss} We estimated the mapping matrix $\bm{B}$ for 90\% of the singular-plural pairs in our pluralization dataset (10,574 pairs) using 300-dimensional word2vec vectors. The remaining 1,175 word pairs were set aside as held-out testing data. The resulting 300$\times$300 $\bm{B}$ matrix implements the change in the meaning of singular words that goes hand in hand with the affixation of the plural \textit{-s}. With $\bm{B}$ in hand, we can calculate predicted plural vectors for both the training data and the test data. The model correctly predicts plural forms for 88\% of training items and for 76\% of test items. Clearly, the mapping appears robust as a memory for seen items and it is also productive for unseen items. To better understand the performance of the FRACSS model, recall that in section \ref{sec:realizational-morphology} we observed that word2vec's singular and plural vectors are very similar. That is to say, any model for finding a mapping between the singular and the plural space is a-priori in an advantageous position since the relationship between the two spaces is already a given property of the semantic space constructed by word2vec. In other words, the mapping matrix $\bm{B}$ must be somewhat similar to an identity matrix (i.e., a matrix with ones on the diagonal and zeroes elsewhere). The cool-to-warm heat map in Fig.~\ref{fig:fracss-weights}, that visualizes the FRACSS matrix, shows that this is indeed the case. Input vector dimensions are on the vertical axis, indexed by $i$ from 1 to 300, and output vector dimensions, indexed by $j$ from 1 to 300, are on the horizontal axis. The color indicates the magnitude of the value at index $(i,j)$. The value at index $(i,j)$ of this matrix, $b_{i,j}$, shows the association strength between the $i$-th dimension of the singular vectors and the $j$-th dimension of the plural vectors. Association strengths are highest on the diagonal entries of this matrix, which links every singular with its own plural. \begin{figure} \centering \includegraphics[width=0.9\textwidth]{fracss_weights.png} \caption{FRACSS matrix for English plural suffix -s.} \label{fig:fracss-weights} \end{figure} The mean value of the diagonal elements is 0.57 ($SD=0.02$). Barely any structure is evident elsewhere: the mean value of off-diagonal elements is a mere $9.8\times 10^{-5}$ ($SD=0.017$). We can therefore approximate the effect of multiplication with $\bm{B}$ with a much simpler operation: \begin{equation} \hat{\bm{Y}} = 0.57 \bm{X} \bm{I} + \bm{\epsilon}, \bm{\epsilon} \sim {\cal N}_{300}({\bf -0.001}, 0.08\bm{I}), \end{equation} \noindent where $\bm{I}$ is the identity matrix, $\bm{\epsilon}$ is a matrix of 300-dimensional random vectors as row vectors all chosen from the same multivariate normal distribution with mean vector $\bf{-0.001}$ (a 300-dimensional vector with -0.001 everywhere) and covariance matrix $0.08\bm{I}$.\footnote{For almost all predicted plural and singular vector pairs, the epsilons were normally distributed with an average mean of -0.001 and an average standard deviation of 0.08 (D'Agostino's $K^2$ departure from normality hypothesis test; $p > 0.001$ for 99.8\% of 11749 tests).} Note that this approximation of $\bm{B}$ predicts that the semantic vectors predicted by FRACSS are shorter in length than their singulars: this follows from the multiplication factor 0.57. How do the FRACSS predicted vectors compare to the vectors predicted by CosClassAvg? To address this question, we first consider similarity evaluated by means of the angle between vectors, and subsequently by means of the Euclidean distance of the corpus-extracted vectors. The median cosine similarity of predicted and target vectors is 0.75 for FRACSS and 0.71 for CosClassAvg (Wilcoxon signed-rank test $W=65105609.0$, $p \ll 0.0001$ one-tailed, $N=11749$). Furthermore, the median cosine similarity between singular vectors and predicted vectors is 0.87 for FRACSS and 0.95 for CosClassAvg (Wilcoxon signed-rank test $W=649018.0$, $p \ll 0.0001$ one-tailed). When accuracy is evaluated with the cosine similarity measure, the FRACSS plural vectors are now close enough to the target plural vectors to capture the plural word correctly as the first nearest neighbor in 1520 cases (13\%). Similar results are obtained when we use the Euclidean distance measure. The median Euclidean distance to corpus-extracted plural vectors is shorter from predicted vectors for FRACSS at 2.28 in comparison with vectors for CosClassAvg at 2.64 (Wilcoxon signed-rank test $W=1530725.0$, $p \ll 0.0001$ one-tailed). Inversely, the median Euclidean distance between singular vectors and predicted vectors is 1.67 for FRACSS and 1.04 for CosClassAvg (Wilcoxon signed-rank test $W=68556852.0$, $p \ll 0.0001$ one-tailed). Thus far, we have based our evaluation on the angle and distance between vectors. We have seen that FRACSS vectors have smaller angles and shorter distances to plural vectors than CosClassAvg vectors. What about the Euclidean length of the predicted plural vectors? Fig.~\ref{fig:predicted-pl-length} plots the length of predicted plural vectors against the length of singular vectors, for CosClassAvg (left) and FRACSS (right). For both methods, length of predicted plural vectors increases with the length of singular vectors, similar to the trend observed in Fig.~\ref{fig:len-shift-depends-len-sg} for the length of corpus-extracted plural and singular vectors. However, there is a striking difference. Most plural vectors predicted by CosClassAvg are longer than their singular vector (74\%). By contrast, as anticipated above on the basis of an analysis of the $\bm{B}$ matrix, all plural vectors predicted by FRACSS are shorter than their corresponding singular vectors.\footnote{The signed difference between the length of the target plural vectors and the length of the predicted plural vectors is lower for CosClassAvg compared to FRACSS (Wilcoxon signed-rank test $W=69025375.0, p \ll 0.0001, \mathrm{MD}_{\text{CosClassAvg}}=0.09, \mathrm{MD}_{\text{FRACSS}}=0.89, N=11749$).} However, for the corpus-based actual word2vec vectors, 66\% of the plural vectors are longer than the corresponding singular vectors. \begin{figure} \centering \includegraphics[width=\textwidth]{scatter-len-hatpl-against-sg-2methods.png} \caption{Scatter plots depicting the length of predicted plural vectors, on the vertical axis, versus the length of singular vectors, on the horizontal axis, by CosClassAvg (left panel) and FRACSS (right panel) with the Locally WEighted Scatterplot Smoothing (LOWESS) trend lines in red. The dashed black lines represent the identity line $y=x$.} \label{fig:predicted-pl-length} \end{figure} \subsection{Discussion} We have seen that FRACSS outperforms CosClassAvg when evaluation is based on the angle or distance between vectors, but CosClassAvg outperforms FRACSS when we consider vector lengths. In section~\ref{sec:ldl} we propose another measure for evaluating the relative merits of the two methods. , we first reflect on some technical and conceptual problems that come with the FRACSS approach. One conceptual problem concerns the interpretation of the $\bm{B}$ matrix. Our t-SNE analysis of shift vectors revealed clustering by semantic class. However, $\bm{B}$ is calculated by evaluating all singulars and plurals simultaneously. It is an empirical question whether this is advantageous for understanding human lexical processing, an issue we pursue in more detail in section~\ref{sec:ldl}. If we assume, for the sake of the argument, that FRACSS is a more precise version of CosClassAvg, then CosClassAvg provides us with insight into what FRACSS is actually achieving: semantic-cluster driven local generalization. In other words, the FRACSS matrix $\bm{B}$ does not represent a single operation of pluralization that is independent and orthogonal to the lexical meaning of the singular. To the contrary, $\bm{B}$ captures a wide range of different local pluralization functions. Another conceptual problem concerns the directionality of semantic operations. \cite{Baroni:Bernardi:Zamparelli:2014} argue that semantic composition is intrinsically asymmetric (compare `water under the bridge' and `bridge under the water'), and that therefore implementations of semantic functions using matrix multiplication is superior to functions using vector addition. \cite{Marelli:Baroni:2015} likewise assert that representing affixes as functions over base forms in FRACSS captures this important asymmetry. However, a FRACSS matrix such as $\bm{B}$ has a pseudo-inverse, and technically it is straightforward to construct a mapping from plurals to singulars. Such a linear mapping trained in the inverse direction on the same data correctly predicts singular semantics for 87\% of training items and 74\% of test items from plural semantics. We conclude that FRACSS is not intrinsically asymmetric. There are also some technical issues worth mentioning. First, updating FRACSS matrices is more costly than updating the CosClassAvg model. Introducing new word pairs, or even a single pair, to the training dataset necessitates re-computation of the whole FRACSS network. For CosClassAvg, a new word pair merely requires re-calibration of the average shift vector for the semantic class of the pertinent lexeme. Second, FRACSS requires large numbers of parameters: given vectors of dimension $n$, it requires a mapping with $n^2$ parameters (which can be conceptualized as the beta weights of a multivariate multiple regression model). For the present word2vec vectors, we have no less than 300 $\times$ 300 = 90,000 parameters. As our current dataset has more than 11,000 datapoints, we have more data than parameters, and FRACSS works just fine. However, when the number of datapoints is substantially less than the number of parameters, the FRACSS approach will overfit the data, and not generalize well. For example, in the study of \cite{Lazaridou:Marelli:Zamparelli:Baroni:2013}, 12 out of 18 affixes have fewer than 350 words (training samples), whereas the semantic vectors used had a dimensionality equal to 350. Likewise, 27 out of 34 affixes studied by \cite{Marelli:Baroni:2015} are trained on fewer observations than their vectors' dimensionality. To avoid the problem of overfitting, one could model the complete set of derivational affixes of English with one FRACSS mapping. Under the assumption that the number of derived words is substantially larger than the dimensionality squared of the embeddings, the model should show good generalization performance. However, even though data sparsity would no longer be a problem, the model would not be very informative about the semantics of the different affixes. In the light of these considerations, we consider how well the two models for conceptualizing plurals, FRACSS and CosClassAvg, perform when integrated into a model of morphology that addresses the mappings between form and meaning, the Discriminative Lexicon (DL) model proposed by \citep{Baayen:Chuang:Shafaei:Blevins:2019}. \section{Conceptualization and the mapping from form to meaning} \label{sec:ldl} Up till now, we have considered how the meanings of singulars and plurals are related to each other, and we have considered two alternative mathematical formalizations of how to conceptualize a plural given a singular. Both formalizations provide an account of the semantic productivity of pluralization. However, for understanding or producing actual words, we need to consider mappings between form and meaning. In the ensuing paragraphs, we focus on comprehension, and investigate which of the two formalizations provides semantic vectors that are better aligned with words' forms. An initial question is whether words' form representations make systematic contact with the semantic vectors of CosClassAvg and FRACSS. If there exists systematicity between the form space and these semantic spaces, it should be possible to find accurate mappings from forms to meanings, not only for training data, but also for held-out test data. \subsection{Comprehension with FRACSS and CosClassAvg} We model comprehension with the discriminative lexicon model of \cite{Baayen:Chuang:Shafaei:Blevins:2019}. This model makes use of linear mappings from numeric representations of words' forms to numeric representations of words' meanings. The DL model is well-suited for our purposes as it has been shown to be successful in modeling comprehension of morphologically complex words for various languages \citep{Chuang:Loo:Blevins:Baayen:2020, Heitmeier:Chuang:Baayen:2021, Denistia:Baayen:2022, Heitmeier:Baayen:2020} and, importantly, because it is flexible in terms of which semantic space is selected to represent words' meanings. Keeping form representations and the representations for singular meanings the same, meaning representations for plurals can be created according to CosClassAvg, or alternatively, according to FRACSS. For our modeling experiments, we extracted all singular and plural tokens from the vocabulary dataset introduced in section \ref{sec:data}. This subset comprises 9541 English singular and plural tokens of 8762 unique orthographic word-form types. There are more tokens than types because 728 words have two or more pronunciations in the NewsScape English Corpus. We constructed training data and test data in such a way that plurals in the test data always had the corresponding singular in the training data. The training data also included plural forms that do not have a corresponding singular in the dataset. Of all plurals with corresponding singulars, 70\% were assigned to the training data, and 30\% to the testing data. This resulted in training data comprising 8,507 tokens of 7,886 types, and test data comprising 1034 tokens of 1002 types. Table~\ref{tab:ldl-modeling-data} provides further information on the composition of the training and test sets. \begin{table}[ht] \begin{center} \begin{minipage}{275pt} \caption{Number of word-form types and tokens in the datasets used for the DL simulations.}\label{tab:ldl-modeling-data}% \begin{tabular}{@{}lrrr@{}} \toprule Dataset & Word-form Types & Word-form Tokens \\ \midrule \textsc{Training set}\\ \hspace{7mm}Singular & 5073 & 5511 \\ \hspace{7mm}Plural with seen stem & 2253 & 2412 \\ \hspace{7mm}Plural with unseen stem & 560 & 584 \\ \textsc{Test set}\\ \hspace{7mm}Plural with seen stem & 1002 & 1034 \\ \botrule \end{tabular} \end{minipage} \end{center} \end{table} \cite{Heitmeier:Chuang:Baayen:2021} discuss several methods with which numeric representations for word forms can constructed. In the present study, we make use of numeric form vectors that are based on triphones, i.e., context-sensitive phone units that include information about neighboring segments. For the word \textit{cities}, the triphone cues are \texttt{\#s\textsci}, \texttt{s\textsci t}, \texttt{\textsci ti}, \texttt{tiz}, and \texttt{iz\#}, where the \texttt{\#} symbol is used to denote word boundaries. For our dataset, there are 6,375 unique triphones. A word's form vector is defined as a vector with length 6,375 that has values that are either zero or one, depending on whether a triphone is present in a word (1) or not (0). Words' form vectors can be brought together in a matrix $\bm{C}$ with words on rows and triphones on columns \citep[For form vectors derived from the audio signal, see][]{Shafaei:Tari:Uhrig:Baayen:2021}. As a result, the matrix with word form vectors $\bm{C}$ used for deriving mappings from form to meaning had 8,507 rows and 6,375 columns. The form vectors for words are based on the phone transcriptions in the NewsScape English Corpus, which are obtained from the Gentle forced aligner. Gentle’s ASR backend is kaldi \citep{Povey:etal:2011:Kaldi}, which is set up to run with a version of the CMUDict machine-readable pronunciation dictionary (\url{https://github.com/cmusphinx/cmudict}), but with information on stress removed. For various words, the dictionary offers pronunciation variants, such as \texttt{d\_B ae\_I t\_I ah\_E} and \texttt{d\_B ey\_I t\_I ah\_E} for \textit{data}. Here, CMUDict combines ARPABET phone representations with additional information on whether a segment is at the beginning of a word, at an intermediate position, or at the end of a word (\texttt{B}, \texttt{I}, and \texttt{E} respectively). We note here that the list of pronunciation variants provided by CMUDict is far from complete. For instance, for \textit{ideology}, it provides the transcription /a\textsci di\textscripta l\textturnv d\textyogh i/ but not the alternative /idi\textscripta l\textturnv d\textyogh i/. Various reduced forms of function words as typically found in spoken language are not represented in the dictionary. For instance, the conjunction \textit{and} is listed with two variants, /\ae nd/ and /\textturnv nd/, but forms such as /\textturnv n/ or even /n/ are not included. As a consequence, the representations we used for words' forms may not correspond to the exact way in which these words were actually spoken. For evaluating the advantages and disadvantages of semantic vectors based on CosClassAvg and FRACSS, we set up two semantic matrices, $\bm{S}_{\text{\tiny{CosClassAvg}}}$ and $\bm{S}_{\text{\tiny{FRACSS}}}$ that were based on word2vec. The vectors for singulars were straightforwardly taken from word2vec, but the vectors for plurals were calculated either according to CosClassAvg or according to FRACSS. The two semantic matrices had 8,507 rows and 300 columns. We then calculated two 6,375$\times$300 mappings, $\bm{F}_{\text{\tiny{CosClassAvg}}}$ and $\bm{F}_{\text{\tiny{FRACSS}}}$, by solving the equations \begin{eqnarray*} \bm{S}_{\text{\tiny{CosClassAvg}}} & = & \bm{C}\bm{F}_{\text{\tiny{CosClassAvg}}} \\ \bm{S}_{\text{\tiny{FRACSS}}} & = & \bm{C}\bm{F}_{\text{\tiny{FRACSS}}}. \end{eqnarray*} With these the two mappings, we obtained two sets of predicted semantic vectors for the training data: \begin{eqnarray*} \hat{\bm{S}}_{\text{\tiny{CosClassAvg}}} & = & \bm{C}\bm{F}_{\text{\tiny{CosClassAvg}}} \\ \hat{\bm{S}}_{\text{\tiny{FRACSS}}} & = & \bm{C}\bm{F}_{\text{\tiny{FRACSS}}}. \end{eqnarray*} Given the form vectors of the held-out plurals, which we collect as the row vectors of a form matrix $\bm{C}_{\text{\tiny{test}}}$, we also obtain two matrices with predicted plurals: \begin{eqnarray*} \hat{\bm{S}}_{\text{\tiny{CosClassAvg}}, \text{\tiny{test}}} & = & \bm{C}{\text{\tiny{test}}}\bm{F}_{\text{\tiny{CosClassAvg}}} \\ \hat{\bm{S}}_{\text{\tiny{FRACSS}},\text{\tiny{test}} } & = & \bm{C}{\text{\tiny{test}}}\bm{F}_{\text{\tiny{FRACSS}}}. \end{eqnarray*} Prediction accuracy was evaluated by inspecting which gold-standard row vector is closest to the corresponding predicted semantic vector in terms of Pearson's correlation coefficient. If these vectors belong to the same word (i.e., they have the same row index), prediction is taken to be accurate. In the same way, we can check whether the gold-standard vector is among the top $n$ nearest semantic neighbors. Making a prediction for a given test token always involves choosing among 7,886 $+$ 1 different semantic vectors---the semantic vectors for the word types in the training set plus the semantic vector for the current test word. Henceforth, we will refer to the DL model with FRACSS vectors as DL-FRACSS and the model with CosClassAvg embeddings as DL-CosClassAvg. Fig.~\ref{fig:ldl-top5-accuracy} presents the top 1 to top 5 accuracy of word recognition evaluated on the training set in dark bars and on the test set in light bars. Recognition accuracy on the training set by both models is 96\% for models' top 1 predictions and increases to almost 100\% as we consider top 2 to top 5 predicted words. With respect to the test data, DL-CosClassAvg outperforms DL-FRACCS by a wide margin in terms of accuracy (top 1)\footnote{The median correlation between the predicted semantic vectors and the target semantic vector is larger for the DL-CosClassAvg model compared to DL-FRACSS ($W=214575.0$, $p < 0.0001$, $\mathrm{MD}_{\text{DL-CosClassAvg}}=0.78$, $\mathrm{MD}_{\text{DL-FRACSS}}=0.77$, $N=1034$). }, whereas DL-FRACSS has slightly better performance when the top 2 or top 3 candidates are considered. \begin{figure} \centering \includegraphics[width=0.95\textwidth]{ldl-top5-accuracy-both-models-notsplit.png} \caption{Accuracy of word recognition (\%) on the training set ($N=8507$) and on the test set ($N=1034$) by DL-CosClassAvg on the left panel and by DL-FRACSS on the right panel.} \label{fig:ldl-top5-accuracy} \end{figure} Recall that our dataset contains words with multiple pronunciations. The random selection for inclusion in the held-out dataset of seen-stem plural words may result in either having no instances of the plural word in the training set (e.g., both pronunciations recorded for \textit{reports} occur in the test set), or having one pronunciation in the training data and another pronunciation in the test set (e.g., \textit{results} is trained on /\textturnr \textsci z\textturnv lts/ and tested on /\textturnr iz\textturnv lts/). DL-CosClassAvg recognizes at least one instance of a word in the test set correctly for 63\% of words with multiple pronunciations ($N=155$). DL-FRACSS performs slightly worse at 46\%. Fig.~\ref{fig:ldl-top1-accuracy-train-categories} summarizes model accuracy for the training data. DL-FRACSS is slightly better at recognizing singulars, whereas DL-CosClassAvg performs slightly better for plurals with unseen stems. \begin{figure} \centering \includegraphics[width=0.7\textwidth]{ldl-top1-accuracy-train-categories-both-models-side.png} \caption{Recognition accuracy on the training set for the singular words, the plural words with a corresponding singular in the training set (seen-stem), and the plural words without a singular in the training set (unseen-stem) by DL-CosClassAvg shown in dark green bars and by DL-FRACSS in light green bars.} \label{fig:ldl-top1-accuracy-train-categories} \end{figure} We also examined the kind of errors made by the DL mappings for the words in the test data. Overall, DL-FRACSS makes 726 errors in the evaluation of the test set, and DL-CosClassAvg 501 errors. There are 439 word tokens that both models fail to predict correctly. We distinguished between three types of errors, tabulated in Fig.~\ref{fig:ldl-errors}. First, many seen-stem plural words of the test set are recognized as their singular word. FRACSS tends to make more errors of this sort, for which both models frequently get the plural word as their second-best guess, and they always find the plural word among their first four guesses. Highly-ranked competitors tend to be synonyms or semantically related words. \begin{figure} \centering \includegraphics[width=0.7\textwidth]{ldl-errors.png} \caption{Different types of errors made by the DL-CosClassAvg ($N=501$) and the DL-FRACSS ($N=726$) model on the test set with 1034 tokens.} \label{fig:ldl-errors} \end{figure} Most of the remaining errors are observed for words with similar forms. To assess this quantitatively, we computed the recall and the overlap indices between the set of target triphones $t$ and the set of predicted triphones $p$ as follows: \begin{align*} \text{recall } (t, p) &= \frac{\lvert t \cap p\rvert}{\lvert p\rvert},\\ \text{overlap } (t, p) &= \frac{\lvert t \cap p\rvert}{\min (\lvert t \rvert, \lvert p\rvert)}.\\ \end{align*} For example, the word \textit{bribes} is recognized as \textit{tribes} by both models. The predicted and the target word share many form features with a recall and an overlap index of 0.6. We classified words as `similar sounding' when the overlap index was greater than 0.3 and the recall index was greater than 0.2. The remaining words were assigned to the `other' class. The set of words for which a similar-sounding error was made by DL-FRACSS is a subset of that of DL-CosClassAvg. The two models are in error for the same 33 words assigned to the `other' category. \subsection{Discussion} Both CosClassAvg and FRACSS generate high-quality plural vectors. FRACSS plurals are somewhat better aligned with respect to angle, whereas CosClassAvg plurals are better positioned in terms of length. We used the DL model to assess whether FRACSS or CosClassAvg vectors are closer aligned with words' forms. On training data, both models have very similar performance. On held-out test data, CosClassAvg is more accurate. We take this as evidence that plural vectors generated by CosClassAvg are better aligned with the corresponding plural forms. \section{General Discussion}\label{sec:general-discussion} Using distributional semantics, visualization with t-SNE, and WordNet, we have documented for nearly 15,000 pairs of English singulars and their corresponding plurals that how plural semantics is realized in semantic space varies with the semantic class of the base word. Instead of there being one universal shift from singulars to plurals in distributional space, the direction and length of shift vectors depends on a lexeme's own semantics. As a consequence, shift vectors for fruits are substantially different from shift vectors for instruments. We proposed the CosClassAvg model to account for the conceptualization of a plural given the singular. This model proposes that an empirical plural vector is the sum of four vectors: the vector of the lexeme, the shift vector appropriate for its semantic class, a lexeme-specific vector representing the lexeme's own lexical properties, and an error vector representing measurement noise. We showed that CosClassAvg provides more precise approximations of plural vectors than a model based on a general average shift vector (3CosAvg). We compared the CosClassAvg model with the FRACSS model \citep{Marelli:Baroni:2015}. The FRACSS model also takes the semantic vector of the singular as input, but makes use of matrix multiplication instead of vector addition to calculate the semantic vector of the plural. The FRACSS model generates plural vectors that are closer to the target plural vectors. However, the plural vectors produced by FRACSS are shorter than the target plural vectors. To better understand the merits of the two models, we also considered how well the FRACSS plural vectors and the CosClassAvg vectors are aligned with words' form vectors. We evaluated the quality of the alignment with the Discriminative Lexicon model \citep{Baayen:Chuang:Shafaei:Blevins:2019}, focusing on its comprehension network. We created form vectors by first collecting all possible triphones and then specified, for a given word, in a high-dimensional binary vector, which triphones are present (1) in that word and which are absent (0). We created two mappings from form vectors to semantic vectors, one for semantic vectors that use FRACSS to generate plural vectors, and a second mapping for semantic vectors that use CosClassAvg to produce plural vectors. For training data, both types of vectors allowed highly accurate mappings to be set up. However, for the held-out test data, plural vectors could be predicted with substantially higher accuracy when plural vectors were created using CosClassAvg. This suggests that plural vectors created with CosClassAvg are better aligned with plurals' forms compared to vectors generated with FRACSS. CosClassAvg offers two advantages compared to FRACSS. First, FRACSS models run the risk of overparameterization, especially for small datasets with numbers of observations that are substantially smaller than the square of the dimension of the semantic vectors. Second, the FRACSS matrix operation seems to suggest that pluralization is a unitary operation, represented by one transformation matrix. However, what this model is actually doing is to capture, within one highly-parameterized mapping operation, a wide range of different ways in which plurals are realized, depending on the semantic class of their lexemes. For comparison, one can set up a single FRACSS model for all bi-morphemic suffixed derived words of English, with high accuracy on both training and test data (see the supplementary materials for further details). However, the different derivational suffixes of English serve different semantic goals, which emerge immediately from a t-SNE visualization. Thus, being able to obtain a high-quality mapping between singulars and plurals does not guarantee that the same semantic operation is governing all transitions from singulars to their plurals in semantic space. This conclusion has important consequences for the principle of semantic compositionality \citep{Pelletier2001} as applied to morphology. According to this principle, the meaning of a plural is determined by the meaning of the singular and the meaning of the plural suffix, or the meaning that is realized by the rule that creates plurals from singulars. As we have seen, a general shift vector that is the same for all lexemes (as formalized by the 3CosAvg method) has some value, but fails to have the required precision. FRACSS does not provide a uniform pluralization operation either, as, thanks to its large numbers of parameters, it can wrap itself around the many individual clusters of shift vectors that are characteristic of a large number of specific semantic classes. It is, of course, possible to adjust the CosClassAvg model $$ \bm{v}_{\text{pl}} = \bm{v}_{\text{sg}} + \bm{v}_{\textsc{pl} \mid \text{semantic class}} + \bm{\epsilon}_\text{lexeme} + \bm{\epsilon} $$ by subtracting the average plural vector $\bar{\bm{v}}$ from all class-specific vectors: $$ \bm{v}_{\text{pl}} = \bm{v}_{\text{sg}} + \bar{\bm{v}} + [\bm{v}_{\textsc{pl} \mid \text{semantic class}} - \bar{\bm{v}}] + \bm{\epsilon}_\text{lexeme} + \bm{\epsilon}. $$ This formulation of CosClassAvg isolates what is common to all plurals. Unfortunately, this common core is a shift vector that is located far outside the cluster of actual shift vectors (see Fig. \ref{fig:scatter-r-theta-shift}), and hence it remains unclear what is gained by incorporating it into the CosClassAvg model. As a consequence, it is also unclear in what sense English plurals are `compositional' in the sense of, e.g., \cite{Pelletier:1994}. At the same time, the present findings dovetail well with the insight from usage-based grammar and corpus linguistics that individual words, including inflected words, often have their own highly specific usage profiles \citep[see, e.g.,][]{Sinclair:1991}. Noun pluralization has been characterized as being rather close to derivation: \cite{Booij:1996} characterizes it as inherent inflection, rather than contextual inflection. It remains an issue for further research to clarify whether the present conclusions for nominal pluralization generalize to contextual inflection. Agreement marking on English simple present verbs makes for an interesting case to pursue in parallel with the present results on nominal plurals. We conclude this study of the semantics of English noun pluralization by placing English in a broader cross-linguistic perspective. Many languages have rules that are sensitive to semantic subsets of nouns. Some languages split nouns into a group for which plurality marking is relevant, and a group for which it is irrelevant. Typically, such splits are made along an animacy hierarchy, from kinship nouns at the highest rank, to human nouns, to (higher and lower) animate nouns, to inanimate nouns at the lowest rank \citep{Corbett:2000:Number}. In Slave, an Athabaskan language in Northwest Territories, Canada, plural marking occurs optionally only for human nouns and dogs \citep{Rice:1989:Slave}. The World Atlas of Language Structures documents 60 other languages that have an optional or obligatory plural marking for human nouns and lack a plural for nouns further down the animacy hierarchy \citep{WALS:34-Haspelmath:2013}. In Persian, subject-verb agreement in person and number coded on the verb is obligatory for animate plural nouns but optional for inanimate ones \citep[][p.~145]{Mahootian:2002:Persian}. \cite{Smith-Stark:1974} reports a similar rule in Georgian. Maori provides a case where number marking is obligatory only for kinship nouns such as \textit{matua} `parent' and \textit{teina} `younger sibling' \citep{Bauer:1993:Maori}. Kiowa, an endangered Tanoan language spoken in Oklahoma, exhibits a strong relationship between semantically coherent noun classes and number agreement behavior. Table~\ref{tab:kiowa-noun-classes} summarizes the nine classes distinguished by \cite{Harbour:2011, Harbour:2008:MorphosemanticNumber}, on the basis of which he argues for a \textit{morphosemantic theory} of number. Bantu languages are known for their large numbers of semantically motivated noun classes \citep[see, e.g.,][for Swahili]{polome1967swahili}. \begin{table}[ht] \begin{center} \begin{minipage}{250pt} \caption{Kiowa noun classes based on \cite{Harbour:2011, Harbour:2008:MorphosemanticNumber}} \label{tab:kiowa-noun-classes}% \begin{tabular}{@{}clll@{}} \toprule Class & Semantic characteristics & Example \\ \midrule 1 & First person only & `I' \\ 2 & Animates & `boy', `bird' \\ & and independently mobile inanimates & `leg', `moon' \\ 3 & Default for vegetation & `grass' \\ & and implements & `pencil' \\ 4 & Vegetation forming natural collections & `tree' \\ & and implements that act collectively & `ember' \\ % 5 & Hair types & `eyelash' \\ & and midsize fruit growing in clusters & `tomato' \\ 6 & Individuable objects & `river' \\ 7 & Non-granular mass nouns & `water' \\ 8 & Pluralia tantum nouns, & `trousers' \\ & composite nouns & `necklace' \\ & and granular mass nouns & `rice' \\ 9 & Default & `shoe' \\ \botrule \end{tabular} \end{minipage} \end{center} \end{table} English has in few instances grammaticalized the diverse ways in which our minds perceive and structure the objects and ideas in the world with which we interact. For English nouns, the distinction between mass and count nouns comes to mind. Additionally, a major part of present-day English count nouns that never or occasionally take the suffix \textit{-s} in their plural form are animal nouns that are hunted (e.g., \textit{duck}, \textit{woodcock}, and \textit{elk}) or fished (\textit{salmon} and \textit{crab}) \citep[see][for lexemes other than animal names]{Quirk:etal:85} \citep[see][for an extended list of 85 animal nouns]{Toupin:2015}. We kept the stimuli in the present study simple and consistent by focusing on regular singular and plural forms. Further research is required that investigates varieties of plurals including irregular plurals (e.g., \textit{man} $\sim$ \textit{men}), zero plurals (\textit{fish} $\sim$ \textit{fish}), pluralia tantum (\textit{scissors} with no singular variant), singularia tantum (\textit{wealth} with no plural variant), or sense-specific plural formations (\textit{mouse} $\sim$ \textit{mice} for rodents and \textit{mouse} $\sim$ \textit{mouses} for computer input devices; \citealp{Acquaviva:2008:LexicalPlurals}). Many other languages reflect in their grammars a variety of ways in which nouns are perceived to cluster semantically. Whereas semantic differentiation in the nominal system is explicitly grammaticalized in these languages, semantic noun classes also play a role in the grammar of English, albeit mainly implicitly. By combining distributional semantics, WordNet, and t-SNE visualization, we have been able to detect that semantic noun clusters also structure English language use. \section*{Declarations} \subsection*{Funding} This research was funded by the European Research Council under the ERC grant number 742545, Project WIDE, awarded to the last author. The data processing of the NewsScape corpus was funded by the Competence Network for Scientific High Performance Computing in Bavaria to the third author. \subsection*{Conflict of interest/Competing interests} No potential conflict of interest was reported by the authors. \subsection*{Authors' contributions} E. S-B was responsible for data collection, analysis, interpretation, and wrote the first draft of the manuscript. M. M-T contributed to the~ data collection, analyses, and interpretation. P. U assembled the auditory resources, and contributed to data collection, interpretation, and writing. R. H. B contributed to the research planning, data analysis, interpretation, and writing. \noindent
4f31c1038cee3db58385118e6c6bb4813da31eab
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\subsection{Visual Grounding} The visual grounding methods can be categorized into two-stage methods and one-stage methods. \textbf{Two-stage methods} divide the visual grounding process into two steps: generation and ranking. Specifically, a module such as selective search~\cite{uijlings2013selective}, region proposal network~\cite{ren2015faster}, or pre-trained detector~\cite{girshick2014rich,girshick2015fast,ren2015faster} is firstly used to generate proposals that contain objects. Then a multimodal ranking network will measure the similarity between the query sentence and proposals and select the best matching result. Early works~\cite{rohrbach2016grounding,mao2016generation,hu2016natural} only consider sentence-region level similarity. \citet{yu2018mattnet} decompose the query sentence and image into three modular components related to the subject, location, and relationship to model fine-grained similarity. Several studies~\cite{bajaj2019g3raphground,yang2019dynamic,yang2020graph,mu2021disentangled} incorporate graph learning to better model cross-modal alignment. The more related work to ours is Ref-NMS~\cite{chen2021ref}, which uses the query feature to guide the Non-Maximum Suppression on region proposals to increase the recall of critical objects. However, Ref-NMS~\cite{chen2021ref} can only be integrated into two-stage methods. Moreover, it cannot affect the visual backbone in feature extraction and proposal generation. \textbf{One-stage methods} extract visual feature maps that maintain the spatial structure and perform cross-modal interaction at pixel level. The fused feature maps are further used to predict bounding boxes. \citet{yang2019fast} use a Darknet~\cite{redmon2018yolov3} to extract feature maps and broadcast the query embedding to each spatial location. Several recent works~\cite{liao2020real,yang2020improving,ye2021one} regard multimodal interaction as a multi-step reasoning process to better understand the input query. \citet{huang2021look} extract landmark features with the guidance of a linguistic description. The more recent work TransVG~\cite{deng2021transvg} incorporates DETR encoder to extract visual features and proposes a transformer-based visual grounding framework. \citet{kamath2021mdetr} model the visual grounding as a modulated detection task and propose a novel framework MDETR derived from the DETR detector. \subsection{Transformer-based Visual Backbones} \citet{dosovitskiy2021an} propose to extract image features by applying a pure Transformer architecture on image patches. This method is called Vision Transformer (ViT) and achieves excellent results compared to state-of-the-art convolutional networks. \citet{pmlr-v139-touvron21a} introduce improved training strategies to train a data-efficient ViT. \citet{yuan2021tokens} propose a Tokens-to-Token transformation to obtain a global representation and a deep-narrow structure to improve the efficiency. Some recent works~\cite{chu2021we,han2021transformer} modify the ViT architecture for better performance. \citet{liu2021Swin} present a novel hierarchical ViT called Swin Transformer. It computes the representation with shifted windowing scheme to allow for cross-window connection. Due to the fixed window size, the architecture has linear computational complexity with respect to image size. \subsection{Multimodal Interaction} In early studies, multimodal systems use simple interaction methods such as concatenation, element-wise product, summation, and multilayer perception to learn the interaction~\cite{zadeh2017tensor,baltruvsaitis2018multimodal}. \citet{fukui2016multimodal} introduce a compact bilinear pooling to learn a more complex interaction. \citet{arevalo2017gated} present a gated unit that can learn to decide how modalities influence the activation. \cite{nguyen2018improved,nagrani2021attention} use the cross-attention mechanism to enable dense, bi-directional interactions between the visual and textual modalities. \citet{NIPS2017_6fab6e3a} introduce Conditional Batch Normalization at channel-level to modulate visual feature maps by a linguistic embedding. \citet{vaezi20mmtm} use squeeze and excitation operations to fuse the multimodal features and recalibrate the channel-wise visual features. There are also methods~\cite{zadeh2017tensor,baltruvsaitis2018multimodal,arevalo2017gated,vaezi20mmtm,NIPS2017_6fab6e3a} that only perform interaction at channel-level. However, spatial-level information is also important to some downstream tasks, e.g., visual grounding and visual commonsense reasoning. Other methods~\cite{fukui2016multimodal,nguyen2018improved,nagrani2021attention} maintain the spatial structure to perform interaction but have a high computational cost. \subsection{Visual Grounding} The visual grounding methods can be categorized into two-stage methods and one-stage methods. \textbf{Two-stage methods} divide the visual grounding process into two steps: generation and ranking. Specifically, a module such as selective search~\cite{uijlings2013selective}, Edge-box~\cite{zitnick2014edge}, Region Proposal Network, or pre-trained detector~\cite{girshick2014rich,girshick2015fast,ren2015faster} will generate proposals that contain objects. Then a multimodal ranking network will measure the similarity between the query sentence and proposals and select the best matching. Early works~\cite{rohrbach2016grounding,mao2016generation,hu2016natural} only considered sentence-region level similarity. \citet{yu2018mattnet} decomposed the query sentence and image into three modular components related to subject, location, and relationship to models fine-grained similarity. Several studies~\cite{bajaj2019g3raphground,yang2019dynamic,yang2020graph,mu2021disentangled} incorporated graph learning to better model cross-modal alignment. \citet{chen2021ref} proposed Ref-NMS to use the query feature to guide the Non-Maximum Suppression to increase the recall of critical objects. \textbf{One-stage methods} extract visual feature maps that maintaining the spatial structure and perform cross-modal interaction at pixel-level. The fused feature maps are further used to predict bounding boxes. \citet{yang2019fast} used a darknet\cite{redmon2018yolov3} to extract feature maps and broadcast the query embedding to each spatial location. Several works~\cite{liao2020real,yang2020improving,ye2021one} regarded multimodal interaction as a multiple step reasoning process to better understand the input query. \citet{huang2021look} extracted landmark feature with the guidance of linguistic description. The recent work TransVG~\cite{deng2021transvg} incorporated DETR encoder to extract visual features and proposed a transformer-based visual grounding framework. \citet{kamath2021mdetr} modeled the visual grounding as a modulated detection task and proposed a novel framework MDETR derived from the DETR detector. The most similar work to ours is Ref-NMS~\cite{chen2021ref} and MDETR~\cite{kamath2021mdetr}. However, Ref-NMS~\cite{chen2021ref} can only be integrated into two-stage methods. Moreover, it can not affect proposal generation and feature extraction. MDETR~\cite{kamath2021mdetr} requires 1.3M text-image pairs with explicit alignment annotation to train from scratch instead of initializing from the pre-trained DETR. In contrast, our MMSwin\ \ can be trained end-to-end and does not need multimodal pretraining. \subsection{Transformer based Visual Backbones} \citet{dosovitskiy2021an} proposed to extract image features by applying a pure Transformer architecture on image patches. The method achieves excellent results compared to state-of-the-art convolutional networks. These transformer-based visual backbones are called Vision Transformer (ViT). \citet{pmlr-v139-touvron21a} introduced training strategies to train a data-efficient ViT. \citet{yuan2021tokens} proposed a Tokens-to-Token transformation to obtain a global representation and a deep-narrow structure to improve its efficiency. Some works~\cite{chu2021we,han2021transformer} modified the ViT architecture for better performance. \citet{liu2021Swin} presented a novel hierarchical ViT called Swin Transformer. It computes the representation with shifted windowing scheme to allow for cross-window connection. Due to the fixed window size, the architecture has linear computational complexity with respect to image size. \subsection{Multimodal Interaction} In early studies, multimodal systems used simple interaction methods such as concatenation, element-wise product or summation, and fed to multilayer perception to learn the interaction~\cite{zadeh2017tensor,baltruvsaitis2018multimodal}. \citet{fukui2016multimodal} introduced a compact bilinear pooling to learn a more complex interaction. \citet{arevalo2017gated} presented a gated unit that can learn to decide how modalities influence the activation. \citet{nguyen2018improved,nagrani2021attention} used the cross-attention mechanism to enable dense, bi-directional interactions between the visual and textual modalities. \citet{NIPS2017_6fab6e3a} introduced Conditional Batch Normalization at channel-level to modulate visual feature maps by a linguistic embedding. \citet{vaezi20mmtm} used squeeze and excitation operations to fuse the multimodal features and recalibrate the channel-wise visual features. Some of these methods\cite{zadeh2017tensor,baltruvsaitis2018multimodal,arevalo2017gated,vaezi20mmtm,NIPS2017_6fab6e3a} only perform interaction at channel-level. However, spatial-level information is important to some downstream tasks, e.g., visual grounding and visual commonsense reasoning. The other methods~\cite{fukui2016multimodal,nguyen2018improved,nagrani2021attention} maintain the spatial structure to perform interaction but have a high computational cost. Moreover, these methods lead to uncertain feature spaces after their interactions, which is harmful to plug into the pre-trained networks. \subsection{Architecture} \begin{figure*}[htb] \includegraphics[width=1\textwidth]{figs/overview_2_cropped.pdf} \caption{(a) The QRNet-based visual grounding framework used in this paper. (b) An overview of our Query-modulated Refinement Network. (c) Illustration of Query-aware Dynamic Attention.} \label{fig:model} \end{figure*} In this section, we first formulate the visual grounding task and then present the architecture of the adopted framework. Visual grounding task aims at grounding a query onto a region of an image. The query refers to an object in the image and can be a sentence or a phrase. It can be formulated as: given an image $I$ and a query $q$, the model needs to predict a bounding box $\mathbf{b}=\{x,y,w,h\}$ which exactly contains the target object expressed by the query. As shown in \Cref{fig:model} (a), our framework is designed based on a typical end-to-end visual grounding architecture TransVG~\cite{deng2021transvg}\footnote{https://github.com/djiajunustc/TransVG}. Given an image and a query sentence, there is a linguistic backbone, typically a pre-trained BERT model, extracting a sequence of 1D feature $\mathbf{T}\in \mathbb{R}^{D_l\times N_l}$. For the visual backbone, we adopt a new Query-modulated Refinement Network\ (described in \Cref{sec:network}) to extract a flattened sequence of visual feature $\mathbf{V} \in \mathbb{R}^{D_v\times N_v}$. The major difference between the proposed Query-modulated Refinement Network\ and existing visual backbones is that we take the contextual textual feature from the linguistic backbone to guide the feature extraction and multiscale fusion with the help of Query-aware Dynamic Attention\ (described in \Cref{sec:QDA}). Two projection layers map the visual and linguistic features into the same feature space $\mathbb{R}^{D}$. The projected visual and linguistic features are denoted by $\mathbf{p}_v\in \mathbb{R}^{D\times N_v}$ and $\mathbf{p}_l\in \mathbb{R}^{D\times N_l}$. Then $\mathbf{p}_v$ and $\mathbf{p}_l$ are concatenated by inserting a learnable embedding (i.e., a [REG] token) at the beginning of the concatenated sequence. The joint sequence is formulated as: \begin{equation} \begin{aligned} \boldsymbol{X}=[\mathbf{p}_{r}, \underbrace{\mathbf{p}_{v}^{1}, \mathbf{p}_{v}^{2}, \cdots, \mathbf{p}_{v}^{N_{v}}}_{\text {visual tokens } \boldsymbol{p}_{v}}, \underbrace{\mathbf{p}_{l}^{c}, \mathbf{p}_{l}^{1}, \cdots, \mathbf{p}_{l}^{N_{l}}}_{\text {linguistic tokens } \boldsymbol{p}_{l}}], \end{aligned} \end{equation} where $\mathbf{p}_r$ is the learnable embedding of [REG] token. $\mathbf{p}_l^c$ is the [CLS] token's representation which is regarded as the contextual textual feature. Next, a multi-layer visual-linguistic transformer is applied to perform intra- and inter-modal reasoning on the joint sequence. Finally, a prediction head takes the output representation of the [REG] token to predict the bounding box coordinates $\mathbf{b}$. The smooth L1 loss~\cite{girshick2015fast} and giou loss~\cite{rezatofighi2019generalized} are used to train the framework. The training objective can be formulated as: \begin{equation} \begin{aligned} \mathcal{L}=\mathcal{L}_{smooth-l1}{(\mathbf{b},\mathbf{\hat{b}})}+\mathcal{L}_{giou}{(\mathbf{b},\mathbf{\hat{b}})}, \end{aligned} \end{equation} where $\mathbf{\hat{b}}$ is the ground-truth box. \subsection{Query-modulated Refinement Network} \label{sec:network} In this section, we introduce the proposed visual backbone of Query-modulated Refinement Network\ (MMSwin\ ). An overview of the network is shown in \Cref{fig:model} (b). The network consists of two phases: (1) Query-refined Feature Extraction for extracting query-refined visual feature maps with a hierarchical structure, (2) Query-aware Multiscale Fusion for fusing the extracted feature maps at different scales with the guidance of the query feature. The two phases both rely on a novel Query-aware Dynamic Attention (QD-ATT), which dynamically computes textual-dependent visual attentions at spatial and channel levels, to enable to compute features with query guidance. In the following, we will first introduce the implementation of the Query-aware Dynamic Attention. Then we detail the Query-refined Feature Extraction and Multiscale Fusion. \subsubsection{Query-aware Dynamic Attention} \label{sec:QDA} Now, we will describe the details of our Query-aware Dynamic Attention (shown in \cref{fig:model}(c)). We first introduce the dynamic linear layer, which learns a linear transformation that can be applied to the visual features to compute the query-aware attentions. Different from the conventional trainable linear layer, the parameters of the dynamic linear layer are generated dynamically based on textual features. Next, we will illustrate how to use the dynamic linear layer to compute query-aware channel and spatial attentions and obtain the query-consistent visual features. A pseudo-code is presented in the Appendix for better comprehension. \paragraph{Dynamic Linear Layer.} Existing visual backbones use modules with static parameters to compute the visual feature maps, where feeding in the same image will output the same feature maps. However, in visual grounding, different queries for a single image may reveal different semantic information and intentions, which require different visual features. We present a dynamic linear layer which can leverage the contextual textual feature $\mathbf{p}_l^c\in \mathbb{R}^{D_l}$ to guide the mapping from an given input vector $\mathbf{z}_{in}\in \mathbb{R}^{D^{in}}$ to the output $\mathbf{z}_{out}\in \mathbb{R}^{D^{out}}$. The dynamic linear layer is formalized as follow: \begin{equation} \begin{aligned} \mathbf{z}_{out}&=\mathrm{DyLinear}_{\mathcal{M}_l}(\mathbf{z}_{in})=\mathbf{W}_l^\intercal \mathbf{z}_{in}+\mathbf{b}_l \end{aligned} \end{equation} where $\mathcal{M}_l=\{\mathbf{W}_l,\mathbf{b}_l\},\,\mathbf{W}_l\in \mathbb{R}^{D^{in}\times D^{out}},\, \mathbf{b}_l\in \mathbb{R}^{D^{out}}$. $D^{in}$ and $D^{out}$ are the dimensions of input and output, respectively. We use a plain linear layer to generate the $\mathcal{M}_l$. The generator is denoted by $\mathcal{M}^{'}_l=\Psi(\mathbf{p}_l^c)$, where $\mathcal{M}^{'}_l\in\mathbb{R}^{(D^{in}+1)\ast D^{out}}$. In detail, we predict a $(D^{in}+1)*D^{out}$ vector which can be reshaped to $\mathcal{M}_l$. However, it is easy to find that the number of parameters in the generator, i.e., $D_l\ast ((D^{in}+1)\ast D^{out})$, is too large. Such large-scale parameters will slow down the speed of the network and make it easier to be overfitting. Inspired by matrix factorization, we consider decomposing the $\mathcal{M}_l$ into two factors $\mathbf{U}\in \mathbb{R}^{(D^{in}+1)\times K}$ and $\mathbf{S}\in \mathbb{R}^{K\times D^{out}}$, where $\mathbf{U}$ is a matrix generated from $\mathbf{p}_l^c$, $\mathbf{S}$ is a static learnable matrix, $K$ is a hyper-parameter denoting the factor dimension. The factor generator $\{\mathbf{W}_l,\mathbf{b}_l\}=\Psi^*(\mathbf{p}_l^c)$ can be formulated as follow: \begin{equation} \begin{aligned} & \mathbf{U}=\mathrm{Reshape}({\mathbf{W}_{g}}^\intercal \mathbf{p}_l^c+\mathbf{b}_{g}),\\ & \mathcal{M}_l=\mathbf{U}\mathbf{S},\\ & \{\mathbf{W}_l,\mathbf{b}_l\}= \mathrm{Split}(\mathcal{M}_l),\\ \end{aligned} \end{equation} where $\mathbf{W}_{g}\in \mathbb{R}^{D_l\times (D^{in}+1)\ast K}$ and $ \mathbf{b}_{g}\in \mathbb{R}^{(D^{in}+1)\ast K}$ are trainable parameters of the factor generator. The parameter matrix $\mathcal{M}_l$ of the dynamic linear layer can be reconstructed by multiplying $\mathbf{U}$ and $\mathbf{S}$. The $\mathbf{W}_l$ and $\mathbf{b}_l$ can be split from the matrix $\mathcal{M}_l$ along the first dimension. Finally, we reformulate the dynamic linear layer as follows: \begin{equation} \begin{aligned} \mathbf{z}_{out}&=\mathrm{DyLinear}_{\mathcal{M}_l}(\mathbf{z}_{in})=\mathrm{DyLinear}_{\Psi^*(\mathbf{p}_l^c)}(\mathbf{z}_{in}). \end{aligned} \end{equation} Unless otherwise specified, we use $\mathrm{DyLinear}(\mathbf{z}_{in})$ to represent a dynamic linear layer with $\mathbf{p}_l^c$ for simplify. And the different dynamic linear layers do not share parameters. When the input is a multidimensional tensor, the dynamic linear layer transforms the input at the last dimension. \paragraph{Channel and Spatial Attention.} As explained above, the pre-trained visual backbone is sensitive to all the objects it learned in the pre-training task. However, only the object which is referred to by the query text is useful. Besides, the features useful for the bounding box prediction highly depend on the semantics contained in the query sentence (e.g. entities, descriptions of attributes, and relationships). In other words, the importance of each channel or each region of the feature map should change dynamically according to the query sentence. Inspired by Convolutional Block Attention Module~\cite{woo2018cbam}, we consider inferring channel and spatial attentions, i.e., $\mathbf{A}^{cl}$ and $\mathbf{A}^{sl}$, along the separate dimensions of the feature map to obtain adaptively refined features for a better cross-modal alignment. Specifically, for a given visual feature map $\mathbf{F}\in \mathbb{R}^{H\times W\times D_v}$, we first aggregate its spatial information by average and maximum pooling and produce $\mathbf{F}^c_{max},\,\mathbf{F}^c_{mean}\in \mathbb{R}^{1\times 1\times D_v}$. Then, a dynamic multilayer perception consisting of two dynamic linear layers with a ReLU activation in the middle is built to process the pooled features. The output dimension is the same as the input dimension. To reduce the number of parameters, we set the dimension of multilayer perception's hidden states as $D_v/r$, where $r=16$ is a reduction ratio. By feeding the $\mathbf{F}^c_{max}$ and $\mathbf{F}^c_{mean}$ to the dynamic multilayer perception, a Sigmoid function is applied to the summation of the two output features. The channel attention map $\mathbf{A}^{cl}$ can be captured as follow: \begin{equation} \begin{aligned} \mathbf{F}^{cl}_{mean}&=\mathrm{DyLinear}_{1}(\mathrm{ReLU}(\mathrm{DyLinear}_{2}(\mathbf{F}^c_{mean}))\\ \mathbf{F}^{cl}_{max}&=\mathrm{DyLinear}_{1}(\mathrm{ReLU}(\mathrm{DyLinear}_{2}(\mathbf{F}^c_{max}))\\ \mathbf{A}^{cl}&=\mathrm{Sigmoid}(\mathbf{F}^{cl}_{mean}+\mathbf{F}^{cl}_{max}). \end{aligned} \end{equation} We perform element-wise multiplication between $\mathbf{F}$ and $\mathbf{A}^{cl}$ to form the channel-wise refined visual feature, where the $\mathbf{A}^{cl}$ is broadcast along the spatial dimension: \begin{equation} \begin{aligned} \mathbf{F}^{'}&=\mathbf{A}^{cl}\otimes \mathbf{F}. \end{aligned} \end{equation} To generate a spatial attention map, instead of squeezing the channel dimension, we leverage another dynamic linear layer to reduce the channel dimension to learn areas of interest to the query and apply an activation function Sigmoid to generate the attention map. In short, the computing process is formulated as follows: \begin{equation} \begin{aligned} \mathbf{A}^{sl}&=\mathrm{Sigmoid}(\mathrm{DyLinear}_{3}(\mathbf{F}^{'}))\\ \mathbf{F}^{''}&=\mathbf{A}^{sl}\otimes \mathbf{F}^{'} \end{aligned} \end{equation} where $\mathbf{A}^{sl}\in \mathbb{R}^{H\times W\times 1}$ is the spatial attention map and $\mathbf{F}^{''}$ is the spatially refined visual feature and also the output of our Query-aware Dynamic Attention. \subsubsection{Query-refined Feature Extraction} To extract refined feature maps with the guidance of the query feature, we extend the Swin-Transformer\footnote{https://github.com/SwinTransformer/Swin-Transformer-Object-Detection} to a modulated visual feature extractor. As shown in \Cref{fig:model} (b), for a given image $I \in \mathbb{R}^{H\times W\times 3}$, a patch partition operation is firstly adopted to embed $I$ to $\mathbf{F}_0 \in \mathbb{R}^{\frac{H}{4}\times \frac{W}{4}\times C}$, where $C$ is the embed dimension. Then $\mathbf{F}_0$ is fed into four cascaded stages, where each stage consists of multiple Swin-Transformer blocks and a QD-ATT\ module. In this work, we take the [CLS] representation of the input query sentence from BERT~\cite{devlin2018bert} as the contextual query representation $\mathbf{p}_l^c$ to compute the query-aware dynamic attention. The $k$-th stage receives the visual feature map $\mathbf{F}_{k-1}^*$ (or $\mathbf{F}_0$ if $k=1$) obtained in the previous stage and generates a transformed feature map $\mathbf{F}_{k}$ through the Swin-Transformer blocks. Then, the QD-ATT\ module takes the transformed feature $\mathbf{F}_{k}$ and produces a query-aware feature $\mathbf{F}_k^{*}$ that will be further used in the next stage. The output of the query-refined feature extractor is a list of hierarchical features $[\mathbf{F}_{1}^{*},\mathbf{F}_{2}^{*},\mathbf{F}_{3}^{*},\mathbf{F}_{4}^{*}]$. \subsubsection{Query-aware Multiscale Fusion}\label{sec:multiscale} Multiscale features are beneficial to detecting objects at different scales~\cite{DBLP:conf/eccv/CaiFFV16}. However, because visual grounding requires fine-grained interaction after visual backbone (\eg Cross Attention), high-resolution features will dramatically increase the computation. Therefore, previous works always use the low-resolution features or fuse the multiscale features in a query-agnostic manner, which will lose scale information or incorporate noise. Thanks to the hierarchical structure of the modulated Swin-Transformer, we can obtain multiscale features. We fuse the features obtained from different stages with the help of Query-aware Dynamic Attention mechanism and pooling operation. We flatten and concatenate the low-resolution features as the output token sequence of the backbone. Specifically, except for the first stage, each stage reduces the resolution of the feature map by a patch merging operator. In other words, the resolutions of the output feature maps at four stages are $\frac{H}{4}\times\frac{W}{4},\,\frac{H}{8}\times\frac{W}{8},\,\frac{H}{16}\times\frac{W}{16}$ and $\frac{H}{32}\times\frac{W}{32}$, respectively. Besides, the patch merging operator fuses the patch features into the channel which doubles the channel dimension. Thus the channel dimensions of the output at the four stages are $C,\,2C,\,4C$ and $8C$, respectively. Next, we will introduce how to efficiently fuse these multiscale features with the guidance of the query text. As shown in \Cref{fig:model} (b), we propose to fuse the output features at different stages with the help of QD-ATT. Specifically, we first use four $1\times 1$ convolutional layers to unify the channel dimensions to $D$. To filter out noisy signals in the feature maps, we build QD-ATT\ modules for the feature maps $\{\mathbf{F}^{*}_k |\,k=1,2,3 \}$ of the first three stages. From $\mathbf{F}^{*}_k$, the QD-ATT\ module produces a weighted feature map with the same size as the input. We apply a $2\times 2$ mean pooling with stride=2 to reduce the resolution to be the same as the next feature map $\mathbf{F}^{*}_{k+1}$ and compute the average of them to obtain $\mathbf{\bar{F}}^{*}_{k+1}$. Finally, the last feature map $\mathbf{\bar{F}}^{*}_{4}$ contains features of interest to the query from all scales. To detect very large objects, we also apply a $2\times 2$ max pooling to obtain a $\frac{H}{64}\times\frac{W}{64}$ feature map $\mathbf{\bar{F}}^{*}_{5}$. We flatten and concatenate the $\mathbf{\bar{F}}^{*}_{4}$ and $\mathbf{\bar{F}}^{*}_{5}$ as the output token sequence $\mathbf{V}$. \subsection{Preliminary} Visual grounding task aims at grounding a query sentence onto a region of an image. It can be formulated as: given an image $I$ and a query sentence $q$, the model needs to learn to predict a bounding box $\mathbf{b}=\{x,y,w,h\}$ which exactly contains the target object expressed by the sentence. Before introducing our method, we firstly present a typical end-to-end visual grounding architecture TransVG~\cite{deng2021transvg}. Given an image and a query sentence, there is a linguistic backbone, typically a pre-trained BERT model, extracting a 1D feature sequence $\mathbf{T}\in \mathbb{R}^{D_l\times N_l}$. There is also a visual backbone (\eg DETR Encoder\cite{carion2020end}) extracting a flattened visual feature sequence $\mathbf{V} \in \mathbb{R}^{D_v\times N_v}$. Two projection layers map the visual and linguistic features into the same feature space $\mathbb{R}^{D}$. The projected visual and linguistic features are denoted by $\mathbf{p}_v\in \mathbb{R}^{D\times N_v}$ and $\mathbf{p}_l\in \mathbb{R}^{D\times N_l}$. Then $p_v$ and $p_l$ are concatenated by inserting a learnable embedding (i.e., a [REG] token) at the beginning of the concatenated sequence. The joint sequence is formulated as: \begin{equation} \begin{aligned} \boldsymbol{x}_{0}=[\mathbf{p}_{r}, \underbrace{\mathbf{p}_{v}^{1}, \mathbf{p}_{v}^{2}, \cdots, \mathbf{p}_{v}^{N_{v}}}_{\text {visual tokens } \boldsymbol{p}_{v}}, \underbrace{\mathbf{p}_{l}^{1}, \mathbf{p}_{l}^{2}, \cdots, \mathbf{p}_{l}^{N_{l}}}_{\text {linguistic tokens } \boldsymbol{p}_{l}}], \end{aligned} \end{equation} where $p_r$ is the learnable embedding of [REG] token. Next, a multi-layer visual-linguistic transformer is applied to perform intra- and inter-modal reasoning on the joint sequence. Finally, a prediction head takes the output representation of the [REG] token to predict the bounding box coordinates $\mathbf{b}$. The smooth L1 loss~\cite{girshick2015fast} and giou loss~\cite{rezatofighi2019generalized} are used to train the framework. The training objective can be formulated as: \begin{equation} \begin{aligned} \mathcal{L}=\mathcal{L}_{smooth-l1}{(\mathbf{b},\mathbf{\hat{b}})}+\mathcal{L}_{giou}{(\mathbf{b},\mathbf{\hat{b}})}, \end{aligned} \end{equation} where $\mathbf{\hat{b}}$ is the ground-truth box. \begin{figure*}[tb] \includegraphics[width=1\textwidth]{figs/overview_2_cropped.pdf} \caption{(a) The typical visual grounding framework we used in this paper. (b) An overview of our MMSwin\ . The image is } \label{fig:model} \end{figure*} \subsection{Motivation and Overview} \paragraph{Motivation} As explained earlier, the visual features extracted from query-agnostic visual backbones have spatial and semantic inconsistencies. The inconsistencies hinder the multimodal interaction and hurt the models' performance. In this paper, we propose to mitigate the spatial and semantic inconsistent issues by leveraging textual features to guide the visual backbone with Query-aware Dynamic Attention, which dynamically computes textual-dependent visual attention maps at spatial and channel level. We refine the feature maps during the feature extraction and multiscale fusion processes and output a query-consistent visual feature. We designing a flexible visual grounding framework based on the TransVG\footnote{https://github.com/djiajunustc/TransVG} by replacing the visual backbone with our MMSwin\ . The complete framework is shown in \Cref{fig:model} (a). We next focus on the visual backbone proposed in this paper. \paragraph{Overview} We build the modulated multiscale visual backbone on a hierarchical visual backbone Swin-Transformer. We show the overall architecture in \Cref{fig:model} (b). During the feature extraction, a patch merge downsamples the input image and divides it into patches, and then there are four cascading stages. For simple representation, we denote the modules from pre-trained Swin-Transformer in the stage as Swin-Transformer Modules. Each stage also contains a Query-aware Dynamic Attention which takes the textual representation to refine the visual feature maps. Except for the first stage, the other three stages will obtain the feature of resolution divided by 2. During the multi-scale fusion stage, we fuse the features from each scale with the help of Query-aware Dynamic Attention and pooling operation. We flatten and concatenate the low-resolution features as the output token sequence of the backbone. In the following, we first introduce the Query-aware Dynamic Attention (in \Cref{sec:QDA}) and how we build a modulated multiscale visual backbone with the Query-aware Dynamic Attention (in \Cref{sec:MMSwin}). \subsection{Query-aware Dynamic Attention} \label{sec:QDA} In this section, we describe the details of our Query-aware Dynamic Attention (shown in \cref{fig:model}(c)). We first introduce the dynamic linear layer, which learns a linear transformation applied to the visual features. The difference is that the parameters of the linear transformation is not static and will be generated dynamically by textual features. We use dynamic linear layers to extract query-aware visual clues from the input visual features. We further introduce channel and spatial attention to refine the visual features with help of visual clues to produce query-consistent visual features. \paragraph{Dynamic Linear Layer} The existing visual feature extractor uses modules with static parameters to compute the visual feature maps. Feeding in the same image will output the same feature maps. However, in visual grounding, the textual features reveals the intention of the query. We present a dynamic linear which leverages the contextual textual feature $\mathbf{p}_l^c$ to guide the linear transformation to map an input vector $\mathbf{z}_{in}\in \mathbb{R}^{D^{in}}$ to $\mathbf{z}_{out}\in \mathbb{R}^{D^{out}}$. The dynamic linear layer can be formalized as follow: \begin{equation} \begin{aligned} \mathbf{z}_{out}&=\mathrm{DyLinear}_{\mathcal{M}_l}(\mathbf{z}_{in})=\mathbf{W}_l^\intercal \mathbf{z}_{in}+\mathbf{b}_l \end{aligned} \end{equation} where $\mathcal{M}_l=\{\mathbf{W}_l,\mathbf{b}_l\},\,\mathbf{W}_l\in \mathbb{R}^{D^{in}\times D^{out}},\, \mathbf{b}_l\in \mathbb{R}^{D^{out}}$, and $D^{in}$ and $D^{out}$ are the dimensions of input and output respectively. We use a plain linear layer to generate the $\mathcal{M}_l$. The generator is denoted by $\mathcal{M}_l=\Psi(\mathbf{p}_l^c)$, where $\mathcal{M}^{'}_l\in\mathbb{R}^{(D^{in}+1)\ast D^{out}}$. In detail, we obtain a vector with shape $(D^{in}+1)*D^{out}$ and reshape it to $\mathcal{M}_l$. However, it is easy to find that the number of parameters in the generator is $D_l\ast ((D^{in}+1)\ast D^{out})$. We find that such large-scale parameters will slow down the training speed of the network and make it easier to be overfitting. Inspired by matrix factorization, we consider decomposing the $\mathcal{M}_l$ into two factor $\mathbf{U}\in \mathbb{R}^{(D^{in}+1)\times K}$ and $\mathbf{S}\in \mathbb{R}^{K\times D^{out}}$, where $\mathbf{U}$ is a matrix generate from $\mathbf{p}_l^c$, $\mathbf{S}$ is a static learnable matrix, $K$ is a hyper-parameter denote the factor dimension. The factor generator $\{\mathbf{W}_l,\mathbf{b}_l\}=\Psi^*(\mathbf{p}_l^c)$ can be formulated as follow: \begin{equation} \begin{aligned} \mathbf{U}&=\mathrm{Reshape}({\mathbf{W}_{g}}^\intercal \mathbf{p}_l^c+\mathbf{b}_{g}) \end{aligned} \end{equation} where $\mathbf{W}_{g}\in \mathbb{R}^{D_l\times (D^{in}+1)\ast K}$ and $ \mathbf{b}_{g}\in \mathbb{R}^{(D^{in}+1)\ast K}$ are the parameters of the factor generator \begin{equation} \begin{aligned} \mathcal{M}_l&=\mathbf{U}\mathbf{S}\\ \{\mathbf{W}_l,\mathbf{b}_l\} &= \mathrm{Split}(\mathcal{M}_l)\\ \end{aligned} \end{equation} Then the parameter matrix of dynamic linear layer $\mathcal{M}_l$ can be reconstructed by multiply $\mathbf{U}$ and $\mathbf{S}$. The $\mathbf{W}_l$ and $\mathbf{b}_l$ can be split from the matrix $\mathcal{M}_l$ along the first dimension. Finally, we reformulate the guidance function as follow: \begin{equation} \begin{aligned} \mathbf{z}_{out}&=\mathrm{DyLinear}_{\mathcal{M}_l}(\mathbf{z}_{in})=\mathrm{DyLinear}_{\Psi^*(\mathbf{p}_l^c)}(\mathbf{z}_{in}) \end{aligned} \end{equation} Unless otherwise specified, the different $\mathrm{DyLinears}$ do not share parameters. And when the input is a multidimensional tensor, the layer transforms the input at the channel dimension. \paragraph{Channel and Spatial Attention} As we can obtain the visual clues, we consider refining the visual feature map by attention mechanism. As explained earlier, the pre-trained visual backbone is sensitive to all salient objects. Most of them are irrelevant to the query text. Therefore, The backbone only needs to attend to a few areas. Besides, The features useful for localization depend on the semantics contained in the query sentence (e.g. entities, descriptions of attributes and relationships). In other words, the importance of each channel in the features should change dynamically according to the query sentence. Inspired by the Convolutional Block Attention Module\cite{woo2018cbam}, we consider inferring a channel attention map $\mathbf{A}^{cl}$ to calibrate the semantic of feature for a better cross-modal alignment. And we further infer a spatial attention map $\mathbf{A}^{sl}$ from calibrated feature to reveal where the referent located. Specifically, for a given visual feature $\mathbf{v}\in \mathbb{R}^{H\times W\times D_v}$, we first aggregate its spatial information by average pooling and maximum pooling and produce $\mathbf{v}^c_{max},\,\mathbf{v}^c_{mean}\in \mathbb{R}^{1\times 1\times D_v}$. We further build a dynamic multilayer perception consists of two dynamic linear layers. We use a ReLU activation after the first layer. The output dimension is the same as the input dimension. To reduce the number of parameter, we set the dimension of hidden states as $D_v/r$, where $r$ is the reduction ratio. By feeding the $\mathbf{v}^c_{max}$ and $\mathbf{v}^c_{mean}$ to the dynamic multilayer perception. We merge the two output features using summation. The channel attention map $\mathbf{A}^{cl}$ can be captured as follow: \begin{equation} \begin{aligned} \mathbf{v}^{cl}_{mean}&=\mathrm{DyLinear}_1(\mathrm{ReLU}(\mathrm{DyLinear}_0(\mathbf{v}^c_{mean},p_l^c)),\mathbf{p}_l^c)\\ \mathbf{v}^{cl}_{max}&=\mathrm{DyLinear}_1(\mathrm{ReLU}(\mathrm{DyLinear}_0(\mathbf{v}^c_{max},p_l^c)),\mathbf{p}_l^c)\\ \mathbf{A}^{cl}&=\mathrm{sigmoid}(\mathbf{v}^{cl}_{mean}+\mathbf{v}^{cl}_{max}) \end{aligned} \end{equation} We perform element-wise multiplication between $\mathbf{v}$ and $\mathbf{A}^{cl}$ to form the representation of the channel refined visual feature, where the $A^{cl}$ are broadcast along the spatial dimension: \begin{equation} \begin{aligned} \mathbf{V}^{'}&=\mathbf{A}^{cl}\otimes \mathbf{V} \end{aligned} \end{equation} To generate a spatial attention map, instead pooling the channel dimension, we leverage another dynamic linear layer to reduce the channel dimension to learn areas interest to the query and apply a sigmoid function to generate the attention map. In short, The computing process is formulated as follow: \begin{equation} \begin{aligned} \mathbf{A}^{sl}&=\mathrm{sigmoid}(\mathrm{DyLinear}_2(\mathbf{v}^{'},\mathbf{p}_l^c))\\ \mathbf{v}^{''}&=\mathbf{A}^{cl}\otimes \mathbf{v}^{'} \end{aligned} \end{equation} where $\mathbf{A}^{sl}\in \mathbb{R}^{H\times W\times 1}$ is the spatial attention map and $\mathbf{v}^{''}$ is the spatial refined visual feature and also the output of our Query-aware Dynamic Attention. \subsection{Query-modulated Transformer} \label{sec:MMSwin} In this section, we discuss how to use query-aware dynamic attention to extend Swin-Transformer\footnote{https://github.com/SwinTransformer/Swin-Transformer-Object-Detection} to a modulated visual backbone. \paragraph{Query-aware Attention in Feature Extraction} For a given image $I \in \mathbb{R}^{H\times W\times 3}$, a plain Swin-Transformer first embed $I$ to a $\mathbf{v}_0 \in \mathbb{R}^{\frac{H}{4}\times \frac{W}{4}\times 48}$. Then $\mathbf{v}_0$ is fed into four cascaded stages. Each stage $k$ receives the visual feature map $\mathbf{v}_{k-1}^*$ or $\mathbf{v}_0$ and generates a transformed feature map $\mathbf{v}_{k}$. We take the [CLS] representation of the input query sentence from BERT\cite{devlin2018bert} as the contextual query representation $\mathbf{p}_l^c$. We append a query-aware dynamic attention module at the end of each stage. It receives the transformed feature $\mathbf{v}_{k}$ from Swin-Transformer Blocks and produces a query-aware feature $\mathbf{v}_k^{*}$ to the next stage. \paragraph{Query-aware Attention in Multiscale Fusion} \label{sec:multiscale} Thanks to the hierarchical structure, we can obtain features at different scales from each stage. Specifically, except the first stage, each stage reduce the resolution of feature map by a patch merging operator. In other words, the resolutions of the output of each stage are $\frac{H}{4}\times\frac{W}{4},\,\frac{H}{8}\times\frac{W}{8},\,\frac{H}{16}\times\frac{W}{16}$ and $\frac{H}{32}\times\frac{W}{32}$, respectively. Beside, the patch merging operator fuse the patch feature into channel which double the channel dimension. Thus the channel dimensions of the output of each stage are $C,\,2C,\,4C$ and $8C$. Multiscale features are benefit to detect objects at different scale. however, because visual grounding require fine-grained interaction after visual backbone (\eg Cross Attention), high-resolution features will dramatically increase the computation. Previous works using the last feature or fuse the multiscale features by a query-agnostic fusion will obviously lose scale information or incorporate noise. As shown in \Cref{fig:model} (b), we propose to fuse the features with the QD-ATT. Specifically, we first use four $1\times 1$ convolutional layers to unify the channel dimensions to $D$. To filter out noisy signals in the feature maps, we build QD-ATT\ modules for the first three feature maps $\{\mathbf{v}^{*}_k |\,k=1,2,3 \}$. From $\mathbf{v}^{*}_0$, each module produce a weighted feature map with the same shape as before. We apply a $2\times 2$ mean pooling with stride=2 to reduce the resolution to be the same as next feature map $\mathbf{v}^{*}_k$ and compute the average of them to obtain $\mathbf{\bar{v}}^{*}_{k+1}$. Finally, the last feature map $\mathbf{\bar{v}}^{*}_{4}$ contains features interest to the query from all scales. To detect very large objects, we also apply a $2\times 2$ max pooling to obtain a $\frac{H}{64}\times\frac{W}{64}$ feature map $\mathbf{\bar{v}}^{*}_{5}$. We flatten and concatenate the $\mathbf{\bar{v}}^{*}_{4}$ and $\mathbf{\bar{v}}^{*}_{5}$ as the output token sequence $\mathbf{V}$. \subsection{Architecture} {\color{red}In this section, we first formulate the visual grounding task and present the architecture of the framework we used.} Visual grounding task aims at grounding a query sentence onto a region of an image. It can be formulated as: given an image $I$ and a query sentence $q$, the model needs to learn to predict a bounding box $\mathbf{b}=\{x,y,w,h\}$ which exactly contains the target object expressed by the sentence. {\color{red}As shown in \Cref{fig:model} (a), our framework is based on a typical end-to-end visual grounding architecture TransVG~\cite{deng2021transvg}\footnote{https://github.com/djiajunustc/TransVG}} Given an image and a query sentence, there is a linguistic backbone, typically a pre-trained BERT model, extracting a 1D feature sequence $\mathbf{T}\in \mathbb{R}^{D_l\times N_l}$. {\color{red}We propose the Query-modulated Refinement Network\ (described in \Cref{sec:network}) as a visual backbone to extract a flattened visual feature sequence $\mathbf{V} \in \mathbb{R}^{D_v\times N_v}$. The different is that the backbone take the contextual textual feature from the linguistic backbone to refine the feature extraction and multiscale fusion with the help of Query-aware Dynamic Attention\ (described in \Cref{sec:QDA}).} Two projection layers map the visual and linguistic features into the same feature space $\mathbb{R}^{D}$. The projected visual and linguistic features are denoted by $\mathbf{p}_v\in \mathbb{R}^{D\times N_v}$ and $\mathbf{p}_l\in \mathbb{R}^{D\times N_l}$. Then $\mathbf{p}_v$ and $\mathbf{p}_l$ are concatenated by inserting a learnable embedding (i.e., a [REG] token) at the beginning of the concatenated sequence. The joint sequence is formulated as: \begin{equation} \begin{aligned} \boldsymbol{X}=[\mathbf{p}_{r}, \underbrace{\mathbf{p}_{v}^{1}, \mathbf{p}_{v}^{2}, \cdots, \mathbf{p}_{v}^{N_{v}}}_{\text {visual tokens } \boldsymbol{p}_{v}}, \underbrace{\mathbf{p}_{l}^{c}, \mathbf{p}_{l}^{1}, \cdots, \mathbf{p}_{l}^{N_{l}}}_{\text {linguistic tokens } \boldsymbol{p}_{l}}], \end{aligned} \end{equation} where $p_r$ is the learnable embedding of [REG] token. Next, a multi-layer visual-linguistic transformer is applied to perform intra- and inter-modal reasoning on the joint sequence. Finally, a prediction head takes the output representation of the [REG] token to predict the bounding box coordinates $\mathbf{b}$. The smooth L1 loss~\cite{girshick2015fast} and giou loss~\cite{rezatofighi2019generalized} are used to train the framework. The training objective can be formulated as: \begin{equation} \begin{aligned} \mathcal{L}=\mathcal{L}_{smooth-l1}{(\mathbf{b},\mathbf{\hat{b}})}+\mathcal{L}_{giou}{(\mathbf{b},\mathbf{\hat{b}})}, \end{aligned} \end{equation} where $\mathbf{\hat{b}}$ is the ground-truth box. \begin{figure*}[tb] \includegraphics[width=1\textwidth]{figs/overview_2_cropped.pdf} \caption{(a) The QRNet-based visual grounding framework we used in this paper. (b) An overview of our Query-modulated Refinement Network. (c) The illustration of Query-aware Dynamic Attention.} \label{fig:model} \end{figure*} \subsection{Query-modulated Refinement Network} \label{sec:network} {\color{red} In this section, we introduce our modulated visual backbone Query-modulated Refinement Network\ (MMSwin\ ). An overview of the network is shown in \Cref{fig:model} (b). The network consists of two phases: (1) Query-refined Feature Extraction extracts query-refined visual feature maps with a hierarchical structure. (2) Multi-scale Fusion fuses the maps at different scales with the guidance of the query feature. The two phases both rely on a novel Query-aware Dynamic Attention (QD-ATT), which dynamically computes textual-dependent visual attentions at spatial and channel level, to enable to compute features with query guidance. Thus, in the following, we will first introduce implementation of the Query-aware Dynamic Attention. Then we detail the Query-refined Feature Extraction and Multi-scale Fusion. } \subsubsection{Query-aware Dynamic Attention} \label{sec:QDA} In this section, we describe the details of our Query-aware Dynamic Attention (shown in \cref{fig:model}(c)). We first introduce the dynamic linear layer, which learns a linear transformation that can be applied on the visual features to compute the query-aware attentions. Different from the conventional trainable linear layer, the parameters of the dynamic linear layer are generated dynamically based on textual features. Next, we will illustrate how to use the dynamic linear layer to compute query-aware channel and spatial attentions and obtain the query-consistent visual features. A pseudo-code is presented in the Appendix for better comprehension. \paragraph{Dynamic Linear Layer} Existing visual backbones use modules with static parameters to compute the visual feature maps, where feeding in the same image will output the same feature maps. However, in visual grounding, different queries for a single image may reveal different semantic information and intentions, which require different visual features. We present a dynamic linear layer which can leverage the {\color{red}contextual textual feature $\mathbf{p}_l^c\in \mathbb{R}^{D_l}$} to guide the mapping from an given input vector $\mathbf{z}_{in}\in \mathbb{R}^{D^{in}}$ to the output $\mathbf{z}_{out}\in \mathbb{R}^{D^{out}}$. The dynamic linear layer is formalized as follow: \begin{equation} \begin{aligned} \mathbf{z}_{out}&=\mathrm{DyLinear}_{\mathcal{M}_l}(\mathbf{z}_{in})=\mathbf{W}_l^\intercal \mathbf{z}_{in}+\mathbf{b}_l \end{aligned} \end{equation} where $\mathcal{M}_l=\{\mathbf{W}_l,\mathbf{b}_l\},\,\mathbf{W}_l\in \mathbb{R}^{D^{in}\times D^{out}},\, \mathbf{b}_l\in \mathbb{R}^{D^{out}}$. $D^{in}$ and $D^{out}$ are the dimensions of input and output, respectively. We use a plain linear layer to generate the $\mathcal{M}_l$. The generator is denoted by $\mathcal{M}^{'}_l=\Psi(\mathbf{p}_l^c)$, where $\mathcal{M}^{'}_l\in\mathbb{R}^{(D^{in}+1)\ast D^{out}}$. In detail, we predict a vector with shape $(D^{in}+1)*D^{out}$ which can be reshaped to $\mathcal{M}_l$. However, it is easy to find that the number of parameters in the generator, i.e., {\color{red}$D_l\ast ((D^{in}+1)\ast D^{out})$}, is too large. Such large-scale parameters will slow down the training speed of the network and make it easier to be overfitting. Inspired by matrix factorization, we consider decomposing the $\mathcal{M}_l$ into two factors $\mathbf{U}\in \mathbb{R}^{(D^{in}+1)\times K}$ and $\mathbf{S}\in \mathbb{R}^{K\times D^{out}}$, where $\mathbf{U}$ is a matrix generate from $\mathbf{p}_l^c$, $\mathbf{S}$ is a static learnable matrix, $K$ is a hyper-parameter denoting the factor dimension. The factor generator $\{\mathbf{W}_l,\mathbf{b}_l\}=\Psi^*(\mathbf{p}_l^c)$ can be formulated as follow: \begin{equation} \begin{aligned} & \mathbf{U}=\mathrm{Reshape}({\mathbf{W}_{g}}^\intercal \mathbf{p}_l^c+\mathbf{b}_{g}),\\ & \mathcal{M}_l=\mathbf{U}\mathbf{S},\\ & \{\mathbf{W}_l,\mathbf{b}_l\}= \mathrm{Split}(\mathcal{M}_l),\\ \end{aligned} \end{equation} where $\mathbf{W}_{g}\in \mathbb{R}^{D_l\times (D^{in}+1)\ast K}$ and $ \mathbf{b}_{g}\in \mathbb{R}^{(D^{in}+1)\ast K}$ are trainable parameters of the factor generator. The parameter matrix $\mathcal{M}_l$ of the dynamic linear layer can be reconstructed by multiply $\mathbf{U}$ and $\mathbf{S}$. The $\mathbf{W}_l$ and $\mathbf{b}_l$ can be split from the matrix $\mathcal{M}_l$ along the first dimension. Finally, we reformulate the dynamic linear layer as follows: \begin{equation} \begin{aligned} \mathbf{z}_{out}&=\mathrm{DyLinear}_{\mathcal{M}_l}(\mathbf{z}_{in})=\mathrm{DyLinear}_{\Psi^*(\mathbf{p}_l^c)}(\mathbf{z}_{in}). \end{aligned} \end{equation} Unless otherwise specified, we use $\mathrm{DyLinear}(\mathbf{z}_{in})$ to represent a dynamic linear layer with $\mathbf{p}_l^c$ for simplify. And the different dynamic linear layers do not share parameters. When the input is a multidimensional tensor, the dynamic linear layer transforms the input at the last dimension. \paragraph{Channel and Spatial Attention} As explained in the introduction, the pre-trained visual backbone is sensitive to the objects defined in the pre-training task. However, most of these objects are irrelevant to the query text in visual grounding. Besides, the features useful for localization highly depend on the semantics contained in the query sentence (e.g. entities, descriptions of attributes and relationships). In other words, the importance of each channel or each region of the feature map should change dynamically according to the query sentence. Inspired by Convolutional Block Attention Module~\cite{woo2018cbam}, we consider inferring channel and spatial attentions, i.e., $\mathbf{A}^{cl}$ and $\mathbf{A}^{sl}$, along the separate dimensions of the feature map to obtain adaptively refined features for a better cross-modal alignment. Specifically, for a given visual feature map $\mathbf{F}\in \mathbb{R}^{H\times W\times D_v}$, we first aggregate its spatial information by average pooling and maximum pooling and produce $\mathbf{F}^c_{max}\in \mathbb{R}^{1\times 1\times D_v},\mathbf{F}^c_{mean}\in \mathbb{R}^{1\times 1\times D_v}$. Then, we build a dynamic multilayer perception consists of two dynamic linear layers. We use a ReLU activation after the first layer. The output dimension is the same as the input dimension. To reduce the number of parameter, we set the dimension of hidden states as $D_v/r$, {\color{red}where $r=16$ is the reduction ratio.} By feeding the $\mathbf{F}^c_{max}$ and $\mathbf{F}^c_{mean}$ to the dynamic multilayer perception, we merge the two output features using summation. {\color{red}The channel attention map $\mathbf{A}^{cl}$} can be captured as follow: {\color{red} \begin{equation} \begin{aligned} \mathbf{F}^{cl}_{mean}&=\mathrm{DyLinear}_{1}(\mathrm{ReLU}(\mathrm{DyLinear}_{2}(\mathbf{F}^c_{mean}))\\ \mathbf{F}^{cl}_{max}&=\mathrm{DyLinear}_{1}(\mathrm{ReLU}(\mathrm{DyLinear}_{2}(\mathbf{F}^c_{max}))\\ \mathbf{A}^{cl}&=\mathrm{Sigmoid}(\mathbf{F}^{cl}_{mean}+\mathbf{F}^{cl}_{max}). \end{aligned} \end{equation} } We perform element-wise multiplication between $\mathbf{F}$ and $\mathbf{A}^{cl}$ to form the channel-wise refined visual feature, where the $\mathbf{A}^{cl}$ is broadcast along the spatial dimension: \begin{equation} \begin{aligned} \mathbf{F}^{'}&=\mathbf{A}^{cl}\otimes \mathbf{F}. \end{aligned} \end{equation} To generate a spatial attention map, instead of pooling the channel dimension, we leverage another dynamic linear layer to reduce the channel dimension to learn areas of interest to the query and apply a Sigmoid function to generate the attention map. In short, the computing process is formulated as follows: \begin{equation} \begin{aligned} \mathbf{A}^{sl}&=\mathrm{Sigmoid}(\mathrm{DyLinear}_{3}(\mathbf{F}^{'}))\\ \mathbf{F}^{''}&=\mathbf{A}^{sl}\otimes \mathbf{F}^{'} \end{aligned} \end{equation} where $\mathbf{A}^{sl}\in \mathbb{R}^{H\times W\times 1}$ is the spatial attention map and $\mathbf{F}^{''}$ is the spatially refined visual feature and also the output of our Query-aware Dynamic Attention. \subsubsection{Query-refined Feature Extraction} {\color{red}To extract query-aware feature maps, we extend the Swin-Transformer\footnote{https://github.com/SwinTransformer/Swin-Transformer-Object-Detection} to a modulated visual feature extractor.} As shown in \Cref{fig:model} (b), {\color{red}For a given image $I \in \mathbb{R}^{H\times W\times 3}$, a plain Swin-Transformer first embeds $I$ to $\mathbf{F}_0 \in \mathbb{R}^{\frac{H}{4}\times \frac{W}{4}\times 48}$ by a patch partition operation. Then $\mathbf{F}_0$ is fed into four cascaded stages. The $k$-th stage receives the visual feature map $\mathbf{F}_{k-1}$ and generates a transformed feature map $\mathbf{F}_{k}$. In this work, we take the [CLS] representation of the input query sentence from BERT~\cite{devlin2018bert} as the contextual query representation $\mathbf{p}_l^c$. We append a query-aware dynamic attention module at the end of each stage. It take the transformed feature $\mathbf{F}_{k}$ from Swin-Transformer blocks and produces a query-aware feature $\mathbf{F}_k^{*}$ to the next stage. Thus in the modulated Swin-Transformer, the last three stage receive the refined feature map $\mathbf{F}_{k-1}^{*}$ instead. The output of the query-refined feature extraction is a hierarchical feature list $[\mathbf{F}_{1}^{*},\mathbf{F}_{2}^{*},\mathbf{F}_{3}^{*},\mathbf{F}_{4}^{*}]$.} \subsubsection{Query-aware Multiscale Fusion.}\label{sec:multiscale} Multiscale features are benefit to detect objects at different scales~\cite{DBLP:conf/eccv/CaiFFV16}. However, becuase visual grounding requires fine-grained interaction after visual backbone (\eg Cross Attention), high-resolution features will dramatically increase the computation. Therefore, previous works always use the low-resolution features or fuse the multiscale features in a query-agnostic manner, which will obviously lose scale information or incorporate noise. Thanks to the hierarchical structure of the modulated Swin-Transformer, we can obtain multiscale features. We fuse the features obtained from different stages with the help of Query-aware Dynamic Attention mechanism and pooling operation. We flatten and concatenate the low-resolution features as the output token sequence of the backbone. Specifically, except the first stage, each stage reduces the resolution of feature map by a patch merging operator. In other words, the resolutions of the output feature maps at four stages are $\frac{H}{4}\times\frac{W}{4},\,\frac{H}{8}\times\frac{W}{8},\,\frac{H}{16}\times\frac{W}{16}$ and $\frac{H}{32}\times\frac{W}{32}$, respectively. Besides, the patch merging operator fuses the patch feature into the channel which doubles the channel dimension. Thus the channel dimensions of the output at the four stages are $C,\,2C,\,4C$ and $8C$, respectively. Next, we will introduce how to efficiently fuse these multiscale features with the guidance of the query text. As shown in \Cref{fig:model} (b), we propose to fuse the output features at different stages with the help of QD-ATT. Specifically, we first use four $1\times 1$ convolutional layers to unify the channel dimensions to $D$. To filter out noisy signals in the feature maps, we build QD-ATT\ modules for the feature maps $\{\mathbf{F}^{*}_k |\,k=1,2,3 \}$ of the first three stages. From {\color{red}$\mathbf{F}^{*}_k$}, the QD-ATT\ module produces a weighted feature map with the same size as the {\color{red}input}. We apply a $2\times 2$ mean pooling with stride=2 to reduce the resolution to be the same as next feature map {\color{red}$\mathbf{F}^{*}_{k+1}$} and compute the average of them to obtain $\mathbf{\bar{F}}^{*}_{k+1}$. Finally, the last feature map $\mathbf{\bar{F}}^{*}_{4}$ contains features of interest to the query from all scales. To detect very large objects, we also apply a $2\times 2$ max pooling to obtain a $\frac{H}{64}\times\frac{W}{64}$ feature map $\mathbf{\bar{F}}^{*}_{5}$. We flatten and concatenate the $\mathbf{\bar{F}}^{*}_{4}$ and $\mathbf{\bar{F}}^{*}_{5}$ as the output token sequence $\mathbf{V}$. \subsection{Datasets and Evaluation We evaluate our method on phrase grounding dataset Flickr30K Entities\cite{plummer2015flickr30k} and referring expression grounding datasets RefCOCO\cite{yu2016modeling}, RefCOCO+\cite{yu2016modeling}, RefCOCOg\cite{mao2016generation} and ReferItGame\cite{kazemzadeh2014referitgame}. The details and statistics are summarized in Appendix. In phrase grounding the queries are phrases and in referring expression grounding, they are referring expressions corresponding to the referred objects. We follow the same metric used in \cite{deng2021transvg}. Specifically, a prediction is right if the IoU between the grounding-truth box and the predicted bounding box is larger than 0.5. \subsection{Implementation Details} The QRNet is built based on Swin-Transformer, i.e., Swin-S pre-trained with Mask-RCNN on MSCOCO~\cite{lin2014microsoft}\footnote{We excluded images in the validation and test set of the RefCOCO series from MSCOCO training set and retrained Swin-Transformer for fair comparison.}. We use $\mathrm{BERT}_{\mathrm{base}}$(uncased) for linguistic feature extraction. We set the intermediate dimension $D=256$ and the factor dimension $K=30$. We follow the TransVG~\cite{deng2021transvg} to process the input images and sentences. We also follow the training setting used in TransVG, which uses a AdamW optimizer with weight decay $10^{-4}$, sets the batch size to 64 and the dropout ratio to 0.1 for FFN in Transformer. The learning rate is set to $10^{-5}$ for pre-trained parameters and $10^{-4}$ for other parameters. The parameters without pre-training are randomly initialized with Xavier. We train our model for 160 epochs. The learning rate is multiplied by a factor of 0.1 at epoch 40 for Flickr30K Entities and at epoch 60 for other datasets. We also follow the commonly used data augmentation strategies in ~\cite{liao2020real,yang2020improving,yang2019fast}. \subsection{Quantitative Results} We show the comparison results on ReferItGame and Flickr30k Entities in \Cref{tab:sub_main}. The ReferItGame collects queries by a cooperative game, requiring one player to write a referring expression for a specified object. The other one needs to click on the correct object. Queries in Flickr30k Entities are phrases in the caption. We observe that the proposed MMSwin\ \ outperforms previous works. We replace the visual branch of TransVG with Swin-Transformer and denote it by TransVG(Swin) to explore the impact of backbone. The performance is similar to the original TransVG, indicating that the accuracy gains are not from Swin-Transformer. \begin{table}[t] \small \centering \begin{tabular}{@{}cccc@{}} \toprule \multicolumn{1}{c|}{\multirow{2}{*}{Module}} & \multicolumn{1}{c|}{\multirow{2}{*}{Backbone}} & \multicolumn{1}{c|}{ReferItGame} & Flickr30K \\ \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{test} & test \\ \midrule \multicolumn{4}{l}{\textbf{Two-stage}} \\ \midrule \multicolumn{1}{c|}{VC~\cite{zhang2018grounding}} & \multicolumn{1}{c|}{VGG16} & \multicolumn{1}{c|}{31.13} & - \\ \multicolumn{1}{c|}{MAttNet~\cite{yu2018mattnet}} & \multicolumn{1}{c|}{ResNet-101} & \multicolumn{1}{c|}{29.04} & - \\ \multicolumn{1}{c|}{Similarity net~\cite{wang2018learning}} & \multicolumn{1}{c|}{ResNet-101} & \multicolumn{1}{c|}{34.54} & 50.89 \\ \multicolumn{1}{c|}{LCMCG~\cite{liu2020learning}} & \multicolumn{1}{c|}{ResNet-101} & \multicolumn{1}{c|}{-} & 76.74 \\ \multicolumn{1}{c|}{DIGN~\cite{mu2021disentangled}} & \multicolumn{1}{c|}{VGG-16} & \multicolumn{1}{c|}{{\ul 65.15}} & {\ul 78.73} \\ \midrule \multicolumn{4}{l}{\textbf{One-stage}} \\ \midrule \multicolumn{1}{c|}{FAOA~\cite{yang2019fast}} & \multicolumn{1}{c|}{DarkNet-53} & \multicolumn{1}{c|}{60.67} & 68.71 \\ \multicolumn{1}{c|}{RCCF~\cite{liao2020real}} & \multicolumn{1}{c|}{DLA-34} & \multicolumn{1}{c|}{63.79} & - \\ \multicolumn{1}{c|}{ReSC-Large~\cite{yang2020improving}} & \multicolumn{1}{c|}{DarkNet-53} & \multicolumn{1}{c|}{64.60} & 69.28 \\ \multicolumn{1}{c|}{SAFF~\cite{ye2021one}} & \multicolumn{1}{c|}{DarkNet-53} & \multicolumn{1}{c|}{66.01} & 70.71 \\ \multicolumn{1}{c|}{TransVG~\cite{deng2021transvg}} & \multicolumn{1}{c|}{ResNet-101} & \multicolumn{1}{c|}{70.73} & {\ul 79.10} \\ \multicolumn{1}{c|}{TransVG\ (Swin)} & \multicolumn{1}{c|}{Swin-S} & \multicolumn{1}{c|}{{\ul 70.86}} & 78.18 \\ \midrule \multicolumn{1}{c|}{MMSwin\ \ (ours)} & \multicolumn{1}{c|}{Swin-S} & \multicolumn{1}{c|}{\textbf{74.61}} & \textbf{81.95} \\ \bottomrule \end{tabular} \caption{The performance comparisons ([email protected]) on ReferItGame and Flickr30K Entities.} \label{tab:sub_main} \end{table} \begin{table*}[ht] \centering \begin{tabular}{@{}ccccccccccc@{}} \toprule \multicolumn{1}{c|}{\multirow{2}{*}{Models}} & \multicolumn{1}{c|}{\multirow{2}{*}{Backbone}} & \multicolumn{3}{c|}{RefCOCO} & \multicolumn{3}{c|}{RefCOCO+} & \multicolumn{3}{c}{RefCOCOg} \\ \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & val & testA & \multicolumn{1}{c|}{testB} & val & testA & \multicolumn{1}{c|}{testB} & val-g & val-u & test-u \\ \midrule \multicolumn{11}{l}{\textbf{Two-stage}} \\ \midrule \multicolumn{1}{c|}{VC~\cite{zhang2018grounding}} & \multicolumn{1}{c|}{VGG16} & - & 73.33 & \multicolumn{1}{c|}{67.44} & - & 58.40 & \multicolumn{1}{c|}{53.18} & 62.30 & - & - \\ \multicolumn{1}{c|}{MAttNet~\cite{yu2018mattnet}} & \multicolumn{1}{c|}{ResNet-101} & 76.65 & 81.14 & \multicolumn{1}{c|}{69.99} & 65.33 & 71.62 & \multicolumn{1}{c|}{56.02} & - & 66.58 & 67.27 \\ \multicolumn{1}{c|}{Ref-NMS~\cite{chen2021ref}} & \multicolumn{1}{c|}{ResNet-101} & {\ul 78.82} & 82.71 & \multicolumn{1}{c|}{{\ul 73.94}} & 66.95 & 71.29 & \multicolumn{1}{c|}{{\ul 58.40}} & - & {\ul 68.89} & {\ul 68.67} \\ \multicolumn{1}{c|}{LGRANs~\cite{wang2019neighbourhood}} & \multicolumn{1}{c|}{VGG16} & - & 76.60 & \multicolumn{1}{c|}{66.40} & - & 64.00 & \multicolumn{1}{c|}{53.40} & 61.78 & - & - \\ \multicolumn{1}{c|}{RvG-Tree~\cite{hong2019learning}} & \multicolumn{1}{c|}{ResNet-101} & 75.06 & 78.61 & \multicolumn{1}{c|}{69.85} & 63.51 & 67.45 & \multicolumn{1}{c|}{56.66} & - & 66.95 & 66.51 \\ \multicolumn{1}{c|}{CM-Att-Erase~\cite{liu2019improving}} & \multicolumn{1}{c|}{ResNet-101} & 78.35 & {\ul 83.14} & \multicolumn{1}{c|}{71.32} & {\ul 68.09} & {\ul 73.65} & \multicolumn{1}{c|}{58.03} & {\ul 68.67} & - & - \\ \multicolumn{1}{c|}{NMTree~\cite{liu2019learning}} & \multicolumn{1}{c|}{ResNet-101} & 76.41 & 81.21 & \multicolumn{1}{c|}{70.09} & 66.46 & 72.02 & \multicolumn{1}{c|}{57.52} & 64.62 & 65.87 & 66.44 \\ \midrule \multicolumn{11}{l}{\textbf{One-stage}} \\ \midrule \multicolumn{1}{c|}{FAOA~\cite{yang2019fast}} & \multicolumn{1}{c|}{DarkNet-53} & 72.54 & 74.35 & \multicolumn{1}{c|}{68.50} & 56.81 & 60.23 & \multicolumn{1}{c|}{49.60} & 56.12 & 61.33 & 60.36 \\ \multicolumn{1}{c|}{RCCF~\cite{liao2020real}} & \multicolumn{1}{c|}{DLA-34} & - & 81.06 & \multicolumn{1}{c|}{71.85} & - & 70.35 & \multicolumn{1}{c|}{56.32} & - & - & 65.73 \\ \multicolumn{1}{c|}{ReSC-Large~\cite{yang2020improving}} & \multicolumn{1}{c|}{DarkNet-53} & 77.63 & 80.45 & \multicolumn{1}{c|}{72.30} & 63.59 & 68.36 & \multicolumn{1}{c|}{56.81} & 63.12 & 67.30 & 67.20 \\ \multicolumn{1}{c|}{SAFF~\cite{ye2021one}} & \multicolumn{1}{c|}{DarkNet-53} & 79.26 & 81.09 & \multicolumn{1}{c|}{76.55} & 64.43 & 68.46 & \multicolumn{1}{c|}{58.43} & - & 68.94 & 68.91 \\ \multicolumn{1}{c|}{HFRN~\cite{qiu2020language}} & \multicolumn{1}{c|}{ResNet-101} & 79.76 & {83.12} & \multicolumn{1}{c|}{75.51} & 66.80 & 72.53 & \multicolumn{1}{c|}{59.09} & - & {\ul 69.71} & 69.08 \\ \multicolumn{1}{c|}{ISRL~\cite{sun2021iterative}} & \multicolumn{1}{c|}{ResNet-101} & - & 74.27 & \multicolumn{1}{c|}{68.10} & - & 71.05 & \multicolumn{1}{c|}{58.25} & - & - & {\ul 70.05} \\ \multicolumn{1}{c|}{LBYL-Net~\cite{huang2021look}} & \multicolumn{1}{c|}{DarkNet-53} & 79.67 & 82.91 & \multicolumn{1}{c|}{74.15} & {\ul 68.64} & {\ul 73.38} & \multicolumn{1}{c|}{{\ul 59.49}} & 62.70 & - & - \\ \multicolumn{1}{c|}{TransVG~\cite{deng2021transvg}} & \multicolumn{1}{c|}{ResNet-101} & {81.02} & 82.72 & \multicolumn{1}{c|}{{78.35}} & 64.82 & 70.70 & \multicolumn{1}{c|}{56.94} & {67.02} & 68.67 & 67.73 \\ \multicolumn{1}{c|}{TransVG\ (Swin)} & \multicolumn{1}{c|}{Swin-S} & {\ul 82.33} & {\ul 84.01} & \multicolumn{1}{c|}{{\ul 79.83}} & 64.94 & 70.19 & \multicolumn{1}{c|}{56.47} & {\ul 67.81} & 69.34 & 68.99 \\ \midrule \multicolumn{1}{c|}{MMSwin\ \ (ours)} & \multicolumn{1}{c|}{Swin-S} & \textbf{84.01} & \textbf{85.85} & \multicolumn{1}{c|}{\textbf{82.34}} & \textbf{72.94} & \textbf{76.17} & \multicolumn{1}{c|}{\textbf{63.81}} & \textbf{71.89} & \textbf{73.03} & \textbf{72.52} \\ \bottomrule \end{tabular} \caption{The performance comparisons ([email protected]) on ReferCOCO, ReferCOCO+, and ReferCOCOg. The results of previous best two-stage and one-stage methods are highlighted with underlines. We highlight our results in bold. The results demonstrate that our method outperforms all state-of-the-art one-stage and two-stage methods.} \label{tab:main} \end{table*} We also present the accuracy comparison with state-of-the-art methods on ReferCOCO, ReferCOCO+, and ReferCOCOg in \Cref{tab:main}. In ReferCOCO and ReferCOCO+ datasets, referred objects are people in ``testA" and could be common objects in ``testB". The expressions in ReferCOCOg are much longer than the ones in other datasets. Note that TransVG uses a ResNet-101 and a DETR encoder split from a pre-trained DETR framework. Its backbone is more powerful than a single ResNet-101. We observe that our MMSwin\ \ greatly outperforms all two-stage and one-stage state-of-the-art methods. On RefCOCO and RefCOCO+ datasets, our method gains 1.84\%$\sim$2.52\% absolute improvement in ``testA" and 2.51\%$\sim$4.32\% in ``testB". When the referred objects are arbitrary, the inconsistent issue will be more serious, and our modulated backbone can better filter irrelevant objects and correct the representation with textual guidance. In the RefCOCOg test split, we notice that ISRL~\cite{sun2021iterative} performs better than TransVG~\cite{deng2021transvg}. It models the visual grounding as a Markov decision process that handles long expressions iterative by filtering out irrelevant areas. However, the limited action space makes it easy to converge to a local optimum. Our model does not modify the Visual-Linguistic Transformer in the TransVG and only provides query-consistent visual features. The performance is greatly improved, which demonstrates that our query-aware refinement is more effective to model the representation for visual grounding. \subsection{Ablation Study} We conduct ablation studies on ReferItGame and Flickr30k to reveal the effectiveness of the proposed MMSwin\ . We first study the effectiveness of QD-ATT\ in query-refined feature extraction and query-aware multiscale fusion. As shown in \Cref{tab:abl_module}, we use a checkmark to denote enabling QD-ATT\ in the corresponding module, and a cross mark to denote disabling QD-ATT\ and passing the feature without modification. When disabling QD-ATT\ in multiscale fusion, the performance is dropped by 2.52\% in ReferItGame-\textit{test} and 0.79\% in Flickr30k-\textit{test}, respectively. When disabling QD-ATT\ in query-refined feature extraction, the performance is dropped by 3.22\% and 1.51\%. When completely disabling QD-ATT, the performance is dropped by 3.75\% and 3.77\%. We find that QD-ATT\ is more important in query-refined feature extraction than in multiscale fusion. We also notice that, when compared with completely disabling QD-ATT, only enabling QD-ATT\ in multiscale fusion gains little improvement because the features from the transformer are still noise and query-inconsistent. We further study the effectiveness of spatial attention and channel attention in the QD-ATT. Spatial attention can filter out irrelevant areas. And channel attention can redistribute the importance of the features to fit different query sentences. The results shown in the \Cref{tab:abl_attention} demonstrate that spatial and channel attention are both effective. \begin{table}[tb] \small \centering \setlength{\tabcolsep}{4pt} \begin{tabular}{c|cc|cc|cc} \toprule \multirow{2}{*}{Models} & \multirow{2}{*}{\tabincell{c}{{\scriptsize Feature} \\ {\scriptsize Extraction}}} & \multirow{2}{*}{\tabincell{c}{{\scriptsize Multiscale} \\ {\scriptsize Fusion}}} & \multicolumn{2}{c}{ReferItGame} & \multicolumn{2}{c}{Flickr30k} \\ & & & val & test & val & test \\ \midrule MMSwin\ & \CheckmarkBold & \CheckmarkBold & \bf 76.84 & \bf 74.61 & \bf 80.83 & \bf 81.95 \\ \midrule (a) & \CheckmarkBold & \XSolidBrush & 74.31 & 72.09 & 80.09 & 81.16 \\ (b) & \XSolidBrush & \CheckmarkBold & 73.63 & 71.39 & 79.35 & 80.44\\ (c) & \XSolidBrush & \XSolidBrush & 73.25 & 70.86 & 77.17 & 78.18\\ \bottomrule \end{tabular} \caption{Ablation studies of QD-ATT\ in two phases of MMSwin\ .} \label{tab:abl_module} \vspace{1.2em} \small \setlength{\tabcolsep}{4pt} \begin{tabular}{c|cc|cc|cc} \toprule \multirow{2}{*}{Models} & \multirow{2}{*}{\tabincell{c}{{\scriptsize Channel} \\ {\scriptsize Attention}}} & \multirow{2}{*}{\tabincell{c}{{\scriptsize Spatial}\\{\scriptsize Attention}}} & \multicolumn{2}{c}{ReferItGame} & \multicolumn{2}{c}{Flickr30k} \\ & & & val & test & val & test \\ \midrule MMSwin\ & \CheckmarkBold & \CheckmarkBold & \bf 76.84 & \bf 74.61 & \bf 80.83 & \bf 81.95 \\ \midrule (d) & \CheckmarkBold & \XSolidBrush & 74.35 & 72.02 & 80.22 & 81.35 \\ (e) & \XSolidBrush & \CheckmarkBold & 74.41 & 71.80 & 80.67 & 81.55\\ \bottomrule \end{tabular} \caption{Ablation studies of different attentions in QD-ATT.} \label{tab:abl_attention} \end{table} \subsection{Qualitative Results} \begin{figure}[tb] \centering \includegraphics[width=1\linewidth]{figs/sup_vis.pdf} \caption{Visualization of activation maps from the backbone of our MMSwin\ \ and other popular models. Red: the predicted box. White: the ground-truth box.} \label{fig:vis} \vspace{-1em} \end{figure} We show the qualitative comparison between our MMSwin\ \ and three popular methods in \Cref{fig:vis}. The feature maps are extract from the backbone of each model. We can see that previous methods are sensitive to many query-unrelated areas, which may lead to wrong predictions, e.g., the results of TransVG and ReSC for the queries of ``glass upper righ" and ``light blue tall board", and the result of Swin-S for the query of ``upper left cake". In contrast, our QRNet generates query-consistent features and makes more accurate predictions. More results can be found in the supplementary. \subsection{Datasets and Evaluation We evaluate our method on phrase grounding dataset Flickr30K Entities\cite{plummer2015flickr30k} and referring expression grounding datasets RefCOCO\cite{yu2016modeling}, RefCOCO+\cite{yu2016modeling}, RefCOCOg\cite{mao2016generation} and ReferitGame\cite{kazemzadeh2014referitgame}. The details and statistics are summarized in Appendix. In phrase grounding the queries are phrases split from the captions and in referring expression grounding, they are referring expressions corresponding to the referred objects. We follow the same metric in \cite{deng2021transvg}. Specifically, a prediction is right if the IoU $>$ 0.5 between grounding-truth box and predicted bounding box. \subsection{Implementation Details} The Swin-Transformer we extend is the Swin-S pre-trained with Mask-RCNN on MSCOCO~\cite{lin2014microsoft}\footnote{We excluded images in the validation and test split of the refcoco series from mscoco training set and retrained Swin-Transformer for fair comparison.}. We use $\mathrm{BERT}_{\mathrm{base}}$(uncased)\footnote{https://github.com/huggingface/pytorch-pretrained-BERT} for linguistic feature extraction. We set the intermediate dimension $D=256$ and the factor dimension $K=30$. We follow the TransVG~\cite{deng2021transvg} to process the input images and sentences. We also follow the training setting used in TransVG, which uses a AdamW optimizer with weight decay $10^{-4}$, sets the batch size to 64 and the dropout ratio to 0.1 for FFN in transformer. The learning rate of pre-trained parameters is set to $10^{-5}$ and the other is set to $10^{-4}$. The parameters without pre-training are randomly initialized with Xavier. We training our model for 160 epoches. The learning rate is multiplied by a factor of 0.1 at the epoch 60 for most dataset and 40 for Flickr30K Entities. We also follow the common used data augmentation strategies in ~\cite{liao2020real,yang2020improving,yang2019fast}. \subsection{Quantitative Results} We show the comparison results on ReferItGame and Flickr30k Entities in \Cref{tab:sub_main}. The ReferItGame collects queries by a cooperative game, requiring one player to write a referring expression for a specified object. The other one needs to click on the correct object. Queries in Flickr30k Entities are phrases in the caption. MMSwin\ \ also outperforms previous works. We replace the visual branch of TransVG with Swin-Transformer and denote it as TransVG(Swin) to explore the impact of replacing the backbone. The performance is similar to the origin TransVG, indicating that the accuracy gains are not from Swin-Transformer. \begin{table}[t] \small \centering \begin{tabular}{@{}cccc@{}} \toprule \multicolumn{1}{c|}{\multirow{2}{*}{Module}} & \multicolumn{1}{c|}{\multirow{2}{*}{Backbone}} & \multicolumn{1}{c|}{ReferItGame} & Flickr30K \\ \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{test} & test \\ \midrule \multicolumn{4}{l}{\textbf{Two-stage}} \\ \midrule \multicolumn{1}{c|}{CMN~\cite{hu2017modeling}} & \multicolumn{1}{c|}{VGG16} & \multicolumn{1}{c|}{28.33} & - \\ \multicolumn{1}{c|}{VC~\cite{zhang2018grounding}} & \multicolumn{1}{c|}{VGG16} & \multicolumn{1}{c|}{31.13} & - \\ \multicolumn{1}{c|}{MAttNet~\cite{yu2018mattnet}} & \multicolumn{1}{c|}{ResNet-101} & \multicolumn{1}{c|}{29.04} & - \\ \multicolumn{1}{c|}{Similarity net~\cite{wang2018learning}} & \multicolumn{1}{c|}{ResNet-101} & \multicolumn{1}{c|}{34.54} & 50.89 \\ \multicolumn{1}{c|}{LCMCG~\cite{liu2020learning}} & \multicolumn{1}{c|}{ResNet-101} & \multicolumn{1}{c|}{-} & 76.74 \\ \multicolumn{1}{c|}{DIGN~\cite{mu2021disentangled}} & \multicolumn{1}{c|}{VGG-16} & \multicolumn{1}{c|}{{\ul 65.15}} & {\ul 78.73} \\ \midrule \multicolumn{4}{l}{\textbf{One-stage}} \\ \midrule \multicolumn{1}{c|}{SSG~\cite{chen2018real}} & \multicolumn{1}{c|}{DarkNet-53} & \multicolumn{1}{c|}{54.24} & - \\ \multicolumn{1}{c|}{FAOA~\cite{yang2019fast}} & \multicolumn{1}{c|}{DarkNet-53} & \multicolumn{1}{c|}{60.67} & 68.71 \\ \multicolumn{1}{c|}{RCCF~\cite{liao2020real}} & \multicolumn{1}{c|}{DLA-34} & \multicolumn{1}{c|}{63.79} & - \\ \multicolumn{1}{c|}{ReSC-Large~\cite{yang2020improving}} & \multicolumn{1}{c|}{DarkNet-53} & \multicolumn{1}{c|}{64.60} & 69.28 \\ \multicolumn{1}{c|}{SAFF~\cite{ye2021one}} & \multicolumn{1}{c|}{DarkNet-53} & \multicolumn{1}{c|}{66.01} & 70.71 \\ \multicolumn{1}{c|}{TransVG~\cite{deng2021transvg}} & \multicolumn{1}{c|}{ResNet-101} & \multicolumn{1}{c|}{70.73} & {\ul 79.10} \\ \multicolumn{1}{c|}{TransVG\,(Swin)} & \multicolumn{1}{c|}{Swin-S} & \multicolumn{1}{c|}{{\ul 70.86}} & 78.18 \\ \midrule \multicolumn{1}{c|}{MMSwin\ \ (ours)} & \multicolumn{1}{c|}{Swin-S} & \multicolumn{1}{c|}{\textbf{74.61}} & \textbf{81.95} \\ \bottomrule \end{tabular} \caption{The performance comparisons ([email protected]) on ReferItGame and Flickr30K Entities.} \label{tab:sub_main} \end{table} \begin{table*}[ht] \centering \begin{tabular}{@{}ccccccccccc@{}} \toprule \multicolumn{1}{c|}{\multirow{2}{*}{Models}} & \multicolumn{1}{c|}{\multirow{2}{*}{Backbone}} & \multicolumn{3}{c|}{RefCOCO} & \multicolumn{3}{c|}{RefCOCO+} & \multicolumn{3}{c}{RefCOCOg} \\ \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & val & testA & \multicolumn{1}{c|}{testB} & val & testA & \multicolumn{1}{c|}{testB} & val-g & val-u & test-u \\ \midrule \multicolumn{11}{l}{\textbf{Two-stage}} \\ \midrule \multicolumn{1}{c|}{CMN~\cite{hu2017modeling}} & \multicolumn{1}{c|}{VGG16} & - & 71.03 & \multicolumn{1}{c|}{65.77} & - & 54.32 & \multicolumn{1}{c|}{47.76} & 57.47 & - & - \\ \multicolumn{1}{c|}{VC~\cite{zhang2018grounding}} & \multicolumn{1}{c|}{VGG16} & - & 73.33 & \multicolumn{1}{c|}{67.44} & - & 58.40 & \multicolumn{1}{c|}{53.18} & 62.30 & - & - \\ \multicolumn{1}{c|}{MAttNet~\cite{yu2018mattnet}} & \multicolumn{1}{c|}{ResNet-101} & 76.65 & 81.14 & \multicolumn{1}{c|}{69.99} & 65.33 & 71.62 & \multicolumn{1}{c|}{56.02} & - & 66.58 & 67.27 \\ \multicolumn{1}{c|}{Ref-NMS~\cite{chen2021ref}} & \multicolumn{1}{c|}{ResNet-101} & {\ul 78.82} & 82.71 & \multicolumn{1}{c|}{{\ul 73.94}} & 66.95 & 71.29 & \multicolumn{1}{c|}{{\ul 58.40}} & - & {\ul 68.89} & {\ul 68.67} \\ \multicolumn{1}{c|}{LGRANs~\cite{wang2019neighbourhood}} & \multicolumn{1}{c|}{VGG16} & - & 76.60 & \multicolumn{1}{c|}{66.40} & - & 64.00 & \multicolumn{1}{c|}{53.40} & 61.78 & - & - \\ \multicolumn{1}{c|}{RvG-Tree~\cite{hong2019learning}} & \multicolumn{1}{c|}{ResNet-101} & 75.06 & 78.61 & \multicolumn{1}{c|}{69.85} & 63.51 & 67.45 & \multicolumn{1}{c|}{56.66} & - & 66.95 & 66.51 \\ \multicolumn{1}{c|}{CM-Att-Erase~\cite{liu2019improving}} & \multicolumn{1}{c|}{ResNet-101} & 78.35 & {\ul 83.14} & \multicolumn{1}{c|}{71.32} & {\ul 68.09} & {\ul 73.65} & \multicolumn{1}{c|}{58.03} & {\ul 68.67} & - & - \\ \multicolumn{1}{c|}{NMTree~\cite{liu2019learning}} & \multicolumn{1}{c|}{ResNet-101} & 76.41 & 81.21 & \multicolumn{1}{c|}{70.09} & 66.46 & 72.02 & \multicolumn{1}{c|}{57.52} & 64.62 & 65.87 & 66.44 \\ \midrule \multicolumn{11}{l}{\textbf{One-stage}} \\ \midrule \multicolumn{1}{c|}{SSG~\cite{chen2018real}} & \multicolumn{1}{c|}{DarkNet-53} & - & 76.51 & \multicolumn{1}{c|}{67.50} & - & 62.14 & \multicolumn{1}{c|}{49.27} & 47.47 & 58.80 & - \\ \multicolumn{1}{c|}{FAOA~\cite{yang2019fast}} & \multicolumn{1}{c|}{DarkNet-53} & 72.54 & 74.35 & \multicolumn{1}{c|}{68.50} & 56.81 & 60.23 & \multicolumn{1}{c|}{49.60} & 56.12 & 61.33 & 60.36 \\ \multicolumn{1}{c|}{RCCF~\cite{liao2020real}} & \multicolumn{1}{c|}{DLA-34} & - & 81.06 & \multicolumn{1}{c|}{71.85} & - & 70.35 & \multicolumn{1}{c|}{56.32} & - & - & 65.73 \\ \multicolumn{1}{c|}{ReSC-Large~\cite{yang2020improving}} & \multicolumn{1}{c|}{DarkNet-53} & 77.63 & 80.45 & \multicolumn{1}{c|}{72.30} & 63.59 & 68.36 & \multicolumn{1}{c|}{56.81} & 63.12 & 67.30 & 67.20 \\ \multicolumn{1}{c|}{SAFF~\cite{ye2021one}} & \multicolumn{1}{c|}{DarkNet-53} & 79.26 & 81.09 & \multicolumn{1}{c|}{76.55} & 64.43 & 68.46 & \multicolumn{1}{c|}{58.43} & - & 68.94 & 68.91 \\ \multicolumn{1}{c|}{HFRN~\cite{qiu2020language}} & \multicolumn{1}{c|}{ResNet-101} & 79.76 & {\ul 83.12} & \multicolumn{1}{c|}{75.51} & 66.80 & 72.53 & \multicolumn{1}{c|}{59.09} & - & {\ul 69.71} & 69.08 \\ \multicolumn{1}{c|}{ISRL~\cite{sun2021iterative}} & \multicolumn{1}{c|}{ResNet-101} & - & 74.27 & \multicolumn{1}{c|}{68.10} & - & 71.05 & \multicolumn{1}{c|}{58.25} & - & - & {\ul 70.05} \\ \multicolumn{1}{c|}{LBYL-Net~\cite{huang2021look}} & \multicolumn{1}{c|}{DarkNet-53} & 79.67 & 82.91 & \multicolumn{1}{c|}{74.15} & {\ul 68.64} & {\ul 73.38} & \multicolumn{1}{c|}{{\ul 59.49}} & 62.70 & - & - \\ \multicolumn{1}{c|}{TransVG~\cite{deng2021transvg}} & \multicolumn{1}{c|}{ResNet-101} & {\ul 81.02} & 82.72 & \multicolumn{1}{c|}{{\ul 78.35}} & 64.82 & 70.70 & \multicolumn{1}{c|}{56.94} & {\ul 67.02} & 68.67 & 67.73 \\ \midrule \multicolumn{1}{c|}{MMSwin\ \ (ours)} & \multicolumn{1}{c|}{Swin-S} & \textbf{84.01} & \textbf{85.85} & \multicolumn{1}{c|}{\textbf{82.34}} & \textbf{72.94} & \textbf{76.17} & \multicolumn{1}{c|}{\textbf{63.81}} & \textbf{74.05} & \textbf{75.80} & \textbf{75.52} \\ \bottomrule \end{tabular} \caption{The performance comparisons ([email protected]) on ReferCOCO, ReferCOCO+,ReferCOCOg. The previous best two-stage and one-stage performances are highlighted with underline, respectively. We highlight our results in bold. The results demonstrate our method outperforms all state-of-the-art one-stage and two-stage methods.} \label{tab:main} \end{table*} We also present the accuracy comparison with state-of-the-art methods on ReferCOCO, ReferCOCO+ and ReferCOCOg in \Cref{tab:main}. In ReferCOCO and ReferCOCO+ datasets, referred objects are people in ``testA" and could be common objects in ``testB". The expressions in ReferCOCOg are much longer than in other datasets. Note that TransVG uses a ResNet-101 and a DETR encoder split from a pre-trained DETR framework. The visual backbone is more powerful than other ResNet-101. Because the MDETR\cite{kamath2021mdetr} uses large-scale image-caption pairs with bounding box annotations for pre-training, the other methods only use the corresponding train split when evaluated on each dataset. For fair, we do not present its performances. We observe that our MMSwin\ \ greatly outperforms all two-stage and one-stage stage-of-the-art methods. In RefCOCO and RefCOCO+ datasets, our method gains 2.37\%$\sim$2.79\% absolute improvement in ``testA" and 3.99\%$\sim$4.32\% in ``testB". When the referred objects are arbitrary, the inconsistent issue will be more obvious, and our modulated backbone can better filter irrelevant objects and correct the representation with textual guidance. In the RefCOCOg test split, we notice that ISRL~\cite{sun2021iterative} performs better than TransVG~\cite{deng2021transvg}. It models the visual grounding to a Markov decision process that handles long expressions iterative by filtering out irrelevant areas. However, the limited action space makes it easy to converge to a local optimum. Our model does not modify the Visual-Linguistic Transformer in the TransVG but only provides query-consistent visual features. The performance is greatly improved which proves that our query-aware refinement is more effective to model the multimodal representation for visual grounding. \subsection{Ablation Study} \begin{table}[tb] \small \setlength{\tabcolsep}{8pt} \centering \begin{tabular}{c|cc|cc} \toprule \multirow{2}{*}{Models} & \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Feature \\ Extraction\end{tabular}} & \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Multiscale\\ Fusion\end{tabular}} & \multicolumn{2}{l}{ReferItGame} \\ & & & val & test \\ \midrule MMSwin\ & \CheckmarkBold & \CheckmarkBold & \bf 76.84 & \bf 74.61 \\ \midrule (a) & \CheckmarkBold & \XSolidBrush & 74.31 & 72.09 \\ (b) & \XSolidBrush & \CheckmarkBold & 73.63 & 71.39 \\ (c) & \XSolidBrush & \XSolidBrush & 73.25 & 70.86 \\ \bottomrule \end{tabular} \caption{The ablations of the proposed two modules.} \label{tab:abl_module} \vspace{1.5em} \begin{tabular}{c|cc|cc} \toprule \multirow{2}{*}{Models} & \multirow{2}{*}{\tabincell{c}{Channel\\ Attention}} & \multirow{2}{*}{\tabincell{c}{Spatial\\ Attention}} & \multicolumn{2}{c}{ReferItGame} \\ & & & val & test \\ \midrule MMSwin\ & \CheckmarkBold & \CheckmarkBold & \bf 76.84 & \bf 74.61 \\ \midrule (d) & \CheckmarkBold & \XSolidBrush & 74.35 & 72.02 \\ (e) & \XSolidBrush & \CheckmarkBold & 74.41 & 71.80 \\ \bottomrule \end{tabular} \caption{The ablations of the query-driven attention.} \label{tab:abl_attention} \end{table} We conduct several ablation studies on ReferItGame to reveal the effectiveness of our proposed modules. We first study the effectiveness of the two proposed modules. As shown in \Cref{tab:abl_module}, when only adopting QD-ATT\ during feature extraction, the performance is improved by 1.06\% in ``val" and 1.27\% in ``test", respectively. When only adopting QD-ATT\ during multiscale fusion, the performance is improved by 0.38\% and 0.53\%. When enhancing both two processes, the performance is improved by 3.63\% and 3.59\%. We find that when the feature extraction is not modified, the features of each scale are still query-inconsistent. {\color{red}It is hard for the fusion module to learn both feature refinement and query-aware multiscale fusion from scratch without the help of pre-training knowledge.} Thus there is still much noise in the fused multiscale features, which limits its improvement. When the feature extraction is query-aware, the multiscale fusion can significantly improve the model's performance. We further study the effectiveness of spatial attention and channel attention in the QD-ATT. Note that the settings affect both the feature extraction and multiscale fusion. Spatial attention can filter out irrelevant areas. And channel attention can redistribution the importance of the features to fit different query sentences. The results shown in the \Cref{tab:abl_attention} demonstrate that spatial and channel attention are both effective. \begin{figure}[tb] \centering \includegraphics[width=\linewidth]{figs/factor.pdf} \caption{The effect of factor dimension $K$.} \label{fig:factor} \end{figure} We study the hyper-parameter $K$ which denotes the factor dimension. We report the accuracy of model with $K=\{10,30,50,70\}$ in \Cref{fig:factor}. When $K$ is small, the QD-ATT\ can not learn the transformation well. And when $K$ is large, the QD-ATT\ is easy to overfitting and perform worse on validation set. We take the best $K=30$ on validation set as our default setting. \subsection{Qualitative Results} \begin{figure}[tb] \centering \includegraphics[width=\linewidth]{figs/vis_1_cropped.pdf} \caption{Visualization of activation maps from plain Swin-Transformer and the modulated backbone of our MMSwin\ \ . Green: grounding truth; blue: prediction of our model} \label{fig:vis} \end{figure} We show the qualitative examples of our MMSwin\ \ framework on the RefCOCO dataset in \Cref{fig:vis}. The first row shows the activation maps from plain Swin-Transformer. The second row shows the activation maps from our modulated visual backbone. We observe that query-agnostic Swin-Transformer tends to extract features of all salient objects. In comparison, our query-aware backbone can understand entities words, \eg, ``glass'', and appearance descriptions, \eg, ``light blue tall''. It also can perform reasoning through location words, \eg, ``upper left'' and ``nearest''. The produced activation maps are highly relevant to the query sentences. \subsection{Language} All manuscripts must be in English. \subsection{Dual submission} Please refer to the author guidelines on the CVPR\ 2022\ web page for a discussion of the policy on dual submissions. \subsection{Paper length} Papers, excluding the references section, must be no longer than eight pages in length. The references section will not be included in the page count, and there is no limit on the length of the references section. For example, a paper of eight pages with two pages of references would have a total length of 10 pages. {\bf There will be no extra page charges for CVPR\ 2022.} Overlength papers will simply not be reviewed. This includes papers where the margins and formatting are deemed to have been significantly altered from those laid down by this style guide. Note that this \LaTeX\ guide already sets figure captions and references in a smaller font. The reason such papers will not be reviewed is that there is no provision for supervised revisions of manuscripts. The reviewing process cannot determine the suitability of the paper for presentation in eight pages if it is reviewed in eleven. \subsection{The ruler} The \LaTeX\ style defines a printed ruler which should be present in the version submitted for review. The ruler is provided in order that reviewers may comment on particular lines in the paper without circumlocution. If you are preparing a document using a non-\LaTeX\ document preparation system, please arrange for an equivalent ruler to appear on the final output pages. The presence or absence of the ruler should not change the appearance of any other content on the page. The camera-ready copy should not contain a ruler. (\LaTeX\ users may use options of cvpr.sty to switch between different versions.) Reviewers: note that the ruler measurements do not align well with lines in the paper --- this turns out to be very difficult to do well when the paper contains many figures and equations, and, when done, looks ugly. Just use fractional references (\eg, this line is $087.5$), although in most cases one would expect that the approximate location will be adequate. \subsection{Paper ID} Make sure that the Paper ID from the submission system is visible in the version submitted for review (replacing the ``*****'' you see in this document). If you are using the \LaTeX\ template, \textbf{make sure to update paper ID in the appropriate place in the tex file}. \subsection{Mathematics} Please number all of your sections and displayed equations as in these examples: \begin{equation} E = m\cdot c^2 \label{eq:important} \end{equation} and \begin{equation} v = a\cdot t. \label{eq:also-important} \end{equation} It is important for readers to be able to refer to any particular equation. Just because you did not refer to it in the text does not mean some future reader might not need to refer to it. It is cumbersome to have to use circumlocutions like ``the equation second from the top of page 3 column 1''. (Note that the ruler will not be present in the final copy, so is not an alternative to equation numbers). All authors will benefit from reading Mermin's description of how to write mathematics: \url{http://www.pamitc.org/documents/mermin.pdf}. \subsection{Blind review} Many authors misunderstand the concept of anonymizing for blind review. Blind review does not mean that one must remove citations to one's own work---in fact it is often impossible to review a paper unless the previous citations are known and available. Blind review means that you do not use the words ``my'' or ``our'' when citing previous work. That is all. (But see below for tech reports.) Saying ``this builds on the work of Lucy Smith [1]'' does not say that you are Lucy Smith; it says that you are building on her work. If you are Smith and Jones, do not say ``as we show in [7]'', say ``as Smith and Jones show in [7]'' and at the end of the paper, include reference 7 as you would any other cited work. An example of a bad paper just asking to be rejected: \begin{quote} \begin{center} An analysis of the frobnicatable foo filter. \end{center} In this paper we present a performance analysis of our previous paper [1], and show it to be inferior to all previously known methods. Why the previous paper was accepted without this analysis is beyond me. [1] Removed for blind review \end{quote} An example of an acceptable paper: \begin{quote} \begin{center} An analysis of the frobnicatable foo filter. \end{center} In this paper we present a performance analysis of the paper of Smith \etal [1], and show it to be inferior to all previously known methods. Why the previous paper was accepted without this analysis is beyond me. [1] Smith, L and Jones, C. ``The frobnicatable foo filter, a fundamental contribution to human knowledge''. Nature 381(12), 1-213. \end{quote} If you are making a submission to another conference at the same time, which covers similar or overlapping material, you may need to refer to that submission in order to explain the differences, just as you would if you had previously published related work. In such cases, include the anonymized parallel submission~\cite{Authors14} as supplemental material and cite it as \begin{quote} [1] Authors. ``The frobnicatable foo filter'', F\&G 2014 Submission ID 324, Supplied as supplemental material {\tt fg324.pdf}. \end{quote} Finally, you may feel you need to tell the reader that more details can be found elsewhere, and refer them to a technical report. For conference submissions, the paper must stand on its own, and not {\em require} the reviewer to go to a tech report for further details. Thus, you may say in the body of the paper ``further details may be found in~\cite{Authors14b}''. Then submit the tech report as supplemental material. Again, you may not assume the reviewers will read this material. Sometimes your paper is about a problem which you tested using a tool that is widely known to be restricted to a single institution. For example, let's say it's 1969, you have solved a key problem on the Apollo lander, and you believe that the CVPR70 audience would like to hear about your solution. The work is a development of your celebrated 1968 paper entitled ``Zero-g frobnication: How being the only people in the world with access to the Apollo lander source code makes us a wow at parties'', by Zeus \etal. You can handle this paper like any other. Do not write ``We show how to improve our previous work [Anonymous, 1968]. This time we tested the algorithm on a lunar lander [name of lander removed for blind review]''. That would be silly, and would immediately identify the authors. Instead write the following: \begin{quotation} \noindent We describe a system for zero-g frobnication. This system is new because it handles the following cases: A, B. Previous systems [Zeus et al. 1968] did not handle case B properly. Ours handles it by including a foo term in the bar integral. ... The proposed system was integrated with the Apollo lunar lander, and went all the way to the moon, don't you know. It displayed the following behaviours, which show how well we solved cases A and B: ... \end{quotation} As you can see, the above text follows standard scientific convention, reads better than the first version, and does not explicitly name you as the authors. A reviewer might think it likely that the new paper was written by Zeus \etal, but cannot make any decision based on that guess. He or she would have to be sure that no other authors could have been contracted to solve problem B. \medskip \noindent FAQ\medskip\\ {\bf Q:} Are acknowledgements OK?\\ {\bf A:} No. Leave them for the final copy.\medskip\\ {\bf Q:} How do I cite my results reported in open challenges? {\bf A:} To conform with the double-blind review policy, you can report results of other challenge participants together with your results in your paper. For your results, however, you should not identify yourself and should not mention your participation in the challenge. Instead present your results referring to the method proposed in your paper and draw conclusions based on the experimental comparison to other results.\medskip\\ \begin{figure}[t] \centering \fbox{\rule{0pt}{2in} \rule{0.9\linewidth}{0pt}} \caption{Example of caption. It is set in Roman so that mathematics (always set in Roman: $B \sin A = A \sin B$) may be included without an ugly clash.} \label{fig:onecol} \end{figure} \subsection{Miscellaneous} \noindent Compare the following:\\ \begin{tabular}{ll} \verb'$conf_a$' & $conf_a$ \\ \verb'$\mathit{conf}_a$' & $\mathit{conf}_a$ \end{tabular}\\ See The \TeX book, p165. The space after \eg, meaning ``for example'', should not be a sentence-ending space. So \eg is correct, {\em e.g.} is not. The provided \verb'\eg' macro takes care of this. When citing a multi-author paper, you may save space by using ``et alia'', shortened to ``\etal'' (not ``{\em et.\ al.}'' as ``{\em et}'' is a complete word). If you use the \verb'\etal' macro provided, then you need not worry about double periods when used at the end of a sentence as in Alpher \etal. However, use it only when there are three or more authors. Thus, the following is correct: ``Frobnication has been trendy lately. It was introduced by Alpher~\cite{Alpher02}, and subsequently developed by Alpher and Fotheringham-Smythe~\cite{Alpher03}, and Alpher \etal~\cite{Alpher04}.'' This is incorrect: ``... subsequently developed by Alpher \etal~\cite{Alpher03} ...'' because reference~\cite{Alpher03} has just two authors. \begin{figure*} \centering \begin{subfigure}{0.68\linewidth} \fbox{\rule{0pt}{2in} \rule{.9\linewidth}{0pt}} \caption{An example of a subfigure.} \label{fig:short-a} \end{subfigure} \hfill \begin{subfigure}{0.28\linewidth} \fbox{\rule{0pt}{2in} \rule{.9\linewidth}{0pt}} \caption{Another example of a subfigure.} \label{fig:short-b} \end{subfigure} \caption{Example of a short caption, which should be centered.} \label{fig:short} \end{figure*} \section{Formatting your paper} \label{sec:formatting} All text must be in a two-column format. The total allowable size of the text area is $6\frac78$ inches (17.46 cm) wide by $8\frac78$ inches (22.54 cm) high. Columns are to be $3\frac14$ inches (8.25 cm) wide, with a $\frac{5}{16}$ inch (0.8 cm) space between them. The main title (on the first page) should begin 1 inch (2.54 cm) from the top edge of the page. The second and following pages should begin 1 inch (2.54 cm) from the top edge. On all pages, the bottom margin should be $1\frac{1}{8}$ inches (2.86 cm) from the bottom edge of the page for $8.5 \times 11$-inch paper; for A4 paper, approximately $1\frac{5}{8}$ inches (4.13 cm) from the bottom edge of the page. \subsection{Margins and page numbering} All printed material, including text, illustrations, and charts, must be kept within a print area $6\frac{7}{8}$ inches (17.46 cm) wide by $8\frac{7}{8}$ inches (22.54 cm) high. Page numbers should be in the footer, centered and $\frac{3}{4}$ inches from the bottom of the page. The review version should have page numbers, yet the final version submitted as camera ready should not show any page numbers. The \LaTeX\ template takes care of this when used properly. \subsection{Type style and fonts} Wherever Times is specified, Times Roman may also be used. If neither is available on your word processor, please use the font closest in appearance to Times to which you have access. MAIN TITLE. Center the title $1\frac{3}{8}$ inches (3.49 cm) from the top edge of the first page. The title should be in Times 14-point, boldface type. Capitalize the first letter of nouns, pronouns, verbs, adjectives, and adverbs; do not capitalize articles, coordinate conjunctions, or prepositions (unless the title begins with such a word). Leave two blank lines after the title. AUTHOR NAME(s) and AFFILIATION(s) are to be centered beneath the title and printed in Times 12-point, non-boldface type. This information is to be followed by two blank lines. The ABSTRACT and MAIN TEXT are to be in a two-column format. MAIN TEXT. Type main text in 10-point Times, single-spaced. Do NOT use double-spacing. All paragraphs should be indented 1 pica (approx.~$\frac{1}{6}$ inch or 0.422 cm). Make sure your text is fully justified---that is, flush left and flush right. Please do not place any additional blank lines between paragraphs. Figure and table captions should be 9-point Roman type as in \cref{fig:onecol,fig:short}. Short captions should be centred. \noindent Callouts should be 9-point Helvetica, non-boldface type. Initially capitalize only the first word of section titles and first-, second-, and third-order headings. FIRST-ORDER HEADINGS. (For example, {\large \bf 1. Introduction}) should be Times 12-point boldface, initially capitalized, flush left, with one blank line before, and one blank line after. SECOND-ORDER HEADINGS. (For example, { \bf 1.1. Database elements}) should be Times 11-point boldface, initially capitalized, flush left, with one blank line before, and one after. If you require a third-order heading (we discourage it), use 10-point Times, boldface, initially capitalized, flush left, preceded by one blank line, followed by a period and your text on the same line. \subsection{Footnotes} Please use footnotes\footnote{This is what a footnote looks like. It often distracts the reader from the main flow of the argument.} sparingly. Indeed, try to avoid footnotes altogether and include necessary peripheral observations in the text (within parentheses, if you prefer, as in this sentence). If you wish to use a footnote, place it at the bottom of the column on the page on which it is referenced. Use Times 8-point type, single-spaced. \subsection{Cross-references} For the benefit of author(s) and readers, please use the {\small\begin{verbatim} \cref{...} \end{verbatim}} command for cross-referencing to figures, tables, equations, or sections. This will automatically insert the appropriate label alongside the cross-reference as in this example: \begin{quotation} To see how our method outperforms previous work, please see \cref{fig:onecol} and \cref{tab:example}. It is also possible to refer to multiple targets as once, \eg~to \cref{fig:onecol,fig:short-a}. You may also return to \cref{sec:formatting} or look at \cref{eq:also-important}. \end{quotation} If you do not wish to abbreviate the label, for example at the beginning of the sentence, you can use the {\small\begin{verbatim} \Cref{...} \end{verbatim}} command. Here is an example: \begin{quotation} \Cref{fig:onecol} is also quite important. \end{quotation} \subsection{References} List and number all bibliographical references in 9-point Times, single-spaced, at the end of your paper. When referenced in the text, enclose the citation number in square brackets, for example~\cite{Authors14}. Where appropriate, include page numbers and the name(s) of editors of referenced books. When you cite multiple papers at once, please make sure that you cite them in numerical order like this \cite{Alpher02,Alpher03,Alpher05,Authors14b,Authors14}. If you use the template as advised, this will be taken care of automatically. \begin{table} \centering \begin{tabular}{@{}lc@{}} \toprule Method & Frobnability \\ \midrule Theirs & Frumpy \\ Yours & Frobbly \\ Ours & Makes one's heart Frob\\ \bottomrule \end{tabular} \caption{Results. Ours is better.} \label{tab:example} \end{table} \subsection{Illustrations, graphs, and photographs} All graphics should be centered. In \LaTeX, avoid using the \texttt{center} environment for this purpose, as this adds potentially unwanted whitespace. Instead use {\small\begin{verbatim} \centering \end{verbatim}} at the beginning of your figure. Please ensure that any point you wish to make is resolvable in a printed copy of the paper. Resize fonts in figures to match the font in the body text, and choose line widths that render effectively in print. Readers (and reviewers), even of an electronic copy, may choose to print your paper in order to read it. You cannot insist that they do otherwise, and therefore must not assume that they can zoom in to see tiny details on a graphic. When placing figures in \LaTeX, it's almost always best to use \verb+\includegraphics+, and to specify the figure width as a multiple of the line width as in the example below {\small\begin{verbatim} \usepackage{graphicx} ... \includegraphics[width=0.8\linewidth] {myfile.pdf} \end{verbatim} } \subsection{Color} Please refer to the author guidelines on the CVPR\ 2022\ web page for a discussion of the use of color in your document. If you use color in your plots, please keep in mind that a significant subset of reviewers and readers may have a color vision deficiency; red-green blindness is the most frequent kind. Hence avoid relying only on color as the discriminative feature in plots (such as red \vs green lines), but add a second discriminative feature to ease disambiguation. \section{Final copy} You must include your signed IEEE copyright release form when you submit your finished paper. We MUST have this form before your paper can be published in the proceedings. Please direct any questions to the production editor in charge of these proceedings at the IEEE Computer Society Press: \url{https://www.computer.org/about/contact}. \section{Introduction} \label{sec:intro} Please follow the steps outlined below when submitting your manuscript to the IEEE Computer Society Press. This style guide now has several important modifications (for example, you are no longer warned against the use of sticky tape to attach your artwork to the paper), so all authors should read this new version. \subsection{Language} All manuscripts must be in English. \subsection{Dual submission} Please refer to the author guidelines on the CVPR\ 2022\ web page for a discussion of the policy on dual submissions. \subsection{Paper length} Papers, excluding the references section, must be no longer than eight pages in length. The references section will not be included in the page count, and there is no limit on the length of the references section. For example, a paper of eight pages with two pages of references would have a total length of 10 pages. {\bf There will be no extra page charges for CVPR\ 2022.} Overlength papers will simply not be reviewed. This includes papers where the margins and formatting are deemed to have been significantly altered from those laid down by this style guide. Note that this \LaTeX\ guide already sets figure captions and references in a smaller font. The reason such papers will not be reviewed is that there is no provision for supervised revisions of manuscripts. The reviewing process cannot determine the suitability of the paper for presentation in eight pages if it is reviewed in eleven. \subsection{The ruler} The \LaTeX\ style defines a printed ruler which should be present in the version submitted for review. The ruler is provided in order that reviewers may comment on particular lines in the paper without circumlocution. If you are preparing a document using a non-\LaTeX\ document preparation system, please arrange for an equivalent ruler to appear on the final output pages. The presence or absence of the ruler should not change the appearance of any other content on the page. The camera-ready copy should not contain a ruler. (\LaTeX\ users may use options of cvpr.sty to switch between different versions.) Reviewers: note that the ruler measurements do not align well with lines in the paper --- this turns out to be very difficult to do well when the paper contains many figures and equations, and, when done, looks ugly. Just use fractional references (\eg, this line is $087.5$), although in most cases one would expect that the approximate location will be adequate. \subsection{Paper ID} Make sure that the Paper ID from the submission system is visible in the version submitted for review (replacing the ``*****'' you see in this document). If you are using the \LaTeX\ template, \textbf{make sure to update paper ID in the appropriate place in the tex file}. \subsection{Mathematics} Please number all of your sections and displayed equations as in these examples: \begin{equation} E = m\cdot c^2 \label{eq:important} \end{equation} and \begin{equation} v = a\cdot t. \label{eq:also-important} \end{equation} It is important for readers to be able to refer to any particular equation. Just because you did not refer to it in the text does not mean some future reader might not need to refer to it. It is cumbersome to have to use circumlocutions like ``the equation second from the top of page 3 column 1''. (Note that the ruler will not be present in the final copy, so is not an alternative to equation numbers). All authors will benefit from reading Mermin's description of how to write mathematics: \url{http://www.pamitc.org/documents/mermin.pdf}. \subsection{Blind review} Many authors misunderstand the concept of anonymizing for blind review. Blind review does not mean that one must remove citations to one's own work---in fact it is often impossible to review a paper unless the previous citations are known and available. Blind review means that you do not use the words ``my'' or ``our'' when citing previous work. That is all. (But see below for tech reports.) Saying ``this builds on the work of Lucy Smith [1]'' does not say that you are Lucy Smith; it says that you are building on her work. If you are Smith and Jones, do not say ``as we show in [7]'', say ``as Smith and Jones show in [7]'' and at the end of the paper, include reference 7 as you would any other cited work. An example of a bad paper just asking to be rejected: \begin{quote} \begin{center} An analysis of the frobnicatable foo filter. \end{center} In this paper we present a performance analysis of our previous paper [1], and show it to be inferior to all previously known methods. Why the previous paper was accepted without this analysis is beyond me. [1] Removed for blind review \end{quote} An example of an acceptable paper: \begin{quote} \begin{center} An analysis of the frobnicatable foo filter. \end{center} In this paper we present a performance analysis of the paper of Smith \etal [1], and show it to be inferior to all previously known methods. Why the previous paper was accepted without this analysis is beyond me. [1] Smith, L and Jones, C. ``The frobnicatable foo filter, a fundamental contribution to human knowledge''. Nature 381(12), 1-213. \end{quote} If you are making a submission to another conference at the same time, which covers similar or overlapping material, you may need to refer to that submission in order to explain the differences, just as you would if you had previously published related work. In such cases, include the anonymized parallel submission~\cite{Authors14} as supplemental material and cite it as \begin{quote} [1] Authors. ``The frobnicatable foo filter'', F\&G 2014 Submission ID 324, Supplied as supplemental material {\tt fg324.pdf}. \end{quote} Finally, you may feel you need to tell the reader that more details can be found elsewhere, and refer them to a technical report. For conference submissions, the paper must stand on its own, and not {\em require} the reviewer to go to a tech report for further details. Thus, you may say in the body of the paper ``further details may be found in~\cite{Authors14b}''. Then submit the tech report as supplemental material. Again, you may not assume the reviewers will read this material. Sometimes your paper is about a problem which you tested using a tool that is widely known to be restricted to a single institution. For example, let's say it's 1969, you have solved a key problem on the Apollo lander, and you believe that the CVPR70 audience would like to hear about your solution. The work is a development of your celebrated 1968 paper entitled ``Zero-g frobnication: How being the only people in the world with access to the Apollo lander source code makes us a wow at parties'', by Zeus \etal. You can handle this paper like any other. Do not write ``We show how to improve our previous work [Anonymous, 1968]. This time we tested the algorithm on a lunar lander [name of lander removed for blind review]''. That would be silly, and would immediately identify the authors. Instead write the following: \begin{quotation} \noindent We describe a system for zero-g frobnication. This system is new because it handles the following cases: A, B. Previous systems [Zeus et al. 1968] did not handle case B properly. Ours handles it by including a foo term in the bar integral. ... The proposed system was integrated with the Apollo lunar lander, and went all the way to the moon, don't you know. It displayed the following behaviours, which show how well we solved cases A and B: ... \end{quotation} As you can see, the above text follows standard scientific convention, reads better than the first version, and does not explicitly name you as the authors. A reviewer might think it likely that the new paper was written by Zeus \etal, but cannot make any decision based on that guess. He or she would have to be sure that no other authors could have been contracted to solve problem B. \medskip \noindent FAQ\medskip\\ {\bf Q:} Are acknowledgements OK?\\ {\bf A:} No. Leave them for the final copy.\medskip\\ {\bf Q:} How do I cite my results reported in open challenges? {\bf A:} To conform with the double-blind review policy, you can report results of other challenge participants together with your results in your paper. For your results, however, you should not identify yourself and should not mention your participation in the challenge. Instead present your results referring to the method proposed in your paper and draw conclusions based on the experimental comparison to other results.\medskip\\ \begin{figure}[t] \centering \fbox{\rule{0pt}{2in} \rule{0.9\linewidth}{0pt}} \caption{Example of caption. It is set in Roman so that mathematics (always set in Roman: $B \sin A = A \sin B$) may be included without an ugly clash.} \label{fig:onecol} \end{figure} \subsection{Miscellaneous} \noindent Compare the following:\\ \begin{tabular}{ll} \verb'$conf_a$' & $conf_a$ \\ \verb'$\mathit{conf}_a$' & $\mathit{conf}_a$ \end{tabular}\\ See The \TeX book, p165. The space after \eg, meaning ``for example'', should not be a sentence-ending space. So \eg is correct, {\em e.g.} is not. The provided \verb'\eg' macro takes care of this. When citing a multi-author paper, you may save space by using ``et alia'', shortened to ``\etal'' (not ``{\em et.\ al.}'' as ``{\em et}'' is a complete word). If you use the \verb'\etal' macro provided, then you need not worry about double periods when used at the end of a sentence as in Alpher \etal. However, use it only when there are three or more authors. Thus, the following is correct: ``Frobnication has been trendy lately. It was introduced by Alpher~\cite{Alpher02}, and subsequently developed by Alpher and Fotheringham-Smythe~\cite{Alpher03}, and Alpher \etal~\cite{Alpher04}.'' This is incorrect: ``... subsequently developed by Alpher \etal~\cite{Alpher03} ...'' because reference~\cite{Alpher03} has just two authors. \begin{figure*} \centering \begin{subfigure}{0.68\linewidth} \fbox{\rule{0pt}{2in} \rule{.9\linewidth}{0pt}} \caption{An example of a subfigure.} \label{fig:short-a} \end{subfigure} \hfill \begin{subfigure}{0.28\linewidth} \fbox{\rule{0pt}{2in} \rule{.9\linewidth}{0pt}} \caption{Another example of a subfigure.} \label{fig:short-b} \end{subfigure} \caption{Example of a short caption, which should be centered.} \label{fig:short} \end{figure*} \section{Formatting your paper} \label{sec:formatting} All text must be in a two-column format. The total allowable size of the text area is $6\frac78$ inches (17.46 cm) wide by $8\frac78$ inches (22.54 cm) high. Columns are to be $3\frac14$ inches (8.25 cm) wide, with a $\frac{5}{16}$ inch (0.8 cm) space between them. The main title (on the first page) should begin 1 inch (2.54 cm) from the top edge of the page. The second and following pages should begin 1 inch (2.54 cm) from the top edge. On all pages, the bottom margin should be $1\frac{1}{8}$ inches (2.86 cm) from the bottom edge of the page for $8.5 \times 11$-inch paper; for A4 paper, approximately $1\frac{5}{8}$ inches (4.13 cm) from the bottom edge of the page. \subsection{Margins and page numbering} All printed material, including text, illustrations, and charts, must be kept within a print area $6\frac{7}{8}$ inches (17.46 cm) wide by $8\frac{7}{8}$ inches (22.54 cm) high. Page numbers should be in the footer, centered and $\frac{3}{4}$ inches from the bottom of the page. The review version should have page numbers, yet the final version submitted as camera ready should not show any page numbers. The \LaTeX\ template takes care of this when used properly. \subsection{Type style and fonts} Wherever Times is specified, Times Roman may also be used. If neither is available on your word processor, please use the font closest in appearance to Times to which you have access. MAIN TITLE. Center the title $1\frac{3}{8}$ inches (3.49 cm) from the top edge of the first page. The title should be in Times 14-point, boldface type. Capitalize the first letter of nouns, pronouns, verbs, adjectives, and adverbs; do not capitalize articles, coordinate conjunctions, or prepositions (unless the title begins with such a word). Leave two blank lines after the title. AUTHOR NAME(s) and AFFILIATION(s) are to be centered beneath the title and printed in Times 12-point, non-boldface type. This information is to be followed by two blank lines. The ABSTRACT and MAIN TEXT are to be in a two-column format. MAIN TEXT. Type main text in 10-point Times, single-spaced. Do NOT use double-spacing. All paragraphs should be indented 1 pica (approx.~$\frac{1}{6}$ inch or 0.422 cm). Make sure your text is fully justified---that is, flush left and flush right. Please do not place any additional blank lines between paragraphs. Figure and table captions should be 9-point Roman type as in \cref{fig:onecol,fig:short}. Short captions should be centred. \noindent Callouts should be 9-point Helvetica, non-boldface type. Initially capitalize only the first word of section titles and first-, second-, and third-order headings. FIRST-ORDER HEADINGS. (For example, {\large \bf 1. Introduction}) should be Times 12-point boldface, initially capitalized, flush left, with one blank line before, and one blank line after. SECOND-ORDER HEADINGS. (For example, { \bf 1.1. Database elements}) should be Times 11-point boldface, initially capitalized, flush left, with one blank line before, and one after. If you require a third-order heading (we discourage it), use 10-point Times, boldface, initially capitalized, flush left, preceded by one blank line, followed by a period and your text on the same line. \subsection{Footnotes} Please use footnotes\footnote{This is what a footnote looks like. It often distracts the reader from the main flow of the argument.} sparingly. Indeed, try to avoid footnotes altogether and include necessary peripheral observations in the text (within parentheses, if you prefer, as in this sentence). If you wish to use a footnote, place it at the bottom of the column on the page on which it is referenced. Use Times 8-point type, single-spaced. \subsection{Cross-references} For the benefit of author(s) and readers, please use the {\small\begin{verbatim} \cref{...} \end{verbatim}} command for cross-referencing to figures, tables, equations, or sections. This will automatically insert the appropriate label alongside the cross-reference as in this example: \begin{quotation} To see how our method outperforms previous work, please see \cref{fig:onecol} and \cref{tab:example}. It is also possible to refer to multiple targets as once, \eg~to \cref{fig:onecol,fig:short-a}. You may also return to \cref{sec:formatting} or look at \cref{eq:also-important}. \end{quotation} If you do not wish to abbreviate the label, for example at the beginning of the sentence, you can use the {\small\begin{verbatim} \Cref{...} \end{verbatim}} command. Here is an example: \begin{quotation} \Cref{fig:onecol} is also quite important. \end{quotation} \subsection{References} List and number all bibliographical references in 9-point Times, single-spaced, at the end of your paper. When referenced in the text, enclose the citation number in square brackets, for example~\cite{Authors14}. Where appropriate, include page numbers and the name(s) of editors of referenced books. When you cite multiple papers at once, please make sure that you cite them in numerical order like this \cite{Alpher02,Alpher03,Alpher05,Authors14b,Authors14}. If you use the template as advised, this will be taken care of automatically. \begin{table} \centering \begin{tabular}{@{}lc@{}} \toprule Method & Frobnability \\ \midrule Theirs & Frumpy \\ Yours & Frobbly \\ Ours & Makes one's heart Frob\\ \bottomrule \end{tabular} \caption{Results. Ours is better.} \label{tab:example} \end{table} \subsection{Illustrations, graphs, and photographs} All graphics should be centered. In \LaTeX, avoid using the \texttt{center} environment for this purpose, as this adds potentially unwanted whitespace. Instead use {\small\begin{verbatim} \centering \end{verbatim}} at the beginning of your figure. Please ensure that any point you wish to make is resolvable in a printed copy of the paper. Resize fonts in figures to match the font in the body text, and choose line widths that render effectively in print. Readers (and reviewers), even of an electronic copy, may choose to print your paper in order to read it. You cannot insist that they do otherwise, and therefore must not assume that they can zoom in to see tiny details on a graphic. When placing figures in \LaTeX, it's almost always best to use \verb+\includegraphics+, and to specify the figure width as a multiple of the line width as in the example below {\small\begin{verbatim} \usepackage{graphicx} ... \includegraphics[width=0.8\linewidth] {myfile.pdf} \end{verbatim} } \subsection{Color} Please refer to the author guidelines on the CVPR\ 2022\ web page for a discussion of the use of color in your document. If you use color in your plots, please keep in mind that a significant subset of reviewers and readers may have a color vision deficiency; red-green blindness is the most frequent kind. Hence avoid relying only on color as the discriminative feature in plots (such as red \vs green lines), but add a second discriminative feature to ease disambiguation. \section{Final copy} You must include your signed IEEE copyright release form when you submit your finished paper. We MUST have this form before your paper can be published in the proceedings. Please direct any questions to the production editor in charge of these proceedings at the IEEE Computer Society Press: \url{https://www.computer.org/about/contact}. {\small \bibliographystyle{ieee_fullname} \section{Dataset Analysis} We present the statistics about five datasets we used in our experiments. Table~\ref{tab:dataset_st} shows the statistics. \paragraph{ReferItGame:} ReferItGame~\cite{kazemzadeh2014referitgame} contains images from SAIAPR12~\cite{escalante2010segmented} and collects expressions by a two-player game. In this game, the first player is shown an image with an object annotation and asked to write a natural language expression referring to the object. The second player is shown the same image and the written expression and asked to click the object's corresponding area. If the clicking is correct, the two players receive points and swap roles. If not, the new image would be presented. \paragraph{RefCOCO, RefCOCO+, RefCOCOg:} These three datasets contain images from MSCOCO~\cite{lin2014microsoft}. Expressions in RefCOCO~\cite{yu2016modeling} and RefCOCO+~\cite{yu2016modeling} are also collected by the two-player game proposed in ReferitGame~\cite{kazemzadeh2014referitgame}. There are two test splits called ``testA'' and ``testB''. Images in ``testA'' only contain multiple people annotation. In contrast, images in ``testB'' contain all other objects. Expressions in RefCOCOg~\cite{mao2016generation} are collected on Amazon Mechanical Turk in a non-interactive setting. Thus, the expressions in RefCOCOg are longer and more complex. RefCOCOg has ``google'' and ``umd'' splits. The ``google'' split does not have a public test set. And there is an overlap between the training and validation image set. The ``umd'' split does not have this overlap. We denote these splits by ``val-g'', ``val-u'' and ``test-u'', respectively. \paragraph{Flickr30k Entities:} Flickr30k Entities~\cite{plummer2015flickr30k} contains images in Flickr30k dataset. The query sentences are short noun phrases in the captions of the image. The queries are easier to understand. \section{QD-ATT in Other Vision Backbones} The experimental results in our paper have shown that the Query-aware Dynamic Attention can help improve the transformer-based visual backbone. In this section, we present the performance improvement in visual grounding by applying the Query-aware Dynamic Attention to DarkNet53~\cite{redmon2018yolov3} and ResNet~\cite{he2016deep} to show its generalizability in different backbones. \paragraph{DarkNet53.} We use a state-of-the-art one-stage visual grounding framework ReSC~\cite{yang2020improving}, which adopts the visual feature map from the 102-th convolutional layer of DarkNet53. We append Query-aware Dynamic Attention modules after the 78-th, 91-th and 102-th convolutional layer of DarkNet53. We take the visual feature map from the last Query-aware Dynamic Attention module as the output of the visual backbone. \paragraph{ResNet.} We consider the TransVG~\cite{deng2021transvg} framework, which uses ResNet50 as the visual backbone. We apply Query-aware Dynamic Attention modules to the C2, C3, C4, and C5 layers. The evaluation results using different visual backbones on the ReferItGame dataset are shown in \Cref{tab:qd_imp}. The proposed QD-ATT can also significantly improve the performance. \begin{table}[t] \centering \begin{tabular}{@{}llll@{}} \toprule Dataset & Images & Instances & Queries \\ \midrule RefCOCO & 19,994 & 50,000 & 142,210 \\ RefCOCO+ & 19,992 & 49,856 & 141,564 \\ RefCOCOg & 25,799 & 49,822 & 95,010 \\ ReferItGame & 20,000 & 19,987 & 120,072 \\ Flickr30K Entities & 31,783 & 427,000 & 427,000 \\ \bottomrule \end{tabular} \caption{Data statistics of RefCOCO, RefCOCO+, RefCOCOg, ReferItGame and Flickr30K Entities.} \label{tab:dataset_st} \end{table} \begin{table}[t] \centering \begin{tabular}{@{}lcc@{}} \toprule \multicolumn{1}{l|}{\multirow{2}{*}{Model}} & \multicolumn{2}{c}{ReferItGame} \\ \multicolumn{1}{l|}{} & val & test \\ \midrule \multicolumn{3}{l}{\textbf{\emph{DarkNet53}}} \\ \midrule \multicolumn{1}{l|}{ReSC-Base} & 66.78 & 64.33 \\ \multicolumn{1}{l|}{\quad +QD-ATT} & $\text{67.85}_{\text{+1.07}}$ & $\text{65.21}_{\text{+0.88}}$ \\ \midrule \multicolumn{3}{l}{\textbf{\emph{ResNet50}}} \\ \midrule \multicolumn{1}{l|}{TransVG} & 71.60 & 69.76 \\ \multicolumn{1}{l|}{\quad +QD-ATT} & $\text{75.01}_{\text{+3.41}}$ & $\text{72.67}_{\text{+2.91}}$ \\ \bottomrule \end{tabular} \caption{Performance of ReSC and TransVG when QD-ATT is adopted.} \label{tab:qd_imp} \end{table} \section{Ablation study on RefCOCO} We also present the ablation study results on RefCOCO dataset in \Cref{tab:sub_abl_module} and \Cref{tab:sub_abl_attention}. The experimental results reveal similar conclusions. We also notice that spatial attention is more useful in ``testA'' split and channel attention is more useful in ``testB'' split. It is because the referents in ``testB'' can be arbitrary objects but images in ``testA'' only contain multiple people annotation. \section{Analysis of hyper-parameter K} We study the impact of hyper-parameter $K$ which denotes the factor dimension. We report the accuracy of our model with $K=\{10,30,50,70\}$ in \Cref{fig:factor}. When $K$ is small, the QD-ATT\ cannot learn the transformation well. And when $K$ is large, the QD-ATT\ is easy to overfit and performs worse on validation set. We take the best $K=30$ on the validation set as our default setting. \section{Efficiency Analysis} We study the running time of our model with different factor dimensions in the Query-aware Dynamic Attention. We set $K=\{0,10,30,50,70\}$. $K=0$ is a special setting which means the Query-aware Dynamic Attention directly returns the input feature without any computation. We conduct the experiment on a single NVIDIA RTX3090 GPU. The results are shown in \Cref{fig:factor_time}. We notice that the running time increases linearly with the growth of K. We also observe that incorporating the Query-aware Dynamic Attention does not introduce excessive computation cost, which means our QD-ATT is efficient and effective. \begin{table}[t] \centering \begin{minipage}{1\linewidth} \centering \small \begin{tabular}{c|cc} \toprule &\multicolumn{2}{c}{RefCOCO}\\ & testA & testB \\ \midrule (a) & 84.63 & 81.42 \\ (b) & 84.46 & 80.96 \\ (c) & 84.01 & 79.83 \\ \bottomrule \end{tabular} \caption{Ablation studies of QD-ATT in two phases of QRNet.} \label{tab:sub_abl_module} \vspace{1em} \end{minipage}% \hspace{.01\linewidth} \begin{minipage}{1\linewidth} \centering \small \begin{tabular}{c|cc} \toprule &\multicolumn{2}{c}{RefCOCO} \\ & testA & testB \\ \midrule (d) & 84.61 & 81.25 \\ (e) & 85.43 & 80.91 \\ \bottomrule \end{tabular} \caption{Ablation studies of different attentions in QD-ATT.} \label{tab:sub_abl_attention} \end{minipage} \end{table} \begin{figure}[tb] \centering \includegraphics[width=1\linewidth]{figs/factor.pdf} \caption{The effect of factor dimension $K$ on the validation split of ReferItGame dataset.} \label{fig:factor} \vspace{-1.4em} \end{figure} \begin{figure}[tb] \centering \includegraphics[width=1\linewidth]{figs/factor_time.pdf} \caption{The running time (ms) of our model with different factor dimension $K$ on the validation split of ReferItGame.} \label{fig:factor_time} \end{figure} \section{Qualitative Analysis} \paragraph{Feature Refinement Visualization.} We present more visualize cases in \Cref{fig:vis_wide}. It shows the ability of our QRNet to refine general purposed feature maps to query-aware feature maps. \begin{figure*}[htb] \centering \includegraphics[width=\textwidth]{figs/wide_vis.pdf} \caption{Visualization of activation maps from the backbone of our MMSwin\ \ and original Swin-Transformer. Red: the predicted box. White: the ground-truth box.} \label{fig:vis_wide} \end{figure*} \paragraph{Comparison with TransVG.} We quantitatively compare the results predicted by our model and the TransVG in \Cref{fig:case}. Green boxes are the ground truth. Yellow and red boxes are the predictions of our model and TransVG, respectively. In the first row, we notice that the predictions of TransVG are close to the ground truth. However, sometimes the TransVG only localizes the significant areas of the target objects (e.g., ``mountain on right"), and sometimes the predicted boxes cover the irrelevant areas around the target objects (e.g., ``person in white"), resulting in failures. In the second row, the TransVG does not fully capture the semantics of queries and is vulnerable to the interference of significantly noisy objects in the image, resulting in incorrect predictions. Our model utilizes query sentence representation to guide the visual backbone to obtain query-aware visual features, which helps the framework give correct predictions. \paragraph{Failure Cases.} We show some typical failure cases in \Cref{fig:failure_case}. One type of error is the long tail description. For the first example, our model does not recognize ``slats'' correctly. During both the pre-training the fine-tuning, the samples of long-tail concepts are infrequent. Thus, our method fails. For the second image, we notice that ``crazy'' is an abstract word, and its visual appearance can be completely different in different contexts. Therefore, it is also hard for our model to learn. In the third example, we found that our model understands the query's intention, but it tends to predict a box containing some objects, and the annotator does not have such bias. For the last example, we find that our model may make mistakes when facing long sentence queries. Our model only takes the [CLS] representation rather than the complete sequence representation from BERT to refine the visual features, limiting the ability to understand long text. \section{Limitation} In this paper, we propose QD-ATT\ to extract query-consistent features from the visual backbone. However, we only take the contextual textual representation of the query to keep it efficient. Due to the lack of fine-grained multimodal interaction, we still need a post-interaction module in the visual grounding framework. It also hinders generalizing our module to the task requiring complex reasoning, \eg, multimodal dialogue~\cite{nie2019multimodal} and visual storytelling~\cite{huang2016visual}. \begin{figure*}[b] \centering \includegraphics[width=0.8\linewidth]{figs/case_cropped.pdf} \caption{ % Qualitative comparison with TransVG. % Green boxes are the ground-truth, yellow boxes are the predictions of our model, and red boxes denote the predictions of TransVG.} \label{fig:case} \end{figure*} \begin{figure*}[b] \centering \includegraphics[width=0.8\linewidth]{figs/fail_case_cropped.pdf} \caption{The failure cases of our model. Green boxes are the ground-truth, yellow boxes are the predictions of our model.} \label{fig:failure_case} \end{figure*} \section{Online Deployment Setting} We apply QRNet to enhance the search engine in Pailitao at Alibaba and perform A/B testing. In order to reduce the discrepancy between the images from consumers and sellers, it is important to locate the target from the item image. Note that a detection-based two-stage method is already deployed online. The A/B testing system split online users equally into two groups and direct them into two separate buckets, respectively. Then in bucket A (i.e., the baseline group), the target boxes from images are generated by a detection-based method. While for users in the B bucket (i.e., the experimental group), the target boxes are generated by the proposed QRNet. All the conditions of the two buckets are identical except for the target grounding methods. We calculate the clicked query rate and the number of transactions for all the categories in the two buckets. The online A/B testing lasts for two days, and over 1.5 million daily active users are in each bucket. We find that the performance in the experimental bucket (i.e., QRNet) is significantly better (p $<$ 0.05) than that in the baseline bucket (i.e., detection-based) on both measures. QRNet decreases the no click rate by 1.47\% and improves the number of transactions by 2.20\% over the baseline. More specifically, the decrease of the no click rate implies that QRNet can generate more accurate target boxes so that users are more likely to click. The improvement of the number of transactions means that the clicked item is exactly what the users want to purchase, which also reveals the great performance of QRNet. \section{Pseudo-code of QD-ATT} We present a Pytorch-style pseudo-code in Listing~\ref{lst:qda}. \begin{figure*} \begin{lstlisting}[language=Python, caption=Pytorch-style pseudo-code of Query-aware Dynamic Attention, label={lst:qda},xleftmargin=.05\textwidth, xrightmargin=.05\textwidth] # Perform linear transform to change the dimension of the vector space from in_dim to out_dim # Inputs: # F: the input visual features (B, H, W, D_in) # q: the input linguistic feature (B, D_q) # Return: # F_q: the output transformed visual features (B, H, W, D_out) # Parameters: # linear: a plain linear layer to generate factor U # S: a random-initialized factor matrix (K, D_out) def dynamic_linear(F, q): # Parameter generation # K is the factor dimension # generate the factor matrix U U = reshape(linear(q), (B, D_in+1, K)) # reconstructed matrix by U x S M = einsum("bik,kj->bij", U, S) Weight, bias = M[:,:-1], M[:,-1] # Perform linear transform F_q = einsum("b...d,bde->b...e", F, Weight) + bias return F_q # Perform dynamic attention on visual feature map by textual guidance. # Inputs: # F: input visual feature map (B, H, W, C) # q: [CLS] token's last hiddenn states from BERT (B, D_q) # Return: # F_refined: refined visual feature (B, H, W, C) def query_aware_dynamic_attention(F, q): # Channel Attention B,H,W,C = F.shape F_flatten = reshape(F, (B, -1, C)) avg_pool = mean(F_flatten, dim=1) # The mlp transform the channel dimension C -> C/16 -> C att_avg = dynamic_linear(relu((dynamic_linear(avg_pool, q))), q) max_pool = max(F_flatten, dim=1) att_max = dynamic_linear(relu((dynamic_linear(max_pool, q))), q) attn = sigmoid(att_avg + att_max) F = F * reshape(attn, (B, 1, 1, C)) # Spatial Attention # dynamic_linear transform channel dimension C -> 1 attn = sigmoid(dynamic_linear(F, q)) F_refined = F * attn return F_refined \end{lstlisting} \end{figure*} \section{Introduction} \label{sec:intro} \input{1.intro} \section{Related Work} \label{sec:related} \input{2.related_work} \section{Approach} \label{sec:method} \input{3.method} \section{Experiments} \label{sec:experiment} \input{4.experiment} \section{Online Deployment} Previous experimental results have proven the advantages of our proposed QRNet, so we deploy it in a real-world online environment to test its practical performance. Specifically, we apply QRNet to enhance the search engine in Pailitao at Alibaba and perform A/B testing to evaluate the impact of our model. Details can be found in supplementary materials. We observe that QRNet decreases the no click rate by 1.47\% and improves the number of transactions by 2.20\% over the baseline. More specifically, the decrease of no click rate implies that QRNet can generate more accurate target boxes so that users are more likely to click. The improvement of the number of transactions means that the clicked item is exactly the users want to purchase, which also reveals the great performance of QRNet. \section{Conclusion} In this paper, we argue that pre-trained visual backbones cannot produce visual features that are consistent with the requirement of visual grounding. To overcome the weaknesses, we propose a Query-modulated Refinement Network\ (MMSwin\ )\ to adjust the visual feature maps with the guidance of query text. The MMSwin\ \ is designed based on a novel Query-aware Dynamic Attention mechanism, which can dynamically compute query-dependent spatial and channel attentions for refining visual features. Extensive experiments indicate that the improved framework significantly outperforms the state-of-the-art methods. The proposed MMSwin\ \ exhibits vast potential to improve multimodal reasoning. In future work, we plan to improve the fine-grained interaction ability of MMSwin\ \ and discard the post-interaction modules to simplify the existing end-to-end visual grounding frameworks. \paragraph{Acknowledgement} We thank Zenghui Sun, Quan Zheng and Weilin Huang at Alibaba Group for their help on online deployment and the anonymous reviewers for their valuable suggestions. This work was supported by the National Innovation 2030 Major S\&T Project of China (No.2020AAA0104200 \& 2020AAA0104205), the Science and Technology Commission of Shanghai Municipality (No. 19511120200 \& 21511100100 \& 18DZ2270800), the Open Fund of PDL, and Alibaba Group through Alibaba Research Intern Program. {\small \bibliographystyle{ieee_fullname} \section{Introduction} \label{sec:intro} \input{1.intro} {\small \bibliographystyle{ieee_fullname} \subsection{Overall Architecture} \begin{figure}[tb] \includegraphics[width=1\linewidth]{figs/overview_cropped.pdf} \caption{An overview of the MMSwin\ . (1) The language model first extract textual feature sequence. (2) Our query-aware vision backbone extracts and fuse multiscale visual features with textual guidance. (3) The visual and textual feature sequences are fed into a transformer, and a [REG] token representation is used to regress the bounding box.} \label{fig:model} \end{figure} Before detailing the proposed mechanism and modules, we first present a typical visual grounding architecture used in this paper. We followed the recently proposed state-of-the-art architecture TransVG\cite{deng2021transvg}. Given an image and a query sentence, there is a linguistic backbone, typically a pre-trained BERT model, extracting a 1D feature sequence $t\in \mathbb{R}^{D_l\times N_l}$. There is also a vision backbone extracting a 2D feature map $v'\in \mathbb{R}^{D_v\times H\times W}$. Generally, the resolution of the feature map is $\frac{1}{2^s}$ of the origin image resolution, where $s$ is the number of downsample operators. The 2D feature map $v'$ is further flatten into a feature sequence $v \in \mathbb{R}^{D_v\times N_v}$, where $N_v=H\times W$. Two projection layers project the visual and linguistic features into the same feature space $\mathbb{R}^{D}$. The projected visual and linguistic features are denoted by $p_v\in \mathbb{R}^{D\times N_v}$ and $p_l\in \mathbb{R}^{D\times N_l}$. Then it concatenates $p_v$ and $p_l$ and inserts a learnable embedding (namely a [REG] token) at the begining of the concatenated sequence. The joint sequence is formulated as: \begin{equation} \begin{aligned} \boldsymbol{x}_{0}=[p_{r}, \underbrace{p_{v}^{1}, p_{v}^{2}, \cdots, p_{v}^{N_{v}}}_{\text {visual tokens } \boldsymbol{p}_{v}}, \overbrace{p_{l}^{1}, p_{l}^{2}, \cdots, p_{l}^{N_{l}}}^{\text {linguistic tokens } p_{l}}] \end{aligned} \end{equation} where $p^r$ is the learnable embedding of [REG] token. A multi-layer visual-linguistic transformer with positional encoding is applied to perform inta- and inter- modal reasoning on the joint sequence. Finally, a prediction head takes the output representation of the [REG] token to predict the bounding box coordinates. Specifically, an MLP with ReLU activations transforms the $D$-dim [REG] embedding to 4-dim coordinates $b$. The smooth L1 loss and giou loss are using to train the framework. The training object can be formulated as: \begin{equation} \begin{aligned} \mathcal{L}=\mathcal{L}_{smooth-l1}{(b,\hat{b})}+\mathcal{L}_{giou}{(b,\hat{b})} \end{aligned} \end{equation} where $\hat{b}$ is the ground-truth box. The structure of TransVG is elegant and representative of most visual grounding frameworks. We notice a widespread problem that not all visual signals in images are helpful for the grounding task. However, the vision backbone pre-trained on detection tasks tends to extract all objects it has learned. Moreover, the backbone is trained to extract features for classification and is not enough for cross-modal alignment. There is also a problem that the cross-modal interaction module takes the feature map from the last layer or a query-agnostic multi-scale fusion whose scale may be inconsistent with the referent object or be noisy. To deal with these problems, we propose infusing the linguistic embedding into the vision backbone to guide the feature extraction and multi-scale feature fusion. To utilize the multi-scale feature, we first discard the vision backbone of TransVG because it only produces single-scale features. Instead, we use Swin-Transformer to extract multi-scale features. Then we introduce a novel Query-Driven Attention Mechanism, which leverages the linguistic embedding to drive the visual feature refinement. We further integrated the mechanism within the Swin-Transformer to guide the hierarchical feature extraction and multi-scale fusion. The improved backbone is called Modulated and Multiscale Swin-Transformer. We will cover the details in the following sections. \subsection{Query-Driven Attention Mechanism} In this section, we describe how we produce textual guidance and computing the visual attention distribution. Given an contextual textual representation $p_l^c \in \mathbb{R}^{D_l}$ (\eg a [CLS] token embedding), we introduce a Query Guidance Generator to generate a guide function $v_{clue}=G(v,\Theta_l)$. Then for each intermediate visual feature map $v$. We use a Multi-level Feature Refinement module to produce a refined feature map $v^*=R(v,p_l^c)$ with the help of the decoder \subsubsection{Query Guidance Function} The existing visual feature extractor uses modules with static parameters to process the visual feature map. For different data points with the same image, the outputs are the same. However, in visual grounding, the text reveals the intention of the query. For different query text, the crucial visual clues are also different. Thus we propose a dynamic linear layer as our guidance function which parameters are decoded from the contextual textual representation $p_l^c$. For the guidance function, we define its parameters by $\Theta_l=\{W_l,b_l\},\,W_l\in \mathbb{R}^{D^{in}\times D^{out}},\, b_l\in \mathbb{R}^{D^{out}}$, where $D^{in}$ and $D^{out}$ are the dimensions of input and output respectively. The guidance function can be formulized as follow: \begin{equation} \begin{aligned} v_{clue}&=G(v,\Theta_l)=vW_l+b_l \end{aligned} \end{equation} A intuitive way to decode these parameters is introduce another larger linear module, which is denoted by $\Theta^{'}_l=\mathrm{Decoder}(p_l^c)$, where $\Theta^{'}_l\in\mathbb{R}^{(D^{in}+1)\ast D^{out}}$. We can simply reshape and split $\Theta^{'}_l$ to obtain $\{W_l,b_l\}$. However, it's easy to find that the number of parameters in the decoder is $D_l\ast ((D^{in}+1)\ast D^{out})$. We found that such large-scale parameters will slow down the training speed of the network and make it easier to be overfitting. Inspired by the application of matrix factorization, we consider decomposing the $\Theta_l$ into two factor $U\in \mathbb{R}^{(D^{in}+1)\times K}$ and $V\in \mathbb{R}^{K\times D^{out}}$, where $U$ is a matrix decoded from $p_l^c$, $V$ is a static learnable matrix, $K$ is a hyper-parameter denote the dimension of factor matrixes. The decompose-based decode $\{W_l,b_l\}=\mathrm{Decoder}^*(p_l^c)$ can be formulated as follow: \begin{equation} \begin{aligned} U^{'} &= p_l^c W^{dec}+b^{dec}\\ U&=\mathrm{Reshape}(U^{'}) \end{aligned} \end{equation} where $W^{dec}\in \mathbb{R}^{D_l\times (D^{in}+1)\ast K}$ and $ b^{dec}\in \mathbb{R}^{(D^{in}+1)\ast K}$ are the paramemters of the factor decoder. We first use the factor decoder to calculate the vector $U^{'}\in \mathbb{R}^{(D^{in}+1)\ast K}$, We further reshape it into a matrix $U\in \mathbb{R}^{(D^{in}+1)\times K}$. \begin{equation} \begin{aligned} \Theta_l&=UV\\ \{W_l,b_l\} &= \mathrm{Split}(\Theta_l)\\ \end{aligned} \end{equation} Then the parameter matrix of guidance function $\Theta_l$ can be reconstruct by multiply $U$ and $V$. The $W_l$ and $b_l$ can be split from the matrix $U$ along the first dimension. Finally, we reformulized the guidance function as follow: \begin{equation} \begin{aligned} v_{clue}&=G^*(v,p_l^c)=G(v,\mathrm{Decoder}^*(p_l^c)) \end{aligned} \end{equation} \subsubsection{Multi-level Feature Refinement} \begin{figure}[tb] \centering \includegraphics[width=1\linewidth]{figs/sc-attention_1_cropped.pdf} \caption{Diagram of the Query-Driven Attention Mechanism} \label{fig:query_attention} \end{figure} After obtaining the textual guidance, we consider refining the visual feature map. As explained earlier, the pre-trained vision backbone is sensitive to all salient objects. Most of them are irrelevant to the query text. Therefore, The backbone only needs to attend to a few areas. Besides, the extracted feature is suitable for the pretraining classification task instead of visual grounding. In other words, the importance of channels is different. Inspired by the Convolutional Block Attention Module\cite{woo2018cbam}, we consider infer a channel attention map $A_c$ to calibrate the semantic of feature for a better cross-modal alignment. And we further infer a spatial attention map $A_s$ from calibrated feature to reveal where the referent located. Specifically, for a given visual feature $v\in \mathbb{R}^{H\times W\times D_v}$, we first aggregate its spatial information by average pooling and maximum pooling and produce $v^c_{max}\in \mathbb{R}^{1\times 1\times D_v}$ and $v^c_{mean}\in \mathbb{R}^{1\times 1\times D_v}$. We further build a query-driven multilayer perception (QMLP) consists of two guide functions. We use a ReLU activation after the first guide function. The output dimension is the same as the input dimension. To reduce the number of parameter, we set the dimension of hidden states as $D_v/r$, where $r$ is the reduction ratio. By feeding the $v^c_{max}$ and $v^c_{mean}$ to the QMLP, we merge the two output features using summation. The channel attention map $A_c$ can be captured as follow: \begin{equation} \begin{aligned} v^{cl}_{mean}&=G^*_1(\mathrm{ReLU}(G^*_0(v^c_{mean},p_l^c)),p_l^c)\\ v^{cl}_{max}&=G^*_1(\mathrm{ReLU}(G^*_0(v^c_{max},p_l^c)),p_l^c)\\ A_c&=\mathrm{sigmoid}(v^{cl}_{mean}+v^{cl}_{max}) \end{aligned} \end{equation} We perform element-wise multiplication between $v$ and $A_c$ to form the representation of the channel refined visual feature: \begin{equation} \begin{aligned} \dot{v}&=A_c\otimes v \end{aligned} \end{equation} The $A_c$ are broadcast along the spatial dimension. To generate a spatial attention map, instead pooling the channel dimension, we leverage a guidance function to reduce the channel dimension to learn areas interest to the query and apply a sigmoid function to generate the attention map. In short, The computing process is formulated as follow: \begin{equation} \begin{aligned} A_s&=\mathrm{sigmoid}(G(\dot{v},p_l^c))\\ \ddot{v}&=A_c\otimes \dot{v} \end{aligned} \end{equation} where $A_s\in \mathbb{R}^{H\times W\times 1}$ is the spatial attention map and $\ddot{v}$ is the spatial refined visual feature and also the output of our multi-level feature refinement. \subsection{Modulated and Multiscale Swin-Transformer} In this section, we discuss how to use query-driven attention to extend Swin-Transformer to a modulated vision backbone. We propose a Modulated Swin-Transformer Block to plug into each stage of Swin-Transformer architecture to help extract query-aware visual features. Thanks to the hierarchical structure, we can obtain features at different scales from each stage. We introduce a Query-guided Multiscale Feature Fusion to compute a scale-consist visual feature map. We present the proposed modules below. \subsubsection{Modulated Swin-Transformer Block} For a given image $I \in \mathbb{R}^{H\times W\times 3}$, a plain Swin-Transformer first embed $I$ to a $v_0 \in \mathbb{R}^{\frac{H}{4}\times \frac{W}{4}\times 48}$. Then $v_0$ is feeded into four cascaded stages. Each stage $k$ receives the visual feature map $v_{k-1}$ and generates a transformed feature map $v_{k}$. As shown in \Cref{fig:stage}, we take the [CLS] representation of the input query sentence from BERT as the contextual query representation $p_l^c$. We append a Query-Driven Attention module after each Swin Transformer Block. It recieves the transformed feature $v_{k}$ and produces a query-aware feature $v_k^{*}$ to the next stage. \begin{figure}[tb] \centering \includegraphics[width=1\linewidth]{figs/block_cropped.pdf} \caption{Modulated Swin-Transformer Block} \label{fig:stage} \end{figure} \subsubsection{Query-guided Multiscale Feature Fusion} \label{sec:multiscale} Except the first stage, each stage reduce the resolution of feature map by a patch merging operator. In other words, the resolutions of the output of each stage are $\frac{H}{4}\times\frac{H}{4},\,\frac{H}{8}\times\frac{H}{8},\,\frac{H}{16}\times\frac{H}{16}$ and $\frac{H}{32}\times\frac{H}{32}$, respectively. Beside, the patch merging operator fuse the patch feature into channel which double the channel dimension. Thus the channel dimensions of the output of each stage are $C,\,2C,\,4C$ and $8C$. Note that because visual grounding require fine-grained interaction (\eg Cross Attention), high-resolution features will dramatically increase the computation. Besides they will bring in noise and hurt the accuracy. Previous works using the last feature will obviously lose scale information. We propose to fuse the features with query guidance follow a bottom-up pathway. Specifically, we first use four $1\times 1$ convolutional layers to unify the channel dimensions to $D$. To filter out noisy signals in the feature maps, we build query-driven attention modules for the first three feature maps $\{v^{*}_k |\,k=1,2,3 \}$. Each module produce a weighted feature map with the same shape as before. Instead of interpolating the visual feature map to low-resolution, we consider apply a $2\times 2$ mean pooling with stride=2 to reduce the resolution to be the same as next feature map and add it to the next feature map $v^{*}_{k+1}$. Finally, the last feature map $v^{*}_{4}$ contains features interest to the query from all scales. We also apply a max pooling to obtain a smaller faeture map $v^{*}_{5} \in\frac{H}{64}\times\frac{H}{64}$. We flatten and concatenate the $v^{*}_{4}$ and $v^{*}_{5}$ as the output token sequence of our Modulated and Multiscale Swin-Transformer.
7b409fd26509e905456e3ec391994432f3ede136
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Open Source Software (OSS) has become ubiquitous and provides developers with a free-to-use platform for open public collaboration. With project developers spread across the world, OSS projects bring in diverse perspectives which are important for the success and sustainability of a project. In terms of OSS, GitHub has become the most popular web-based open-source software for developers to store and manage their code as well as track and control changes to their code.\\ In software development, developers and users (in the form of outside external contributors) utilize GitHub as an issue tracker and code collaboration tool across various projects. It is critically important to understand that software development across various developers is more productive when there is communication amongst developers across different projects. In addition, the progress of software development can be demonstrated through communication within the team and even across outside teams not working on this project. This phenomenon can be observed when developers accurately respond to any code-related bugs (commonly termed an issue in GitHub) report if there are any. \\ In this project, we intend to study the effect of increased communication via shared code development on the productivity of the projects on GitHub. We particularly intend to find the most significant factors that influence the productivity of a project. To analyze the productivity within a software development medium, we decided to leverage the metric of average latency of issue closure associated with a project (we consider a repository as one project). It is computed by calculating the sum of all the issue lifetime (time taken to close an issue) for every issue within a project and dividing it by the number of closed issues for a given repository. For considering the communication across developers beyond the considered project, we measured a metric that measured cross-development across multiple open source repositories. This metric was the average (mean) number of repositories worked by the top ten contributors (based on their involvement in the current project) outside the current project. In addition to this, we also analyzed certain other standard metrics relating to a project such as the number of contributors (team size), age of a project (how long it is active since its creation), total closed issues, etc. The goal of this project is to investigate the correlation between shared development and productivity on GitHub and find the critical features that influence issue closure latency. \footnote{https://github.com/Sairamvinay/Github-Drilling-Shared-vs-Solo} \subsection{Research Questions} Research and practice of software development are performed under various assumptions, their relationship with hypotheses, and discovered facts for validation. Based on the extensive empirical studies we have investigated, we have constructed several hypotheses for this research: \subsubsection*{Research Question I:} In general, we know that more people working on development can improve productivity. Hence, we want to discover whether in open source software development: In an OSS medium, we can observe in general that more people working on development tends to improve productivity (by solving the proposed problems faster), but will this trend persist whenever there are more people working on the same project. We seek to answer whether for any project: With a larger software development team (more developers working on the same project), is there effectively a lower issue closure latency in open source projects? \subsubsection*{Research Question II:} In terms of one project’s productivity, would the presence of more shared developers reduce the issue closure latency? For the research purpose of this project, we consider shared developers as those who have contributed to multiple projects other than the current working project during the current project’s age time frame. \subsubsection*{Research Question III:} We analyze whether the project’s average latency of issue closure time reduces when the number of developers communicates knowledge across projects in terms of sharing knowledge? We consider this since we firmly believe that working on multiple projects would facilitate the transfer of knowledge across developers and improve the productivity of a software development team. \subsubsection*{Hypothesis I:} An increase in the number of developers working on the same project (team size) can lead to lower latency in resolving issues \subsubsection*{Hypothesis II:} An increase in the number of shared developers indicates more communication and collaboration between them, which leads to lower latency in resolving issues \subsubsection*{Hypothesis III:} The project’s average latency of issue closure time can be reduced due to having developers that communicate knowledge across projects in terms of sharing knowledge. Based on the research questions, we attempt to validate our hypothesis on the role of communication during software development. \section{Literature Review} In this research project, our team has decided to investigate the role of communication among shared developers during open-source software (OSS) development and how different team sizes of software developers can affect the overall productivity of the software development. \\ In the beginning, our focus is to evaluate the OSS development process by modeling and evaluating issue closure latencies against various features pertaining to the project and cross-development of contributors. For example, in the paper \cite{krishnan2000empirical}, the author examines different factors that can positively affect quality and productivity, such as the personnel capability of developers, product size, software process factors, and usage of tools. The author specifies the quality of the product as a function of product size, personnel capability, usage of tools, process factors, and proportion of investment in front-end development. The quality measures the number of unique problems reported by customers that are being solved. The author uses nonlinear data analysis and Ordinary Least Squares for the estimation procedures which is the first model method that we intend to use. The paper provides several insights for managers of commercial software products. The results of the quality equation identify several drivers of product quality. For example, the authors find that size of the software product personnel capability of project team members significantly affects quality. \\ Furthermore, we want to explore the effectiveness of having the software developer that is involved in many development projects on the overall productivity of those projects. There is limited theoretical work that exists in this field pertaining to the OSS research community. From previous research \cite{vasilescu2016sky}, multitasking has proved highly beneficial to productivity across GitHub projects through load balancing, more efficient work practices, learning, and cross-fertilization. Through our project, we have chosen to investigate how multitasking by shared developers across projects can facilitate communication of knowledge resulting in a lower latency in issue closure but the paper provides inspiration to using shared developers as the feature. In paper \cite{box1964analysis}, the authors talk about the importance of multi-discussing where developers can contribute their comments on multiple issues and switch their discussions between various issues they are handling at any given point in time. The paper claims that the work efficiency of developers increases on a per-issue basis, as multiple issues are discussed simultaneously by these developers. However, they also argue that multi-discussing may involve developers re-allocating their time and focus, which can cause a hindrance to the efficiency involved in issue closure. The datasets they have used (obtained using GHTorrent) are relatively small and their study indicates that there is more research needed in this area. We also observe that \cite{jarczyk2018surgical} the researchers emphasized the influence of having multiple developers working on a project and its effect on the overall quality of software development. \\ Furthermore, we wants to see how does the communication factor affects productivity. The researchers illustrated that the integration of information technology could increase the developers’ productivity by communicating and collaborating much faster. Since communication among the developers is essential to increase productivity, it is strictly essential to many industries that care about software quality which inspires our curiosity on the communication factor. In \cite{jarczyk2018surgical}, the researchers have used GHTorrent for their data collection and utilized survival analysis to understand the factors that affect issue closure rates in OSS projects. However, the researchers did not consider how important communication was. Hence, although it provides a good overview of the research direction, we decided not to do survival analysis but instead use polynomial regression because there are many parameters to consider when determining the productivity of developers in OSS projects. \\ Eventually, we are firmly believed that team sizes has a positive correlation with productivity. For example, in the paper \cite{tohidi2006productivity}, has explored the effectiveness of team sizes in projects which address our research question 1. As many projects may depend primarily on team members and how much they contribute to the projects, the researchers emphasized how the organizational structure on team sizes may be affected by communication and how tasks can be improved and promote the efficiency of organizations. However, the researchers did not consider the performance metrics regarding how many issues were closed after successfully communicating with team members. They also did not consider how one developer with more experience in a higher hierarchy may affect the overall productivity of the other developers in the team. The researchers also asserted that a well-developed organization may still have defects in their products and delay communication among the developers. With the advent of DSCM’s (distributed source code management systems) like GitHub, the ease with which developers can switch between projects has dramatically increased. Developers can find themselves working on different projects due to dependencies between projects or projects being in similar domains, which becomes important to identify and evaluate the productivity of shared developers. By handling multiple projects, developers can be more efficient in resolving issues and can also pass on knowledge/communicate across projects they have been involved with. Specifically, we want to explore the effectiveness of having how the one software developer that is involved that involved in many development projects can influence the overall productivity of those projects.\\ In comparison to previous works, we can observe some research regarding cross-project developments \cite{vasilescu2016sky}\cite{jarczyk2018surgical} and product quality. However, those research did not propose analyzing latency of productivity among shared developers. Similarly, some works have analyzed the team size \cite{vasilescu2016sky}\cite{krishnan2000empirical} and other important metrics such as organizational structures \cite{tohidi2006productivity} to determine the productivity of developers. However, to the best of our knowledge, there is very little work done with analyzing the cross-development factor in GitHub and several other parameters such as team size and the number of issues, which are being used for predicting the issue closure latency. There have been separate works in predicting and analyzing the issue closure latency, but none of those works have investigated the cross-development factor. Similarly, communication parameters have been analyzed, but there is very minimal work using the same variable we defined for cross-development. In addition, most of the works did not consider many analysis methodologies that we considered when conducting this research; for instance, we could not observe many papers that used polynomial regression for analyzing regression of productivity. \\ Some works have analyzed the team size \cite{vasilescu2016sky}\cite{krishnan2000empirical} and other important metrics such as organizational structures \cite{tohidi2006productivity} to determine the productivity of developers. However, to the best of our knowledge, there is very little work done with analyzing the cross-development factor in GitHub and several other parameters such as team size and the number of issues, which are being used for predicting the issue closure latency. There have been separate works in predicting and analyzing the issue closure latency, but none of those works have investigated the cross-development factor. Our work bridges the gap between predicting latency of issues using communication-based metrics such as cross-development factors as defined by our team in addition to the number of collaborators and other key metrics. \\ \section{Methodology} For our project, we chose quantitative analysis since we were primarily analyzing data with numeric values and we wanted to derive conclusions from our data by statistical modeling techniques. In comparison to our progress report, we improved the number of samples by collecting more data by crawling the GitHub-based APIs. For the inputs, we decided to use the project size, the team size (number of contributors), total closed issues, the average number of cross-development repositories by a contributor for each repository, the average comments, project age, and the number of forks as the independent variables(features). We plan to fit a simple regression model that validates our hypothesis based on the learned regression coefficients and the significance values tests for identifying the most critical features for predicting the latency of issues. We use statistical tests learned from the course, particularly the P-value significance for these analyses. We report the standard metrics used for regression models, such as the R squared metric. For solving the regression models, we only used the Ordinary Least Squares (OLS) method since it was the most widely used regression solution method. We leveraged more tools such as the inverse of an error function (erfinv) for transforming some of our input variables into a Gaussian Distribution. We will also explain some of the challenges that we faced and our choices for feature transforming techniques. \\ Our design for modeling was straightforward just like how regular statistical models are trained. We collect our data from Github API, pre-process using outlier detection techniques and then transform some features for changing their raw distribution into a Gaussian-like distribution. Finally, we scaled our data using centering techniques and then predicted using a polynomial regression model. \subsection{Data} \subsubsection{Data Extraction: Features and Response Variables} We have decided to investigate public repositories that have been created during the last five years (2016 - 2021) from GitHub. The GitHub Search API provides the ability to gather certain information about each repository, such as repository creation time, the number of issues within a repository, whether the issues are closed or open, the creation date, the issue closure date (if closed), the project size, and the number of comments per issue. Since the GitHub API imposed a rate limit while extraction, each person within our team was delegated to gather one year’s worth of public repositories in terms of their creation date. To make sure we don’t miss any crucial information, we crawl the API for the creation date of a project each day of the year, on a monthly basis. Results from this search are returned sorted based on “best matches/most relevant” as defined by the API. GitHub describes their “best matches/most relevant” as “Multiple factors which are combined to boost the most relevant to the top of the result list.”\cite{githubdocs}\\ We then used the name of Repos and users in conjunction with GitHub issues Search API to gather the issue closure information, the contributors working on a repository, the commit logs associated with the repository, and each issue's open date and closure date. Each of these unique repositories was considered as individual projects for this project’s scope. With this data, we can compute the average time to close an issue easily by averaging the lifetime of all closed issues of a repository. In order to determine the cross-development factor, we leverage a metric of measuring the average number of projects other than the current project being worked on by each of the top ten contributors during the time frame of this current project. The project’s top 10 contributors (based on their increased involvement in this project) were found and then the number of repositories that have been created after this project in a chronological sense by each of these ten contributors were accumulated and then finally averaged across all the ten contributors. \\ We gathered GitHub’s top 50 projects each day as returned by the search API, which allowed us to collect 12,800 samples initially. We filtered our search then to identify those repositories with at least one closed issue and obtained around 10381 samples before processing. \subsubsection{Data Preprocessing and Analysis} There are many outliers in our data and all our features did not possess a perfect Gaussian distribution but the average number of comments. For the outlier detection, we performed a simple outlier removal technique entirely based on the percentile values of the features. We calculated the 97.5th percentile of each of the features we collected and removed values larger than the 97.5th percentile by using these as a cutoff to remove the outlier samples. We also calculated the 2.5th percentile of our entire dataset which was leveraged as a cutoff for removing those samples which have feature values that are lesser than its 2.5th percentile. After outlier detection, we had a final dataset of 6757 samples. \\ For the purpose of analyzing parameters and displaying the analyzed results using Gaussian distribution, we intended to transform our features into a normal distribution. For our transformations, we leveraged the square root, logarithmic, and cubic root for each corresponding parameter, and we did not use more than one transformation for converting the features into normal Gaussian-like distributions. We did a logarithmic transformation for the project size (in KB) and the number of forks. Similarly, we applied a square root method for transforming the cross-development factor and a cube root method for transforming the closed issues. \\ For the age and team size variables of a project, we decided to choose a slightly different method from regular transformation methods. We chose to apply the inverse of an error function (erfinv) which was widely believed to be particularly useful in statistical applications for converting uniform random numbers into Normal random numbers. For the age variable (measured in days), we scaled into a [0,1] range and then applied an erfinv transformation to obtain the Gaussian Distribution. Similarly, we applied the same technique for the team size feature which however did not exactly transform into a Gaussian distribution because of its more discrete set of values. \\ Finally, after all our transformations, we chose to apply a simple centering technique that ensured that our variable distributions had a mean of 0 and standard deviation close to 1. It was performed by subtracting the mean of the variable from the variable values and then dividing by the standard deviation. From the frequency distribution in histograms, there were six parameters (besides team size) out of seven parameters that showed a widely spread out Gaussian distribution, which was a promising result for prediction in polynomial regression indicating that the transformation applied were powerful in obtaining Gaussian distributions. Refer to Figure [\ref{fig:histo}].\\ In addition to the features being transformed, we chose to model the latency after ensuring it possessed a normal Gaussian distribution, as referred to Figure [\ref{fig:Latency}]. We simply applied a log transformation on the average transformation and that was our output variable for predicting. \begin{figure}[!ht] \centering \includegraphics[width=\linewidth]{ECS_260_2.png} \caption{Output latency - Before and after Log Transformation} \label{fig:Latency} \end{figure} The graph in the appendix Figure [\ref{fig:scatter}] shows a scatter matrix among all variables collected. Although we can observe specific quick trends, more data need to be collected to verify this in a very general way. We can observe that with respect to the average latency, we can observe a slight downward trend with respect to the average number of repositories outside the current project and similarly another slight downward trend with respect to the number of contributors. Another observation was that our data displayed that there was no a visible linear relationship between latency and any of the input features and therefore we opted to work on a polynomial regression algorithm. \subsection*{Methodologies Used:} \subsubsection*{Ordinary Least Squares} The ordinary least squares method is commonly used in statistics to determine the unknown parameters of a regression model. It calculates the sum of the squares of the residuals from the sample data-point values indicated by the polynomial function. However, as we worked on the OLS method, we observed that from our progress reports, transforming variables into a Gaussian distribution (which we incorporated recently) improved the modeling results. Having Gaussian distribution allowed us to analyze the dataset in more detail and it would be better for us to predict the latency of the developers, but we could not see any distribution and could not proceed with the analysis of the data. We did not consider adopting OLS for this research even though the OLS would be great for linear regression for observing linear relationships between input and output variables. \subsubsection*{Polynomial Regression} A form of statistical analysis that uses the relationship between the dependent variable y and the independent variable x by fitting a polynomial function is called polynomial regression. It is a simple method that considers a simple polynomial function for modeling a response variable by solving the unknown parameters (simply coefficients) of the variables via optimization techniques. \\ We chose this method since it had a perfect balance between a simplistic method and non-linear behavior across the input and output variables. We chose this method over more complex methods such as Poisson regression and negative binomial regression since our data had a small number of samples and we still wanted to capture the non-linear relationships across the input and output variables. Hence we chose to proceed to model with these models for the scope of this project. We modeled our data via polynomial regression to explore the non-linear behavior of the features with respect to the response variable. Another advantage of using these methods allowed us to obtain more variables (although they were powered expressions of the features) for modeling. Hence we moved on to leverage polynomial regression to consider many dependent variables that may result in higher accuracy of predicting the response variable latency. Most of these analyses were conducted in Python (which includes crawling the API, pre-processing, and modeling our data).\\ \begin{figure}[!ht] \centering \includegraphics[scale=0.7]{Rsquare.png} \caption{$R^2$-values} \label{fig:Rsquare} \end{figure} We noticed that from the scatter matrix Figure [\ref{fig:scatter}] most of the features bear a nonlinear relationship with the latency of closing issues, so we modeled using polynomial regression. We picked the degree of polynomial regression based on the performance of regression models of various degrees from 1 to 20 [\ref{fig:Rsquare}]. As we observed from the plot, we found that the polynomial regression models do not improve after a degree of 5 and hence we chose to stick with a small degree which also adds more non-linear behavior to our model. \section{Results} We present the regression summary results we have obtained after fitting a polynomial regression model of degree 5 on the data features, see Figure [\ref{fig:OLS}]. \begin{figure}[!ht] \centering \includegraphics[width=1\linewidth]{OLS_Regression_results.png} \caption{OLS Polynomial Regression results} \label{fig:OLS} \end{figure} The results show that based on the p-value significance (variables that have a significance $<$ 0.05)) indicates that the age of projects, contributors, cross-development factor (the number of repositories created outside a current project during its timeline), and total closed issues of the second degree are critical predictors for the response variable (log of the average latency). We also find that for all the power raised for the features: forks, average comments, and forks are not very significant. The results confirm our hypotheses and in fact, we are able to validate our questions by confirming with the p-values of the features. Clearly, we can observe that the cross-development factor has a negative coefficient with respect to the output variable and hence it shows that an increase in the cross-development would decrease the average latency of closing issues. Similarly, we hypothesized that team size is correctly a strong predictor for latency. The positive coefficient for team size is a deduction where the results disagree with our hypotheses that it would bear a negative correlation with the output variable (that a larger team size would reduce the latency of closing issues). \subsubsection*{RQ1:} Our results do not agree with our hypotheses of verifying whether a larger number of people within a team working on the same project during its lifetime would reduce the latency output variable. We strongly attribute this with the positive coefficient but, the variable of team size is definitely a strong predictor based on the p-value significance. We find that from our results that as a team size grows, we find an increase in the latency, which means it takes a longer time to close issues. We attribute the disagreement in the trend with what we observe and we hypothesize because we probably did not consider any other correlating factor (like weighting it based on the experience of each developer in the team) along with the team size which might have improved or shown a different trend. \subsubsection*{RQ2:} The presence of shared developers was not directly gauged in our project; however, we consider the involvement of both the variables: forks and the cross-development factor for analyzing the presence of shared developers. We mainly focus on these variables because they have a straight connection with shared development: forks represent the number of various versions working on the same project and cross-development represents the number of other different projects worked during the same time. The results reveal that the forks do not have a huge influence on the latency while the cross-development factor does bear a negative relationship. We came to a conclusion that shared developers working more on this project do influence the latency of closed issues on the basis of these two factors. The negative coefficients of both these variables suggest that they bear a negative relationship as we had proposed in our hypothesis. We conclude that our results agree with the RQ2 we proposed. \subsubsection*{RQ3:} There is a healthy agreement between the cross-development factor and the output variable of latency. We can observe that the cross-development factor indeed was a critical feature as a predictor for predicting latency and its coefficient was negative (-0.1093) which implied that an increase in this factor reduces the latency. This was in direct agreement with what we hypothesized and this research question was validated by our research results, which corresponds to the fact that cross-development between developers outside the current project is very helpful in resolving issues in open source software development because of possible increased sharing of knowledge across developers. \section{Discussion} \subsection*{Main Findings from Our Results} Our final project results demonstrate that we have found the best predictors of latency, which was considered as a measure of productivity. Amongst those best predictors, we deduce that the average number of created repositories outside the current project by each of the top ten contributors is a strong variable that negatively influences the latency. This leads to a conclusion that cross-development across developers beyond the current project leads to more sharing of knowledge that allows more productivity and hence the developers are able to solve the issue quicker than the regular cases without shared development. In conclusion, we have validated our overall aim that collaboration between developers beyond the current working project improves the latency and hence increases productivity. \\ \subsection*{Strengths and Limitations} We confirm that our project was successful in validating all our research questions and we were fairly successful in correctly stating and validating the relations in the form of our research questions. We had collected and modeled a simple dataset with a small set of features using polynomial regression. However, our results prove to be in good agreement with our hypotheses. While we have been successful in completing research on this topic, we wanted to explore more complex models such as Poisson and Negative Binomial with a larger dataset. Poisson distribution is a statistical procedure that shows the probability of a given number (events) of events happening in a fixed time interval and can use the results for estimating events of varying sizes (area or distance). We could have considered adopting the Poisson Distribution methodology to predict the number of days taken to resolve issues as a discrete variable. Also, we didn't apply Box-Cox Transformation in our features although it was one of the transformation methods of transforming non-normal dependent variables into a normal distribution. This was because it employed a complicated methodology and we didn't want to explore a very complicated function into our simplistic dataset. Similarly, we did not consider certain critical features such as the experience of developers, lines of code, and a number of edited files for modeling. Also, we considered a plain domain and did not consider our work within a particular domain: such as pertaining to only application development or entirely based on back-end development, etc.\\ \section{Conclusion} We have seen several aspects of interpreting the relationship between the productivity of the developers in the open-source software and the collaboration across various developers., From our quantitative analysis, based on the data we have collected from the open-source software, GitHub, there are a few parameters that influence the latency of closing issues within software development. We have used certain statistical methodologies to analyze the data we collected from the scripts we have written and we have shown how to model the data we collected for a better understanding of the dataset and for better prediction of the latency of software development among the shared developers. Most importantly we have utilized simple but effective analysis methodologies such as Polynomial regression of a small degree 5 to predict the latency and we have observed that our method has provided many unique results, and have shown how to predict and measure the quality of open-source software. For further research, we can observe more on polynomial regression results and measure the actual results in a specific time period of the development and may apply other statistical techniques for a better understanding of productivity. \\ \section{Team Membership and Attestation of Work} Seongwoo Choi, Terry Guan, Sutej Kulkarni, Jason (Jinxiao) Song, and Sairamvinay Vijayaraghavan agree to participate and work on this project with the understanding of the project. \newpage \bibliographystyle{plain}
6d37667d40e5f367f4db67335f44b867ca35d595
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} In recent years, many computer vision (CV) researchers make efforts to design CV-oriented vision Transformer to surpass the performance of the convolutional neural networks (CNNs). Due to a high capability in modeling the long-range dependencies, vision Transformer achieves prominent results in diversified vision tasks, such as image classification \cite{ViT,Deit,TNT,Swin,Twins,CSWin}, semantic segmentation \cite{Segformer,zheng2021rethinking,wang2021max}, object detection \cite{DETR,zhu2020deformable,dai2021up} and etc. However, the powerful performance usually comes at a cost of heavy computational complexity. \begin{figure} \centering \includegraphics[height=4cm]{throughput_latency} \caption{Comparison of throughput and latency on ImageNet-1K classification. The throughput and the latency are tested based on the PyTorch framework with a V100 GPU and TensorRT framework with a T4 GPU, respectively. } \label{fig:throughput_latency} \end{figure} Primordially, ViT \cite{ViT} firstly introduces Transformer to the image recognition tasks. It splits the whole image into patches and feeds each patch as a token into Transformer. However, the patch-based Transformer is hard to deploy due to the computationally inefficient full-attention mechanism. To relieve this problem, Swin \cite{Swin} proposes the window-based self-attention to limit the computation of self-attention in non-overlapping sub-windows. Obviously, the window-based self-attention helps to reduce the complexity to a great extent, but the shifted operator for building connection among the windows brings difficulty for ONNX or TensorRT deployment. Twins \cite{Twins} takes advantage of the window-based self-attention and the spatial reduction attention from PVT \cite{PVT_v1} and proposes the spatially separable self-attention. Although Twins is deployment-friendly and achieves outstanding performance, its computational complexity is hardly reduced. CSWin \cite{CSWin} shows state-of-the-art performance via the novel cross-shaped window self-attention, but its throughput is low. Albeit, with varying degrees of progress in these famous vision Transformers, most of its recent successes are accompanied with huge resource demands. To overcome the aforementioned issues, we propose an efficient Transformer backbone, called {\bf Separable Vision Transformer (SepViT)}, which captures both local and global dependencies in a sequential order. A key design element of SepViT is its {\bf depthwise separable self-attention} module, as shown in Fig. \ref{fig:SepViT}. Inspired by the depthwise separable convolution in MobileNets \cite{MobileNet_v1,MobileNet_v2,Mobilenet_v3}, we re-design the self-attention module and propose the depthwise separable self-attention, which consists of a depthwise self-attention and a pointwise self-attention that can correspond to depthwise and pointwise convolution in MobileNets, respectively. The depthwise self-attention is used to capture local feature within each window while the pointwise self-attention is for building connections among windows that notably improve the expressive power. Moreover, to get the global representation of a local window, we develop a novel {\bf window token embedding}, which can model the attention relationship among windows with negligible cost. Furthermore, we also extend the idea of grouped convolution from AlexNet \cite{AlexNet} to our depthwise separable self-attention and present the {\bf grouped self-attention} to further improve the performance. To demonstrate the effectiveness of SepViT, we conduct a series of experiments on some typical vision tasks, including ImageNet-1K \cite{ImageNet-1K} classification, ADE20K \cite{ADE20K} semantic segmentation and COCO \cite{COCO} object detection and instance segmentation. The experimental results show that SepViT can achieve a better trade-off between performance and latency than other competitive vision Transformers \cite{PVT_v1,Swin,Twins,CSWin}. As shown in Fig. \ref{fig:throughput_latency}, SepViT achieves better accuracy at the same latency constraint and costs less inference time than the methods with the same accuracy. Furthermore, SepViT can be expediently applied and deployed since it only contains some universal operators (e.g., transpose and matrix multiplication). To sum up, the contributions of our work can be summarized as follows: \begin{enumerate} \item We propose the Separable Vision Transformer (SepViT) with a depthwise separable self-attention. It can achieve local information communication within the windows and global information exchange among the windows in a single Transformer block. \item We propose the window token embedding to learn a global feature representation of each window, which helps SepViT to model the attention relationship among windows with negligible computational cost. \item We extend depthwise separable self-attention to grouped self-attention in SepViT. It can capture more contextual concepts across multiple windows and achieve better performance. \end{enumerate} \section{Related work} \subsection{Vision Transformer} In the computer vision field, CNN has been dominant for decades due to its advantages of the spatial inductive biases. Later, in order to model the global dependencies of pixels, ViT \cite{ViT} introduces Transformer to computer vision for the first time and achieves an excellent performance on image classification task. In quick succession, a series of vision Transformers have been produced based on ViT. DeiT \cite{Deit} introduces the knowledge distillation scheme and proposes the data-efficient image Transformer. T2T-ViT \cite{T2T} progressively structurizes the image to tokens by recursively aggregating neighboring tokens into one token. TNT \cite{TNT} proposes the inner and outer Transformers to model the relationship of the word embeddings and the sentence embeddings, respectively. CPVT \cite{CPVT} produces the conditional position encoding which is conditioned on the local neighborhood of input tokens and is adaptable to arbitrary input sizes. Recently, PVT \cite{PVT_v1} and Swin \cite{Swin} synchronously propose the hierarchical architecture which is friendly for the dense prediction tasks, such as object detection, semantic and instance segmentation. Meanwhile, Swin \cite{Swin} as a pioneer proposes the window-based self-attention to compute attention within local windows. Soon after, Twins \cite{Twins} and CSWin \cite{CSWin} sequentially propose the spatial separable self-attention and cross-shaped window self-attention based on the hierarchical architecture. On the other hand, some researchers incorporate the spatial inductive biases of CNNs into Transformer. CoaT \cite{CoaT}, CVT \cite{CvT} and LeViT \cite{LeViT} introduce the convolutions before or after self-attentions and obtain well-pleasing results. Regarding to the design of lightweight Transformer, Mobile-Former \cite{Mobile-Former} and MobileViT \cite{MobileViT} combine Transformer blocks with the inverted bottleneck blocks in MobileNet-V2 \cite{MobileNet_v2} in series and parallel. Besides, another direction of research \cite{so2019evolved,Autoformer,Glit,Bossnas} is to automatically search the structure details of Transformer with neural architecture search \cite{zoph2016neural,Bignas} technology. \subsection{Lightweight Convolutions} Many lightweight and mobile-friendly convolutions are proposed for mobile vision tasks. Of these, grouped convolution is the first to be proposed by AlexNet \cite{AlexNet}, which groups the feature maps and conducts the distributed training. Then the representative work of mobile-friendly convolution must be the MobileNets \cite{MobileNet_v1,MobileNet_v2,Mobilenet_v3} with depthwise separable convolution. The depthwise separable convolution contains a depthwise convolution for spatial information communication and a pointwise convolution for information exchange across the channels. As time goes on, plenty of variants based on the aforementioned works are developed, such as \cite{ShuffleNet,ShuffleNet_v2,EfficientNet,GhostNet}. In our work, we adapt the ideology of depthwise separable convolution to Transformer, which aims to reduce the Transformer's computational complexity without the sacrifice of performance. \section{Methodology: SepViT} In this section, we first illustrate the design overview for SepViT, and then discuss some key modules within the SepViT block. Finally, we provide the architecture specifications and variants with different FLOPs. \subsection{Overview} As illustrated in Fig. \ref{fig:SepViT}, SepViT follows the widely-used hierarchical architecture \cite{PVT_v1,Swin,Twins,CSWin} and the window-based self-attention \cite{Swin}. Besides, SepViT also employs conditional position encoding (CPE) from \cite{CPVT,Twins}. For each stage, there is an overlapping patch merging layer for feature map downsampling followed by a series of SepViT blocks. The spatial resolution will be progressively reduced by 32$\times$ with either stride 4 or 2, and the channel dimension will be doubled stage by stage. It is worth noting that both local contextual concepts and global abstraction can be captured in a single SepViT block, while other works \cite{Swin,Twins} should employ two successive blocks to accomplish this local-global modeling. \begin{figure}[th] \centering \includegraphics[width=12cm]{SepViT} \caption{Separable Vision Transformer (SepViT). The top row is the overall hierarchical architecture of SepViT. The bottom row is the SepViT block and the detailed visualization of our depthwise separable self-attention and the window token embedding scheme.} \label{fig:SepViT} \end{figure} In the SepViT block, local information communication within each window is achieved by depthwise self-attention (DWA), and global information exchange among the windows is performed via pointwise self-attention (PWA). \subsection{Depthwise Separable Self-Attention} \subsubsection{Depthwise Self-Attention (DWA).} Similar to some pioneering works \cite{Swin,Twins}, SepViT is built on top of the window-based self-attention scheme. Firstly, we perform a window partition on the input feature map. Each window can be seen as an input channel of the feature map, while different windows contain diverse information. Different from previous works, we create a window token for each window, which serves as a global representation and is used to model the attention relationship in the following pointwise self-attention module. Then, a depthwise self-attention (DWA) is performed on all the pixel tokens within each window as well as its corresponding window token. This window-wise operation is quite similar to a depthwise convolution layer in MobileNets, aiming to fuse the spatial information within each channel. The implementation of DWA can be summarized as follows: \begin{equation} \label{eqution:DWA} \text{DWA}(z)= \text{Attention}(z \cdot W_Q, z \cdot W_K, z \cdot W_V) \; \end{equation} where $z$ is the feature tokens, consisted of the pixel and window tokens. $W_Q$, $W_K$, and $W_V$ denote three Linear layers for query, key and value computation in a regular self-attention. Attention means a standard self-attention operator that works on local windows. \subsubsection{Window Token Embedding.} A straightforward solution to model the attention relationship among windows is to employ all pixel tokens. However, it will bring huge computational costs and make the whole model very complicated. To better establish the attention relationship among windows, we present a window token embedding scheme, which leverages a single token to encapsulate the core information for each sub-window. This window token can be initialized either as a fixed zero vector or a learnable vector with the initialization of zero. While passing through DWA, there is an informational interaction between the window token and pixel tokens in each window. Thus the window token can learn a global representation of this window. Thanks to the effective window token, we can model the attention relationship among windows with negligible computational cost. \subsubsection{Pointwise Self-Attention (PWA).} The famous pointwise convolution in MobileNets is utilized to fuse the information from different channels. In our work, we imitate pointwise convolution to develop the pointwise self-attention (PWA) module to establish connections among windows. PWA is also mainly used to fuse the information across windows and obtain a final representation of the input feature map. More specifically, we extract the feature maps and window tokens from the output of DWA. Then, window tokens are used to model the attention relationship among windows and generate the attention map after a LayerNormalization (LN) layer and a Gelu activation function. Meanwhile, we directly treat the feature maps as the value branch of PWA without any other extra operation. With the attention map and the feature maps which are in the form of windows, we perform an attention computation among the windows for global information exchange. Formally, the implementation of PWA can be depicted as follows: \begin{equation} \text{PWA}(z, wt) = \text{Attention}(\text{Gelu}(\text{LN}(wt)) \cdot W_Q, \text{Gelu}(\text{LN}(wt)) \cdot W_K, z) \; \end{equation} where $wt$ denotes the window token. Here, Attention is a standard self-attention operator but works on all of the windows $z$. \subsubsection{Complexity Analysis.} \label{sec:complexity} Given an input feature with size $H \times W \times C$, the computational complexity of the multi-head self-attention (MSA) is $4HWC^2 + 2H^2W^2C$ in the global Transformer block of ViT \cite{ViT}. The complexity of the MSA in a window-based Transformer with window size $M \times M$ (Usually, $M$ is a common factor of $H$ and $W$, so the number of the windows is $N=\frac{HW}{M^2}$) can be decreased to $4HWC^2 + 2M^2HWC$ in Swin \cite{Swin}. As for the depthwise separable self-attention in SepViT, the complexity contains two parts, DWA and PWA. {\bf DWA.} Building on top of a window-based self-attention, DWA shares a similar computational cost to it. Additionally, the introduction of window tokens will cause an extra cost, but it is negligible compared to the overall cost of DWA. The complexity of DWA can be calculated as follows: \begin{equation} \varOmega(\text{DWA}) = 3HWC^2 + 3NC^2 + 2N(M^2+1)^2C \; \end{equation} where $3NC^2$ is the extra cost of encoding window tokens in Linear layers. $2N(M^2+1)^2C$ indicates the matrix multiplications involved in the self-attention for $N$ windows, where $M^2+1$ represents the $M^2$ pixel tokens in a window and its corresponding window token. Thanks to that the number of sub-windows $N$ is usually a small value, the extra costs caused by window tokens can be ignored. {\bf PWA.} Since the window token summarizes the global information of a local window, the proposed PWA helps to efficiently perform information exchange among windows in a window level instead of pixel level. Concretely, the complexity of PWA is given as follows: \begin{equation} \varOmega(\text{PWA}) = HWC^2 + 2NC^2 + N^2C + NHWC \; \end{equation} where $2NC^2$ represents the little cost of computing the query and key with $N$ window tokens, while the value branch is zero-cost. $N^2C$ indicates the computation of generating attention map with $N$ window tokens in a window level, which saves computational cost for PWA to a great extent. Finally, $NHWC$ indicates the matrix multiplication between the attention map and the feature maps. \subsection{Grouped Self-Attention} Motivated by the excellent performance of grouped convolution in visual recognition \cite{AlexNet}, we make an extension of our depthwise separable self-attention with the ideology of group, and propose the grouped self-attention. As shown in Fig. \ref{fig:grouped_attn}, we splice several neighboring sub-windows to form a larger window, which is similar to dividing the windows into groups and conducting a depthwise self-attention communication inside a group of windows. In this way, the grouped self-attention can capture long-range visual dependencies of multiple windows. In terms of computational cost and performance gains, the grouped self-attention has a certain extra cost compared with the depthwise separable self-attention but results in a better performance. Ultimately, we apply the block with grouped self-attention to SepViT and run it alternately with the depthwise separable self-attention block in the late stages of the network. \begin{figure} \centering\ \includegraphics[width=10cm]{grouped_attn} \caption{A macro view of the similarities and differences between the depthwise separable self-attention and the grouped self-attention.} \label{fig:grouped_attn} \end{figure} \subsection{SepViT Block} To summarize, our SepViT block can be formulated as follows: \begin{align} \label{eqution:SepViT} & \tilde{z}^l = \text{Concat}(z^{l-1}, wt) \; \\ & \ddot{z}^l = \text{DWA}(\text{LN}(\tilde{z}^l)) \; \\ & \dot{z}^l, \dot{wt} = \text{Slice}(\ddot{z}^l) \; \\ & \hat{z}^l = \text{PWA}(\dot{z}^l, \dot{wt}) + z^{l-1} \; \\ & z^l = \text{MLP}(\text{LN}(\hat{z}^l)) + \hat{z}^l \; \end{align} where $\ddot{z}^l$, $\hat{z}^l$ and $z^{l}$ denote the outputs of the DWA, PWA and SepViT block $l$, respectively. $\dot{z}^l$ and $\dot{wt}$ are feature maps and the learned window tokens. Concat represents the concatenation operation while Slice represents the slice operation. {\bf Comparison of Complexity.} We compare the complexity of our proposed SepViT block with two other SOTA blocks (Swin \cite{Swin}, Twins \cite{Twins}). As we stated before, the information interaction within and among windows is completed in a single SepViT block, while Swin \cite{Swin} and Twins \cite{Twins} require two successive blocks. As shown in Fig. \ref{fig:complexity}, we can observe that the SepViT block only costs about half the MACs of its competitors in each stage of the network. The reason lies in two aspects: i) SepViT block is more lightweight; ii) SepViT block removes many redundant layers, e.g., there is only one MLP layer and two LN layers in a single SepViT block while there are double MLP and LN layers in two successive Swin or Twins blocks. \begin{figure} \centering \includegraphics[height=4cm]{flops} \caption{Complexity comparison of an information interaction within and among windows in a single SepViT block with those two-block pattern works in each stage.} \label{fig:complexity} \end{figure} \begin{table} \centering \caption{Detailed configurations of SepViT variants in different stages.} \label{tab:configs} \resizebox{0.9\textwidth}{!}{ \begin{tabular}{@{}c|c|c|c|c@{}} \toprule Configuration & SepViT-Lite & SepViT-T & SepViT-S & SepViT-B \\ \midrule Blocks & [1, 2, 6, 2] & [1, 2, 6, 2] & [1, 2, 14, 2] & [1, 2, 14, 2] \\ \midrule Channels & [32, 64, 128, 256] & [96, 192, 384, 768] & [96, 192, 384, 768] & [128, 256, 512, 1024] \\ \midrule Heads & [1, 2, 4, 8] & [3, 6, 12, 24] & [3, 6, 12, 24] & [4, 8 ,16, 32] \\ \midrule Block Type & \multicolumn{4}{c}{[DSSA, DSSA\&GSA, DSSA\&GSA, DSSA]} \\ \bottomrule \end{tabular}} \end{table} \subsection{Architecture Configurations} To provide a fair comparison with other vision Transformers, we propose the SepViT-T (Tiny), SepViT-S (Small) and SepViT-B (Base) variants. Moreover, we also design the SepViT-Lite variant with a very light model size. The specific configurations of SepViT variants are shown in Table \ref{tab:configs}, the block depth of SepViT is smaller in some stages than the competitors since SepViT is more efficient. DSSA and GSA denote the blocks with depthwise separable self-attention and grouped self-attention, respectively. Additionally, the expansion ratio of each MLP layer is set as 4, the window sizes are 7$\times$7 and 14$\times$14 for DSSA and GSA in all SepViT variants. \section{Experimental Results} \subsection{ImageNet-1K Classification} \subsubsection{Settings.} We carry out the image classification experiment on the ImageNet-1K \cite{ImageNet-1K}, which contains about 1.28M training images and 50K validation images from 1K categories. For a fair comparison, we follow the training settings of the recent vision Transformer \cite{Twins}. Concretely, all of the SepViT variants are trained for 300 epochs on 8 V100 GPUs with a total batch size of 1024. The resolution of the input image is resized to 224 $\times$ 224. We adopt the AdamW \cite{AdamW} as the optimizer with weight decay 0.1 for SepViT-B and 0.05 for SepViT-S/T. The learning rate is gradually decayed based on the cosine strategy with the initialization of 0.001. We use a linear warm-up strategy with 20 epochs for SepViT-B and 5 epochs for SepViT-S/T. Besides, we have also employed the increasing stochastic depth augmentation \cite{Stochasticdepth} with the maximum drop-path rate of 0.2, 0.3, 0.5 for our SepViT-T/S/B models. \begin{table}[ht] \centering \caption{Comparison of different state-of-the-art methods on ImageNet-1K classification. Throughput and latency are tested based on the PyTorch framework with a V100 GPU (batchsize=192) and TensorRT framework with a T4 GPU (batchsize=8).} \label{tab:ImageNet_1K} \scalebox{0.7}{ \begin{tabular}{c|cccc|c} \toprule \multirow{2}{*}{Method} & Param & FLOPs & Throughput & Latency & Top-1 Acc \\ & (M) & (G) & (Images/s) & (ms) & (\%) \\ \midrule \multicolumn{6}{c}{ConvNet} \\ \midrule RegNetY-4G\cite{RegNet} & 21.0 & 4.0 & 1064 & - & 80.0 \\ RegNetY-8G\cite{RegNet} & 39.0 & 8.0 & 548 & - & 81.7 \\ RegNetY-16G\cite{RegNet} & 84.0 & 16.0 & 305 & - & 82.9 \\ \midrule \multicolumn{6}{c}{Transformer} \\ \midrule DeiT-Small/16\cite{Deit} & 22.0 & 4.6 & 406 & - & 79.9 \\ T2T-ViT-14\cite{T2T} & 22.0 & 5.2 & - & - & 81.5 \\ TNT-S\cite{TNT} & 23.8 & 5.2 & - & - & 81.3 \\ CoaT-Lite-Small\cite{CoaT} & 20.0 & 4.0 & - & - & 81.9 \\ CvT-13\cite{CvT} & 20.0 & 4.5 & - & - & 81.6 \\ PVT-Small\cite{PVT_v1} & 24.5 & 3.8 & 794 & 20.7 & 79.8 \\ Swin-T\cite{Swin} & 29.0 & 4.5 & 704 & - & 81.3 \\ Twins-PCPVT-S\cite{Twins} & 24.1 & 3.8 & 778 & 20.2 & 81.7 \\ Twins-SVT-S\cite{Twins} & 24.0 & 2.9 & 979 & 18.8 & 81.7 \\ CSWin-T\cite{CSWin} & 23.0 & 4.3 & 627 & 30.2 & 82.7 \\ PVT-v2-B2\cite{PVT_v2} & 25.4 & 4.0 & 664 & 37.8 & 82.0 \\ {\textbf{SepViT-T}} & 31.2 & 4.5 & 738 & 23.7 & 82.5 \\ \midrule T2T-ViT-19\cite{T2T} & 39.2 & 8.9 & - & - & 81.9 \\ CoaT-Lite-Medium\cite{CoaT} & 45.0 & 9.8 & - & - & 83.6 \\ CvT-21\cite{CvT} & 32.0 & 7.1 & - & - & 82.5 \\ PVT-Medium\cite{PVT_v1} & 44.2 & 6.7 & 511 & 30.0 & 81.2 \\ Swin-S\cite{Swin} & 50.0 & 8.7 & 412 & - & 83.0 \\ Twins-PCPVT-B\cite{Twins} & 43.8 & 6.7 & 502 & 29.1 & 82.7 \\ Twins-SVT-B\cite{Twins} & 56.0 & 8.6 & 433 & 38.9 & 83.2 \\ CSWin-S\cite{CSWin} & 35.0 & 6.9 & 390 & 52.0 & 83.6 \\ PVT-v2-B3\cite{PVT_v2} & 45.2 & 6.9 & 443 & 54.1 & 83.2 \\ \textbf{SepViT-S} & 46.6 & 7.5 & 476 & 34.5 & 83.5 \\ \midrule Deit-Base/16\cite{Deit} & 86.6 & 17.6 & 273 & - & 81.8 \\ T2T-ViT-24\cite{T2T} & 64.1 & 14.1 & - & - & 82.3 \\ TNT-B\cite{TNT} & 66.0 & 14.1 & - & - & 82.8 \\ PVT-Large\cite{PVT_v1} & 61.4 & 9.8 & 357 & 43.2 & 81.7 \\ Swin-B\cite{Swin} & 88.0 & 15.4 & 255 & - & 83.3 \\ Twins-PCPVT-L\cite{Twins} & 60.9 & 9.8 & 339 & 39.8 & 83.1 \\ Twins-SVT-L\cite{Twins} & 99.2 & 15.1 & 271 & 48.3 & 83.7 \\ CSWin-B\cite{CSWin} & 78.0 & 15.0 & 216 & 76.1 & 84.2 \\ PVT-v2-B4\cite{PVT_v2} & 62.6 & 10.1 & 298 & 75.5 & 83.6 \\ PVT-v2-B5\cite{PVT_v2} & 82.0 & 11.8 & 285 & 77.5 & 83.8 \\ \textbf{SepViT-B} & 82.3 & 13.1 & 308 & 46.0 & 84.0 \\ \bottomrule \end{tabular} } \end{table} \subsubsection{Results.} As shown in Table \ref{tab:ImageNet_1K}, compared to the latest state-of-the-art methods, our SepViT achieves the best trade-off between accuracy and latency. To be more specific, our SepViT-B and SepViT-S achieve 84.0\% and 83.5\% top-1 accuracy, surpassing Swin by 0.7\% and 0.5\% with about 14\% fewer FLOPs. And for the tiny variant, our SepViT-T outperforms the Swin-T by 1.2\% with the same FLOPs of 4.5G. In terms of latency, compared to the recent methods (e.g., PVT-v2 \cite{PVT_v2} and CSWin \cite{CSWin}) with similar performance, both of our small and base models cost about 40\% less inference time. Moreover, our SepViT shows very promising performance by comparison with the CNNs counterparts. \subsection{ADE20K Semantic Segmentation} \begin{table} \centering \caption{Comparison of different backbones on ADE20K semantic segmentation task. FLOPs are measured with the input size of 512$\times$2048.} \label{tab:ADE20K} \resizebox{0.9\textwidth}{!}{ \begin{tabular}{c|ccc|ccc} \toprule \multirow{2.5}{*}{Backbone} & \multicolumn{3}{c|}{Semantic FPN 80k} & \multicolumn{3}{c}{UperNet 160k} \\ \cmidrule(l){2-7} & Param(M) & FLOPs(G) & mIoU(\%) & Param(M) & FLOPs(G) & mIoU/MS mIoU(\%) \\ \midrule ResNet50\cite{ResNet} & 28.5 & 183 & 36.7 & - & - & -/- \\ PVT-Small\cite{PVT_v1} & 28.2 & 161 & 39.8 & - & - & -/- \\ Swin-T\cite{Swin} & 31.9 & 182 & 41.5 & 59.9 & 945 & 44.5/45.8 \\ Twins-PCPVT-S\cite{Twins} & 28.4 & 162 & 44.3 & 54.6 & 919 & 46.2/47.5 \\ Twins-SVT-S\cite{Twins} & 28.3 & 144 & 43.2 & 54.4 & 901 & 46.2/47.1 \\ \textbf{SepViT-T} & 38.8 & 181 & \textbf{44.3} & 66.8 & 940 & \textbf{46.9}/\textbf{47.7} \\ \midrule ResNet101\cite{ResNet} & 47.5 & 260 & 38.8 & 86.0 & 1092 & -/44.9 \\ PVT-Medium\cite{PVT_v1} & 48.0 & 219 & 41.6 & - & - & -/- \\ Swin-S\cite{Swin} & 53.2 & 274 & 45.2 & 81.3 & 1038 & 47.6/\textbf{49.5} \\ Twins-PCPVT-B\cite{Twins} & 48.1 & 220 & 44.9 & 74.3 & 977 & 47.1/48.4 \\ Twins-SVT-B\cite{Twins} & 60.4 & 261 & 45.3 & 88.5 & 1020 & 47.7/48.9 \\ \textbf{SepViT-S} & 55.4 & 244 & \textbf{46.1} & 83.4 & 1003 & \textbf{48.1}/49.2 \\ \midrule ResNeXt101-64$\times$4d\cite{ResNeXt} & 86.4 & - & 40.2 & - & - & -/- \\ PVT-Large\cite{PVT_v1} & 65.1 & 283 & 42.1 & - & - & -/- \\ Swin-B\cite{Swin} & 91.2 & 422 & 46.0 & 121.0 & 1188 & 48.1/49.7 \\ Twins-PCPVT-L\cite{Twins} & 65.3 & 283 & 46.4 & 91.5 & 1041 & 48.6/49.8 \\ Twins-SVT-L\cite{Twins} & 103.7 & 404 & 46.7 & 133.0 & 1164 & 48.8/49.7 \\ \textbf{SepViT-B} & 94.7 & 367 & \textbf{47.3} & 124.8 & 1128 & \textbf{49.1}/\textbf{50.4} \\ \bottomrule \end{tabular} } \end{table} \subsubsection{Settings.} To further verify the capacity of our SepViT, we conduct the semantic segmentation experiment on ADE20K \cite{ADE20K}, which contains about 20K training images and 2K validation images from 150 categories. To make fair comparisons, we also follow the training conventions of the previous vision Transformers \cite{PVT_v1,Swin,Twins} on the Semantic FPN \cite{Semantic_FPN} and UperNet \cite{UperNet} frameworks. All of our models are pre-trained on the ImageNet-1k and then finetuned on ADE20K with the input size of 512$\times$512. For the Semantic FPN framework, we adopt the AdamW optimizer with both the learning rate and weight decay being 0.0001. Then we train the whole networks for 80K iterations with the total batch size of 16 based on the stochastic depth of 0.2, 0.3, and 0.4 for SepViT-T/S/B. For the training and testing on the UperNet framework, we train the models for 160K iterations with the stochastic depth of 0.3, 0.3, and 0.5. AdamW optimizer is used as well but with the learning rate $6\times10^{-5}$, total batch size 16 and weight decay 0.01 for SepViT-T/S and 0.03 for SepViT-B. Then we test the mIoU based on both single-scale and multi-scale (MS) where the scale goes from 0.5 to 1.75 with an interval of 0.25. \subsubsection{Results.} In Table \ref{tab:ADE20K}, we make a comparison with the recent vision Transformer and CNN backbones. Based on the Semantic FPN framework, SepViT-T, SepViT-S and SepViT-B surpass Swin's variants by 2.8\%, 0.9\% and 1.3\% mIoU with about 1G, 30G and 55G fewer FLOPs, respectively. Meanwhile, our SepViT shows great advantage over CNNs (e.g., ResNet\cite{ResNet}). By contrast to Swin on the UperNet framework, our models achieve 2.4\%, 0.5\% and 1.0\% higher mIoU with fewer FLOPs in terms of single-scale testing. Extensive experiments reveal that our SepViT shows great potential on segmentation tasks. \subsection{COCO Object Detection and Instance Segmentation} \begin{table}[th] \caption{Comparison of different backbones on RetinaNet-based object detection task. FLOPs are measured with the input size of $800 \times 1280$.} \label{tab:RetinaNet_COCO} \centering \resizebox{0.9\textwidth}{!}{ \begin{tabular}{c|cc|cccccc|cccccc} \toprule \multirow{2}{*}{Backbone} & Param & FLOPs & \multicolumn{6}{c|}{RetinaNet 1$\times$} & \multicolumn{6}{c}{RetinaNet 3$\times$ + MS} \\ \cline{4-15} & (M) & (G) & AP & AP$_{50}$ & AP$_{75}$ & AP$_S$ & AP$_M$ & AP$_L$ & AP & AP$_{50}$ & AP$_{75}$ & AP$_S$ & AP$_M$ & AP$_L$ \\ \midrule ResNet50\cite{ResNet} & 37.7 & 239 & 36.3 & 55.3 & 38.6 & 19.3 & 40.0 & 48.8 & 39.0 & 58.4 & 41.8 & 22.4 & 42.8 & 51.6 \\ PVT-Small\cite{PVT_v1} & 34.2 & 226 & 40.4 & 61.3 & 43.0 & 25.0 & 42.9 & 55.7 & 42.2 & 62.7 & 45.0 & 26.2 & 45.2 & 57.2 \\ Swin-T\cite{Swin} & 38.5 & 245 & 41.5 & 62.1 & 44.2 & 25.1 & 44.9 & 55.5 & 43.9 & 64.8 & 47.1 & 28.4 & 47.2 & 57.8 \\ Twins-PCPVT-S\cite{Twins} & 34.4 & 226 & 43.0 & 64.1 & 46.0 & 27.5 & 46.3 & 57.3 & 45.2 & 66.5 & 48.6 & 30.0 & 48.8 & 58.9 \\ Twins-SVT-S\cite{Twins} & 34.4 & 210 & 43.0 & 64.2 & \textbf{46.3} & 28.0 & 46.4 & 57.5 & 45.6 & 67.1 & 48.6 & 29.8 & 49.3 & 60.0 \\ \textbf{SepViT-T} & 45.4 & 243 & \textbf{43.9} & \textbf{65.1} & 46.2 & \textbf{28.4} & \textbf{47.3} & \textbf{58.5} &\textbf{ 46.2} & \textbf{67.7} & \textbf{49.4 } & \textbf{30.3 } & \textbf{49.8 } & \textbf{60.7} \\ \midrule ResNet101\cite{ResNet} & 58.0 & 315 & 38.5 & 57.8 & 41.2 & 21.4 & 42.6 & 51.1 & 40.9 & 60.1 & 44.0 & 23.7 & 45.0 & 53.8 \\ PVT-Medium\cite{PVT_v1} & 53.9 & 283 & 41.9 & 63.1 & 44.3 & 25.0 & 44.9 & 57.6 & 43.2 & 63.8 & 46.1 & 27.3 & 46.3 & 58.9 \\ Swin-S\cite{Swin} & 59.8 & 335 & 44.5 & 65.7 & 47.5 & 27.4 & 48.0 & 59.9 & 46.3 & 67.4 & 49.8 & 31.1 & 50.3 & 60.9 \\ Twins-PCPVT-S\cite{Twins} & 54.1 & 283 & 44.3 & 65.6 & 47.3 & 27.9 & 47.9 & 59.6 & 46.4 & 67.7 & 49.8 & 31.3 & 50.2 & 61.4 \\ Twins-SVT-B\cite{Twins} & 67.0 & 326 & 45.3 & 66.7 & 48.1 & 28.5 & 48.9 & 60.6 & 46.9 & 68.0 & 50.2 & 31.7 & 50.3 & 61.8 \\ \textbf{SepViT-S} & 61.9 & 302 &\textbf{ 45.5 } &\textbf{ 66.8} &\textbf{ 48.3} & \textbf{28.9} & \textbf{49.4 } & \textbf{60.8 } & \textbf{47.5} & \textbf{68.9} & \textbf{50.9} & \textbf{32.4} & \textbf{51.1} &\textbf{ 62.5} \\ \bottomrule \end{tabular} } \end{table} \subsubsection{Settings.} Next, we evaluate SepViT on the objection detection and instance segmentation task \cite{COCO} based the RetinaNet \cite{RetinaNet} and Mask R-CNN \cite{Mask_RCNN} frameworks with COCO2017 \cite{COCO}. Specifically, all of our models are pre-trained on ImageNet-1K and then finetuned following the settings of the previous works \cite{PVT_v1,Swin,Twins}. As for the 12 epochs (1$\times$) experiment, both the RetinaNet-based and the Mask R-CNN-based models use the AdamW optimizer with the weight decay 0.001 for SepViT-T and 0.0001 for SepViT-S. And they are trained with the total batch size of 16 based on the stochastic depth of 0.2 and 0.3 for SepViT-T/S. \begin{table}[ht] \centering \caption{Comparison of different backbones on Mask R-CNN-based object detection and instance segmentation tasks. FLOPs are measured with the inpus size of $800 \times 1280$. The superscript $b$ and $m$ denote the box detection and mask instance segmentation.} \label{tab:MaskRCNN_COCO} \resizebox{0.9\textwidth}{!}{ \begin{tabular}{c|cc|cccccc|cccccc} \toprule \multirow{2}{*}{Backbone} & Param & FLOPs & \multicolumn{6}{c|}{Mask R-CNN 1$\times$} & \multicolumn{6}{c}{Mask R-CNN 3$\times$ + MS} \\ \cline{4-15} & (M) & (G) & AP$^b$ & AP$_{50}^b$ & AP$_{75}^b$ & AP$^m$ & AP$_{50}^m$ & AP$_{75}^m$ & AP$^b$ & AP$_{50}^b$ & AP$_{75}^b$ & AP$^m$ & AP$_{50}^m$ & AP$_{75}^m$ \\ \midrule ResNet50\cite{ResNet} & 44.2 & 260 & 38.0 & 58.6 & 41.4 & 34.4 & 55.1 & 36.7 & 41.0 & 61.7 & 44.9 & 37.1 & 58.4 & 40.1 \\ PVT-Small\cite{PVT_v1} & 44.1 & 245 & 40.4 & 62.9 & 43.8 & 37.8 & 60.1 & 40.3 & 43.0 & 65.3 & 46.9 & 39.9 & 62.5 & 42.8 \\ Swin-T\cite{Swin} & 47.8 & 264 & 42.2 & 64.4 & 46.2 & 39.1 & 64.6 & 42.0 & 46.0 & 68.2 & 50.2 & 41.6 & 65.1 & 44.8 \\ Twins-PCPVT-S\cite{Twins} & 44.0 & 245 & 42.9 & 65.8 & 47.1 & 40.0 & 62.7 & 42.9 & 46.8 & 69.3 & 51.8 & 42.6 & 66.3 & 46.0 \\ Twins-SVT-S\cite{Twins} & 44.0 & 228 & 43.4 & 66.0 & 47.3 & 40.3 & 63.2 & 43.4 & 46.8 & 69.2 & 51.2 & 42.6 & 66.3 & 45.8 \\ \textbf{SepViT-T} & 54.7 & 261 & \textbf{44.4} & \textbf{67.1 } & \textbf{48.3} &\textbf{41.1} & \textbf{64.1} & \textbf{43.9} & \textbf{47.5} & \textbf{70.0} & \textbf{52.3} & \textbf{43.2} & \textbf{67.1} & \textbf{46.3} \\ \midrule ResNet101\cite{ResNet} & 63.2 & 336 & 40.4 & 61.1 & 44.2 & 36.4 & 57.7 & 38.8 & 42.8 & 63.2 & 47.1 & 38.5 & 60.1 & 41.3 \\ ResNeXt101-32$\times$4d\cite{ResNeXt} & 63.0 & 340 & 41.9 & 62.5 & 45.9 & 37.5 & 59.4 & 40.2 & 44.0 & 64.4 & 48.0 & 39.2 & 61.4 & 41.9 \\ PVT-Medium\cite{PVT_v1} & 63.9 & 302 & 42.0 & 64.4 & 45.6 & 39.0 & 61.6 & 42.1 & 44.2 & 66.0 & 48.2 & 40.5 & 63.1 & 43.5 \\ Swin-S\cite{Swin} & 69.1 & 354 & 44.8 & 66.6 & 48.9 & 40.9 & 63.4 & 44.2 & 48.5 & 70.2 & 53.5 & 43.3 & 67.3 & 46.6 \\ Twins-PCPVT-B\cite{Twins} & 64.0 & 302 & 44.6 & 66.7 & 48.9 & 40.9 & 63.8 & 44.2 & 47.9 & 70.1 & 52.5 & 43.2 & 67.2 & 46.3 \\ Twins-SVT-B\cite{Twins} & 76.3 & 340 & 45.2 & 67.6 & 49.3 & 41.5 & 64.5 & 44.8 & 48.0 & 69.5 & 52.7 & 43.0 & 66.8 & 46.6 \\ \textbf{SepViT-S} & 71.3 & 321 &\textbf{ 46.3} &\textbf{ 68.0} & \textbf{49.8 } & \textbf{42.3} & \textbf{65.8} & \textbf{45.3} & \textbf{48.7 } & \textbf{70.5} &\textbf{ 53.7} &\textbf{ 43.9} &\textbf{ 67.7 } & \textbf{47.1} \\ \bottomrule \end{tabular} } \end{table} During the training, there are 500 iterations for warm-up and the learning rate will decline by 10$\times$ at epochs 8 and 11. For the 36 epochs (3$\times$) experiment with multi-scale (MS) training, models are trained with the resized images such that the shorter side ranges from 480 to 800 and the longer side is at most 1333. Moreover, most of all the other settings are the same as the 1$\times$ except that the stochastic depth is 0.3 for SepViT-T, the weight decay becomes 0.05 and 0.1 for SepViT-T/S, and the decay epochs are 27 and 33. \subsubsection{Results.} Table \ref{tab:RetinaNet_COCO} reports object detection results using the RetinaNet framework. It indicates that our SepViT can achieve competitive performance, compared with the recent vision Transformers and CNNs. For the 1$\times$ schedule, our SepViT-T and SepViT-S surpass the Swin by 2.4 AP and 1.0 AP with fewer FLOPs. In particular, our SepViT variants achieve a state-of-the-art performance with 46.2 AP and 47.5 AP in the 3$\times$ experiment. Table \ref{tab:MaskRCNN_COCO} shows the evaluation result with Mask R-CNN framework. We can see that our SepViT-T outperforms Swin-T by 2.2 box AP, 2.0 mask AP with 1$\times$ schedule, and 1.5 box AP, 1.6 mask AP with 3$\times$ schedule. For the SepViT-S variant, it achieves a similar performance gain while saving a certain amount of computation overhead. \begin{table}[t] \centering \caption{Ablation studies of the key components in our SepViT. LWT means initializing the window tokens with learnable vectors.} \label{tab:Ablation1} \resizebox{0.85\textwidth}{!}{ \begin{tabular}{@{}c|ccc|ccc|c@{}} \toprule Model & DSSA & GSA & LWT & Param(M) & FLOPs(G) & Throughput(Images/s)) & Top-1 Acc(\(\% \)) \\ \midrule Swin-T+CPVT \cite{Twins} & & & & 28.0 & 4.4 & 704 & 81.2 \\ SepViT-T$\dagger$ & $\surd$ & & & 29.3 & 4.3 & 755 & 81.7 \\ \midrule \multirow{3}{*}{SepViT-T} & $\surd$ & & & 32.1 & 4.4 & 746 & 82.0 \\ & $\surd$ & $\surd$ & & 31.2 & 4.5 & 738 & 82.3 \\ & $\surd$ & $\surd$ & $\surd$ & 31.2 & 4.5 & 738 & \textbf{82.5} \\ \bottomrule \end{tabular} } \end{table} \subsection{Ablation Study} To better demonstrate the significance of each key component, including depthwise separable self-attention, grouped self-attention and the novel window token embedding scheme in SepViT, we conduct a series of ablation experiments on ImageNet-1K classification with SepViT-T variant. \subsubsection{Efficient Components.} As mentioned above, SepViT adopts the conditional position encoding (CPE) \cite{CPVT} and the overlapping patch embedding (OPE) \cite{ViT}. Therefore, we take the Swin-T+CPVT reported in \cite{Twins} as the baseline and we produce the SepViT-T$\dagger$ with CPE but without OPE to eliminate the influence of other factors. As shown in Table \ref{tab:Ablation1} where each component is added in turn to verify their benefits, our SepViT-T$\dagger$ simply equipped with the depthwise separable self-attention block (DSSA) outperforms Swin+CPVT by 0.5\% and it is much faster than Swin with the throughput of 755 images/s. Meanwhile, our SepViT-T with CPE, OPE and DSSA achieves 82.0\% top-1 accuracy. After employing grouped self-attention block (GSA) and DSSA alternately in the second and third stages, we gain an accuracy improvement of 0.3\%. \subsubsection{Window Token Embedding.} We further study whether it makes a difference if the window token is initialized with a fixed zero vector or a learnable vector. In contrast to the fixed zero initialization scheme, the learnable window token helps our SepViT-T to boost the performance to 82.5\%, as shown in the last row of Table \ref{tab:Ablation1}. \begin{table}[th] \centering \caption{Comparison of different approaches of getting the global representation of each window in SepViT.} \label{tab:Ablation2} \resizebox{0.75\textwidth}{!}{ \begin{tabular}{@{}c|ccc|c@{}} \toprule Method & Param(M) & FLOPs(G) & Throughput(Images/s)) & Top-1 Acc(\(\% \)) \\ \midrule Win\_Tokens & 31.2 & 4.5 & 738 & \textbf{82.5} \\ Avg\_Pooling & 31.2 & 4.5 & 743 & 82.1 \\ Dw\_Conv & 31.3 & 4.5 & 735 & 82.3 \\ \bottomrule \end{tabular} } \end{table} Moreover, to verify the effectiveness of learning the global representation of each window with our window token embedding scheme (Win\_Tokens), we further study some other methods that directly get the global representations from the output feature maps of DWA, such as average pooling (Avg\_Pooling) and depthwise convolution (DW\_Conv). As the results illustrated in Table \ref{tab:Ablation2}, our window token embedding scheme achieves the best performance among these approaches. Meanwhile, the comparison of parameters and FLOPs between Win\_Token and Avg\_Pooling methods demonstrates that our window token embedding scheme brings negligible computational cost. \begin{table}[t] \centering \caption{Comparison of lite models on ImageNet-1K classification.} \label{tab:Ablation3} \resizebox{0.6\textwidth}{!}{ \begin{tabular}{c|cc|c} \toprule Method & Param(M) & FLOPs(G) & Top-1 Acc(\(\% \)) \\ \midrule MobileNet-V2 \cite{MobileNet_v2} & 3.4 & 0.3 & 71.8 \\ ResNet18 \cite{ResNet} & 11.1 & 1.8 & 69.8 \\ PVTv2-B0 \cite{PVT_v2} & 3.4 & 0.6 & 70.5 \\ {\bf SepViT-Lite} & 3.7 & 0.6 & \textbf{72.3} \\ \bottomrule \end{tabular} } \end{table} \subsubsection{Comparison with Lite Models.} To further explore the potential of SepViT, we scale down SepViT to a lite model size (SepViT-Lite). As we can observe in Table \ref{tab:Ablation3}, SepViT-Lite obtains an excellent top-1 accuracy of 72.3\%, outperforming its counterparts with similar model sizes. \section{Conclusion} In this paper, we have presented an efficient Separable Vision Transformer, dubbed SepViT, which consists of three core designs. Firstly, depthwise separable self-attention enables SepViT to achieve information interaction within and among the windows in a single block. Next, the window token embedding scheme helps SepViT to model the attention relationship among windows with negligible computational cost. Thirdly, grouped self-attention enables SepViT to capture long-range visual dependencies across multiple windows for better performance. Experimental results on various vision tasks verify that SepViT achieves a better trade-off between performance and latency. \bibliographystyle{splncs04}
34bd255fa58d72b26374511e3125e38769a36db4
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Modern warfare situations are fluid and require rapid ad hoc countermeasure decisions. Military technology is also advancing with the development of artificial intelligence, and the future warfare can be said to be dominated by the participation of few combatants and the unmanned nature of actual combat. Here to use NetLogo software simulation to build a dynamic projection of both sides tanks in complex terrain confrontation thought\cite{b1}, both sides confrontation terrain environment as shown in Figure 1. \begin{figure*}[t] \centerline{\includegraphics[width=6.7in]{dixingtu}} \caption{Diagram of the Game Environment of both Sides.} \label{fig1} \end{figure*} The dynamic projection of the two sides' tank confrontation in complex terrain is conceived as a situation where the Red side is preparing to achieve a strike against the Blue side's chain of command in the complex terrain of the mountain peaks and valleys, and the Blue side intends to send a significant portion of its armor numbers to intervene in order to achieve the objective of stopping the strike and maintain the intention of containing the Red side's course. After the Red side learns of the Blue side's strategic intent, it sends its absolute superior armor numbers to execute counter-intervention operations at the first opportunity. The OODA cycle connects the two sides in the confrontation process, forming a complete game process, and finally using hierarchical analysis to provide a reference for the weight value of the mixed game strategy. -Decision-action" cycle. The "Orientation" and "Decision" steps are the most critical in the OODA cycle, and if the enemy's threat is misjudged or the surrounding environment is misunderstood, then the judgment and decision will be wrong\cite{b2,b3,b4,b5}. The goal is to interfere with the enemy's OODA cycle by taking prompt action after the first OODA cycle is completed by the own side. In constructing a complex combat system adversarial analysis, NetLogo modeling software will be used to model the system dynamics of the game process on both sides\cite{b6,b7,b8,b9,b10,b11}. \section{Complex system confrontation model construction theory} In the 1970s, the U.S. Air Force Colonel Boyd proposed the "$OODA$ Loop" theory. $OODA$ is the abbreviation of the four English words Observation, Orientation, Decision, and Action. Its meaning is to observe, Orientation, make decisions, and Action.\cite{b11,b12}The OODA Loop theory (Observation, Orientation, Decesion, Action) proposed by John Boyd provides a way to describe conflicts in the cycle of detection, judgment, decision-making, and action. Decision-making processing is widely used in the study of military issues. The OODA loop theory points out that the characteristic of command and control operations is to fight in accordance with the observation-judgment-decision-action loop, which can be divided into the following four stages: The first stage is observation (Observation), mainly through various sensing equipment and The use of the network for intelligence collection, for example, early warning detection information, battlefield environment information, enemy coordinate information, etc. The second stage is Orientation. The battlefield situation is changing rapidly and there is great uncertainty. Judgment is to convert data into useful information. Effective and rapid judgment of the results can assist the commander in making correct decisions and even changes. The battlefield situation. The third stage is Decision, where the commander clearly formulates a mission plan and issues a battle plan. The rapid formation of decision-making is of decisive significance to the battlefield situation. The fourth stage is action. Actions on the battlefield are usually described as taking corresponding operational deployments and performing actions based on the operational plan issued by the superior. The OODA Loop has periodicity and nesting. Periodicity means that when a loop ends, another new loop begins. The size of the period is related to the scale of combat forces, spatial scope, and combat style; nesting means that the loop and The loops are related in the form of nesting. For example, in the tactical combat system, the smallest OODA Loop is the firepower closed-loop control loop of the close-range weapon system. There are also OODA Loops at the unit level. These command and control loops are nested within each other, and the inner loop The cycle is short and the outer loop cycle is long. In combat, the opposing parties will continuously observe the surrounding environment, obtain relevant information, judge threats, make immediate adjustments, make decisions, and take corresponding actions. This is specifically reflected in the competition of OODA Loop response capabilities. If they can try to shorten their own side The enemy's OODA Loop and increase the enemy's OODA Loop as much as possible. New actions are initiated before the enemy responds to its previous action, causing the enemy to lose the ability to react, so that the initiative can be mastered and a huge advantage can be obtained..The schematic diagram of the $OODA$ Loop is shown in Figure 2. \begin{figure*}[t] \centerline{\includegraphics[width=5.0in]{OODA}} \caption{Diagram of the Game Environment of both Sides.} \label{fig2} \end{figure*} The first is observation. Before the implementation of command operations, a clear observation plan is required. The two sides started by observing the new situation from the beginning of the war and the reaction of the other side. In the experiment, the red and blue sides were simulated and designed for the $OODA$ Loop, and the deployment was judged by observing the strength of the opposing sides before the war. The second is to judge and observe the situation and make reasonable decisions. In order to reflect the process of dynamically deploying the amount of armor, the slider value adjustment in the judgment and decision-making link in $NetLogo$ is used. At the end, the actual output of the red and blue sides is used as the execution link, and the amount of armor that needs to be dispatched for the next $OODA$ Loop is made according to the previous three links.\cite{b13,b14,b15} The $OODA$ Loop is a closed ring for decision-making and control actions, and it has the characteristics of a periodic cycle. The law of future warfare is that combat units that make quick judgments and decisions will take the initiative. From the $OODA$ Loop theory, it can be concluded that the timeliness of military operations research. Each time period of the system combat command cycle depends on different factors. $\lambda_{d}$ and $\lambda_{f}$ are defined separately as the mobile deployment rhythm and engagement rhythm of the combat system in the physical domain.$\lambda_{C 2}$ is the decision-making rhythm of the combat system in the cognitive domain,$\lambda_{T}$is the rhythm of interaction between the information domain, the physical domain, and the cognitive domain,$\Delta t_{1}, \Delta t_{2}, \Delta t_{3}, \Delta t_{4}$is defined as the combat time of the observation, judgment, decision-making and action links of the OODA Loop,then complete the OODA Loop and the time required for each link, as shown in Equation 1 and Equation 2. \begin{equation}\label{eq1} \left\{\begin{array}{l} \Delta t_{1} \geq \frac{1}{\lambda_{T}} \\ \Delta t_{2} \geq \frac{1}{\lambda_{T}}+\frac{1}{\lambda_{C 2}} \\ \Delta t_{3} \geq \frac{1}{\lambda_{T}}+\frac{1}{\lambda_{d}} \\ \Delta t_{4} \geq \frac{1}{\lambda_{T}}+\frac{1}{\lambda_{f}} \end{array}\right. \end{equation} \begin{equation}\label{eq2} \begin{aligned} T_{O O D A} &=\Delta t_{1}+\Delta t_{2}+\Delta t_{3}+\Delta t_{4} \\ & \geq \frac{4}{\lambda_{T}}+\frac{1}{\lambda_{C 2}}+\frac{1}{\lambda_{d}}+\frac{1}{\lambda_{f}} \end{aligned} \end{equation} According to Shannon's information entropy theory, the probability of occurrence of each part of the observation, judgment, decision-making and action links in the OODA Loop is defined as $P(O 1), P(O 2), P(D), P(A)$.Then the information entropy of each part of the observation, judgment, decision and action links in the OODA Loop is shown in Equation 3. \begin{scriptsize} \begin{equation}\label{eq3} \left\{\begin{array}{l} H\left(O 1_{i}\right)=-\sum_{i=1}^{n} P\left(O 1_{i}\right) \log \left(P\left(O 1_{i}\right)\right) \\ H\left(O 2_{i}\right)=-\sum_{i=1}^{n} P\left(O 2_{i}\right) \log \left(P\left(O 2_{i}\right)\right) \\ H\left(D_{i}\right)=-\sum_{i=1}^{n} P\left(D_{i}\right) \log \left(P\left(D_{i}\right)\right) \\ H\left(A_{i}\right)=-\sum_{i=1}^{n} P\left(A_{i}\right) \log \left(P\left(A_{i}\right)\right) \end{array}\right. \end{equation} \end{scriptsize} In the formula, n indicates that the OODA Loop can be multiple cycles. The information entropy of all OODA Loop of complex operations systems is shown in formula 4. \begin{scriptsize} \begin{equation}\label{eq4} \begin{aligned} H(O O D A) &=H\left(O 1_{i}\right)+H\left(O 2_{i}\right)+H(D)+H(A) \\ &=-\sum_{i=1}^{n} P\left(O O D A_{i}\right) \log \left(P\left(O O D A_{i}\right)\right) \end{aligned} \end{equation} \end{scriptsize} \emph{Statement: According to the information entropy of each link of the OODA Loop, the information entropy of the OODA Loop of the complex combat system can be described. An OODA Loop is composed of four links to solve the maximum information entropy of all OODA Loop in a complex combat system.The information entropy of all OODA Loop of the system is $H(O O D A)=-\sum_{i=1}^{n} P\left(O O D A_{i}\right) \log \left(P\left(O O D A_{i}\right)\right)$,Then prove $H(O O D A) \leq \log _{2} n$.} \begin{proof} The information entropy of the complex system is abbreviated as Equation 5, and the constraint condition is Equation 6. The problem of solving the maximum value of the original Equation 4 is equivalent to the minimum value of Equation 5.. \end{proof} \begin{equation}\label{eq5} H(D)=\sum_{i=1}^{n} X_{i} \log _{2} X_{i} \\ \end{equation} \begin{equation}\label{eq6} \sum_{i=1}^{n} X_{i}=1 \end{equation} Then construct the Lagrangian function as formula 7 \begin{scriptsize} \begin{equation}\label{eq7} L\left(X_{1}, \cdots \cdots, X_{n}\right)=\sum_{i=1}^{n} X_{i} \log _{2} X_{i}+\lambda\left(\sum_{i=1}^{n} X_{i}-1\right) \end{equation} \end{scriptsize} \begin{tiny} \begin{equation} \begin{aligned} \frac{\partial L\left(X_{1}, \cdots \cdots, X_{n}\right)}{\partial X_{1}} &=\frac{\partial}{\partial X_{1}}\left[\sum_{i=1}^{n} X_{i} \log _{2} X_{i}+\lambda\left(\sum_{i=1}^{n} X_{i}-1\right)\right]=0 \\ &=\log _{2} X_{1}+\frac{1}{\ln 2}+\lambda=0 \\ & \Rightarrow \lambda=-\log _{2} X_{1}-\frac{1}{\ln 2} \\ \frac{\partial L\left(X_{1}, \cdots \cdots, X_{n}\right)}{\partial X_{2}} &=\frac{\partial}{\partial X_{2}}\left[\sum_{i=1}^{n} X_{i} \log _{2} X_{i}+\lambda\left(\sum_{i=1}^{n} X_{i}-1\right)\right]=0 \\ &=\log _{2} X_{2}+\frac{1}{\ln 2}+\lambda=0 \\ & \Rightarrow \lambda=-\log _{2} X_{2}-\frac{1}{\ln 2} \end{aligned} \end{equation} ...... \begin{equation} \begin{aligned} \frac{\partial L\left(X_{1}, \cdots \cdots, X_{n}\right)}{\partial X_{n}} &=\frac{\partial}{\partial X_{n}}\left[\sum_{i=1}^{n} X_{i} \log _{2} X_{i}+\lambda\left(\sum_{i=1}^{n} X_{i}-1\right)\right]=0 \\ &=\log _{2} X_{n}+\frac{1}{\ln 2}+\lambda=0 \\ & \Rightarrow \lambda=-\log _{2} X_{n}-\frac{1}{\ln 2} \end{aligned} \end{equation} \begin{equation} \begin{aligned} \frac{\partial L\left(X_{1}, \cdots \cdots, X_{n}\right)}{\partial \lambda}=& \frac{\partial}{\partial \lambda}\left[\sum_{i=1}^{n} X_{i} \log _{2} X_{i}+\lambda\left(\sum_{i=1}^{n} X_{i}-1\right)\right]=0 \\ & \Rightarrow \sum_{i=1}^{n} X_{i}=1 \end{aligned} \end{equation} \end{tiny} The above equation can be solved. \begin{equation} X_{1}=X_{2}=\ldots=X_{n}=\frac{1}{n} \end{equation} So $H(O O D A)=-\sum_{i=1}^{n} \frac{1}{n} \log _{2} \frac{1}{n}=\log _{2} n$. The information entropy value of all OODA Loop of a complex combat system is a system that increases as the number of system cycles increases, indicating that the system is a highly complex entropy increasing system and the entropy value is in a state of divergence. For the highly complex entropy increase system, Swarm, $NetLogo$ and other software are needed to assist the analysis. $NetLogo$ has the characteristics of simple model description language and rapid modeling. In the third section, $NetLogo$ modeling specifically analyzes the process of confronting both parties. \section{Netlogo modeling based on OODA Loop} $Netlogo$ is a programmable modeling environment used to simulate natural and social phenomena.\cite{b16,b17,b18}When the internal operating rules of a complex system are not obvious and it is difficult to grasp the rules, $NetLogo$ software can be used to simulate the system.\cite{b19}The red and blue confrontation experiment simulation is based on the hardware platform of $Inter(R) Core(TM) i7-10750H CPU @2.60GHZ$ and the software platform of $NetLogo 6.1.1$. Taking the construction of the red OODA Loop as an example, the modeling is carried out from four aspects: observation, judgment, decision-making and action.The research of complex nonlinear combat with multi-agent systems in modern combat is an important direction of war simulation. NetLogo is a powerful multi-agent simulation tool, which greatly improves the simple analytical model and analytical combat methods. Due to the simplification of the research, this article limits the combat process to the micro process of OODA Loop combat. In the future, the simulation can be extended and expanded to achieve OODA Loop stacking and cumulative confrontation. Use NetLogo to improve the level of human-computer interaction, establish models and calculation formulas with a higher degree of reduction, and analyze the process and results of simulation operations to draw more credible evaluation conclusions. By analyzing the problems, finding the gaps, laying the foundation for the formulation of combat plans, so that simulation can truly serve the combat decision-making. The functions of each module in the OODA Loop are defined as follows: Based on practical foundation and facts, the difference in the amount of armor between the two opposing parties is relatively large, so the party with the less armor will take a longer time to think and need more time to deploy armor to achieve the goal of winning with less. Select the value of the $NetLogo$ slider for the judgment and decision-making links of the red and blue parties. For example, 500 armors of the red side and 400 armors of the blue side appear at one of the nodes of the OODA Loop, and Then the red and blue sides in the NetLogo simulation software slider affiliation value is adjusted to 1 and 0.5 respectively. as shown in Figure 3, Figure 4. \begin{figurehere} \begin{center} \centerline{\includegraphics[width=2in]{rbpanduan}} \caption{Time adjustment module of the judgment link.} \label{fig3} \end{center} \end{figurehere} \begin{figurehere} \begin{center} \centerline{\includegraphics[width=2in]{rbjuece}} \caption{Time adjustment module for the decision-making link.} \label{fig4} \end{center} \end{figurehere} In order to quickly select $ROTime$, $BOTime$, $RDTime$, and $BDTime$ values, some judgment and decision time values are now listed, as shown in $Table 1$. \end{multicols} \begin{tablehere} \tbl{OODA combat Loop part Orientation and Decision-making time value reference table. \label{tab1}} {\begin{tabular*}{16.4cm}{ccccc} \toprule \begin{tabular}[c]{@{}c@{}}Red and Blue \\ Armmored Quantity(X,Y)\end{tabular} & \begin{tabular}[c]{@{}c@{}}Red Determine the \\ time value\end{tabular} & \begin{tabular}[c]{@{}c@{}}Blue Determine the \\ time value\end{tabular} & \begin{tabular}[c]{@{}c@{}}Red Decision \\ time value\end{tabular} & \begin{tabular}[c]{@{}c@{}}Blue Decision \\ time value\end{tabular} \\ \colrule (500,200) & 0.3 & 1.0 & 0.3 & 1.0 \\ (500,300) & 0.4 & 1.0 & 0.4 & 1.0 \\ (500,400) & 0.4 & 0.7 & 0.4 & 0.7 \\ (600,200) & 0.2 & 1.0 & 0.2 & 1.0 \\ (600,300) & 0.3 & 1.0 & 0.3 & 1.0 \\ (600,400) & 0.2 & 0.5 & 0.2 & 0.5 \\ (700,200) & 0.1 & 1.0 & 0.1 & 1.0 \\ (700,300) & 0.1 & 0.9 & 0.1 & 0.9 \\ (700,400) & 0.2 & 0.7 & 0.2 & 0.7 \\ \botrule \end{tabular*}} \end{tablehere} \begin{multicols}{2} \subsection{Investigation link} The reconnaissance behavior model mainly describes the combat behavior of various detection, reconnaissance equipment and various sensing devices, which is the main means to obtain intelligence information on the battlefield. In the OODA Loop, the information acquisition of the investigation link is related to the pre-war deployment, command and decision-making, etc. The Red investigation consists of three modules, the speed at which the Red obtains intelligence ($RIS$), the speed preventing the Red from acquiring intelligence ($BZuA$), and the speed the Red actually obtains intelligence ($R-Actual-S$). The system dynamics module composed of the three modules is as shown in Figure 5. \begin{figurehere} \begin{center} \centerline{\includegraphics[width=2in]{redO1}} \caption{Dynical model of Red Square investigation link.} \label{fig5} \end{center} \end{figurehere} \subsection{Judgment link} This part of the OODA Loop is to analyze the collected intelligence, determine the authenticity of the intelligence, and study the current situation. It is mainly completed by the red judgment ($RO$) and the red judgment time ($ROTime$) in the combat elements of the command system. It is an accusation The processing center of the information flow in the system. The red side judgment link is composed of two modules, namely, red side judgment ($RO$) and red side judgment flow input ($RIn$). The system dynamics module composed of two modules is shown in Figure 6. \begin{figurehere} \begin{center} \centerline{\includegraphics[width=2in]{redO2}} \caption{Dynical model of red square judgment link.} \label{fig6} \end{center} \end{figurehere} \subsection{Decision link} The decision-making link in the OODA Loop is based on the situation judgment, assigning the action and task plan, mainly by the red decision ($RD$) module in the combat elements of the accusation system, generating a new command and control information flow. The decision link consists of red temporary storage module ($RlinshiCun$) and red decision module ($RD$). The system dynamics model of the decision-making link is shown in Figure 7. \begin{figurehere} \begin{center} \centerline{\includegraphics[width=1in]{redD}} \caption{Red square decision link dynamics model.} \label{fig7} \end{center} \end{figurehere} \subsection{Action link} The action link in the OODA Loop is the corresponding action behavior based on the decision made and the designated action plan, mainly through the red square armor module ($Reds$), the red side loss factor module ($RSunhaoxishu$), the red side actual output module ($Redsshijishuchu$), and the blue side Decision Module ($BD$),It is the specific implementation of the charge system information flow,as shown in Figure 8. \begin{figurehere} \begin{center} \centerline{\includegraphics[width=1.5in]{redA}} \caption{Red square action link dynamics model.} \label{fig8} \end{center} \end{figurehere} The dynamic model of the Observation, Orientation, Decision, Action link of the blue OODA Loop is shown in Figure 9 below. \begin{figurehere} \begin{center} \begin{tabular}{c} \centerline{\includegraphics[width=2in]{blueO1}}\\ {\footnotesize\sf {(a)Dynical model of blue fang investigation link.}}\\ \centerline{\includegraphics[width=2in]{blueO2}}\\ {\footnotesize\sf {(b)Blue side judgment link dynamics model.}}\\ \centerline{\includegraphics[width=1in]{blueD}}\\ {\footnotesize\sf {(c)Blue square decision-making link dynamics model.}} \\ \centerline{\includegraphics[width=2in]{blueA}}\\ {\footnotesize\sf {(d)Blue square action link dynamics model.}} \\ \end{tabular} \caption{The logic pattern of Blue with OODA loop.} \end{center} \end{figurehere} \section{Traditional methods are compared with OODA Loop}\label{sec4} The simple system uses two influencing factors as the OODA Loop of NetLogo simulation. Compared analysis shows the difference between the two methods and whether OODA Loop can improve operational thinking. \subsection{Simple system} Assuming the amount of red and blue armor, the two sides fight according to certain rules of engagement. Both parties then adjust their armor numbers and operational capabilities to simulate their operations. The kinetic model of a simple system is shown in $Fig.10$ and $Fig.11$.The combat system is a complex system composed of personnel, equipment, and organization. The combat process is affected by many factors such as combat missions, technical support, logistical support, suddenness, morale, and command art. It is very difficult and tedious to comprehensively analyze and model the factors in the combat process. Therefore, the combat process is specifically abstracted as the link of dynamic combat interaction, and only the system process of red and blue tank confrontation is analyzed, which can also play a good simulation role. By adjusting the number and combat capabilities of the tanks on both sides, let them conduct simulation operations. Simulate the number of tanks on both sides, represented by R-Tank and G-Tank. As the confrontation between the two warring parties continues, the number of tanks will show a certain consumption trend. If the number of subsequent tanks is supplemented, it will lead to a certain decrease or increase in the scale of the tanks of both sides. The confrontation between the two sides is a fierce process. The number of tanks is high. In order to ensure the continuity of combat effectiveness, continuous replenishment of tank armor is required. R-Input and G-Input are used to indicate the number of replenishment of the red and blue sides. At the same time, use R- lost and G-lost indicate the amount of equipment lost by both red and blue. There are four variables in this model, namely the loss rate of the red and blue tanks and the replenishment rate of the red and blue tanks. R-lost-rate, G-lost-rate, R-input-rate and G-input-rate are used respectively. Express. In the process of this model test, the Red Army tanks are replenishing (R-input) and losing (R-lost). The confrontation is carried out step by step. Due to the short process of modern warfare and the fierce confrontation, the speed of equipment replenishment is often lower than that of The speed at which weapons and equipment are consumed. \begin{figurehere} \begin{center} \centerline{\includegraphics[width=3in]{NetLogojiandan}} \caption{Schematic of simple system dynamics model.} \label{fig10} \end{center} \end{figurehere} \begin{figurehere} \begin{center} \centerline{\includegraphics[width=2.5in]{NetLogofangzhen}} \caption{Schematic diagram of the red and blue confrontation results of the simple system.} \label{fig11} \end{center} \end{figurehere} \subsection{OODA Loop system} Through simulation of red and blue OODA Loop by NetLogo in Fig.5-Fig.9, the dynamic model of complex combat system is shown in Figure 12, and the schematic diagram of red and blue confrontation results of OODA Loop system is shown in Figure 13. \begin{figure*}[tbh] \centering \includegraphics[scale=0.6]{quanju.eps} \caption{Dynamical models of complex combat systems based on OODA Loop.} \end{figure*} \begin{figurehere} \begin{center} \centerline{\includegraphics[width=2.5in]{OODAxitong}} \caption{Schematic diagram of the red and blue confrontation results of the OODA Loop system.} \label{fig13} \end{center} \end{figurehere} \subsection{OODA Loop system feasibility verification} The OODA cycle complex OS scheme is selected according to the Operations Research Hierarchy Analysis Method (The Analytic Hierarchy Process, or AHP). Hierarchical analysis is a systematic and quantitative approach proposed by operations strategist Professor T. L. Saaty in the early 1970s. The analytic hierarchy process refers to a complex multi-objective decision-making problem as a system, the goal is decomposed into multiple goals or criteria, and then decomposed into multiple indicators (or criteria, constraints) several levels, through the qualitative index fuzzy quantitative method to calculate the level Single ranking (weight) and total ranking are used as a systematic method for target (multi-index) and multi-scheme optimization decision-making.The analytic hierarchy process is to decompose the decision-making problem into different hierarchical structures in the order of the overall goal, the sub-goals of each level, the evaluation criteria, and the specific investment plan, and then use the method of solving the eigenvectors of the judgment matrix to obtain each level The priority of an element to an element of the previous level, and finally the weighted sum method is recursively merged and the final weight of each alternative plan to the overall goal, and the one with the largest final weight is the optimal plan.The analytic hierarchy process is more suitable for decision-making problems with hierarchical and interlaced evaluation indicators, and the target value is difficult to describe quantitatively.\cite{b20} First OODA Loop complex CS scheme hierarchical hierarchy, as shown in Figure 14. The hierarchical hierarchy includes three levels, target, criterion and scheme. The target layer selects options for complex combat systems; the criterion layer includes four modules: reconnaissance, judgment, decision, and execution; the program layer includes three schemes: support, continuation and retreat. \begin{figurehere} \begin{center} \centerline{\includegraphics[width=2.5in]{AHP}} \caption{Hierarchical structure of OODA Loop complex combat system plan.} \label{fig14} \end{center} \end{figurehere} Secondly, according to the scale value table of the analytic hierarchy process, the consistency matrix of the complex combat system plan to the four criterion modules (as shown in $Table 2$ and $Table 3$) and the consistency matrix of the three combat plans to each part of the OODA Loop are constructed. Due to space limitations, here only the consistency matrix of the four criterion modules of the complex combat system plan and the selection weight matrix of the complex combat system plan (as shown in Table 4) are constructed here, and the consistency of the three combat plans for each part of the OODA Loop The matrix will be explained in the appendix. botrule \end{multicols} \begin{tablehere} \tbl{The scale value matrix of the four criterion modules of the complex combat system plan.\label{tab2}} {\begin{tabular}{ccccc} \toprule \begin{tabular}[c]{@{}c@{}}Complex combat system \\ plan selection(A)\end{tabular} & Observation & Orientation & Decision & Action \\ \colrule Observation & 1.0000 & 3.0000 & 4.0000 & 7.0000 \\ Orientation & 0.3333 & 1.0000 & 2.0000 & 3.0000 \\ Decision & 0.2500 & 0.5000 & 1.0000 & 2.0000 \\ Action & 0.1429 & 0.3333 & 0.5000 & 1.0000 \\ Sum of scaled values & 1.7262 & 4.8333 & 7.5000 & 13.0000 \\ \botrule \end{tabular}} \end{tablehere} \begin{tablehere} \tbl{Consistency matrix of complex combat system plan to four criterion modules.\label{tab3}} {\begin{tabular}{ccccccc} \toprule \begin{tabular}[c]{@{}c@{}}Complex combat system \\ plan selection\end{tabular} & Observation & Orientation & Decision & Action & Weights(w) & Aw \\ \colrule Observation & 0.5793 & 0.6207 & 0.5333 & 0.5385 & 0.5679 & 2.2933 \\ Orientation & 0.1931 & 0.2069 & 0.2667 & 0.2308 & 0.2244 & 0.9029 \\ Decision & 0.1448 & 0.1034 & 0.1333 & 0.1538 & 0.1339 & 0.5357 \\ Action & 0.0828 & 0.0690 & 0.0667 & 0.0769 & 0.0738 & 0.2967 \\ \botrule \end{tabular}} \end{tablehere} \begin{multicols}{2} According to the above table data, the $Expert Choice 11.5$ software is used to calculate the value of its natural attributes to judge whether the matrix construction conforms to logical consistency. Among them, the characteristic maximum value $\lambda_{\max }$=4.0206, $CI=0.0069$, $RI=0.89$, $CR=0.0077$, since $CR<0.1$, the consistency matrix is logical. \end{multicols} \begin{tablehere} \tbl{Selection Weight Matrix of Complex Combat System Scheme.\label{tab4}} {\begin{tabular}{ccccc} \toprule \begin{tabular}[c]{@{}c@{}}Complex combat system \\ scheme selection\end{tabular} & \begin{tabular}[c]{@{}c@{}}Comprehensive \\ weight ratio\end{tabular} & \begin{tabular}[c]{@{}c@{}}Support \\ weight ratio\end{tabular} & \begin{tabular}[c]{@{}c@{}}Continue with the \\ operational weight ratio\end{tabular} & \begin{tabular}[c]{@{}c@{}}Retreback \\ weight ratio\end{tabular} \\ \colrule Observation & 0.5679 & 0.4577 & 0.1263 & 0.4160 \\ Orientation & 0.2244 & 0.5571 & 0.3202 & 0.1226 \\ Decision & 0.1339 & 0.5571 & 0.3202 & 0.1226 \\ Action & 0.0738 & 0.7015 & 0.2267 & 0.0718 \\ \begin{tabular}[c]{@{}c@{}}Weighted \\ weight ratio\end{tabular} & & 0.5113 & 0.2032 & 0.2855 \\ \botrule \end{tabular}} \end{tablehere} \begin{multicols}{2} According to the selection weight matrix of the complex combat system scheme, it can be concluded that in the simulation combat, it is not the mode described by the simple system. The two sides are simply fighting, and the amount of armor continues to decline; instead, through the description of the combat mode like the OODA Loop, the two sides Confrontation is a reciprocating process. At the same time, the dynamic process of the zigzag fluctuation of the armor quantity shown in the schematic diagram of the confrontation between the red and blue sides of the OODA Loop system is verified from the side. It can be concluded from $Table 4$ that the weight ratios of the three combat plans are respectively, the support weight ratio is $0.5113$, and the continued combat weight and the retreat weight ratio are roughly the same. It shows that when using the OODA Loop to analyze the combat plan, the warring parties should support their own operations as much as possible, but the continued combat and retreat plan also accounted for nearly half of the proportion, and the choice to continue combat or retreat based on the confrontation situation. \section{Conclusions} This paper simulates a complex environment combat model based on OODA loop through NetLogo software and uses hierarchical analysis to embody the game strategy under three scenarios of attack, retreat, and continued reinforcement that the red side should take after the current OODA loop is executed in terms of the number of armor. It can be concluded from the experimental results that the simulation system of OODA loop is more exploratory and feasible compared to the traditional simple system approach simulation. The OODA cycle is a correct practice of modern military theory, and the full use of the OODA cycle can form a closed-loop control of the combat confrontation and make the combat analysis comprehensive and concrete. \section*{Acknowledgments} This research is partially supported by Nature Science Foundation of China with ID 62076028 and by National Key Research and Development Program of China with ID 2018AAA0101000.
bb5a5f9c294bf9be99eb6f07ce199b5cf7265398
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:introduction} The success of deep learning and machine learning (ML) in general in recent years is attributed to the availability of large datasets, more efficient algorithms, and specialized hardware \cite{Chollet2017}. Based on the current hype, more and more companies try to integrate ML into their products, leading to an ever increasing demand of data scientists. Software developers who already know the targeted application domain could fill this gap but typically lack a scientific ML background. Therefore, they need \emph{guidance} that helps them correctly use ML. We define guidance to encompass all means to facilitate or enforce correct usage of a tool or an API or proper adherence to a workflow. Guidance includes, on one hand, preventing, detecting, explaining and fixing erroneous usage and, on the other hand, communicating best practices and helping apply them. In a traditional software engineering (SE) context, guidance can help developers when learning an API or the use of a tool, developing a program using the API or tool, and debugging the program when something went wrong. This paper analyses how current ML tools and APIs fail to provide guidance to developers and presents ideas for improvement. Sec. \ref{sec:workflows} reviews a typical workflow of ML application development, points out differences to traditional software engineering, and elaborates the desirable guidance for each step of the ML workflow. Sec. \ref{sec:stateOfArt} reviews how the main APIs, languages, and development environments currently used for ML application development fail to provide guidance. Sec. \ref{sec:simpleml} discusses how better guidance can be offered by applying and adapting various SE concepts to the specific requirements of ML application development. \section{ML Workflows are Different} \label{sec:workflows} Due to space constraints, we focus without loss of generality on supervised learning, the currently most widely-used ML workflow \cite{Chollet2017}. The task in supervised learning is to learn a function $H$ on the basis of some \emph{training data}, which is a (typically very large) set of examples containing \emph{features} and \emph{labels}. Given the features, $H$ should ideally produce the labels. If the labels are from a continuous set, we call it a \emph{regression} problem, if the labels are from a discrete set we call it a \emph{classification} problem. A traditional SE workflow involves activities such as requirement engineering, design, implementation, refactoring, and testing. In an ML workflow, most of these activities are performed in a quite specific way (e.g. Sec. \ref{subsec:requirements} and \ref{subsec:tdd}), if at all\footnote{What, for instance, is the equivalent of refactoring in ML?}. Moreover, an ML workflow involves additional essential activities, such as Data Engineering (Sec. \ref{subsec:data_engineering}), Model Engineering (Sec. \ref{subsec:model_engineering}), and Model Quality Engineering (Sec. \ref{subsec:quality_engineering}). \subsection{Evaluation-Focussed Requirements Engineering} \label{subsec:requirements} Requirements Engineering (RE) for ML reflects the fact that ML development includes empirical evaluation of results as part of the indispensable Model Quality Engineering activity (Sec. \ref{subsec:quality_engineering}). Accordingly, the definition of quality metrics and the required level of quality for each metric is not an optional best practice but an essential part of the workflow. One quality metric we might define upfront, for instance, is that at least $80\%$ accuracy must be achieved. This gives as clear metric to assess the usefulness of a model and a stopping criteria for the workflow. \paragraph{Requirements Engineering Guidance} Desirable guidance for RE for ML includes: \begin{itemize} \item Automated suggestions of suitable quality metrics based on problem (regression / classification) and data. \item Automated checking if a comparable task has been solved before and achieved the desired quality. \end{itemize} \subsection{Test-Driven Development the ML Way} \label{subsec:tdd} Before we can start learning, we must first ensure that a large amount of data is available and split it into a \begin{itemize} \item a \emph{training set} that will be used for the actual learning / training (Sec. \ref{subsec:model_engineering}), \item a \emph{validation set} that will be used for assessing whether the training results are good enough and to fine-tune the model\footnote{Alternatively, we can use \emph{cross-validation} \cite{Chollet2017}.} (Sec. \ref{subsec:quality_engineering}). \item a \emph{test set}, that will be used to get a last measure of how well the model performs on real-world data before pushing the model into production (Sec. \ref{subsec:quality_engineering}). \end{itemize} \paragraph{Test-Driven Development Guidance} Desirable guidance for Test-Driven Development in ML includes: \begin{itemize} \item Automated suggestion whether to use cross-validation or a specific validation set based on desired quality, training time and the amount of data available. \item Automated suggestion of what percentage of the data should go into each of the sets. \item Automated verification of best practices for a `good' split of the data. For instance, the distribution of labels and significant features in the three sets should be as similar as possible (\emph{stratified sampling} \cite{Geron2017}). \item Automatically hiding the test set away until needed, so it does not influence decisions in subsequent steps of the workflow like the choice of the model \cite{Chollet2017}. \end{itemize} \subsection{Data Engineering} \label{subsec:data_engineering} Next, we must ensure that the available training data is of sufficient quality. If not, we need to perform \emph{data engineering}, which involves \begin{itemize} \item handling of missing values, \item turning categorical into numerical values, \item normalization of numerical values, \item assessing the statistical relevance of available features, \item selecting the features used for learning, possibly combining several features. \end{itemize} Data engineering is typically the most time consuming step in an ML project but also the most important one: If the data used for learning is of poor quality, so will be the learned function $H$. \paragraph{Data Engineering Guidance} Desirable guidance for data engineering includes: \begin{itemize} \item Automated detection of missing values and automated suggestions for handling them, ideally specific to the type of data or learning task at hand. For instance, for numeric values, missing values could be substituted by the mean of the other values. This is not possible for a feature that represents street names. \item Automatic conversion of categorical into numerical values, or at least suggestions for possible conversions, again taking into account the specific data types and application semantics. For instance, if categorical values can be ordered (e.g. `poor', `middle class', `rich', `billionaire'), we can replace them by an increasing sequence of numbers (\emph{label encoding}). Otherwise, we can perform a \emph{one-hot encoding}, which maps each different value to a sparse vector \cite{Geron2017}. \item Automated normalization of numerical values. \item Automated computation of the entropy of the distribution of a feature or of any other measure for the statistical relevance of the available features. \item Automated suggestions for sensible feature combinations in a specific application domain. \item Ideally, any data processing step performed on the training data, should be automatically applied also to the validation and test set in order to avoid inconsistencies or tedious and error-prone manual application of each step on each dataset. \end{itemize} \subsection{Model Engineering} \label{subsec:model_engineering} The next step in the ML workflow is the selection of an existing ML API and the choice of a supported \emph{learning algorithm}, such as \emph{decision trees} or \emph{neural networks} (NNs). At first glance, this might appear similar to the choice of proper algorithms and data structures in SE. However, it was shown by Wolpert in \cite{Wolpert1996} that lacking specific assumptions no learning algorithm performs better than any other. This makes it impossible to provide a general guideline to always use, say NNs. Choosing a learning algorithm instead requires significant background in ML and a careful consideration of the application goal\footnote{Do we need explainability?} and the properties of the data available after data engineering. Even with this knowledge, though, the final choice of the proper learning algorithm is typically the outcome of a lot of experimentation, involving several iterations of the entire ML development workflow. Given a choice of an algorithm, a developer then writes a \emph{training program} and starts the learning process on the prepared training data. Depending on the circumstances (hardware, data size, learning algorithm, etc.) this step can take a few seconds or several days. Its outcome is a \emph{model} representing the learned function $H$. It is worth noting that, unlike in SE, the learned model is the final output of the workflow, not the written program. \paragraph{Model Engineering Guidance} Desirable guidance for model engineering includes: \begin{itemize} \item Automated suggestions of suitable learning algorithms based on the available data and the application domain. \item Well-documented APIs and all kinds of teaching and training material that help quickly learn how to use them. \item Automated checking of correct API use, ideally during program development (static checking) but at least at runtime. Given that a single training run can take hours and days and the entire workflow involves many iterations, the importance of static checking cannot be overstated. Costs incurred in statically detecting and fixing errors in the training program that would be prohibitive in traditional SE appear small in an ML context. \item Help in understanding and fixing errors, ranging from sensible error messages, ideally enriched with suggestions how to resolve the error, to automated quickfixes. \end{itemize} \subsection{Model Quality Engineering} \label{subsec:quality_engineering} Next, the performance of the model is evaluated by running it on the validation set (Sec. \ref{subsec:tdd}), to get a measure of how well the model performs on data not seen during training. By measuring the metrics established in the RE phase (Sec. \ref{subsec:requirements}) we check that the model learned the characteristics of the training data well enough (no \emph{underfitting}) and did not simply learn the training data by heart (no \emph{overfitting}). The gathered metrics are used to fine-tune the training program by setting different \emph{hyperparameters} that control the behaviour of the learning algorithm. For example, the maximum number of nodes in a decision tree can be a hyperparameter. A low value can lead to underfitting, while a high value can lead to overfitting. With the improved settings, a new training is started and the entire process is repeated from there. If the results are still not satisfactory, one might go further back to select a different learning algorithm (Sec. \ref{subsec:model_engineering}) or even rethink and enhance data engineering (Sec. \ref{subsec:data_engineering}). Finally, when the model has passed the validation stage, we use the test set (Sec. \ref{subsec:tdd}) to get a last measure of how well the model performs on unseen data before pushing the model into production. We cannot use the validation set for this, since we selected the model that works best on the validation set, which introduces a risk of overfitting \cite{Geron2017}. \paragraph{Model Quality Engineering Guidance} Desirable guidance for quality engineering includes: \begin{itemize} \item Automated experiment management, that is, saving of the $n$ models that achieved the highest performance values during validation along with the related training program and fully data-engineered datasets (including training, validation and test data) in order to support reproducibility of results. \item Automated detection of overfitting and related suggestions how to combat it, e.g. by inserting drop-out layers \cite{Hinton2012} in a neural network. \item Automated detection of underfitting and related suggestions how to combat it, e.g. by choosing a more powerful learning algorithm. \end{itemize} \section{State of the Art} \label{sec:stateOfArt} The highly explorative and iterative workflow described in Sec. \ref{sec:workflows} is supported by high-level APIs for ML (Sec. \ref{subsec:api}), dynamic languages (Sec. \ref{subsec:languages}), and dynamic development environments (Sec. \ref{subsec:ide}). In this section, we review each of them with respect to the guidance they provide. \subsection{Efficient, High-Level APIs} \label{subsec:api} Based on a survey of ML APIs by Nguyen and others from 2019 \cite{Nguyen2019} we investigated scikit-learn \cite{Pedregosa2011}, a representative of an API for `classical' ML, as well as Keras \cite{chollet2015keras} and PyTorch \cite{Paszke2019}, which are APIs for deep learning. These APIs provide high-level abstractions to apply and adapt learning algorithms (model engineering), to ensure sufficient prediction quality (model quality engineering) and even to perform data engineering, thereby providing all functionality needed to rapidly iterate the ML workflow from Sec. \ref{sec:workflows}. With respect to guidance, though, we identified several shortcomings: \paragraph{Criticism: Hidden and Inconsistent Constraints in the API Documentation} The broadness of these APIs makes it difficult to use them correctly, especially since many constraints are hard to understand from the documentation. By looking just at the documentation of the support vector machine learning algorithm for classification (SVC) in scikit-learn\footnote{\url{https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html}} we can already identify four different categories of constraints documented only in natural language or documented inconsistently: \begin{itemize} \item \emph{type constraints} limit values of expressions in any context, \item \emph{dependencies} limit values depending on other values, \item \emph{temporal constraints} limit the order of operations, \item \emph{execution context constraints} express restrictions specific to the used programming language or executions platform. \end{itemize} \begin{figure}[H] \centering \captionsetup{justification=centering} \fbox{\includegraphics[width=0.8\linewidth]{img/scikit_docs_kernel.png}} \caption{Type constraints (scikit-learn)} \label{fig:scikit_docs_kernel} \end{figure} Hidden and inconsistent \emph{type constraints} are illustrated in Fig. \ref{fig:scikit_docs_kernel}: According to the first line of the documentation, the constructor parameter \verb|kernel| of the SVC must be of type string. However, the rest of the text (see highlighting), reveals that only the five string literals `linear', `poly', `rbf', `sigmoid' and `precomputed' are allowed and that we can additionally pass a \emph{callable}, thus something that is not a string. Reading on, we learn that the signature of the callable is further restricted: It must have a single parameter that must be an array of shape n\_samples by n\_samples. \begin{figure}[H] \centering \captionsetup{justification=centering} \fbox{\includegraphics[width=0.8\linewidth]{img/scikit_docs_degree.png}} \caption{Dependent API elements (scikit-learn)} \label{fig:scikit_docs_degree} \end{figure} A \emph{dependency constraint} is shown in Fig. \ref{fig:scikit_docs_degree}: The value of the constructor parameter \verb|degree| is only relevant if the constructor parameter \verb|kernel| has the value `poly'. \begin{figure}[H] \centering \captionsetup{justification=centering} \fbox{\includegraphics[width=0.8\linewidth]{img/scikit_docs_probability.png}} \caption{Temporal constraint (scikit-learn)} \label{fig:scikit_docs_probabilty} \end{figure} A \emph{temporal constraint} is shown in Fig. \ref{fig:scikit_docs_probabilty}: We must set the attribute \verb|probability| to `True' prior to the first call of the \verb|fit| method (which starts the learning process). \begin{figure}[H] \centering \captionsetup{justification=centering} \fbox{\includegraphics[width=0.8\linewidth]{img/scikit_docs_verbose.png}} \caption{Constraint of execution context (scikit-learn)} \label{fig:scikit_docs_verbose} \end{figure} An \emph{execution context constraint} is shown in Fig. \ref{fig:scikit_docs_verbose}: Verbose output may not work in a multithreaded environment. \paragraph{Criticism: Lack of Constraint Checking and Helpful Error Messages} Let us now investigate what happens if we run a program that does not comply with some of the restrictions shown above. We begin with the simple program in List. \ref{fig:scikit_errors_no_error}. There, we create an SVC with the invalid kernel `line' (see Fig. \ref{fig:scikit_docs_kernel}) --- the programmer probably meant 'linear'. But despite the wrong value, the code executes without error. The programmer therefore adds more code to preprocess the data and initiate training, which leads to the program state in List. \ref{fig:scikit_errors_bad_error_program}. Executing this program throws the error shown in List. \ref{fig:scikit_errors_bad_error_output}: \setcounter{figure}{0} \renewcommand{\figurename}{Listing} \begin{figure}[H] \centering \captionsetup{justification=centering} \fbox{\includegraphics[width=0.8\linewidth]{img/scikit_errors_no_error.png}} \caption{Incorrect, but throws no error (scikit-learn)} \label{fig:scikit_errors_no_error} \end{figure} \begin{figure}[H] \centering \captionsetup{justification=centering} \fbox{\includegraphics[width=0.8\linewidth]{img/scikit_errors_bad_error_program.png}} \caption{Throws a misleading error (scikit-learn)} \label{fig:scikit_errors_bad_error_program} \end{figure} \begin{figure}[H] \centering \captionsetup{justification=centering} \fbox{\includegraphics[width=0.85\linewidth]{img/scikit_errors_bad_error_output.png}} \caption{Error thrown by program in List. \ref{fig:scikit_errors_bad_error_program} (scikit-learn)} \label{fig:scikit_errors_bad_error_output} \end{figure} \setcounter{figure}{4} \renewcommand{\figurename}{Figure} There are multiple issues with this behaviour: \begin{itemize} \item \emph{No precondition checking in API function.} First, the error is not thrown by the API at the place where the illegal value was set, misleading the programmer to think that the first two lines are correct. \item \emph{Misleading, generic error messages.} A generic error is thrown by the runtime system when stumbling over the illegal value, which is much too late. At this point, the error message and shown stacktrace further mislead the programmer. Since lines 3 and 4 contain Python lists that indeed do not contain the string `line', the programmer could try to find a bug there. Going back to line 2, which apparently executed flawlessly, requires deep internal knowledge of the API, which is unlikely for anybody except its authors. One could argue that the string literal `line' shows up in line 2, which could point the programmer to the true issue. But note that the code for data preprocessing is normally much longer than shown here, so the line where the error originated might not be visible in the context where it manifests itself. \item \emph{No hint how to recover.} Finally, once the programmer has found the true bug, he must consult the documentation to find the correct value since the generic error message does not specify the valid inputs. \end{itemize} \paragraph{Criticism: No Checking of ML Best Practices} We only looked at constraints of the API so far. For general ML best practices (Sec. \ref{sec:workflows}), the situation is even more dire: For them none of the APIs provides any checking or feedback. In addition, due to the differences between the APIs, each one would have to implement checking of these best practices separately, even though they apply regardless of the API that is used. \paragraph{Criticism: No Static Checking} In either case, even the best documentation and ideal runtime error checking still requires developers to wait for (possibly long) training runs just to find out that an error occured. The effect is an annoying loop of editing, running, debugging, fixing and re-running the training program in order to see if the fix was successful --- the runtime acts like a test oracle. Ideally, the developer would get guidance while he writes the program but this is poorly supported in the programming languages used for ML development, which brings us to the next point. \subsection{Languages} \label{subsec:languages} The above-mentioned study by Nguyen, et al. from 2019 \cite{Nguyen2019} found that Python is the most popular language for ML. This can be attributed to its readability and to the fact that it is an interpreted language and, thus, well suited for highly interactive and explorative development. Moreover, Python has a vast ecosystem of scientific APIs that are useful for ML. Being a general-purpose programming language, Python provides the flexibility needed to implement new learning algorithms and highly customized ML-workflows. However, much of this flexibility --- and therefore complexity of the language --- is not needed if one is just using the functionality of an API for data, model and quality engineering to accomplish standard tasks. \paragraph{Criticism: Static Checking is Hard} Because Python is such a dynamic, general-purpose programming language, it is difficult to statically check the constraints of an API. Since the 2015 release of version 3.5, Python at least supports optional \emph{type hints}, defined in PEP 484 \cite{PEP484}. Still, the authors stress that ``Python will remain a dynamically typed language, and the authors have no desire to ever make type hints mandatory, even by convention''. Thus, taking advantage of type hints requires the use of an external tool such as the static type checker mypy\footnote{http://mypy-lang.org/}. However, of the three ML APIs we observed, only the most recent one, PyTorch, includes type hints. In addition, dependencies, temporal constraints, execution context constraints and ML best practices are beyond the scope of type hints. Even a simple constraint such as "the value must be a float between 0 and 1" cannot be expressed. The impact of static type checking was quantified (among others) in a study by Fischer and Hanenberg from 2015 \cite{Fischer2015}, where they found the development time of a program in the statically typed JavaScript-superset TypeScript\footnote{\url{https://www.typescriptlang.org}} to be significantly shorter than in the dynamically typed JavaScript itself. We argue that static checking of non-type errors has a similar positive effect. \subsection{Development Environments} \label{subsec:ide} Last but not least, notebooks for Python and other languages, e.g. Jupyter Notebooks\footnote{\url{https://jupyter.org/}}, have become a popular learning and development environment for ML and have recently been integrated into the generic Python IDE PyCharm\footnote{\url{https://www.jetbrains.com/pycharm/}}. In a notebook, a program can be split into cells that can be evaluated independently without deleting the results created by other cells. Results, including complex visualizations, are shown directly in the notebook next to the cell. It is possible to include text cells between code cells for documentation purposes and to structure the notebook. This feature also makes notebooks ideal for creating executable teaching materials for novices. Due to their interactivity, they are used in practice as a development environment for ML, especially for data exploration. We claim that the popularity of notebooks, even when used within PyCharm, points to the lack of IDEs that are adapted to the needs of ML development. \paragraph{Criticism: No Support for Data Engineering} Notebooks and generic Python IDEs such as PyCharm (henceforth called altogether `\emph{ML tools}') provide no specific support for data engineering. There are no built-in automated analyses of a dataset, as suggested in Sec. \ref{subsec:data_engineering}, or visualizations of them. Developers must rely on external tools or the functionality provided through APIs. \paragraph{Criticism: No Support for Introspection} While developing a training program, developers need to inspect the current state of data or models. There is no support for this in current ML tools. Instead, developers need to call specific API functions that provide introspection support. Keras, for example, has a \verb|summary| method that displays the layers of an NN, the shape of their outputs and the number of trainable parameters, which is a good measure of how long training is going to take and whether the model is likely to overfit or underfit. Fig. \ref{fig:keras_introspection_summary_output} shows an example output of this method. \begin{figure}[h] \centering \captionsetup{justification=centering} \fbox{\includegraphics[width=0.85\linewidth]{img/keras_introspection_summary_output.png}} \caption{Output of the summary method (Keras)} \label{fig:keras_introspection_summary_output} \end{figure} Although introspection is not conceptually part of the learning program, we must mix the two concerns in the notebook environment. A dedicated ML IDE could provide a clearer separation of concerns. \paragraph{Criticism: No Experiment Management} For experiment management developers must also invent their own solutions or choose external tools. A dedicated IDE could fulfill this need instead and also improve the discoverability of past experiments by automatically comparing the current task and available data to a database, thereby preventing duplicate work. \section{The Simple-ML Approach} \label{sec:simpleml} The Simple-ML project\footnote{https://simple-ml.de/} is dedicated to the development of solutions for the above-mentioned gaps in the state of the art. Its core ideas, summarized in Fig. \ref{fig:simple_ml_approach}, are: (1) the development of a unified ML API, (2) the development of a domain specific language (DSL) for ML, (3) the development of a dedicated ML IDE, and (4) last but not least, as a common basis for (2) and (3), the development of metamodels of the ML domain, ML APIs, and application-specific datasets. \begin{figure}[h] \centering \captionsetup{justification=centering} \includegraphics[width=0.8\linewidth]{img/simple-ml-approach-2.png} \caption{Our Simple-ML Approach} \label{fig:simple_ml_approach} \end{figure} \paragraph{Towards a Unified ML API} In its first release, the unified ML API will generalize the functionality of scikit-learn, Keras and PyTorch. Development of an own API lets us (a) ensure the quality of its documentation, and (b) ensure the existence of runtime checks where no static checking is possible. This enables checking of compliance with general, \emph{API-independent} ML best practices once and for all. The unified API will be based on adapters to the different existing APIs and will shield the higher levels from their details. In particular, it will serve as a unified target for code generation by the compiler of the DSL. \paragraph{A DSL with ML-aware Static Analysis Capabilities} The Simple-ML DSL, will provide ML-specific abstractions as first-class language elements, and will make them available via a textual \emph{and} a visual syntax. This will make it easy to learn by developers who want to experiment with ML but are not experienced programmers. In addition, the DSL will statically catch errors related to all the types of constraints identified in Sec. \ref{subsec:api}. Under the hood the DSL compiler will generate code for a general purpose programming language such as Python, using the implemented adapters to target an individual framework. This avoids locking users into the Simple-ML DSL. If they eventually need the flexibility of a general purpose programming language, they can take the generated code and modify it as desired. \paragraph{Using Ontologies to Store Metadata} ML-specific error detection will be done based on metadata in the form of ontologies. We will create ontologies that describe ML concepts, such as learning algorithms and quality metrics, to capture information like the hyperparameters of learning algorithms or whether a learning algorithm and a quality metric are compatible. For this we consider improving the MEX ontology \cite{Esteves2015}. The ML-specific metadata will be complemented by metadata about available datasets. Each dataset will be associated with a semantic description of its features \cite{Gottschalk2019}. For each feature, we will store metainformation like its semantic category (e.g. the fact that it represents the name of a person), or the associated unit of measurement (e.g. whether a distance is measured in metres or miles). We will also store general statistical properties of a feature, like minimum and maximum values, standard deviation etc. Using this metadata we can provide the desirable data engineering guidance identified in Sec. \ref{subsec:data_engineering}. For instance, we will be able to quickly detect if data is normalized and normalize it automatically if desired, or provide targeted suggestions for feature combinations based on the semantic categories. For model engineering (Sec. \ref{subsec:model_engineering}) we can also provide guidance, e.g. by suggesting suitable models given the data and the task. Ontologies can also provide the technical basis for model quality engineering guidance (Sec. \ref{subsec:quality_engineering}). \paragraph{An IDE to Tie Everything Together} Further guidance will be provided by an ML-specific IDE that will support the entire ML workflow (Sec. \ref{sec:workflows}) through GUI features. The error checking and fixing capabilities of the DSL will be used to display errors and to provide quickfixes while the training program is being written. The ontology-based metadata will be used for elaborate suggestions of preprocessing steps during data engineering (Sec. \ref{subsec:data_engineering}), for suggestions of suitable models during model engineering (Sec. \ref{subsec:model_engineering}), and for experiment management and suggestions of model improvements during quality engineering (Sec. \ref{subsec:quality_engineering}). The GUI of the IDE will also provide introspection (Sec. \ref{subsec:ide}) capabilities, allowing us to eliminate introspection from the user-visible part of the unified ML API, thus making it easier to learn. \section{Conclusion} This paper introduced the concept of guidance as the means offered by an API or tool to facilitate or enforce correct usage or to help follow a predetermined workflow or established best practices. Guidance speeds up learning, development and debugging. We discussed key differences between ML and SE workflows, derived the desirable ML-specific guidance and analyzed how existing APIs, languages and tools used for ML application development fail to provide most of it. As a possible solution, we identified static analysis, meta-modeling, and support by an IDE with an advanced GUI as key SE concepts, whose combined use could provide the missing guidance. Finally, we sketched the Simple-ML project, which will implement this solution in order make ML available as a well-understood tool for software developers. \begin{acks} This work was partially funded by the Federal Ministry of Education and Research (BMBF), Germany under Simple-ML (01IS18054). \end{acks} \bibliographystyle{ACM-Reference-Format}
171cae8a57ccb6fbb6ba411fb3a8830fd461ea15
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Self-supervised pre-training \cite{beit,simclr,mocov3,ibot,vicreg,barlow,clip} is attracting emerging attention due to its effectiveness and flexibility in exploiting large-scale uncurated data, which demonstrates its superiority to supervised pre-training in a wide range of downstream applications, such as classification, detection, and segmentation, \textit{etc.} Recently, the introduction of vision Transformers \cite{vit,deit,swinT} brings about a new revolution to self-supervised learning \cite{beit,mocov3,dino}. Inspired by the great success of BERT \cite{BERT} in natural language processing (NLP) tasks, masked image modeling (MIM) has been introduced for visual pre-training as a new pretext task. It is not trivial, because one key barrier lies in that the visual signal is continuous and cannot be properly classified as is done in masked language modeling (MLM) of BERT. A pioneer work, BEiT \cite{beit}, tackles the challenge by ``tokenizing'' continuous visual signals into discrete vision tokens resorting to a pre-learned codebook \cite{dalle}, which plays the role of a pre-defined vocabulary in MLM. The pre-training objective is to predict the vision token id of the masked image patch based on its context and semantics. \begin{figure}[t] \begin{center} \includegraphics[width=0.9\textwidth]{drawback.png} \caption{ The improper token ids for image discretization, where a better tokenizer \cite{taming} is used here. We observe that semantically-similar patches might be allocated with different token ids while patches with different semantics might be allocated with the same token id, indicting that the hard-label classification with unique token ids in BEiT \cite{beit} may hinder the pre-training performance. } \label{fig:drawback} \end{center} \end{figure} Despite the impressive performances of BEiT on image pre-training, there remain some questions under-developed. (1) \textit{Does the masked patch prediction have ground-truth answers?} Unlike the linguistic vocabulary which is naturally composed of discrete words, the image tokenizer is relatively subjective, \textit{i.e.}, there is no perfect answer to visual discretization and the tokenizer carries inevitable label noise even a better tokenizer is obtained in \cite{taming}. For example, as shown in Fig. \ref{fig:drawback}, patches of the dog and the shoe are discretized into the same vision token (\#319) due to their similar pixel-level representations. (2) \textit{Should the masked patch be assigned a unique token id given a pre-learned tokenizer?} Not really. As illustrated in Fig. \ref{fig:drawback}, semantically-similar patches of the grass are discretized into different vision tokens, \textit{i.e.}, they are classified into distinct and unique ids in BEiT pre-training, neglecting their semantic relations. Given the observation of the above two issues, we argue that performing MIM with a strict mapping between patch predictions and unique token ids by a hard-label classification loss in BEiT limits the visual context capturing and the pre-training performance. To tackle the challenge, we introduce to effectively boost BERT-style image pre-training with eased and refined masked prediction targets, that is, \textit{multi-choice vision token ids}. Rather than retraining the tokenizer with perceptual regularizations \cite{peco,ibot}, we efficiently inject the semantic relations into off-the-shelf vision tokens without any extra computational overhead. Specifically, to enable multi-choice answers for masked patches, we adopt the soft id probability vectors, rather than the hard predicted id over a pre-learned codebook, as the supervision signals for masked image modeling. Although the off-the-shelf image tokenizer \cite{taming} can capture some local semantics with the training objectives of both pixel-level and perceptually-aware regularizations, it is proven to be still vulnerable to various low-level changes (see Fig. \ref{fig:drawback}). Therefore, we introduce to refine the predicted soft id probabilities by inter-patch semantic similarities, which are estimated by the vision Transformers being trained. Under the observation that patches with similar high-level visual perceptions ought to share their predictions, we propagate the soft id probabilities of different patches in an image based on their semantic similarities and form ensembled learning targets for masked image patches (see Fig. \ref{fig:overview}). The final training objective is formulated as a soft-label cross-entropy loss. To fully evaluate our novel, flexible and effective method, we pre-train the vision Transformers with various scales on the widely-acknowledged ImageNet-1K \cite{imagenet1k} dataset and fine-tune the pre-trained models on multiple downstream tasks, including image classification, instance/semantic segmentation, and object detection. The empirical results show that our method impressively outperforms supervised pre-training as well as recent self-supervised learning methods \cite{mocov3,dino,beit,ibot}. Concretely, we achieve 84.1\% top-1 accuracy on ImageNet-1K classification with a ViT-B model, outperforming the state-of-the-art iBOT \cite{ibot} by +0.3\% with 800 fewer epochs. Regarding the transfer learning ability on different downstream tasks, our pre-trained ViT-B model achieves 49.2\% $\text{AP}^{b}$ and 44.0\% $\text{AP}^{m}$ of object detection and instance segmentation on COCO \cite{coco}, 50.8\% mIOU on downstream ADE20K \cite{ade20k} semantic segmentation, outperforming all existing methods. \section{Related Works} Self-supervised learning (SSL) has gained great popularity benefiting from its capability of exploiting the tremendous amounts of unlabeled data, which leverages input data itself as supervision. Substantial works \cite{moco,simclr,beit,BERT,GPT3,miles,liu2021self,cpc,decpc} have shown that the pre-training can be beneficial for downstream tasks and enable faster training convergence, which shows its impressive potentials on various machine learning tasks, especially in the fields of natural language processing and computer vision. \subsection{BERT pre-training with masked language modeling} Self-supervised learning has been studied in NLP for decades. Masked language modeling (MLM) is firstly widely acknowledged because of BERT \cite{BERT}. BERT encourages bidirectional textual context understanding and adopts the masked language modeling approach for pre-training, which randomly masks 15\% tokens and predicts the missing words as the target. After that, various MLM variants are proposed, \textit{e.g.,} GPT \cite{GPT3}, XLM \cite{xlm}, and RoBERTa \cite{roberta}, \textit{etc}. These MLM works achieve huge success and show impressive performances on various downstream tasks, which greatly advance the development of language pre-training. \subsection{Self-supervised visual pre-training} In the past few years, various pretext tasks are designed for self-supervised visual pre-training. For example, earlier pretext-based works adopt the pseudo labels based on the attributes of images to learn the representation, such as image colorization \cite{color}, jigsaw puzzle \cite{jigsaw}, context prediction \cite{doersch2015}, and rotation prediction \cite{rotation}, etc. Besides these approaches, there are two mainstream paradigms, \textit{i.e.}, contrastive learning and masked image modeling approaches, which will be further analyzed in the following subsection. \textbf{Contrastive learning:} Contrastive learning is an instance-level discriminative approach and has occupied a dominant position in visual pre-training. Contrastive learning methods, such as SimCLR \cite{simclr,simclr_v2}, MoCo \cite{moco,mocov2,mocov3}, and Swav \cite{swav}, \textit{etc.}, typically rely on data augmentation to create the counterparts of the images and aim at learning such an embedding space, where similar sample pairs are close to each other while dissimilar ones are far apart. Swav \cite{swav} proposes a cluster-based contrastive learning method to enforce consistency between cluster assignments under different augmentations. BYOL \cite{byol} and SiamSim \cite{siamsam} abandons the negative samples and avoids the collapse with either an additional momentum network or the stop-gradient operation. MoCov3 \cite{mocov3} extends the contrastive learning framework for transformers and further promotes the development of self-supervised vision Transformers. \textbf{Masked Image Modeling:} Motivated by the great success of BERT, masked image modeling (MIM) \cite{beit,ibot,mae,conmim,maskfeat,simmim,cae} becomes a new trend in self-supervised visual pre-training, which randomly masks parts of images and reconstructs them based on the corrupted image. ViT \cite{vit} attempts to adopt masked patch prediction for self-supervised learning. BEiT \cite{beit} predicts the discrete tokens of masked token resorting to an off-the-shelf discrete VAE. Instead of discretizing the visual information, MAE \cite{mae} and SimMIM \cite{simmim} propose to directly predict the pixel-level value as the reconstruction target. MaskFeat \cite{maskfeat} further exploits different supervision signals such as HOG feature to be the objective. iBOT \cite{ibot} performs masked prediction and adopts the teacher network as an online tokenizer to provide the supervision. PeCo \cite{peco} further provides the evidence that the perceptually-aware tokenizer will provide better pre-training performance for the masked image modeling. \section{Preliminaries} \subsection{Image BERT Pre-training with Masked Image Modeling} The paradigm of mask-and-then-predict is first introduced in BERT pre-training \cite{BERT} of NLP tasks to encourage bidirectional context understanding of the textual signals. Recent works \cite{beit,ibot} reproduce the success of BERT by employing the proxy task of masked image modeling (MIM) on image pre-training of vision Transformers \cite{vit,deit,swinT}. MIM requires randomly masking a proportion of the image patches and then training the vision Transformer to recover the corrupted image via reasoning among the visual context. The pretext task of MIM enables a more fine-grained understanding of the local visual semantics compared to the contrastive counterparts \cite{simclr,moco}. Vision Transformers pre-trained with MIM objectives can be well transferred to a wide range of downstream tasks, \textit{i.e.}, classification, segmentation, and detection, after fine-tuning. \subsection{Masked Image Modeling as Single-choice Classification} Introducing the mask-and-then-predict paradigm into image pre-training is actually non-trivial, because the visual signals are continuous and cannot be predicted resorting to a well-defined vocabulary. A pioneering work, BEiT \cite{beit}, tackles the challenge by casting masked patch prediction as a single-choice classification problem via discretizing the image into vision tokens with an off-the-shelf ``tokenizer''. The ``tokenizer'' can be a discrete auto-encoder \cite{dalle,taming} pre-learned towards the reconstruction objective. Formally, given a raw image $x\in\mathbb{R}^{C\times H \times W}$, it is initially divided into $N$ patches $\{x_i\}_{i=1}^{N}$ and then mapped into compact patch embeddings. We denote the corrupted image as $\hat{x}$, which is formed by masking part of the patches in $x$, and we denote the set of masked patch indices as $\mathcal{M}$. We encode the image patch features $f(\hat{x})\in\mathbb{R}^{N\times D}$ with high-level perceptions by feeding $\hat{x}$ into the vision Transformer. The patch features are further projected to the probabilities of the vision token ids using an MLP head which will be dropped for downstream tasks. We denote the probability vectors as $q(f(\hat{x}))\in\mathbb{R}^{N\times V}$ where $V$ is the length of the visual vocabulary defined by the pre-learned image ``tokenizer''. To receive the answers for the masked image modeling, we discrete the raw image $x$ into vision tokens $\{z_i\}_{i=1}^{N}$ using the image ``tokenizer'', where $z_i\in\mathbb{R}^{V}$. The assigned token id with the maximal probability in $z_i$ is termed as $y_i$. The pre-training objective is formulated as a hard-label cross-entropy loss to encourage masked patch prediction with unique token ids as follow, \begin{equation} \mathcal{L}_\text{mim}(x)={\mathbb{E}_{i\in\mathcal{M}}\left[-\log q\left(y_i|f(\hat{x}_i)\right)\right]}. \end{equation} \section{\emph{mc}-BEiT} BEiT provides inspiring insights of casting masked image modeling (MIM) as a classification problem to bridge the gap between discrete words in NLP tasks and continuous visual signals in computer vision tasks. However, as there are no perfect answers for visual discretization, performing a strict mapping between patch predictions and unique token ids as a single-choice classification problem is actually a sub-optimal solution for MIM pre-training. As illustrated in Fig. \ref{fig:drawback}, there may exist multiple appropriate token ids for a certain patch, motivating us to boost the BEiT pre-training with multi-choice classification. \subsection{Masked Image Modeling as Multi-choice Classification} \begin{figure}[t] \begin{center} \includegraphics[width=0.9\textwidth]{overview.png} \caption{The overview of the proposed method, \emph{mc}-BEiT. We improve image BERT pre-training with multi-choice training objectives, which is composed of the soft probability vectors predicted by the off-the-shelf image “tokenizer” and further refined by high-level inter-patch perceptions. A proportion of image patches are randomly masked and then fed into the vision Transformer. The masked patch prediction is optimized towards eased and refined multi-choice token ids in the form of a soft-label cross-entropy loss. } \label{fig:overview} \end{center} \end{figure} We introduce an improved BERT-style image pre-training with eased and refined masked prediction targets, \textit{i.e.,} {multi-choice vision token ids}, rather than a unique answer. All possible token ids in the visual vocabulary will be assigned possibilities to be chosen. To this end, we soften the training objective from the original hard-label cross-entropy loss to a soft-label cross-entropy loss with the multi-choice targets $\hat{z}\in\mathbb{R}^{N\times V}$ as follow, \begin{equation}\label{eq:mc-mim} \mathcal{L}_\text{mc-mim}(x)={\mathbb{E}_{i\in\mathcal{M}}\left[-\sum_{k=1}^{V}\hat{z}_{i,k} \log q\left(f(\hat{x}_{i})\right)_k\right]}, \end{equation} where $\sum_{k=1}^{V}\hat{z}_{i,k}=1, \forall i$ and $q\left(f(\hat{x}_{i})\right)\in\mathbb{R}^{V}$. We will go over how to produce such refined multi-choice answers for MIM pre-training in the following section. \subsection{Multi-choice Visual Discretization} To produce multi-choice discretization without extra training stages or computational overhead, we attempt to exploit the predictions from the off-the-shelf image tokenizer. Given the discretization predictions $z\in\mathbb{R}^{N\times V}$ from the image tokenizer, we estimate the soft probabilities $p(z)\in\mathbb{R}^{N\times V}$ rather than using the unique predicted token id as done in the single-choice version. Specifically, the soft probability vector is obtained using a softmax operation, where a temperature coefficient $\tau$ is used to move between the sharpness (single-choice) and smoothness (multi-choice), \begin{equation} p(z_i)_k = \frac{\text{exp}(z_{i,k}/\tau)}{\sum_{j=1}^{V}\text{exp}(z_{i,j}/\tau)}. \end{equation} As discussed in the introduction section and illustrated in Fig \ref{fig:drawback}, semantically-similar patches may be allocated with discrepant token ids and semantically-dissimilar patches may be allocated with the same token id due to their low-level similarities, indicating that the raw predictions from the off-the-shelf tokenizer are sub-optimal to fully represent the semantic relations among patches. The phenomenon motivates us to refine the predictions of the tokenizer with inter-patch relations. The inter-patch relations can be estimated with their high-level perceptions, which are encoded by the in-training vision Transformer. Specifically, we calculate the cosine similarity between patch features to measure their affinities, \begin{equation} W(\hat{x}_i)_k=\frac{\text{exp}{\langle f(\hat{x}_i)}, {f(\hat{x}_k)}\rangle}{\sum_{j=1}^N{\text{exp}\langle{f(\hat{x}_i)}, {f(\hat{x}_j)}\rangle}}, \end{equation} where $W(\hat{x})\in\mathbb{R}^{N\times N}$ and $\langle\cdot,\cdot\rangle$ indicates the inner product between two feature vectors after $\ell_2$ normalization. Based on the observation that perceptually-similar patches ought to share their choices, we propagate the soft probabilities $p$ of different patches in an image $x$ to form a refined target $W(\hat{x}) p(z)\in\mathbb{R}^{N\times V}$. In this way, patches with similar high-level perceptions can provide complementary supervision signals for the masked patches. The overall objective of multi-choice image discretization is composed of the weighted sum of the aforementioned parts, where the semantic equilibrium coefficient $\omega$ is introduced to move between low-level semantics (directly predicted by the tokenizer) and high-level semantics (ensembled from the perceptually-similar patches). The former one adopts the eased supervision directly predicted from the tokenizer, while the latter one injects high-level perceptions by propagating among other semantically-similar patches, together forming the refined multi-choice targets $\hat{z}\in\mathbb{R}^{N\times V}$ as follow: \begin{equation} \hat{z}=\omega p(z) + (1-\omega)W(\hat{x})p(z), \end{equation} which is further used as the objectives for masked patch predictions in Eq. (\ref{eq:mc-mim}). \section{Experiments} \subsection{Pre-Training Setup} In our experiments, the images of 224$\times$224 resolution are divided into 14$\times$14 image sequences with 16$\times$16 patch size. We use different architectures such as ViT-Base/16 and ViT-Large/16 for pre-training and the backbone implementation follows \cite{vit} for fair comparisons. For the BERT-style visual pre-training, we randomly mask 75\% patches for masked image modeling. Inspired by PeCo \cite{peco}, we employ the off-the-shelf VQGAN of \cite{taming} as a better tokenizer, which is pre-trained on OpenImages \cite{OpenImages2} with the vocabulary size of 8192. In our experiments, the semantic equilibrium coefficient $\omega$ is 0.8 and the temperature coefficient $\tau$ is 4.0 by default. The vision Transformers are pre-trained for 800 epochs on the widely-acknowledged ImageNet-1K \cite{imagenet1k} dataset, which includes 1.28 million images. Note that the ground-truth labels are disabled for pre-training. We use 16 Nvidia A100 GPUs for pre-training and a batch size of 128 per GPU. We adopt simple image augmentation for pre-training, including random resized cropping and horizontal flipping. The detailed recipe of pre-training and finetuning is summarized in the Appendix. \begin{table}[t] \small \centering \caption{The top-1 fine-tuning accuracy of ImageNet-1K using ViT-Base and ViT-Large with different pre-training methods.} \label{table:imagenet1k} \setlength{\tabcolsep}{6mm}{ \begin{tabular}{llcc} \toprule[1pt] \multicolumn{1}{l}{Method} & Reference & Pre-train Epoch & Acc (\%) \\ \hline \multicolumn{4}{l}{\textsl{Supervised Pre-training (training from scratch):}}\\ \hline ViT-B/16 \cite{vit} & ICLR 2021 & - & 77.9 \\ ViT-L/16 \cite{vit} & ICLR 2021 & - & 76.5 \\ DeiT-B/16 \cite{deit} & ICML 2021 & - & 81.8 \\ \hline \multicolumn{4}{l}{\textsl{Self-supervised Pre-training using} ViT-B/16:}\\ \hline MoCo v3 \cite{mocov3} & CVPR 2021 & 300 & 83.2 \\ DINO \cite{dino} & ICCV 2021 & 300 & 82.8 \\ BEiT \cite{beit} & ICLR 2022 & 800 & 83.2 \\ iBOT \cite{ibot} & ICLR 2022 & 1600 & 83.8 \\ MAE \cite{mae} & CVPR 2022 & 1600 & 83.6 \\ SimMIM \cite{simmim} & CVPR 2022 & 800 & 83.8 \\ Ours & this paper & 800 & \bf{84.1} \\ \hline \multicolumn{4}{l}{\textsl{Self-supervised Pre-training using} ViT-L/16:}\\ \hline MoCo v3 \cite{mocov3} & CVPR 2021 & 300 & 84.1 \\ BEiT \cite{beit} & ICLR 2022 & 800 & 85.2 \\ MAE \cite{mae} & CVPR 2022 & 1600 & \textbf{85.9} \\ Ours & this paper & 800 & 85.6 \\ \bottomrule[1pt] \end{tabular} } \end{table} \subsection{Image Classification} For the ImageNet classification task, the fully-connected layer is employed as the classifier after the average pooling of the feature embeddings. We adopt top-1 accuracy after fine-tuning as the evaluation metric and we thoroughly compare our method with the supervised methods, \textit{i.e.,} ViT \cite{vit}, DeiT \cite{deit}, and recently published state-of-the-art self-supervised learning methods, \textit{i.e.,} MoCo v3 \cite{mocov3}, DINO \cite{dino}, BEiT \cite{beit}, and iBOT \cite{ibot}. Besides, we also compare with the very recent pixel-level MIM methods, \textit{i.e.,} MAE \cite{mae} and SimMIM \cite{simmim}. The experiment results are listed in Tab. \ref{table:imagenet1k}. As observed from the results, the proposed method obtains 84.1\% top-1 accuracy on ViT-B, outperforming the competing methods and achieving state-of-the-art performance. We can see that our \emph{mc}-BEiT shows significant gains compared to the baseline BEiT, which verifies the effectiveness of our introduced multi-choice objectives. Concretely, our method outperforms the recent state-of-the-art method iBOT \cite{ibot} by +0.3\% with the fewer 800 epochs pre-training. It is noted that iBOT adopts an extra teacher network and enables multi-crops for pre-training, showing lower efficiency than our method. \begin{table}[h] \small \centering \caption{The top-1 fine-tuning accuracy of ImageNet-1K using our \emph{mc}-BEiT with different training epochs and backbone architectures.} \label{table:imagenet_epochs} \setlength{\tabcolsep}{5mm}{ \begin{tabular}{lcccc} \toprule[1pt] \multicolumn{1}{c}{Method} & Arch. & Model Size& Pre-train Epoch & Acc (\%) \\ \hline \multicolumn{4}{l}{\textsl{Self-supervised Pre-training using} ViT-B/16:}\\ \hline Ours & ViT-B & 86M & 100 & 83.3 \\ Ours & ViT-B & 86M & 300 & 83.9 \\ Ours & ViT-B & 86M & 800 & \textbf{84.1} \\ \hline \multicolumn{4}{l}{\textsl{Self-supervised Pre-training using} ViT-L/16:}\\ \hline Ours & ViT-L & 307M & 300 & 85.2 \\ Ours & ViT-L & 307M & 800 & \textbf{85.6} \\ \bottomrule[1pt] \end{tabular} } \end{table} \noindent\textbf{Different training epochs and architectures:} We also provide more comprehensive results of different training epochs and architectures in Tab. \ref{table:imagenet_epochs}. From the table, we can see that our method can adapt well to different scales of vision tranformers, \textit{e.g.,} the mostly used ViT-B and ViT-L. It is worth noting that our method obtains a relatively high accuracy (already achieves the state-of-the-art performance) when pre-training for only 300 epochs. Moreover, the performance can be further improved with longer pre-training epochs, \textit{e.g.}, the accuracy reaches 84.1\% pre-training for 800 epochs. \begin{figure}[t] \begin{center} \includegraphics[width=0.7\textwidth]{convergence.png} \caption{The convergence curves when fine-tuning ViT-B models on ImageNet-1K classification. The models are pre-trained by different methods.} \label{fig:conver} \end{center} \end{figure} \noindent\textbf{Convergence curve:} In Fig \ref{fig:conver}, we further demonstrate the convergence curve of the supervised learning method and self-supervised learning methods, \textit{i.e.,} the baseline BEiT and our method, when fine-tuning ViT-B models. As shown in the figure, the proposed method achieves faster convergence as well as better performance than training DeiT from scratch \cite{deit}. Meanwhile, our method obtains obvious and consistent performance gains compared to the baseline method BEiT, showing the superiority of the proposed multi-choice training objectives. \subsection{Object Detection and Instance Segmentation} For object detection and instance segmentation tasks, COCO \cite{coco} benchmark is employed to validate the pre-training performances. We follow the implementation of \cite{benchmarking,mimdet} and the model is trained for 25 epochs (we also provide another evaluation setting following iBOT \cite{ibot} in the Appendix). ViT-B is adopted as the backbone and Mask-RCNN \cite{maskrcnn} is used as the task head. The evaluation metrics for objection detection and instance segmentation are bounding box AP and mask AP, respectively. \begin{table}[h] \small \centering \caption{Experiment results of object detection and instance segmentation on COCO. We follow the implementation of \cite{benchmarking,mimdet} and the model is trained for 25 epochs. Intermediate fine-tuning denotes the model is further fine-tuned on ImageNet-1K. } \label{coco} \setlength{\tabcolsep}{3.5mm}{ \begin{tabular}{l|lcc} \toprule[1pt] \multicolumn{1}{l|}{\multirow{2}{*}{Method}} & \multicolumn{1}{l}{\multirow{2}{*}{Reference}} & \multicolumn{1}{c}{Object Det.} & Instance Seg. \\ \multicolumn{1}{l|}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$\text{AP}^{b}$} & \multicolumn{1}{c}{$\text{AP}^{m}$} \\ \hline Supervised \cite{deit} & ICML 2021 & 46.5 & 41.7\\ MoCo v3 \cite{mocov3} & CVPR 2021 & 46.6 & 41.9 \\ DINO \cite{dino} & ICCV 2021 & 47.6 & 42.3 \\ MAE \cite{mae} & CVPR 2022 & 48.0 & 43.0 \\ iBOT \cite{ibot} & ICLR 2022 & 48.4 & 42.9 \\ BEiT \cite{beit} & ICLR 2022 & 47.6 & 42.2 \\ Ours & this paper & 48.5 & 43.1 \\ \hline +Intermediate Fine-tuning \\ \hline BEiT \cite{beit} & ICLR 2022 & 48.4 & 43.5 \\ Ours & this paper & \textbf{49.2} & \textbf{44.0} \\ \bottomrule[1pt] \end{tabular} } \end{table} As observed in Tab. \ref{coco}, the BERT style pre-training shows superiority to supervised pre-training in terms of performances. Our method achieves 48.5\% and 43.1\% in $\text{AP}^{b}$ and $\text{AP}^{m}$. Meanwhile, the proposed method outperforms the competitor BEiT with +0.9\%/+0.9\% gain in $\text{AP}^{b}$ and $\text{AP}^{m}$. We also evaluate the performance after intermediate fine-tuning, the relative improvement is still obvious, \textit{i.e.,} +0.8\%/+0.5\% to BEiT. Our method even outperforms the recent pixel-level MIM method MAE and obtains better performances compared to state-of-the-art methods. \subsection{Semantic Segmentation} Semantic segmentation belongs to the pixel-level classification task and is often adopted to evaluate the pre-training performance on downstream tasks. Here we evaluate the performance on ADE20k \cite{ade20k} benchmark and mean intersection over union (mIOU) averaged over all semantic categories is adopted as the evaluation metric. Following the common setting in \cite{beit,ibot}, ViT-B is adopted as the default backbone and UPerNet \cite{upernet} is used for semantic segmentation task head. \begin{table}[t] \small \centering \caption{Results of semantic segmentation on ADE20K. Intermediate fine-tuning denotes the pre-trained model has been fine-tuned on ImageNet-1K classification. } \label{table:ade20k} \setlength{\tabcolsep}{7mm}{ \begin{tabular}{l|lc} \toprule[1pt] \multicolumn{1}{l|}{Method} & Reference & mIOU \\ \hline Supervised \cite{deit} & ICML 2021 & 45.3 \\ MoCo v3 \cite{mocov3} & CVPR 2021 & 47.2 \\ DINO \cite{dino} & ICCV 2021 & 46.8 \\ MAE \cite{mae} & CVPR 2022 & 48.1 \\ iBOT \cite{ibot} & ICLR 2022 & 50.0 \\ BEiT \cite{beit} & ICLR 2022 & 45.6 \\ Ours & this paper & 47.0 \\ \hline +Intermediate Fine-tuning \\ \hline BEiT \cite{beit} & ICLR 2022 & 47.7 \\ Ours & this paper & \textbf{50.8} \\ \bottomrule[1pt] \end{tabular} } \end{table} Because the pre-training process does not introduce the instance discrimination, the performance can be further improved after intermediate fine-tuning on ImageNet-1K according to BEiT \cite{beit}. Therefore we also compare the performance after intermediate fine-tuning. Tab. \ref{table:ade20k} shows that our method significantly improves the transferability of pre-trained models compared to the supervised learning, with +5.5\% performance gain. It is also noticed that our method outperforms recent state-of-the-art self-supervised methods. It achieves better results as 47.0\%/50.8\% mIOU and improves +1.4\%/3.1\% gain to its pre-training only version. \section{Ablation Study} In this section, we conduct an extensive ablation study of our method on ImageNet-1K. Considering the time expenditure, all ablation experiments are performed under 100-epoch pre-trained ViT-B/16 on ImageNet-1K. \subsection{The temperature coefficient $\tau$} The hyper-parameter of temperature coefficient $\tau$ is to scale the logits from the tokenizer, which moves between the sharpness (single-choice) and smoothness (multi-choice). We adopt the common values for temperature to ablate its effect. In general, the small temperature will sharp the probability distribution and the large one will smooth it conversely. When $\tau$ is extremely small, it is an approximate single-choice classification task. The ablation is shown in the Fig. \ref{fig:hyper}(a), where \textit{single-choice label} indicates training with the strict mapping to the unique answer. From the result, we can observe that multi-choice vision token improves the BERT style pre-training performance and it behaves better when setting temperature factor at 4.0 empirically. \subsection{The semantic equilibrium coefficient $\omega$} The semantic equilibrium coefficient $\omega$ is introduced to move between low-level semantics (directly predicted by the tokenizer) and high-level semantics (ensembled from the perceptually-similar patches). The ablation study is shown in Fig. \ref{fig:hyper}(b). When setting $\omega$ to 0, the objective relies on totally the inter-relationship guided objective and it achieves only 81.8\% accuracy, which is because the inevitable noise of calculating patch similarity, especially in the early epochs, will cause collapse and degrade the pre-learning performance. As the coefficient goes larger, it shows consistent gains over baseline. When setting $\omega$ to 1.0, the objective comes only from the low-level signals of the tokenizer and the performance is still higher than baseline, which shows the superiority of multi-choice to single-choice. As observed from the results, the semantic equilibrium coefficient is thus set to be 0.8 for better performances. \begin{figure}[H] \begin{center} \includegraphics[width=0.8\textwidth]{hyper.png} \caption{Ablation study on the hyper-parameters.} \label{fig:hyper} \end{center} \end{figure} \subsection{Masking strategy} In the masked image modeling approach, the masking strategy determines the difficulty of inferring the missing patches. Tab. 3 shows the influence of different mask strategies, where \textit{Block} and \textit{Random} masking types and different mask ratios are conducted for ablation. It is observed from the results that the random masking strategy with 75\% masking ratio makes the best performances, which is thus adopted as the default setting for pre-training. \begin{table}[t] \small \centering \caption{Ablation study on different masking strategies.} \label{table:pacs} \setlength{\tabcolsep}{7mm}{ \begin{tabular}{c|cc} \toprule[1pt] \multicolumn{1}{c|}{Masking Strategy} & Masking Ratio & Acc (\%) \\ \hline Block & 45 \% & 83.2 \\ Block & 60 \% & 83.2 \\ Block & 75 \% & 82.8 \\ \hline Random & 45 \% & 83.0 \\ Random & 60 \% & 83.1 \\ Random & 75 \% & \textbf{83.3} \\ Random & 90 \% & 83.0 \\ \bottomrule[1pt] \end{tabular} } \end{table} \subsection{Tokenizer} In the BERT-style visual pre-training, the tokenizer plays the role of a vocabulary in texts and is used to produce the discrete vision token as supervision. As discussed in PeCo \cite{peco}, perceptually-aware tokenizer may benefit the image BERT pre-training, so we introduce to use off-the-shelf VQGAN \cite{taming} as a better tokenizer throughout our experiments. Besides, we would like to also verify the effectiveness of our multi-choice objectives on top of the vanilla BEiT. \begin{table}[h] \small \centering \caption{Ablation study on the different tokenizer.} \label{tokenizer} \setlength{\tabcolsep}{4mm}{ \begin{tabular}{c|c|c|c|c} \toprule[1pt] \multicolumn{1}{l|}{} & \multicolumn{2}{c|}{Training Data} & \multicolumn{2}{c}{Top 1 Acc. (100 / 800 epochs)} \\ \cline{2-5} \multicolumn{1}{l|}{} & \multicolumn{1}{c|}{Source} & \multicolumn{1}{c|}{Scale} & BEiT & \multicolumn{1}{c}{Ours} \\ \hline \multicolumn{1}{c|}{DALL-E \cite{dalle}} & Private & 250M & 82.3 / 83.2 & 82.6 / 83.7 \\ \multicolumn{1}{c|}{VQGAN \cite{taming}} & OpenImage & 9M & 82.9 / 83.8 & 83.3 / 84.1\\ \bottomrule[1pt] \end{tabular} } \end{table} The influence of tokenizers is shown in Tab. \ref{tokenizer}. It is shown that adopting the VQGAN as the tokenizer brings better performance than DALL-E, which verify our observation that tokenizer with high semantics can indeed improve the pre-training performance. It also indicates that enhancing the semantic relation is beneficial to visual pre-training. Meanwhile, it is noticed that the relative improvement of our method is consistent regardless of different kinds of tokenizers, which demonstrates the effectiveness of the proposed method. \subsection{Visualization} Besides the quantitative experiment results, we further provide some visualizations in Fig. \ref{vis} for better understanding the effects of our multi-choice answers. 75\% patches of the images are randomly masked for prediction. It can be observed from the blue box in Fig. \ref{vis}(a), the adjacent patches with similar semantics are still allocated with different vision token ids, indicating that the hard vision token id directly from the tokenizer neglects the semantic relations and is a sub-optimal objective. In contrast, the proposed eased and refined objective can provide diverse possible vision tokens for the prediction. As shown in our multi-choice token signals, the semantically-similar patches have the possibility to be allocated with the same vision token, which refines the objective with inter-patch perceptions. Furthermore, we randomly select a masked patch and shows the inter-patch perception relations (obtained from the patch feature similarity) learned by the pre-trained model in Fig. \ref{vis}(c). The similar patches can still be well estimated even under heavy random masking and the inter-patch relation shows higher responses, \textit{e.g,} the skeleton of the car. It demonstrates that the informative semantic relations estimated by the in-training vision Transformer can properly enhance the multi-choice discretization for pre-training. \begin{figure}[t] \begin{center} \includegraphics[width=0.75\textwidth]{vis.png} \caption{The visualization is obtained using the off-the-shelf tokenizer and our pre-trained vision Transformer. The inter-patch perception relation is equipped with contour lines for better visual effect.} \label{vis} \end{center} \end{figure} \section{Conclusion} In this paper, we propose the \emph{mc}-BEiT, \textit{i.e.,} multi-choice discretization for improving image BERT pre-training. Instead of adopting the unique label signals from the tokenizer, we introduce an eased and refined objective for providing multi-choice answers. Extensive experiments are conducted to evaluate the performances of our method. The empirical results show that \emph{mc}-BEiT achieves the state-of-the-art performances on various tasks, such as image classification, semantic/instance segmentation, and objection detection. \section*{Acknowledgement} \label{acknowlegement} This work was supported by the National Natural Science Foundation of China under Grant 62088102, and in part by the PKU-NTU Joint Research Institute (JRI) sponsored by a donation from the Ng Teng Fong Charitable Foundation. \clearpage \bibliographystyle{splncs04}
0b0c5ac527e8814fcde3c976bb59f60ae09700da
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec_intro} Many real-world applications can be modeled as multiobjective combinatorial optimization (MOCO) problems~\citep{ehrgott2000survey}. Examples include the multiobjective traveling salesman problem (MOTSP)~\citep{lust2010multiobjective}, the multiobjective vehicle routing problem (MOVRP)~\citep{jozefowiez2008multi} and the multiobjective knapsack problem (MOKP)~\citep{bazgan2009solving}. These problems have multiple objectives to optimize, and no single solution can optimize all the objectives at the same time. Instead, there is a set of Pareto optimal solutions with different trade-offs among the objectives. It is very challenging to find all the exact Pareto optimal solutions for a MOCO problem. Actually, finding one single Pareto optimal solution can be NP-hard for many problems~\citep{ehrgott2000survey}, and the number of Pareto solutions could be exponentially large with regard to the problem size~\citep{ehrgott2005multicriteria,herzel2021approximation}. The decision-maker's preference among different objectives is usually unknown in advance, making it very difficult to reduce the problem into a single-objective one. Over the past several decades, many methods have been developed to find an approximate Pareto set for different MOCO problems within a reasonable computational time. These methods often need carefully handcrafted and specialized heuristics for each problem. It can be very labor-intensive in practice. In many real-world applications, practitioners need to solve many different instances for the same particular problem, where the instances can be easily obtained or generated~\citep{bengio2020machine}. It is desirable to learn the patterns behind these problem instances explicitly or implicitly to design efficient algorithms~\citep{cappart2021combinatorial}. Machine learning techniques can be naturally used for this purpose. Some learning-based methods have been recently proposed for solving single-objective combinatorial optimization problems~\citep{bengio2020machine,vesselinova2020learning,mazyavkina2020reinforcement,cappart2021combinatorial}. In this work, we extend the learning-based method to solve MOCO problems in a principled way as shown in Figure~\ref{fig_moco_framework}. Our main contributions include: \begin{itemize} \item We propose a novel neural multiobjective combinatorial optimization method to approximate the whole Pareto set via a single preference-conditioned model. It allows decision makers to obtain any preferred trade-off solution without any search effort. \item We develop an efficient end-to-end reinforcement learning algorithm to train the single model for all different preferences simultaneously, and a simple yet powerful active adaption method to handle out-of-distribution problem instances. \item We conduct comprehensive experiments on MOTSP, MOVR and MOKP of different settings. The results show that our proposed method can successfully approximate the Pareto sets for different problems in an efficient way. It also significantly outperforms other methods in terms of solution quality, speed, and model efficiency. \end{itemize} \section{Background and Related Work} \label{sec_related_work} \begin{figure}[t] \centering \includegraphics[width= 1.0 \linewidth]{Figures/neural_moco_idea.pdf} \caption{\textbf{Preference-Conditioned Neural Multiobjective Combinatorial Optimization:} \textbf{a)} The model takes a problem instance as its input. \textbf{b)} The decision makers assign their preferences on different objectives to the model. \textbf{c)} The model directly generates approximate Pareto solutions with different trade-offs via fast forward inference. In this example, the problem is the MOTSP with two cost objectives to minimize. The generated solutions $P_1$,$P_2$ and $P_3$ are different optimal trade-offs between the two cost objectives. The ideal model can generate solutions for all possible optimal trade-offs on the Pareto front and not generate a poor solution such as $P_4$.} \label{fig_moco_framework} \vspace{-0.2in} \end{figure} \textbf{Multiobjective Combinatorial Optimization (MOCO). } MOCO has been attracting growing research efforts from different communities over the past several decades~\citep{sawaragi1985theory, wallenius2008multiple, herzel2021approximation}. There are two main approaches to tackle the MOCO problems: the exact methods and the approximation methods~\citep{ehrgott2005multicriteria}. Exact methods could be prohibitively costly when, as it often happens, the MOCO problem is NP-hard and the problem size is very large~\citep{florios2014generation}. For this reason, many heuristics~\citep{jaszkiewicz2002genetic,zhang2007moea, ehrgott2008hybrid} and approximation methods~\citep{papadimitriou2000approximability, herzel2021approximation} have been developed to find a manageable number of approximated Pareto solutions with a reasonable computational budget. However, these methods usually depend on carefully handcrafted designs for each specific problem~\citep{ehrgott2000survey}, and the required effort is often nontrivial in real-world applications. \textbf{Machine Learning for Combinatorial Optimization. } As summarized in \citet{bengio2020machine}, there are three main learning-based approaches for combinatorial optimization: learning to configure algorithms~\citep{kruber2017learning,bonami2018learning}, learning alongside the algorithms~\citep{lodi2017learning, gasse2019exact, chen2019learning}, and learning to directly predict the solutions~\citep{nowak2018revised,emami2018learning,larsen2018predicting}. Neural combinatorial optimization (NCO) belongs to the last category where the model directly produces a good solution for a given problem instance. \citet{vinyals2015pointer} proposed a pointer network to sequentially construct a solution for the TSP problem. \citet{bello2016neural} made a critical improvement to use reinforcement learning to train the model, eliminating the impractical optimal solutions collection for NP-hard problems. Some other improvements on model structure and training procedure have been proposed in the past few years~\citep{nazari2018reinforcement, deudon2018learning, kool2019attention, velivckovic2021neural}, especially with graph neural networks (GNNs)~\citep{dai2017learning,li2018combinatorial,joshi2019efficient,dwivedi2020benchmarking, drori2020learning}. Recent efforts have been made on more efficient learning strategies~\citep{kwon2020pomo, karalias2020erdos, lisicki2020evaluating, geisler2022generalization}, learning-based graph search~\citep{cappart2021combining, kool2021deep,fu2021generalize, xin2021neurolkh, hudson2022graph}, and iterative improvement methods~\citep{wu2021learning,ma2021learning,li2021learning}. \textbf{Neural MOCO.} Most of the existing learning-based methods are for single-objective combinatorial problems. Recently, a few attempts have been made to solve MOCO problems~\citep{li2020deep,wu2020modrl, zhang2021modrl,zhang2021meta}. These methods adopt the MOEA/D framework~\citep{zhang2007moea} to decompose a MOCO problem into a number of single-objective subproblems, and then build a set of models to solve each subproblem separately. However, since the number of Pareto solutions would be exponentially large~\citep{ehrgott2005multicriteria}, the required number of models would be huge for finding the whole Pareto set. In this work, we propose a single preference-conditioned model for solving MOCO problems, with which the decision makers can easily obtain any trade-off solutions. The proposed single neural MOCO solver could be much easier to use in a real-world system~\citep{velivckovic2021neural}, than those using a large set of different models. \section{Problem Formulation} \label{sec_pareto_mtl} \subsection{Multiobjective Combinatorial Optimization} A multiobjective combinatorial optimization (MOCO) problem can be defined as follows: \begin{align}\label{problem_moco} \min_{x \in \mathcal{X}} \ F(x) = (f_1(x),f_2(x),\ldots, f_m(x)), \end{align} where $\mathcal{X}$ is a discrete search space, and $F(x) = (f_1(x),\ldots, f_m(x))$ is an $m$-objective vector. Since the individual objectives conflict each other, no single solution can optimize all of them at the same time. Therefore, practitioners are interested in Pareto optimal solutions, defined as follows. \textbf{Definition 1 (Pareto Dominance).} Let $x_a,x_b \in \mathcal{X}$, $x_a$ is said to dominate $x_b$ ($x_a \prec x_b$) if and only if $f_i(x_a) \leq f_i(x_b), \forall i \in \{1,...,m\}$ and $f_j(x_a) < f_j(x_b), \exists j \in \{1,...,m\}$. \textbf{Definition 2 (Pareto Optimality).} A solution $x^{\ast} \in \mathcal{X}$ is a Pareto optimal solution if there does not exist $\hat x \in \mathcal{X}$ such that $\hat x \prec x^{\ast}$. The set of all Pareto optimal solutions is called the Pareto set, and the image of the Pareto set in the objective space is called the Pareto front. Each Pareto solution represents an optimal trade-off among the objectives, and it is impossible to further improve one of the objectives without deteriorating any other objectives. \subsection{Decomposition and Preference-based Scalarization} \label{subsec_preference} Decomposition is a mainstream strategy for solving multiobjective optimization problem~\citep{zhang2007moea}. It decomposes a multiobjective problem into a number of subproblems, each of which can be a single objective or multiobjective optimization problem. MOEA/D~\citep{zhang2007moea} and its variants~\citep{trivedi2016survey} solve these subproblems in a collaborative manner and generate a finite set of Pareto solutions to approximate the Pareto front. The most widely used way for constructing a single objective subproblem is the preference-based scalarization ~\citep{ehrgott2005multicriteria,miettinen2012nonlinear}. For an $m$-objective optimization problem, a preference vector for the objective functions can be defined as $\lambda \in R^m$ that satisfies $\lambda_i \geq 0$ and $\sum_{i=1}^{m} \lambda_i = 1$. \textbf{Weighted-Sum Aggregation} is the simplest approach. It defines the aggregation function to minimize in the subproblem associated with $\lambda$ as \begin{eqnarray}\label{ws_decomposition} g_{\text{ws}}(x|\lambda) = \sum_{i=1}^{m}\lambda_i f_i(x). \end{eqnarray} However, this approach can only find solutions on the convex hull of the Pareto front~\citep{ehrgott2005multicriteria}. \textbf{Weighted-Tchebycheff (Weighted-TCH) Aggregation} is an alternative approach to minimize: \begin{eqnarray}\label{tch_decomposition} g_{\text{tch}}(x|\lambda) = \max_{1 \leq i \leq m} \{ \lambda_i |f_i(x) - z^*_i| \}, \end{eqnarray} where $z^*_i < \min_{x \in \mathcal{X}} f_i(x)$ is an ideal value for $f_i(x)$. Any Pareto optimal solution could be an optimal solution of problem~(\ref{tch_decomposition}) with a specific (but unknown) preference $\lambda$~\citep{choo1983proper}. \subsection{Current Drawbacks and Our Method} \begin{figure*}[!t] \centering \subfloat[$105$ Preferences]{\includegraphics[width = 0.25\textwidth]{Figures/3obj_MOTSP50_pref105_v2.pdf}} \subfloat[$105$ Solutions]{\includegraphics[width = 0.25\textwidth]{Figures/3obj_MOTSP50_sample105_v2.pdf}} \subfloat[$1,035$ Solutions]{\includegraphics[width = 0.25\textwidth]{Figures/3obj_MOTSP50_sample1035_v2.pdf}} \subfloat[$10,011$ Solutions]{\includegraphics[width = 0.25\textwidth]{Figures/3obj_MOTSP50_sample10011_v2.pdf}} \caption{ \textbf{Pareto Set Approximation for a New Problem Instance:} Our method with different numbers of preferences on three objective MOTSP with 50 nodes. \textbf{a)\&b)} With a small number of preferences, our model can generate a sparse approximation to the Pareto set. \textbf{c)\&d)} With a large number of preferences, it can generate a dense approximation. Our method can generate any trade-off solutions with a single model without searching, whereas other methods need to solve or build a model for each preference separately. More discussions can be found in Appendix~\ref{supp_subsec_weight}~\ref{supp_subsec_connection}~\ref{supp_subsec_motsp_asymmetric}~\ref{supp_subsec_pref_inference}.} \label{fig_3obj_motsp} \vspace{-0.2in} \end{figure*} \textbf{Drawbacks of Existing Methods.} For many MOCO problems, the size of the Pareto set would be exponentially large with respect to the input size (e.g., nodes in MOTSP). It is computationally impractical for existing methods to find the whole Pareto set~\citep{herzel2021approximation}. For this reason, all of the existing heuristic-based and learning-based methods are to find a small subset of approximate Pareto solutions. Decision makers can only select solutions from this small set, which often does not contain their preferred solutions. In addition, scalarization may also produce a complicated single objective subproblem. For example, the Tchebycheff scalarized subproblem of MOTSP is not a classic TSP, and thus cannot be solved by the highly specialized TSP solvers such as LKH~\citep{helsgaun2000effective} or Concorde~\citep{applegate2007traveling}. \textbf{Our Method.} Instead of finding a set of finite solutions, we propose a novel way to approximate the whole Pareto set using a single model. With our proposed model, decision makers can easily obtain any solution from the approximate Pareto set to satisfy their preferred trade-offs in real time as shown in Figure~\ref{fig_3obj_motsp}. This is a clear advantage to support interactive decision making. In addition, our proposed reinforcement learning based method can use a scalarization method to combine multiobjective rewards, and does not need to consider the problem-specific condition. In this paper, we mainly consider learning the whole Pareto front. It is possible to incorporate decision-maker's preferences on specific regions for model building and inference as discussed in Appendix~\ref{supp_subsec_motsp_asymmetric}. We believe our proposed method is a new principled way to solve multiobjective combinatorial optimization problems. \section{The Proposed Model: Preference-Conditioned Neural MOCO} \label{proposed_method} \subsection{Preference-Conditioned Solution Construction} Decomposition and scalarization link preferences to their corresponding Pareto solutions. This work builds a preference-conditioned model to accommodate all the preferences. We use the MOTSP as an example to explain our model design. In an MOTSP instance $s$, a fully connected graph of $n$ nodes (cities) with $m$ distance metrics on each edge is given. A feasible solution is a tour that visits each city exactly once and returns to the starting city. The $i$-th objective to minimize is the tour length (total cost) based on the $i$-th distance metric. A tour can be represented as $\vpi = (\pi_1, \cdots, \pi_t, \cdots, \pi_n), \pi_t \in \{1,\cdots, n\}$, a permutation of all the nodes defining the order in which $n$ cities is visited. Our model defines a preference-conditioned stochastic policy $p_{{\bm{\theta}}(\lambda)}(\vpi|s)$ parameterized by ${\bm{\theta}}(\lambda)$ to construct a valid solution in sequence: \begin{eqnarray}\label{stochastic_policy} p_{{\bm{\theta}}(\lambda)}(\vpi | s) = \textstyle\prod_{t = 1}^{n} p_{{\bm{\theta}}(\lambda)}(\vpi_t | s, \vpi_{1: t-1}). \end{eqnarray} The goal is to learn an optimal preference-conditioned policy $p_{{\bm{\theta}}(\lambda)}(\pi | s)$ to construct tours with the lowest scalarized costs for each preference $\lambda$. \subsection{The Proposed Model} \begin{figure*}[t] \centering \includegraphics[width= 0.85\linewidth]{Figures/neural_moco_model.pdf} \caption{\textbf{Preference-conditioned Neural MOCO Model:} \textbf{a)} The input is a problem instance $s$ (e.g., a graph). \textbf{b)} A shared attention encoder transfers the instance $s$ into a set of embeddings. \textbf{c)} The embeddings for all nodes would be used by the decoder multiple times with different preferences. \textbf{d)} A MLP takes the preference $\lambda$ as input, and generates the parameters for the decoder. \textbf{e)} The preference-conditioned attention decoder directly generates different approximate Pareto solutions for different preferences. The trainable parameters are in the \textcolor{applegreen}{\textbf{attention encoder}} and \textcolor{arylideyellow}{\textbf{MLP model}}. } \label{fig_neural_moco_model} \vspace{-0.2in} \end{figure*} We propose to use an Attention Model (AM)~\citep{kool2019attention} as our basic encoder-decoder model as shown in Figure~\ref{fig_neural_moco_model}. For the MOCO problems considered in this work, a preference-agnostic encoder is capable to transfer problem instances into embeddings (e.g., embedding for all cities) used in the preference-conditioned decoder. In our model, only the decoder's parameters ${\bm{\theta}}_{\text{decoder}}(\lambda)$ are conditioned on the preference $\lambda$: \begin{eqnarray}\label{shared_encoder} {\bm{\theta}}(\lambda) = [{\bm{\theta}}_{\text{encoder}},{\bm{\theta}}_{\text{decoder}}(\lambda)]. \end{eqnarray} \textbf{Preference-agnostic Encoder.} The encoder takes a problem instance $s$ (e.g., an MOTSP instance with $n$ cities) as its input, and outputs a set of $d$-dimensional node embeddings $\{{\bm{h}}_1, \cdots, {\bm{h}}_n \}$ for each city. For a given instance, the same embeddings can be used for different preferences. Hence we only need a single forward pass for the dense encoder. We use the attention-based encoder as in \citet{kool2019attention} for all preferences. \textbf{Preference-based Attention Decoder.} The decoder has the same structure as in the attention-based model~\citep{kool2019attention}, but with parameters ${\bm{\theta}}_{\text{decoder}}(\lambda) = [W_Q(\lambda), W_K(\lambda), W_V(\lambda), W_{\text{MHA}}(\lambda)]$ conditioned on the preference $\lambda$. It takes the nodes embeddings for all cities as input, and sequentially selects the next node $\vpi_t$ with probability $p_{{\bm{\theta}}(\lambda)}(\vpi_t | s, \vpi_{1: t-1})$. At time step $t$, the decoder first constructs a context embedding $\hat {\bm{h}}_{(C)} = [{\bm{h}}_{\vpi_1}, {\bm{h}}_{\vpi_{t-1}}]W_Q(\lambda)$ from the first selected node ${\bm{h}}_{\vpi_1}$, and the last selected node ${\bm{h}}_{\vpi_{t-1}}$. The matrix $W_Q(\lambda) \in \bbR^{2d \times d}$ projects the concatenated $2d$-dimensional vector to a $d$-dimensional vector. Then we further aggregate the context embedding via a Multi-Head Attention (MHA)~\citep{vaswani2017attention} with the embeddings for all cities $\{{\bm{h}}_1,\cdots,{\bm{h}}_n\}$: \begin{eqnarray}\label{multi_head_embedding} {\bm{h}}_{(C)} = \textbf{MHA}(Q = \hat {\bm{h}}_{(C)}, K = \{{\bm{h}}_1,\cdots,{\bm{h}}_n\}W_K(\lambda), V = \{{\bm{h}}_1,\cdots,{\bm{h}}_n\}W_V(\lambda))W_{\textbf{MHA}}(\lambda), \end{eqnarray} where $Q,K,V$ are the query, key and value for MHA, respectively. $W_{\textbf{MHA}}(\lambda)$ represents the MHA parameters. The context embedding $h_{(C)}$ contains all information for the instance and the current partial tour at step $t$. We can calculate the logit for selecting each city with its embedding $h_j$: \begin{eqnarray}\label{single_head_logits} \text{logit}_j = \left\{ \begin{array}{ll} C \cdot \tanh(\frac{{\bm{h}}_{(C)}^T{\bm{h}}_j}{\sqrt{d}}) &\text{if } j \neq \vpi_{t^{\prime}} \quad \forall t^{\prime} < t, \\ -\infty & \text{otherwise}. \end{array} \right. \end{eqnarray} All already visited cities are masked with $-\infty$ and will not be selected as the next city. The logits of the rest cities are clipped into $[-C,C]\ (C = 10)$ as in the AM model~\citep{kool2019attention}. The probability for choosing the $j$-th city at time step $t$ can be calculated as $p_{{\bm{\theta}}(\lambda)}(\vpi_t = j | s, \vpi_{1: t-1}) = {e^{\text{logit}_j}} / {\sum_k e^{\text{logit}_k}}$. With this probability, the decoder can construct a feasible tour. One remaining designing issue is how to generate the preference-conditioned parameters ${\bm{\theta}}_{\text{decoder}}(\lambda)$. Multiplicative interactions~\citep{jayakumar2020multiplicative} and hypernetwork~\citep{schmidhuber1992learning,ha2017hypernetworks} provide a powerful and efficient way for conditional computation, which is widely used for transfer learning~\citep{oswald2020continual,ehret2020continual, lin2020controllable, navon2021learning}. We use a simple MLP hypernetwork ${\bm{\theta}}_{\text{decoder}}(\lambda) = \text{MLP}(\lambda | \vpsi)$ to generate the decoder parameters conditioned on the preference. The details of our proposed model can be found in Appendix~\ref{supp_sec_model_detail}. \textbf{Instance Augmentation for MOCO.} Our proposed model only has a small extra computational and memory overhead to the original single-objective AM solver. We keep our model as simple as possible, making it easy for our approach to use other models and other improvements developed for single-objective NCO. These properties are crucially important for generalizing the NCO to multiobjective problems. In this work, we simply extend the instance augmentation method~\citep{kwon2020pomo} to MOCO. The details can be found in Appendix~\ref{supp_subsec_augmentation}. \section{Preference-conditioned Multiobjective Policy Optimization} \subsection{Cost Function} Our proposed node selection strategy guarantees that the model can always generate feasible solutions. In this section, we develop an efficient multiobjective policy optimization method to train the model for all the preferences simultaneously. For an MOTSP problem, the objective functions are a vector of $m$ different costs (i.e. lengths) for a tour $L(\vpi) = [L_1(\vpi),\cdots,L_m(\vpi)]$. We can define a weighted-Tchebycheff scalarized cost for each preference $\lambda$: \begin{eqnarray}\label{scalar_cost_tch} L(\vpi|\lambda) = \max_{1 \leq i \leq m} \{ \lambda_i |L_i(\vpi) - (z^*_i - \varepsilon)| \}, \end{eqnarray} where $z^*_i$ is an ideal cost for the $i$-th objective. For a given instance $s$, our goal is to minimize the expected cost for all preferences: \begin{eqnarray}\label{expected_cost} \mathcal{J}({\bm{\theta}} | s) = \bbE_{\lambda \sim \Lambda, \vpi \sim p_{{\bm{\theta}}(\lambda)}(\cdot | s)} L(\vpi|\lambda), \end{eqnarray} where $\Lambda$ is the uniform distribution over all valid preferences. To train the model, we repeatedly sample different instances $s \sim \mathcal{S}$ at each iteration. We define the training loss as $\mathcal{J}({\bm{\theta}} ) = \bbE_{s \sim \mathcal{S}} \mathcal{J}({\bm{\theta}}|s)$. \subsection{Multiobjective REINFORCE} \begin{algorithm}[t] \caption{Neural MOCO Training} \label{alg_neural_moco_training} \begin{algorithmic}[1] \STATE \textbf{Input:} preference distribution $\Lambda$, instances distribution $\mathcal{S}$, number of training steps $T$, number of preferences per iteration $K$, batch size $B$, number of tours $N$ \STATE Initialize the model parameters ${\bm{\theta}}$ \FOR{$t = 1$ to $T$} \STATE $\lambda_k \sim \textbf{SamplePreference}(\Lambda) \quad \forall k \in \{1,\cdots,K\}$ \STATE $s_i \sim \textbf{SampleInstance}(\mathcal{S}) \quad \forall i \in \{1,\cdots,B\}$ \STATE $\vpi_{ki}^{j} \sim \textbf{SampleTour}(p_{{\bm{\theta}}(\lambda_k)}(\cdot | s_i)) \quad \forall k, i \quad \forall j \in \{1,\cdots,N\}$ \STATE $b(s_i|\lambda_k) \leftarrow \frac{1}{N} \sum_{j=1}^{N} L(\vpi_{ki}^{j}|\lambda_k, s_i) \quad \forall k \in \{1,\cdots,K\} \quad \forall i \in \{1,\cdots,B\}$ \STATE $\nabla \mathcal{J}({\bm{\theta}}) \leftarrow \frac{1}{KBN} \sum_{k=1}^{K} \sum_{i=1}^{B} \sum_{j=1}^{N} [ (L(\vpi_{ki}^{j}|\lambda_k, s_i) - b(s_i|\lambda_k)) \nabla_{{\bm{\theta}}(\lambda_k)} \log p_{{\bm{\theta}}(\lambda_k)}(\vpi_{ki}^{j}| s_i)]$ \STATE $\theta \leftarrow \textbf{ADAM}(\theta,\nabla \mathcal{J}({\bm{\theta}}))$ \ENDFOR \STATE \textbf{Output:} The model parameter ${\bm{\theta}}$ \end{algorithmic} \end{algorithm} For a given instance $s$ and a specific preference $\lambda$, we use the REINFORCE~\citep{williams1992simple} to estimate the gradient for the preference-conditioned scalar cost: \begin{eqnarray}\label{reinforce_grad} \nabla \mathcal{J}({\bm{\theta}} |\lambda, s) = \bbE_{\vpi \sim p_{{\bm{\theta}}(\lambda)}(\cdot | s)} [ (L(\vpi|\lambda, s) - b(s|\lambda)) \nabla_{{\bm{\theta}}(\lambda)} \log p_{{\bm{\theta}}(\lambda)}(\vpi| s)], \end{eqnarray} where $b(s|\lambda)$ is the baseline of expected cost to reduce the gradient variance. This gradient can be estimated by Monte Carlo sampling. At each update step, we randomly sample $K$ preference $\{\lambda_1,\cdots, \lambda_K\} \sim \Lambda$, $B$ instances $\{s_1, \cdots, s_B\} \sim \mathcal{S}$, and $N$ different tour $\{\vpi_i^1, \cdots, \vpi_i^N\} \sim p_{{\bm{\theta}}(\lambda_k)}(\cdot | s_i)$ for each $\lambda_k$-$s_i$ combination. The approximated gradient is: \begin{eqnarray}\label{reinforce_approx_grad} \nabla \mathcal{J}({\bm{\theta}}) \approx \frac{1}{KBN} \sum_{k=1}^{K} \sum_{i=1}^{B} \sum_{j=1}^{N} [ (L(\vpi_{i}^{j}|\lambda_k, s_i) - b(s_i|\lambda_k)) \nabla_{{\bm{\theta}}(\lambda_k)} \log p_{{\bm{\theta}}(\lambda_k)}(\vpi_{i}^{j}| s_i)]. \end{eqnarray} We use the shared baseline $b_{\text{shared}}(s_i|\lambda_k) = \frac{1}{N} \sum_{j=1}^{N} L(\vpi_{ki}^{j}|\lambda_k, s_i)$ over $N$ sampled tours for each $\lambda_k-s_i$ combination. The starting node for each tour $\vpi_{ki}^{j}$ is chosen in random to force diverse rollouts as proposed in~\citep{kwon2020pomo}. The algorithm is shown in \textbf{Algorithm \ref{alg_neural_moco_training}}. \subsection{Active Adaption} We also propose a simple yet powerful active adaption approach to further adjust the whole model to approximate the Pareto front for a given test instance in Appendix~\ref{supp_subsec_active_adaption}. The proposed method does not depend on specific instance distribution $\mathcal{S}$, and is suitable for out-of-distribution adaption. \section{Experiments} \label{sec_exp} \textbf{Problems and Model Setting. } We consider MOTSP~\citep{lust2010multiobjective}, MOCVRP~\citep{lacomme2006genetic} and MOKP~\citep{bazgan2009solving} in our experimental studies, and use the same model settings for all problems with different task-specific input sizes and mask methods. The main policy model encoder is the Attention Model~\citep{kool2019attention} and the hypernetwork is an MLP. We randomly generate $100,000$ problem instances on the fly for each epoch, and train the model for $200$ epochs. The optimizer is ADAM with learning rate $\eta = 10^{-4}$ and weight decay $10^{-6}$. We train our models on a single RTX $2080$-Ti GPU, and it costs about $10$ minutes for an epoch on MOTSP100. We give detailed model settings, problem formulations, and more experimental results in Appendix~\ref{supp_sec_model_detail}\ref{supp_sec_problem_detail}\ref{supp_sec_exp_results}. The source code can be found in \url{https://github.com/Xi-L/PMOCO}. \textbf{Baseline.} We call our proposed preference-conditioned multiobjective combinatorial optimization as \textbf{P-MOCO}. We compare it with three widely-used evolutionary algorithm frameworks for MOCO: \textbf{MOGLS}~\citep{jaszkiewicz2002genetic} is a multiobjective genetic local search algorithm, \textbf{NSGAII}~\citep{deb2002fast} is a Pareto dominance-based multiobjective genetic algorithm, and \textbf{MOEA/D}~\citep{zhang2007moea} is a decomposition-based multiobjective evolutionary algorithm. All these algorithm frameworks need problem-specific heuristics to generate and search feasible solutions for different problems. We also compare \textbf{P-MOCO} with two other learning-based methods: \textbf{DRL-MOA}~\citep{li2020deep} decomposes a MOCO with different preferences and builds a Pointer Network~\citep{vinyals2015pointer,bello2016neural} to solve each subproblem, and \textbf{AM-MOCO} is a multi-models variant of our proposed model, which builds Attention Model~\citep{kool2019attention} for each subproblem. The \textbf{Weight-Sum} scalarization of MOTSP and MOKP are their respective single-objective counterpart. Therefore, we also compare our method with the approach that uses some state-of-the-art single-objective solvers for each weight-sum subproblem. \begin{table*}[ht] \centering \caption{Model Information for the learning-based methods.} \label{table_model_info} \tabcolsep=0.12cm \begin{tabular}{llccc} \hline & \multicolumn{1}{c}{Model} & \#Models & \#Params & \#Pref. \\ \hline DRL-MOA & Pointer-Network & 101 & $101 \times$ 0.2M $=$ 20.2M ($7\%$) & Fixed 101 \\ AM-MOCO & Attention Model & 101 & $101 \times$ 1.3M $=$ 131.3M ($1.1\%$) & Fixed 101 \\ P-MOCO (Ours) & Pref-Conditioned AM & 1 & 1.4M & Flexible \\ \hline \end{tabular} \end{table*} \textbf{Model Information} for the learning-based methods is shown in Table~\ref{table_model_info}. Our model supports flexible preference assignment and only has $1.1\%$ total parameters to the multi-model counterpart. \textbf{Inference and Metrics.} We report the results and run time for solving $200$ random test instances for each problem, with normally $101$ to $105$ different trade-offed solutions, and up to $10,011$ solutions for our proposed method. In most cases, we report our model's zero-shot generalization performance without any search and fine-tune. We use the hypervolume indicator~\citep{zitzler2003performance} to measure the performance for each method. For a set $P \subset \mathbb{R}^m$ in the objective space, we can find a reference point $r^*$ that dominated by all solutions in $P$, and define the hypervolume $\text{HV}(P)$ as volume for: \begin{eqnarray} S = \{r \in \mathbb{R}^m \mid \exists \ y \in P \mbox{ such that } y \prec r \prec r^{*}\}, \end{eqnarray} where $\text{HV}(P) = \textbf{Vol}(S)$. In general, the larger the hypervolume, the better the solution set tends to be. The ground truth Pareto set always has the largest hypervolume. We report the normalized hypervolume values in $[0,1]$ with respect to the same $r^*$ for all the methods, and also the ratios of hypervolume difference to our method. A Wilcoxon rank-sum test with a significance level $1\%$ is conducted to compare the results for each experiment. More details can be found in Appendix~\ref{supp_subsec_hypervolume}. \subsection{Results and Analysis} \begin{table*}[t] \centering \caption{Experimental results on two-objective MOTSP, MOCVRP and MOKP with different input sizes (20,50 and 100). HV is the hypervolume metric, Gap is the ratio of hypervolume difference with respect to our method, and Time is the running run for solving 200 random test instances. The best result and its statistically indifferent results are highlighted in \textbf{bold}.} \vspace{-0.1in} \label{table_results_motsp_2obj} \tabcolsep=0.12cm \begin{tabular}{lccccccccc} \hline \multicolumn{10}{c}{MOTSP} \\ \hline \multicolumn{1}{l|}{} & \multicolumn{3}{c|}{MOTSP20} & \multicolumn{3}{c|}{MOTSP50} & \multicolumn{3}{c}{MOTSP100} \\ \multicolumn{1}{l|}{Method} & HV & Gap & \multicolumn{1}{c|}{Time} & HV & Gap & \multicolumn{1}{c|}{Time} & HV & Gap & Time \\ \hline \multicolumn{1}{l|}{Weight-Sum LKH} & 0.51 & 2.44\% & \multicolumn{1}{c|}{(3.9m)} & \textbf{0.58} & \textbf{-0.26\%} & \multicolumn{1}{c|}{(42m)} & \textbf{0.68} & \textbf{-0.58\%} & (3.1h) \\ \multicolumn{1}{l|}{Weight-Sum OR Tools} & 0.48 & 7.29\% & \multicolumn{1}{c|}{(3.7m)} & 0.52 & 9.66\% & \multicolumn{1}{c|}{(38m)} & 0.63 & 5.64\% & (2.8h) \\ \multicolumn{1}{l|}{MOGLS-TSP} & 0.48 & 7.96\% & \multicolumn{1}{c|}{(1.7h)} & 0.51 & 10.7\% & \multicolumn{1}{c|}{(4.5h)} & 0.59 & 14.7\% & (12h) \\ \multicolumn{1}{l|}{NSGAII-TSP} & 0.47 & 9.88\% & \multicolumn{1}{c|}{(45m)} & 0.46 & 19.7\% & \multicolumn{1}{c|}{(49m)} & 0.51 & 26.5\% & (53m) \\ \multicolumn{1}{l|}{MOEA/D-TSP} & 0.48 & 7.82\% & \multicolumn{1}{c|}{(3.1h)} & 0.47 & 18.9\% & \multicolumn{1}{c|}{(3.3h)} & 0.52 & 25.0\% & (3.7h) \\ \hline \multicolumn{1}{l|}{DRL-MOA (101 models)} & 0.46 & 11.3\% & \multicolumn{1}{c|}{(2s)} & 0.49 & 15.0\% & \multicolumn{1}{c|}{(5s)} & 0.57 & 17.0\% & (15s) \\ \multicolumn{1}{l|}{AM-MOCO (101 models)} & \textbf{0.52} & \textbf{0.22\%} & \multicolumn{1}{c|}{(2s)} & 0.57 & 1.72\% & \multicolumn{1}{c|}{(7s)} & 0.67 & 0.72\% & (18s) \\ \hline \multicolumn{1}{l|}{P-MOCO (101 pref.)} & \textbf{0.52} & \textbf{0.19\%} & \multicolumn{1}{c|}{(2s)} & 0.57 & 1.80\% & \multicolumn{1}{c|}{(5s)} & 0.67 & 0.60\% & (16s) \\ \multicolumn{1}{l|}{P-MOCO (101 pref., aug)} & \textbf{0.52} & \textbf{0.00\%} & \multicolumn{1}{c|}{(2.1m)} & 0.58 & 0.00\% & \multicolumn{1}{c|}{(4.2m)} & 0.67 & 0.00\% & (12m) \\ \hline \multicolumn{10}{c}{MOCVRP} \\ \hline \multicolumn{1}{l|}{} & \multicolumn{3}{c|}{MOCVRP20} & \multicolumn{3}{c|}{MOCVRP50} & \multicolumn{3}{c}{MOCVRP100} \\ \multicolumn{1}{l|}{Method} & HV & Gap & \multicolumn{1}{c|}{Time} & HV & Gap & \multicolumn{1}{c|}{Time} & HV & Gap & Time \\ \hline \multicolumn{1}{l|}{MOGLS-MOCVRP} & 0.33 & 6.66\% & \multicolumn{1}{c|}{(2.9h)} & 0.39 & 10.5\% & \multicolumn{1}{c|}{(4.1h)} & 0.38 & 13.0\% & (5h) \\ \multicolumn{1}{l|}{NSGAII-MOCVRP} & 0.31 & 12.3\% & \multicolumn{1}{c|}{(39m)} & 0.36 & 18.0\% & \multicolumn{1}{c|}{(39m)} & 0.35 & 20.8\% & (41m) \\ \multicolumn{1}{l|}{MOEAD-MOCVRP} & 0.29 & 17.9\% & \multicolumn{1}{c|}{(1.7h)} & 0.33 & 24.8\% & \multicolumn{1}{c|}{(1.8h)} & 0.34 & 22.3\% & (2h) \\ \hline \multicolumn{1}{l|}{DRL-MOA (101 models)} & 0.32 & 9.19\% & \multicolumn{1}{c|}{(6s)} & 0.37 & 16.0\% & \multicolumn{1}{c|}{(15s)} & 0.37 & 16.0\% & (33s) \\ \multicolumn{1}{l|}{AM-MOCO (101 models)} & 0.35 & 0.71\% & \multicolumn{1}{c|}{(8s)} & 0.43 & 2.84\% & \multicolumn{1}{c|}{(21s)} & 0.43 & 3.04\% & (39s) \\ \hline \multicolumn{1}{l|}{P-MOCO (101 pref.)} & 0.35 & 0.58\% & \multicolumn{1}{c|}{(8s)} & 0.44 & 0.65\% & \multicolumn{1}{c|}{(18s)} & 0.44 & 0.51\% & (36s) \\ \multicolumn{1}{l|}{P-MOCO (101 pref., aug)} & \textbf{0.35} & \textbf{0.00\%} & \multicolumn{1}{c|}{(1m)} & \textbf{0.44} & \textbf{0.00\%} & \multicolumn{1}{c|}{(2.1m)} & \textbf{0.45} & \textbf{0.00\%} & (4.5m) \\ \hline \multicolumn{10}{c}{MOKP} \\ \hline \multicolumn{1}{l|}{} & \multicolumn{3}{c|}{MOKP50} & \multicolumn{3}{c|}{MOKP100} & \multicolumn{3}{c}{MOKP200} \\ \multicolumn{1}{l|}{Method} & HV & Gap & \multicolumn{1}{c|}{Time} & HV & Gap & \multicolumn{1}{c|}{Time} & HV & Gap & Time \\ \hline \multicolumn{1}{l|}{Weight-Sum DP} & 0.70 & 2.11\% & \multicolumn{1}{c|}{(16m)} & 0.83 & 2.74\% & \multicolumn{1}{c|}{(1.5h)} & 0.66 & 2.86\% & (4.2h) \\ \multicolumn{1}{l|}{Weight-Sum Greedy} & \multicolumn{1}{l}{0.62} & 14.0\% & \multicolumn{1}{c|}{(2s)} & \multicolumn{1}{l}{0.77} & 10.1\% & \multicolumn{1}{c|}{(4s)} & \multicolumn{1}{l}{0.63} & 7.49\% & (7s) \\ \multicolumn{1}{l|}{MOGLS-KP} & 0.58 & 19.1\% & \multicolumn{1}{c|}{(1.8h)} & 0.72 & 15.6\% & \multicolumn{1}{c|}{(3.9h)} & 0.62 & 9.49\% & (9.8h) \\ \multicolumn{1}{l|}{NSGAII-KP} & 0.56 & 22.0\% & \multicolumn{1}{c|}{(34m)} & 0.69 & 19.8\% & \multicolumn{1}{c|}{(33m)} & 0.58 & 14.7\% & (34m) \\ \multicolumn{1}{l|}{MOEAD-KP} & 0.59 & 18.2\% & \multicolumn{1}{c|}{(1.5h)} & 0.76 & 11.1\% & \multicolumn{1}{c|}{(1.4h)} & 0.65 & 5.38\% & (1.6h) \\ \hline \multicolumn{1}{l|}{DRL-MOA (101 models)} & 0.63 & 12.9\% & \multicolumn{1}{c|}{(5s)} & 0.78 & 9.32\% & \multicolumn{1}{c|}{(17s)} & 0.65 & 4.39\% & (35s) \\ \multicolumn{1}{l|}{AM-MOCO (101 models)} & \textbf{0.72} & \textbf{0.21\%} & \multicolumn{1}{c|}{(7s)} & \textbf{0.86} & \textbf{0.41\%} & \multicolumn{1}{c|}{(16s)} & \textbf{0.68} & \textbf{0.32\%} & (42s) \\ \hline \multicolumn{1}{l|}{P-MOCO (101 pref.)} & \textbf{0.72} & \textbf{0.00\%} & \multicolumn{1}{c|}{(7s)} & \textbf{0.86} & \textbf{0.00\%} & \multicolumn{1}{c|}{(15s)} & \textbf{0.68} & \textbf{0.00\%} & (40s) \\ \hline \end{tabular} \vspace{-0.1in} \end{table*} \textbf{MOTSP.} The results on two and three objective MOTSP are shown in Table~\ref{table_results_motsp_2obj} and Table~\ref{table_results_motsp_3obj} respectively. MOGLS, NSGAII and MOEA/D all use $2$-opt local search heuristic~\citep{jaszkiewicz2002genetic} to search for promising solutions. We also include two weight-sum scalarization baselines with the state-of-the-art LKH solver~\citep{helsgaun2000effective,tinos2018efficient} and Google OR tools~\citep{ortools2019}. For the bi-objective problems, our proposed method with a single model has similar performances compared with AM-MOCO on all problems. It achieves the best performance with instance augmentation, which significantly outperforms other methods but is beaten by the LKH solver. For the three objective problems, our method can further improve its performance by generating much more trade-off solutions within a reasonable amount of time, which other methods cannot do. As shown in Figure~\ref{fig_3obj_motsp} and Figure~\ref{fig_supp_motsp_3obj}, our method can successfully learn the mapping from preferences to the corresponding solutions, and can generate a good prediction to the whole Pareto front. Decision makers can easily obtain any preferred trade-off solutions as they like. This flexibility could be desirable in many real-world applications. More discussion on the connection between the preference and Pareto solution for three-objective TSP can be found in Appendix~\ref{supp_subsec_connection}~\ref{supp_subsec_motsp_asymmetric}~\ref{supp_subsec_pref_inference}. \begin{table*}[t] \centering \caption{Experimental results on three-objective MOTSP with different input sizes (20, 50 and 100). The best result and its statistically indifferent results are highlighted in \textbf{bold}.} \vspace{-0.1in} \label{table_results_motsp_3obj} \tabcolsep=0.12cm \begin{tabular}{l|ccc|ccc|ccc} \hline & \multicolumn{3}{c|}{MOTSP20} & \multicolumn{3}{c|}{MOTSP50} & \multicolumn{3}{c}{MOTSP100} \\ Method & HV & Gap & Time & HV & Gap & Time & HV & Gap & Time \\ \hline Weight-Sum LKH & 0.32 & 5.83\% & (4.5m) & 0.36 & 5.48\% & (44m) & 0.45 & 4.03\% & (3.5h) \\ Weight-Sum OR Tools & 0.31 & 8.48\% & (4.1m) & 0.31 & 15.5\% & (39m) & 0.41 & 11.2\% & (3.1h) \\ MOGLS-MOTSP & 0.27 & 19.6\% & (2h) & 0.27 & 27.4\% & (5h) & 0.33 & 30.5\% & (13h) \\ NSGAII-MOTSP & 0.20 & 39.9\% & (47m) & 0.18 & 49.3\% & (56m) & 0.25 & 48.4\% & (1h) \\ MOEA/D-MOTSP & 0.21 & 36.6\% & (3.3h) & 0.20 & 46.7\% & (3.7h) & 0.27 & 42.7\% & (4.1h) \\ \hline DRL-MOA (105 models) & 0.26 & 21.6\% & (2s) & 0.28 & 23.0\% & (5s) & 0.34 & 28.8\% & (19s) \\ AM-MOCO (105 models) & 0.32 & 5.52\% & (2s) & 0.33 & 6.02\% & (7s) & 0.42 & 6.53\% & (21s) \\ \hline P-MOCO (105 pref.) & 0.32 & 5.65\% & (2s) & 0.36 & 5.76\% & (6s) & 0.44 & 5.52\% & (19s) \\ P-MOCO (105 pref., aug) & \multicolumn{1}{l}{0.32} & 5.46\% & (2.1m) & \multicolumn{1}{l}{0.36} & 5.43\% & (6.5m) & \multicolumn{1}{l}{0.45} & \multicolumn{1}{l}{4.39\%} & \multicolumn{1}{l}{(20m)} \\ P-MOCO (1,035 pref.) & 0.33 & 2.08\% & (19s) & 0.36 & 4.03\% & (48s) & 0.46 & 2.12\% & (2.9m) \\ P-MOCO (10,011 pref.) & \textbf{0.34} & \textbf{0.00\%} & (3m) & \textbf{0.38} & \textbf{0.00\%} & (9m) & \textbf{0.47} & \textbf{0.00\%} & (33m) \\ \hline \end{tabular} \vspace{-0.2in} \end{table*} \textbf{MOCVRP.} In this problem, each node has a demand, and we need to construct multiple return routes for a vehicle with a fixed capacity from the same depot to handle all demands. The objectives we consider are to minimize the tour length for all routes and also the tour length for the longest routes (the makespan in scheduling)~\citep{lacomme2006genetic}. All the non-learning algorithm frameworks use the problem-specific constructive heuristics and local search method proposed in \citet{lacomme2006genetic} to search feasible non-dominated solutions. The results in Table~\ref{table_results_motsp_2obj} show that our method significantly outperforms the non-learning heuristics in terms of both solution quality and running time. It also outperforms AM-MOCO with $100$ individual models, which could be due to the asymmetric objective scales. We provide further analysis in Appendix~\ref{supp_subsec_connection_2obj}. \textbf{MOKP.} The multiobjective $0$-$1$ knapsack problem can be found in many real-world applications~\citep{bazgan2009solving}. We consider the uni-dimension problem, where each item has multiple values and one weight. The goal is to select a subset of items to maximize all obtained values with a weight constraint. The non-learning methods use binary coding with a greedy transformation heuristic to maintain feasibility \citep{ishibuchi2014behavior}. We also include weight-sum scalarization baselines with dynamic programming (DP) and a strong greedy search based on the value-weight ratio. According to the results in Table~\ref{table_results_motsp_2obj}, our method has the best performance on all problems. The DP method is also outperformed by our method since the weight-sum scalarization can only find the convex hull of the Pareto front. The Tchebycheff scalarization of MOKP is not a KP problem, while our method is more flexible to use Tchebycheff scalarization on the reward function. We also report the results on $10$ objective MOKP100 and the generalization performance to problem with $500$ items in Appendix~\ref{supp_subsec_many_obj}. \textbf{Out-of-Distribution Problems and Active Adaption.} We also validate the generalization performance of our method on $6$ out-of-distribution (OOD) MOTSP problems from \citet{fonseca2006improved}. Their ground truth Pareto fronts can be obtained by exhaustive search. The results are shown in Appendix~\ref{supp_subsec_exact_front} due to the page limit. With active adaption, our method can achieve good performance ($1\%$ - $1.5\%$ HV gap to the ground truth Pareto fronts) on these OOD problems. \section{Conclusion and Future Work} \label{sec_conclusion} \textbf{Conclusion.} We have proposed a novel preference-conditioned method to approximate the whole Pareto front for MOCO problems using a single model. It allows decision makers to directly obtain any trade-off solutions without any search procedure. Experiments on different problems have shown that our proposed method significantly outperforms other methods in terms of performance, speed and model efficiency. We believe the proposed method is a principled way for solving MOCO. \textbf{Future Work.} In a sense, our method can be regarded as a learning version of the decomposition-based algorithm (MOEA/D~\citep{zhang2007moea}) dealing with all the possible trade-off preferences. Instead of maintaining a set of finite solutions as in other MOEA/D vaiants~\citep{trivedi2016survey}, we build a single learning-based model to solve the subproblems for all the preferences simultaneously in a collaborative manner. We believe the single-model-for-all-preference approach is a promising alternative to the current default finite-population-based methods, and it could be an important research direction for multiobjective optimization. Our method can be further improved with other advanced models and efficient multiobjective training procedures. In the future, we will study fundamental issues of multiobjective optimization (e.g., convergence v.s. diversity, exploitation v.s. exploration trade-off) for Pareto set learning methods. \textbf{Limitation.} It is very difficult to give a convergence guarantee for learning-based MOCO, where each preference-based subproblem could be already NP-hard, and the number of Pareto solutions is exponentially large with respect to the input size. See detailed discussion in Appendix~\ref{supp_sec_approximation}. \subsubsection*{Acknowledgments} We thank Prof. Hisao Ishibuchi for his valuable comments on an earlier version of this work. This work was supported by the Hong Kong General Research Fund (11208121, CityU-9043148).
10f205476b0168f9532f87240db081d3abe479ef
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:Introduction} Deep learning (DL) has brought new opportunities for modeling and forecasting the dynamics of complex multiscale systems due to its excellent performance in non-linear function approximation from examples. The emergence of various architectures,~\eg convolutional neural networks (CNNs)~\cite{Lecun1998} and long short-term memory (LSTM)~\cite{hochreiterschmidhuber}, has led to the development of a variety of DL-based frameworks for modeling complex physical systems by accounting for spatio-temporal dependencies in the predictions. Deep learning has been employed in many scientific and engineering disciplines, \eg astronomy \cite{Waldmann2019}, climate modeling \cite{ham2019}, solid mechanics \cite{Mianroodi2021}, chemistry \cite{Segler2018} and sustainability \cite{VinuesaNat,Interp}. Fluid mechanics has been one of the active research topics for the development of innovative deep-learning-based approaches \cite{kutz2017,duraisamyetal,bruntonetal2020,vinuesa2021}. Successful application of deep neural networks (DNNs) has been shown in the data-driven turbulence closure modeling \cite{ling2016,mlrans}, prediction of temporal dynamics of low-order models of turbulence \cite{srinivasan,EIVAZI2021}, extraction of turbulence theory for two-dimensional decaying isotropic turbulence \cite{jimenez2018}, non-intrusive sensing in turbulent flows \cite{guastoni2020,guemes2021}, and active flow control through deep reinforcement learning \cite{fluidsRL,RL2020,rabault_2019}. The first example of learning in experimental fluid mechanics dates back to the early 1960s for drag reduction \cite{rechenberg1964}. In the early 1990s several approaches were developed based on neural networks with the application in trajectory analysis and classification for particle tracking velocimetry (PTV) \cite{Adamczyk1988} and particle image velocimetry (PIV)\cite{Adrian1984,TeoNNPIV91,grant1995}. During recent decades, image processing and computer vision have seen a breakthrough with the advent of deep-learning methods, which provokes the application of deep learning in the processing and augmenting of PIV measurements. The majority of the literature has been devoted to improving the spatial resolution, recovering missing data, reconstruction of three-dimensional fields from sparse measurements, and post-processing. Reconstruction of high-resolution images from low-resolution ones, the so-called super-resolution reconstruction, has been an active research topic in the field of computer science \cite{Wang2021}. The success of deep learning in super-resolution tasks within computer science motivated its application to fluid mechanics and turbulence using CNNs \cite{fukami2019,Liu2020}, super-resolution generative adversarial networks (SRGANs) \cite{guemes2021}, and unsupervised learning based on cycle-consistent GANs (CycleGANs) \cite{kim2021}. Deep learning has been also applied for super-resolution of four-dimensional (4D) flow magnetic-resonance imaging (MRI) data \cite{Ferdian2020}. However, supervised deep-learning-based super-resolution approaches are limited by the need for high-resolution labels for training, \ie a pair set of low and high-resolution fields are needed, which is difficult to obtain from experiments. Recently, \citeasnoun{guemes2021PIV} showed the capability of GANs to generate high-resolution fields from PIV data without having \textit{a priori} any high-resolution field. Flow data estimation and reconstruction from incomplete data are another common problems in experimental fluid mechanics. Gappy proper orthogonal decomposition (Gappy POD) \cite{Everson95} has been shown suitable for flow-field reconstruction from incomplete data \cite{Bui-Thanh2004}; however, it can not be applied for the reconstruction of the missing data over a fixed region. Recently, \citeasnoun{Morimoto2021} proposed an autoencoder-type CNN for PIV data estimation considering missing regions that can overcome such limitations. Application of machine learning and deep learning has been also shown for flow-field reconstruction from sparse turbomachinery data \cite{Akbari2021}. Another research direction for augmenting sparse data is to perform three-dimensional fluid data reconstruction from sectional flow fields \cite{Chandramouli2019}.~\citeasnoun{stulov2021neural} proposed a CNN-based architecture including two-dimensional and three-dimensional convolutions to reconstruct three-dimensional data from a few numbers of two-dimensional sections in a computationally friendly manner. Moreover, the application of deep learning for performing end-to-end PIV has been shown in the experimental-fluid-mechanics community by \citeasnoun{Rabault2017} and motivated by the progress in computer vision regarding the motion-estimation problem \cite{Hui2018,Yang2019,Cai2020,stulov2021neural}. Deep-learning methods are powerful modeling tools for data-rich domains such as vision, language, and speech. However, extracting interpretable information and learning generalizable knowledge is still a challenge, especially for domains with limited data available \cite{Rudin2019,Interp}.~Purely data-driven techniques require large datasets for training that may not be available for many engineering problems. Moreover, these models may fit the observational data very well but lack in complying with the fundamental physical laws. Therefore, there is a pressing need for integrating governing physical laws and domain knowledge into the model training, which can act as an informative prior to informing the model about the empirical, physical, or mathematical understanding of the system besides the observational data. Physics-informed neural networks (PINNs), which were introduced by \citeasnoun{Raissi2019}, provide a framework to integrate data and physical laws in the form of governing partial differential equations (PDEs) for learning. This can lead to models that are robust in the presence of imperfect data,~\eg missing or noisy values, and can provide accurate and physically-consistent predictions \cite{Karniadakis2021}. PINNs are well suited for ill-posed and inverse problems related to several different types of PDEs. PINNs were applied to simulate vortex-induced vibrations \cite{raissiviv} and to tackle ill-posed inverse fluid-mechanics problems \cite{raissisci}.~\citeasnoun{NSFnets} showed the applicability of PINNs for the simulation of turbulence directly, where good agreement was obtained between the direct numerical simulation (DNS) results and the PINNs simulation results.~\citeasnoun{eivazi2021physicsinformed} employed PINNs for solving Reynolds-averaged Navier--Stokes (RANS) equations without any specific model or assumption for turbulence and using data as the turbulence closure. PINNs were employed also for super-resolution and denoising of cardiovascular-flow MRI data \cite{FATHI2020,Gao2021} and the prediction of near-wall blood flow from sparse data \cite{arzani2021}. Recently,~\citeasnoun{caikarniadakis2021} proposed a method based on PINNs to infer the full continuous three-dimensional velocity and pressure fields from snapshots of three-dimensional temperature fields obtained by tomographic background-oriented Schlieren (Tomo-BOS) imaging. A detailed discussion on the prevailing trends in embedding physics into machine-learning algorithms and diverse applications of PINNs can be found in the work by \citeasnoun{Karniadakis2021}. In this study, we employ PINNs for the super-resolution of flow fields both in time and space from a limited set of measurements without having any high-resolution targets. This is a very important problem that can enhance the accuracy of experimental data in fluid-mechanics studies. Our objective is to learn a functional mapping parameterized by a neural network from spatial $(x)$ and temporal $(t)$ coordinates to the flow parameters, \ie velocity components and pressure, which provides a continuous solution of the problem. We first show the applicability of PINNs for the super-resolution tasks in time through solving an ill-posed problem regarding the canonical case of Burgers’ equation. Next, we examine the performance of PINNs in the super-resolution of flow-field data in the presence of noise for the two-dimensional vortex shedding behind a circular cylinder at a Reynolds number of $Re_D= U_{\infty} D / \nu = 100$ based on the cylinder diameter $D$ and the free-stream velocity $U_{\infty}$ where $\nu$ is the kinematic viscosity. Finally, we employ PINNs for the super-resolution of noisy data with different resolutions in time and space for a turbulent minimal channel flow at a Reynolds number based on the channel half-height $h$ and the laminar centerline-velocity $U_{\mathrm{cl}}$ of $Re_{\mathrm{cl}} = U_{\mathrm{cl}} h / \nu = 5,000$. This article is organized as follows: in $\S$\ref{sec:Methodology} we provide an overview of the physics-informed neural networks and discuss the theoretical background; in $\S$\ref{sec:SR} we discuss the application of PINNs for super-resolution of flow-field data in both time and space without having any high-resolution targets; and finally, in $\S$\ref{sec:conclusions} we provide a summary and the conclusions of the study. \section{Methodology} \label{sec:Methodology} \subsection{Deep neural networks (DNNs)} Deep neural networks are universal approximators of continuous functions, obtained by composing simple but non-linear transformations at each level (the so-called layer). By the composition of enough such non-linear transformations and having a large training dataset available, a deep neural network can learn very complex functions using the backpropagation algorithm~\cite{LeCun2015}. Multilayer perceptrons (MLPs)~\cite{mlps} are the most basic type of artificial neural network comprised of two or more fully-connected layers of neurons, where each node is connected to all nodes in the preceding and succeeding layers. Let us consider $X$ and $\Psi$ as the input and output spaces and each pair of vectors $(\pmb{\chi},\pmb{\psi})$ as a training example or sample. The neural network aims to find the mapping ${f: X \rightarrow \Psi}$ using the training set such that a loss function $L(f(\pmb{\chi}); \pmb{\psi})$ is minimized. An MLP approximates the function $f$ using the composition of simple transfer functions, \ie linear matrix operations followed by an element-wise nonlinear function called activation function, \eg sigmoidal or hyperbolic tangent. For the layer $i$, the weight matrix $\mathbf{W}_i$ and the bias $\mathbf{b}_i$ perform the linear matrix transformation from layer $i-1$ to the next; then the operation of the activation function $g_i$ leads to the output of the layer as $\pmb{z}_{i} = g_i(\mathbf{W}_i \pmb{z}_{i-1} + \mathbf{b}_i)$. The goal of training an MLP is to determine $\mathbf{W}_i$ and $\mathbf{b}_i$ using training data for the given activation functions. \subsection{Physics-informed neural networks (PINNs)} \label{sec:PINNs} \subsubsection{Model architecture:} Physics-informed neural networks (PINNs) are deep-learning-based frameworks for solution or discovery of partial differential equations \cite{Raissi2019}. The goal of PINNs is to include the information from the governing physical laws into the training process of a deep neural network. A PINN comprises two parts: an MLP and a so-called residual network, which calculates the residual of the governing equations. In a general set-up dealing with spatio-temporal partial differential equations, the temporal and the spatial coordinates $(t, \mathbf{x})$ are the inputs of the MLP and the solution vector of the PDE system $\mathbf{u} = f(t, \mathbf{x})$ is the output where the function $f$ is parameterized by the MLP. Automatic differentiation (AD) \cite{baydin2018} is utilized to differentiate the outputs $\mathbf{u}$ with respect to the inputs ($t$, $\mathbf{x}$) and formulate the governing equations.~AD can be implemented directly from the deep-learning framework since it is used to compute the gradients and update the network parameters, \ie weights $\mathbf{W}$ and biases $\mathbf{b}$, during the training. We consider partial differential equations of the general form: \begin{equation} \mathbf{u}_t + \mathcal{N}[\mathbf{u}] = 0,~~~\mathbf{x} \in \Omega, t \in [0, T], \label{eq:generalPDE} \end{equation} where $\mathbf{u}(t, \mathbf{x})$ denotes the solution vector of the PDE system, $\mathbf{u}_t$ is its derivative with respect to time $t$ in the period $[0, T]$, $\mathcal{N}[\cdot]$ is a nonlinear differential operator and $\mathbf{x}$ is the vector of spatial coordinates defined over the domain $\Omega$. Let us consider the residual of the partial differential equations $e(t, \mathbf{x})$ as the left-hand-side of \cref{eq:generalPDE}: \begin{equation} e := \mathbf{u}_t + \mathcal{N}[\mathbf{u}], \label{eq:f} \end{equation} while the MLP approximates $\mathbf{u} = f(t, \mathbf{x})$. The function $f$ is a composition of simple differentiable operations which maps the coordinates to the solution, \ie ${f: (t, \mathbf{x}) \rightarrow \mathbf{u}}$. Therefore, it is possible to obtain derivatives of the outputs with respect to the inputs simply using the chain rule on $f$: $\partial \mathbf{u}/ \partial \mathbf{x} = \mathcal{G}(\mathbf{u}, \mathbf{x})$ and $\partial \mathbf{u}/ \partial t = \mathcal{G}(\mathbf{u}, t)$ where $\mathcal{G}$ indicates the chain-rule operation. Therefore, $\mathbf{u}_t$ and $\mathcal{N}[\mathbf{u}]$ in \cref{eq:generalPDE} can be obtained by applying the chain rule for differentiating compositions of functions in the MLP using AD, thus yielding the residual of the governing equations. The aforementioned process for computation of the residuals through the implementation of AD is known as the residual network.~We use the open-source deep-learning framework TensorFlow \cite{tensorflow} to develop our PINN models. TensorFlow provides the ``\texttt{tf.GradientTape}" application programming interface (API) for AD by computing the gradient of a computation with respect to inputs. TensorFlow ``records" the computational operations executed inside the context of a \texttt{tf.GradientTape} onto a so-called ``tape", and then uses that tape to compute the gradients of a recorded computation using reverse-mode differentiation. \subsubsection{Loss function:} The training process of a PINN consists of both supervised and unsupervised parts. We refer to supervised learning for those samples for which the target solution is available and unsupervised learning for the samples for which the solution is unknown, while the residual of the governing equations is considered as the loss. Let us consider $N_s$ as the number of points for which we have the solution, \eg initial and boundary conditions or sparse measurements, and $N_e$ as the number of collocation points for which we calculate the unsupervised loss for training. The unsupervised loss can be defined as: \begin{equation} L_e = \dfrac{1}{N_e}\sum_{i = 1}^{N_e}\left| e(t^i_e, \mathbf{x}^i_e) \right|^2, \end{equation} and the supervised loss as: \begin{equation} L_s = \dfrac{1}{N_s}\sum_{i = 1}^{N_s}\left| \mathbf{{u}}_s^i - \mathbf{u}(t_s^i, \mathbf{x}_s^i) \right |^2, \end{equation} where the subscript $s$ denotes known values. Furthermore, we define the total loss as: \begin{equation} L = \alpha L_s + \beta L_e, \end{equation} where $\alpha$ and $\beta$ are the weighting coefficients.~The shared parameters between the neural network and the residual network can be learned in a physics-informed manner by minimizing the total loss $L$. \subsubsection{Training:} Following the work by \citeasnoun{Raissi2019}, we employ a full-batch training procedure to learn function $f$. We initiate the training using the Adam optimizer \cite{kingma2017adam} for 1,000 epochs with the learning rate of $1\times10^{-3}$ and then apply the limited-memory Broyden--Fletcher--Goldfarb--Shanno (L-BFGS) algorithm \cite{Liu1989} to obtain the solution. The optimization process of the L-BFGS algorithm is stopped automatically based on the increment tolerance. \section{Physics-informed super-resolution of flow fields in time and space} \label{sec:SR} We employ PINNs for super-resolution of flow-field data in time and space from only a limited set of low-resolution measurements containing noise and without having any high-resolution targets. The training data for supervised learning consists of only a few very low-resolution snapshots of the velocity components while we aim to obtain a continuous solution for velocity components and pressure. We consider three canonical test cases, \ie Burgers’ equation, two-dimensional vortex shedding behind a circular cylinder at $Re_D = 100$ \cite{Raissi2019} and a turbulent minimal channel at $Re_{\mathrm{cl}} = 5,000$ \cite{borrelli_predicting_2022} to show the applicability of PINNs for such super-resolution tasks in fluid mechanics. For all tests, we consider the weighting coefficients in the loss function to be equal to one. For Burgers’ equation, we utilized a neural network comprising 8 hidden layers with 20 neurons per hidden layer. For the cylinder wake and the minimal channel we used a neural network with 10 hidden layers, each containing 100 neurons. For all the models, the hyperbolic tangent is used as the activation function. To evaluate the performance of the PINNs in the super-resolution tasks, we define the relative Euclidean norm of errors for a particular component as: \begin{equation} \epsilon_V = \left< \left\| \tilde{V} - V \right\|^2 / \left\| V \right\|^2 \right>, \end{equation} where $\tilde{V}$ represents the PINN simulation results and $V$ denotes the reference data for a particular component of the solution, which can be either one of the velocity components $(u, v, w)$ or the pressure $(p)$.~Note that $\|\cdot\|$ is the Euclidean norm and $\left<\cdot\right>$ is the average in the time. \subsection{Synthetic low-resolution data with noise} In order to emulate possible measurement errors in an experiment, synthetic low-resolution data are generated from the reference velocity field by selecting a limited set of points in time and space. The low-resolution velocity field $\pmb{Q}_l$ is corrupted by an independent and identically-distributed (i.i.d) Gaussian noise as: \begin{equation} \hat{\pmb{Q}}_l = \pmb{Q}_l \cdot (\mathbf{I} + c\pmb{\epsilon}), \end{equation} where $\pmb{\epsilon} \sim \mathcal{N}(\mathbf{0}, \mathbf{I})$ represents the noise factor, $c \in [0, 1]$ indicates the level of the noise and and $\mathbf{I}$ is the identity matrix. \subsection{Burgers’ equation} For the first test case we consider the Burgers’ equation, which arises in various areas of applied mathematics, including fluid mechanics. This equation be obtained from the Navier--Stokes equations for the velocity field by excluding the pressure-gradient term. We consider a one-dimensional case with Dirichlet boundary conditions and sinusoidal initial condition as: \begin{equation} \begin{cases} \begin{aligned} &u_{t}+u u_{x}-(0.01 / \pi) u_{x x}=0, \quad x \in[-1,1], \quad t \in[0,0.99], \\ &u(0, x)=-\sin (\pi x), \\ &u(t,-1)=u(t, 1)=0. \end{aligned} \end{cases} \end{equation} We only take the data at the first time-step $t = 0$ and the last time-step $t = 0.99$ of the solution domain for supervised learning and our objective is to obtain a continuous solution in time. This can be seen as an extensive super-resolution task in time using only two snapshots of the data for training. Moreover, this is an ill-posed problem since we do not have the boundary conditions for the time-steps between $t = 0$ and $t = 0.99$. We consider $N_s = 512$ (256 for each time-step) and $N_e = 2,000$ randomly-generated collocation pints for the training. Results are reported in \cref{fig:burgers}. The red vertical lines in \cref{fig:burgers}(a) show the data used for supervised learning. It can be observed that the PINN model can accurately provide a continuous solution of the shock formation process, see \cref{fig:burgers}(a), with a relative Euclidean norm of errors of $\epsilon_u = 0.13\%$ .~\Cref{fig:burgers}(b) shows the supervised and unsupervised losses, $L_s$ and $L_e$ respectively, during the training. At the final epoch of training the values $L_s = 2.59\times10^{-7}$ and $L_e = 2.04\times10^{-6}$ are obtained. These results indicate the excellent performance of PINNs in these super-resolution tasks in time, a fact that motivates their application to such problems in fluid mechanics. \begin{figure}[h] \centering \vspace{10pt} \begin{overpic}[height=0.36\textwidth]{burgers_pinn.png} \end{overpic} \begin{overpic}[height=0.36\textwidth]{loss_burgers_pinn.png} \put (-110,75) {(a)} \put (0,75) {(b)} \end{overpic} \caption{Super-resolution in time using PINNs for the one-dimensional Burger's equation: (a) comparison of the solution obtained from PINNs with the reference data; continuous solution of the shock formation process (up) and the absolute error $\varepsilon = \left| u - \tilde{u} \right|$, where $u$ denotes the reference data and $\tilde{u}$ represents the PINN predictions (bottom). The red vertical lines indicates the data used for supervised learning. (b) Supervised and unsupervised losses, $L_s$ and $L_e$ respectively, during the training process. The green dashed line indicates $L_s$ and the blue line represents $L_e$.} \label{fig:burgers} \end{figure} \subsection{Two-dimensional vortex shedding behind a circular cylinder} For the second test case, we consider the super-resolution in time and space for the two-dimensional vortex shedding behind a circular cylinder at $Re_D = 100$. This example aims to highlight the ability of PINNs in the flow-field super-resolution tasks from very low-resolution measurements both in time and space. We consider the incompressible Navier--Stokes equations as: \begin{equation} \begin{aligned} &\frac{\partial \mathbf{u}}{\partial t}+(\mathbf{u} \cdot \nabla) \mathbf{u} =-\nabla p+\dfrac{1}{Re} \nabla^{2} \mathbf{u} \quad \text { in } \Omega, \\ &\nabla \cdot \mathbf{u} =0 \quad \text { in } \Omega, \end{aligned} \end{equation} where for $\mathbf{u}$ is the non-dimensional velocity vector, $t$ is the non-dimensional time and $p$ is the non-dimensional pressure. The reference data has a resolution of $(N_x, N_y, N_t) = (100, 50, 200)$ with a non-dimensional $\Delta t = 0.1$. We consider a time interval of almost one vortex-shedding cycle, \ie $t \in [0, 7]$. We perform downsampling with a factor of 10 in each spatial direction and only utilize there snapshots of low-resolution data at $t = 0, 3.5, 7$ for supervised learning.~\Cref{fig:cylinder_prob} depicts the problem set-up for this test case and the reference data used for training. The blue line shows the first temporal coefficient $a_1$ of the proper orthogonal decomposition (POD) for this test case. \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{cylinder_prob.png} \caption{A schematic view of the resolution of the training data used for the supervised learning for the two-dimensional vortex shedding behind a circular cylinder. Contours depict the streamwise velocity. The blue line shows the first temporal coefficient $a_1$ of the POD for this test case.} \label{fig:cylinder_prob} \end{figure} We utilize $N_s = 150$ points for supervised learning and consider $N_e = 2,000$ collocation points to compute the unsupervised loss. The PINN model contains 10 hidden layers with 100 neurons per hidden layer with the hyperbolic-tangent activation function. We assess the performance of PINNs in the reconstruction of the continuous solution from the low-resolution and noisy data. Noise levels of $c$ = 2.5\%, 5\% and 10\% are considered, and ~\cref{fig:cylinder_res} summarizes the results of our experiment for the noise level $c$ = 5\%.~\Cref{fig:cylinder_res}(a) illustrates the results obtained from the PINN model for the vorticity fields in the $z$ direction at $t = 1.8$ and $5.3$ against the reference data. The middle panel shows the noisy data. It should be noted that these two snapshots are not used for supervised learning and the noisy data are depicted only for comparison. An excellent agreement can be observed between the solution obtained from PINNs and the reference data. Moreover, it is of interest to assess the performance of PINNs in the reconstruction of the high-frequency modes during the cycle of vortex shedding from only three measurements in time. To this end, we project the solution predicted by the PINN model on the POD modes computed from 200 snapshots to obtain the temporal coefficients of the POD $a_i(t)$, where $i$ indicates the mode number.~\Cref{fig:cylinder_res}(b) shows the temporal coefficients of the POD for the 3rd, 5th and 7th modes obtained from the PINN solution in comparison with that of the reference data. It can be seen that a good reconstruction of the temporal dynamics can be obtained even for the high-frequency modes, indicating excellent performance of the PINN model in increasing the temporal resolution of the data and correcting the effect of experimental noise. \begin{figure}[h] \centering \begin{overpic}[width=0.8\textwidth]{cylinder_res_pinn.png} \put (3,46) {(a)} \put (63,46) {(b)} \end{overpic} \caption{Results obtained from the super-resolution in time and space for the cylinder test case using PINNs from a limited set of measurements contaminated with a noise level of $c$ = 5\%: (a) contours of vorticity in the $z$ direction at $t$ = 1.8 and 5.3. (b) Temporal coefficients of the POD for the 3rd, 5th and 7th modes obtained from the PINN solution in comparison with that of the reference data.} \label{fig:cylinder_res} \end{figure} Although increasing the noise level leads to the increase of the relative Euclidean norm of errors $\epsilon$, the PINN model is still able to provide very good solutions.~\Cref{tab:errors} presents $\epsilon$ for the velocity components and the pressure for different noise levels. Note that to evaluate the accuracy of the PINN solutions, we apply a shift to the PINN-simulation results to bring the means of the pressure for reference data and the PINN results to the same value. We observe that the error for the pressure is higher than that of the velocity components since it is not used for supervised learning.~\Cref{fig:cylinder_p} depicts the PINN-simulation results for the pressure at $t = 5.3$ for the clean test case. It can be observed that although the absolute error $\varepsilon$ in some regions is slightly higher, the overall patterns in the flow are reconstructed with very good accuracy. \begin{table}[h] \centering \caption{Relative Euclidean norm of errors for the two-dimensional vortex shedding behind a circular cylinder.} \vspace{9pt} \begin{tabular}{cccc} \hline \hline \vspace{5pt} Noise level & $\epsilon_{u}$ & $\epsilon_{v}$ & $\epsilon_{p}$ \\ \hline \rule{0pt}{3ex}clean & 2.34\% & 6.78\% & 10.90\% \\ 2.5\% & 4.97\% & 9.97\% & 21.42\% \\ 5\% & 7.01\% & 11.98\% & 28.53\% \\ 10\% & 12.18\% & 28.77\% & 58.88\% \\ \hline \hline \end{tabular} \label{tab:errors} \end{table} \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{cylinder_res_p.png} \caption{PINN-simulation results for the pressure at $t = 5.3$ for the clean test case (left), reference data (middle) and the absolute error $\varepsilon = \left| p - \tilde{p} \right|$ (right), where $p$ denotes the reference data and $\tilde{p}$ represents the PINN predictions.} \label{fig:cylinder_p} \end{figure} \subsection{Minimal turbulent channel} We employ a dataset~\cite{borrelli_predicting_2022} of the minimal turbulent channel at $Re_{\mathrm{cl}} = 5,000$ generated following the parameters described in the work by~\citeasnoun{jimenez_moin}. This database was obtained through direct numerical simulation as discussed by \citeasnoun{borrelli_predicting_2022}. The box size was set to $x_l = 0.6 \pi h$, $y_l = 2h$ and $z_l = 0.18 \pi h$, where $h$ denotes the half-height of the channel. The resolution is $(N_x, N_y, N_x) = (32, 129, 16)$, representing the number of grid points in the streamwise ($x$), wall-normal ($y$) and spanwise ($z$) directions, respectively. We take a time interval of $t = [0, 4]$ and a domain size of $x_d = 0.6 \pi h$, $y_d = h$ and $z_d = 0.01125 \pi h$ for our super-resolution task. We assess the performance of PINNs in the reconstruction of a continuous solution from a limited set of measurements with different resolutions in time and space and the presence of noise. For this test case, we employ a PINN model with 10 hidden layers, each containing 100 neurons with hyperbolic tangent as the activation function and the three-dimensional incompressible Navier--Stokes equations as the governing equations. \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{channel_training_data.png} \caption{Training dataset t3--s16 for the supervised learning of the minimal turbulent channel. Colors represent the instantaneous wall-normal velocity $v$.} \label{fig:channel_data} \end{figure} In the following, we test the performance of PINNs in the reconstruction of the continuous solution from a set of measurements with different resolutions in time and space and the presence of noise. For time, we consider two temporal resolutions: $\Delta t = 1.0$ and 2.0 corresponding to, respectively, taking only five and three low-resolution snapshots for supervised learning. And, we utilize two different resolutions in space, \ie $(n_x, n_y, n_z) = (8, 8, 2)$ and $(16, 16, 2)$ where $n_x, n_y$ and $n_z$ represent the number of selected points in the $x$, $y$, and $z$ directions, respectively. The spacing between the selected points in the $x$ and $z$ directions is constant, but the spacing in the $y$ direction $\delta y$ is not uniform: the closer to the wall the lower $\delta y$. We represent different datasets with different resolutions as: t\#--s\#, which indicate the number of selected points in time and space. The trained PINN model with each dataset is represented as PINN--t\#--s\#.~\Cref{fig:channel_data} shows the instantaneous wall-normal velocity $v$ for the dataset t3--s16, which has a low resolution in time and a moderate resolution in space. \begin{table}[h] \centering \caption{Relative Euclidean norm of errors for the minimal turbulent channel.} \vspace{9pt} \begin{tabular}{ccccc} \hline \hline \vspace{5pt} Test & Noise level & $\epsilon_{u}$ & $\epsilon_{v}$ & $\epsilon_{w}$ \\ \hline \rule{0pt}{3ex}PINN--t5--s16 & clean & 0.53\% & 12.54\% & 9.89\% \\ PINN--t3--s16 & clean & 0.81\% & 17.57\% & 20.75\% \\ \rule{0pt}{3ex}PINN--t5--s8 & clean & 1.87\% & 22.86\% & 44.15\% \\ PINN--t3--s8 & clean & 2.64\% & 46.72\% & 56.60\% \\ \rule{0pt}{3ex}PINN--t5--s16--c5.0 & 5.0\% & 4.61\% & 21.78\% & 19.19\% \\ PINN--t3--s16--c5.0 & 5.0\% & 5.40\% & 36.74\% & 35.11\% \\ \hline \hline \end{tabular} \label{tab:errors_channel} \end{table} \Cref{tab:errors_channel} summarizes the results of our experiments for the minimal turbulent channel using the training data of different resolutions and for different noise levels. Our results show that excellent simulation results can be obtained from the PINN model by using the t5--s16 dataset for supervised learning, leading to $\epsilon_u$ = 0.53\%, $\epsilon_v$ = 12.54\% and $\epsilon_w$ = 9.89\%. Very good results can also be achieved using the dataset t3--s16, which leads to $\epsilon_u$ = 0.81\%, $\epsilon_v$ = 17.57\% and $\epsilon_w$ = 20.75\%. Our results show the excellent performance of PINNs for super-resolution of turbulent flows both in time and space from only a limited set of measurements and without having any high-resolution target data. This is a very relevant result in the context of data augmentation for experiments in fluid mechanics. \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{channel_signals.png} \caption{The evolution of the velocity components in time for a point at $(x, y) = (0.0, 0.36)$ (marked by the red square) obtained from the PINN--t3--s16 and PINN--t3--s8 models in comparison with the reference data. Contour represents the instantaneous spanwise velocity at $t$ = 0.0.} \label{fig:channel_sigs} \end{figure} Further reduction of the spatial resolution leads to a considerable increase of the error, where the model PINN--t3--s8 provides simulation results with $\epsilon_u$ = 2.64\%, $\epsilon_v$ = 46.72\% and $\epsilon_w$ = 56.60\%. Note however that the streamwise velocity component still exhibits excellent results; this may be associated with the fact that the main dynamics are in this direction, and therefore the PINN approach is able to effectively capture the relevant physics in this component. We compare the performance of the PINN--t3--s16 model with that of the PINN--t3--s8 model: \Cref{fig:channel_sigs} illustrates the evolution of the velocity components in time for a point at $(x, y) = (0.0, 0.36)$, using both of the aforementioned models. The red square shows the location of the point on the contour of the streamwise velocity $u$. For these cases, we only use the data at $t$ = 0.0, 2.0 and 4.0 for the supervised learning. It can be seen that although the training data for supervised learning is very sparse, the PINN--t3--s16 is able to provide a very good reconstruction of the velocity components in time. However, the results obtained from the PINN--t3--s8 model are not as accurate. \Cref{fig:channel_r1,fig:channel_r2} depict contours of the velocity components $(u, v, w)$ and the spanwise vorticity $(\omega_z)$ obtained from the PINN--t3--s16 and the PINN--t3--s8 models compared with the reference data at $t$ = 1.0 and 3.0, respectively. Our results show that the PINN--t3--s16 can reconstruct the continuous solution with very good accuracy. Moreover, it can be seen that the PINN--t3--s8 model is also able to provide valuable insight into the dynamics of the larger turbulent scales while the accuracy of the reconstructions is lower. The results also indicate that the relative Euclidean errors of the wall-normal and spanwise velocities are much higher than that of the streamwise velocity. This is caused by the larger amplitude of the streamwise velocity than the other two velocity components. A proper normalization may lead to a more balanced accuracy. \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{channel_res_pinn_1.png} \caption{Contours of the instantaneous velocity components $(u, v, w)$ and the spanwise vorticity $(\omega_z)$ obtained from the PINN--t3--s16 and the PINN--t3--s8 models compared with the reference data at $t$ = 1.0.} \label{fig:channel_r1} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{channel_res_pinn_2.png} \caption{Contours of the instantaneous velocity components $(u, v, w)$ and the spanwise vorticity $(\omega_z)$ obtained from the PINN--t3--s16 and the PINN--t3--s8 models compared with the reference data at $t$ = 3.0.} \label{fig:channel_r2} \end{figure} The effect of noise on the accuracy of the reconstructions is also assessed and the results are reported in \cref{tab:errors_channel}. We observe that very good results can be achieved, even in the presence of 5\% noise, from the PINN--t5--s16 and PINN--t3--s16 models. For the PINN--t5--s16 model trained on the noisy data, the highest error is obtained for the wall-normal velocity and it is equal to $\epsilon_w$ = 21.78\%, while the lowest error is again obtained for the streamwise velocity, and it is equal to $\epsilon_u$ = 4.61\%. \section{Summary and conclusions} \label{sec:conclusions} Applications of physics-informed deep learning have been demonstrated for data augmentation in experimental fluid mechanics, where the measurement data are generally imperfect, noisy and have low resolution. We employ physics-informed neural networks (PINNs) for super-resolution of flow-field data both in time and space from a limited set of noisy measurements without having any high-resolution targets. Our objective is to solve the governing partial differential equations for an ill-posed problem, \ie unknown initial and boundary conditions, only having a few low-resolution and noisy measurements. To this end, we use a neural network to obtain a continuous solution of the problem, providing a physically-consistent prediction at any point in the solution domain. In particular, we learn a functional mapping parameterized by the neural network from spatial ($x$) and temporal ($t$) coordinates to the flow parameters, \ie velocity components and the pressure. We first demonstrate the applicability of PINNs to the super-resolution tasks in time using the canonical case of Burgers’ equation. We only take the data at the first and the last time-steps of the solution domain for supervised learning. This can be seen as an extensive super-resolution task in time using only two snapshots of the data for training. Our results show that the PINN model can accurately provide a continuous solution of the shock formation process with a relative Euclidean norm of errors of $\epsilon_u = 0.13\%$ . These results show the excellent performance of PINNs in such tasks and motivate their application to such problems in fluid mechanics. Next, we perform the super-resolution in time and space for the two-dimensional vortex shedding behind a circular cylinder at $Re_D = 100$ to highlight the ability of PINNs in flow-field super-resolution tasks from very low resolution and noisy measurements. We consider a time interval of almost one vortex-shedding cycle and only utilize there snapshots of low-resolution and noisy data for supervised learning. Our results indicate that a very good reconstruction of the temporal dynamics can be obtained even for the high-frequency modes, showing excellent performance of the PINN model in increasing the temporal resolution of the data and correcting the effect of experimental noise. Finally, we apply PINNs for the reconstruction of a continuous solution for a minimal turbulent channel at $Re_{\mathrm{cl}} = 5,000$ from a limited set of measurements with different resolutions in time and space and asses the robustness of the model against noise. Results indicate that excellent predictions can be obtained from the PINN model by using only five low-resolution snapshots of the flow for supervised learning, leading to $\epsilon_u$ = 0.53\%, $\epsilon_v$ = 12.54\% and $\epsilon_w$ = 9.89\%. Very good results can also be achieved using only three snapshots, which leads to $\epsilon_u$ = 0.81\%, $\epsilon_v$ = 17.57\% and $\epsilon_w$ = 20.75\%. We also show that the PINN model is robust against noise. Our results show an excellent applicability of PINNs in the context of physics-informed data augmentation for experiments in fluid mechanics. \section*{Acknowledgments} RV acknowledges the financial support by the G\"oran Gustafsson foundation. Part of the analysis was carried out using computational resources provided by the Swedish National Infrastructure for Computing (SNIC). \section*{References} \bibliographystyle{jphysicsB}
71468d5b647de923cbbdbe1ec435f238679be6aa
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction}\label{intro} Speech sound disorder (SSD) is a common type of communication disorders affecting 2.5\% - 13.8\% of children aged below 8 \cite{kim2017prevalence,eadie2015speech,karbasi2011prevalence, wren2016prevalence}. When growing up, children are expected to master the language's speech sounds in stages and be able to self-correct the pronunciation mistakes. A significant portion of children may encounter persistent difficulties in correctly producing certain speech sounds after the expected stage of acquisition. The symptom is one diagnostic attribute of SSD in clinical speech therapy. Untreated children with SSD are prone to unsatisfactory social and educational outcomes \cite{daniel2017children, hitchcock2015social}. Early diagnosis and intervention are necessary for effective treatment and rehabilitation. At present, clinical diagnosis of SSD is carried out by qualified speech and language pathologists (SLP). The evaluation of the speech sound inventories of children reveals the presence of SSD. To timely identify children with SSD and refer to SLP for intervention, automated detection of speech disorder is considered a highly desirable approach for assessment and/or screening a large population of children. Detection of SSD is commonly formulated as a task of distinguishing disordered speech sounds from typical ones at phoneme-level, based on acoustic speech signals. Siamese neural networks were adopted to contrast hypothetically disordered consonant segments with typical ones \cite{wang19n_interspeech, ng20b_interspeech}. Posterior features were derived from automatic speech recognition systems to facilitate mispronunciation detection in disordered child speech \cite{hair2021assessing, shahin2019anomaly}. Considering that consonant error could alter the acoustical characteristics of its neighbouring vowel, our recent work proposed to detect consonant errors from consonant-vowel speech segments \cite{ng21_interspeech}. The phoneme-level error detection requires automatic time alignment of the target phoneme segments. Time alignment could be inaccurate for disordered speech recorded in naturalistic communication scenarios. Inaccurate segments would affect the efficacy of model training and the detection performance. Taking a different perspective, detection of SSD can also be formulated as a problem of measuring the overall goodness of the child's speech production, without going into specific parts of a long utterance. The reliability concern of segment boundaries is thus bypassed. Paralinguistic features defined in the extended Geneva Minimalistic Acoustic Parameter Set (eGeMAPS) represent the overall acoustic characteristics of a speech utterance using statistical functionals \cite{eyben2015geneva}. They were successfully applied to detect atypical speech, including disordered speech with phonological and articulation problems \cite{shahin2019automatic}. The approach of speaker verification (SV) was also investigated in classifying disordered speech \cite{laaridh17_interspeech, moro2020using, laaridh18b_interspeech, quintas20_interspeech}. In \cite{kothalkar2018automatic, kothalkar2018fusing}, SSD subjects were identified by a text-dependent SV system trained on single-word utterances. The word-level detection results were fused to give a subject-level score as an overall assessment of word articulation. Spectral features, e.g. Mel-frequency cepstrum coefficients (MFCCs), have been routinely used to extract speaker representations. Posterior features derived from deep neural network (DNN) classifiers are closely related to the linguistic properties of speech \cite{behravan2015vector, d2014extended}. They particularly characterize the articulation aspect of speech sounds. Compared to conventional spectral features, posteriors are believed to convey more pertinent information that can help detect atypical speech sounds \cite{wang19n_interspeech, shahin2019anomaly, hair2021assessing}. We expect that using speaker representations extracted from posterior features would effectively differntiate disordered children from typically developing (TD) ones. In the present study, we investigate the possibility of transforming the word articulation test for SSD detection into a holistic assessment of multiple word utterances. Prescribed target words are grouped together, and the subject-level judgement is given based on the overall discrepancy between disordered speech and typical speech. The detection does not require precisely locating, analysing and classifying individual phones/words. Towards capturing the coarse-grained speech characteristics of long utterances, speaker representations such as i-vectors and x-vectors have been investigated \cite{dehak2010front,snyder17_interspeech}. Using word-level utterances ensures that every single error in the pronunciation can be covered, and speech duration would not be too short for feature extraction \cite{mclaren2010experiments}. In view of the limited amount of child speech data, we need to determine the type of speaker representation that can perform well in the low-resource scenario. We also investigate the use of knowledge-driven posteriors in the extraction of speaker representations. Grouping the phonemes based on speech attributes is adopted in the training of posterior extractors, as speech attributes were shown to provide diagnostic information about SSD symptoms \cite{wang19n_interspeech, shahin2019anomaly}. We will compare the proposed speaker representations for subject-level SSD detection with phone-level and word-level approaches. \section{Child Speech Database} This research is focused on SSD in Cantonese-speaking pre-school children. Cantonese is a major Chinese dialect widely spoken by millions of people in Hong Kong, Macau, Guangdong Provinces of Mainland China, and many overseas Chinese communities. It is a monosyllabic and tonal language. Each Chinese character is pronounced as a single syllable carrying a lexical tone. There are $19$ initial consonants, $11$ vowels, $10$ diphthongs, $6$ final consonants and $6$ lexical tones \cite{zee1999acoustical,bauer2011modern}. \begin{table}[t] \caption{Speech attributes of Cantonese.} \label{attribute_map} \centering \resizebox{0.90\linewidth}{!}{% \begin{tabular}{|c|c|c|} \hline \rowcolor[HTML]{EFEFEF} \textbf{Category} & \textbf{Feature} & \textbf{Phoneme} \\ \hline & Plosive & p p\textsuperscript{h} t t\textsuperscript{h} k k\textsuperscript{h} k\textsuperscript{w} k\textsuperscript{wh} \\ \cline{2-3} & Nasal & \textipa{m n N} \\ \cline{2-3} & Affricate & \textipa{ts ts\textsuperscript{h}} \\ \cline{2-3} & Fricative & \textipa{s f h} \\ \cline{2-3} & Glide & \textipa{j w} \\ \cline{2-3} \multirow{-6}{*}{\textbf{Manner}} & Liquid & \textipa{l} \\ \hline & Aspirated & p\textsuperscript{h} t\textsuperscript{h} k\textsuperscript{h} k\textsuperscript{wh} ts\textsuperscript{h} \\ \cline{2-3} \multirow{-2}{*}{\textbf{Aspiration}} & Unaspirated & \textipa{p t k k\textsuperscript{w} ts} \\ \hline & Alveolar & \textipa{t t\textsuperscript{h} ts} \textipa{ts\textsuperscript{h} s j} \\ \cline{2-3} & Lateral & \textipa{l} \\ \cline{2-3} & Labial & \textipa{p p\textsuperscript{h} w m} \\ \cline{2-3} & Velar & \textipa{k k\textsuperscript{h} N} \\ \cline{2-3} & Labio-Velar & \textipa{k\textsuperscript{w} k\textsuperscript{wh}} \\ \cline{2-3} & Labio-dental & \textipa{f} \\ \cline{2-3} \multirow{-7}{*}{\textbf{Place}} & Vocal & \textipa{h} \\ \hline \hline \textbf{Vowel/Semi-vowel} && \textipa{a: i: E: e} \textipa{œ: œ O: o u: y:} \textipa{5 I 8 U } \\ \hline \end{tabular}% } \end{table} Experiments on subject-level SSD detection are carried out with a large-scale child speech database named CUCHILD \cite{ng20_interspeech}. The database contains speech data from $1,986$ kindergarten children aged $3$ - $6$ in Hong Kong. All speakers use Cantonese as their first language. The speech materials consist of $130$ Cantonese words of $1$ to $4$ syllables in length. These words cover all Cantonese consonants and vowels. Each subject in CUCHILD was formally assessed with the Hong Kong Cantonese Articulation Test (HKCAT) \cite{cheung2006hong}. About $230$ children in the database were found to have SSD. Most of these children committed speech sound errors more frequently in the initials consonants than vowels. We select speech data from $415$ subjects in CUCHILD, including $265$ typically developing (TD) children and $150$ disordered. 48\% of the TD and 61\% of the disordered children are aged 3-4. Speech sound errors made by the disordered speakers are carefully annotated by four student clinicians from speech therapy programmes. Given the heterogeneous acoustic environment of speech recording, for some subjects, a few spoken word items could not be located or were contaminated by background noise. $125\pm14$ word utterances are available for each speaker. For each disordered speakers, $45\pm25$ word utterances are annotated as having speech sound errors. 5-fold cross-validation experiments are carried out. 80\% of the TD and disordered speakers are used in model training, i.e. about $5.5$ hours of training data in each fold. Speech data from the training speakers does not appear in the test set. \section{Proposed System and Feature Design}\label{proposed_features} \subsection{System Architecture} In the standardized assessment of SSD for young children, a set of designated test words are used for all subjects. The test words are selected purposely based on linguistic and clinical knowledge to cover the target speech sounds (phonemes) to be evaluated \cite{cheung2006hong, goldman2015}. Our proposed system for subject-level SSD detection is shown as in Figure \ref{fig:system_design}. For each child subject, speech segments that contain the test words are concatenated to construct a long utterance of multiple words. Front-end feature processing involves the computation of filter-bank features, MFCCs or eGeMAPS. I-vector or x-vector is derived from the MFCCs as a speaker-level feature representation. The i-vector can also be obtained from the posterior features generated by a DNN. A support vector machine (SVM) is trained on the i-vector, x-vector or eGeMAPS to determine if the subject is TD or disordered. \begin{figure}[t!] \setlength\belowcaptionskip{-0.8\baselineskip} \centering \includegraphics[width=0.96\linewidth]{IS2022_Proposed_Approach.png} \caption{Subject-level SSD detection system.} \label{fig:system_design} \end{figure} \subsection{I-vector and x-vector} I-vector is a fixed-dimensional representation of variable-length utterance from a speaker. Consider an utterance $i$. It is modeled by a super-vector, defined as $\bm{\mu}_{i} = \bm{m} + \bm{T}\bm{w}_{i}$, where $\bm{m}$ is the mean vector obtained from Gaussian Mixture Model - Universal Background Model (GMM-UBM). The GMM-UBM is the speaker-independent component trained on all speakers. $\bm{T}$ and $\bm{w_{i}}$ are the speaker-dependent components. $\bm{T}$ is the total variability matrix and $\bm{w_{i}}$ is the latent factor, known as the i-vector. Training of i-vector extractor is implemented by the expectation maximization (EM) algorithm. x-vector is extracted from a DNN model \cite{snyder17_interspeech}. A time-delay neural network (TDNN) architecture is adopted and trained with a cross-entropy objective function. Training of the TDNN requires splitting an utterance into segments. x-vectors of the segments are computed by aggregating the hidden representations of the TDNN via mean and variance pooling. They are averaged to derive the subject-level x-vectors. I-vector and x-vector were applied to detecting speech-related diseases, e.g. dysarthria \cite{laaridh17_interspeech}, Parkinson's disease \cite{moro2020using}, and oral cancer \cite{laaridh18b_interspeech, quintas20_interspeech}. It was common to train the extractors using out-of-domain corpus, e.g. from healthy adult speakers. In the present study, apart from using out-of-domain data, we attempt to use in-domain child speech data, which incorporates disordered speech in training. \subsection{Posterior feature for i-vector extraction} Consonant substitution is one of the major types of speech sound errors in child speech. The errors are usually described as specific categories of substitution patterns. For example, the Cantonese initial consonant /\textipa{t}/ being substituted by /\textipa{k}/ is known as the ``backing'' error. /\textipa{ts\textsuperscript{h}}/ substituted by /\textipa{s}/ is described as a ``de-affrication'' error. These errors correspond to the change of speech attributes, i.e., the manner and place of articulation, and/or the aspiration status. In the example of /\textipa{t}/\textrightarrow/\textipa{k}/, the place of articulation shifts from bilabial to alveolar, while the example of /\textipa{ts\textsuperscript{h}}/\textrightarrow/\textipa{s}/ is due to change in the manner of articulation from affricate to fricative. The grouping of phonemes based on speech attributes is listed in Table \ref{attribute_map}. The Cantonese phonemes are represented in the international phonetic alphabet (IPA) symbols. Posterior features derived from a DNN based speech attribute/phone classifier provide information related to the contrast and similarity between phonemes. The classifier adopts the architecture of bi-directional gated recurrent unit (Bi-GRU). The inputs to the Bi-GRUs are filter-bank features. Posteriors are extracted from the Bi-GRU output at each time frame using a fully connected layer. The posteriors are transformed into log-posterior ratio (LPR), which is defined as \begin{equation} \label{LPR} \begin{split} \text{LPR}_{i} = \log (\dfrac{p_{i}}{1-p_{i}}), \end{split} \end{equation} where $i=1,2,...,N$, with $N$ being the total number of phone/articulatory classes. $p_{i}$ represents the posterior probability of the $i$-th class \cite{diez2014projection}. Subsequently, the LPRs are used for the i-vector modeling. \subsection{Paralinguistic features} The eGeMAPS is a minimal set of paralinguistic parameters measured on speech signals \cite{eyben2015geneva}. A collection of low-level descriptors (LLDs) are computed to characterize the speech signal's frequency, energy, and spectral aspects at frame-level. The LLDs include acoustic measures such as pitch, formant frequency, MFCC, shimmer, jitter and spectral energy, etc. An 88-dimensional feature vector is derived by applying statistical functionals to the LLDs. Extraction of eGeMAPS features is implemented by the OpenSmile toolkit \cite{eyben2010opensmile}. \section{Fusing Phone/Word-level Results} Conventionally, SLPs observe the child's speech sound errors in specific parts of the test words. The results are recapitulated for diagnosis of the child. Our proposed approach based on speaker-level representation is compared with methods in which word-level or phone-level error detection is done first on individual test words and subsequently combined to obtain the subject-level decision \cite{ng21_interspeech, shahin2019automatic, kothalkar2018automatic}. Phone-level detection is implemented based on our previous work in \cite{ng21_interspeech}. A DNN model is trained on the classification task to extract fixed-dimension embeddings of consonant-vowel segments. For detection, each test embedding $\boldsymbol{x_{test}}$ is compared with the reference embeddings $\boldsymbol{x_{ref}}$ from TD speakers in a pairwise manner. Pairs of embeddings from TD speech are generated to train a logistic regression (LR) classifier based on the similarities given by $||\boldsymbol{x_{test}}-\boldsymbol{x_{ref}||_{1}}$. The classification output tells whether the consonant-vowel segments in the test-reference pair are different. For each speaker, the accuracy score of detecting each initial consonant is stacked to derive a speaker-level representation that describes the child's performance on the articulation test. A SVM is trained on the representations to classify the test subject as TD or disordered. For word-level detection, i-vector, x-vector, or eGeMAPS can be extracted from single-word utterances. These representations are similar to the speaker-level representations introduced in Section \ref{proposed_features}, except that one representation would be obtained from each test word. Training labels of word-level representations are inherited from the speaker-level diagnostic labels, i.e. TD or SSD. An LR classifier is trained on the word-level representations. The majority of word-level classification results determines the subject-level result. \section{Experimental Set-up} \subsection{I-vector and x-vector extraction} The i-vector and x-vector systems are implemented with the Kaldi toolkit \cite{povey2011kaldi}. Four i-vector systems are evaluated in our experiments. Training of the first system follows the approach in \cite{kothalkar2018automatic} using MFCCs and single-word utterances. The other three systems are trained on long utterances of multiple words for extracting speaker-level representation. The input features are MFCCs, speech attribute LPR and phone LPR, respectively. The i-vector systems use 256 mixture components, and the dimension of i-vectors is 100. Three different x-vector systems are trained and compared with the i-vector systems. The network architecture in \cite{snyder17_interspeech} is used with that the size of hidden layers reduced by half. The generated x-vector has a dimension of $256$. The first x-vector system is built using an out-of-domain corpus called CUSENT, which contains about $20$ hours of Cantonese speech from $76$ adults speakers \cite{lee2002spoken}. The network is trained with speaker labels. The other two x-vector systems are trained with child speech, using long utterances of multiple words, and single-word utterances, respectively. When single-word utterances are used, discriminative training of x-vector extractors is carried out with the speaker labels. When utterances of multiple words are used, diagnostic labels (SSD or TD) are used to capture the difference between different TD and disordered speakers. \subsection{Posterior and embedding extractors} The phone-level or speech-attribute posterior extractors and the consonant-vowel embedding extractors all use the same neural network model with 3 layers of Bi-GRUs. The input acoustic features are 80-dimensional filter-bank features extracted every 0.01 second, and mean and variance normalised. Training speech data consist of consonant-vowels segments extracted obtained by forced alignment. The embedding and posterior extractors are trained as a softmax-based multi-class classification task with cross-entropy objective functions. The number of classification targets for phone and consonant-vowel units is $33$ and $173$, respectively. Multi-task training is carried out on 16 speech attributes for speech attribute posterior extractors. The Adam optimizer is applied with a learning rate of $0.0001$ for the posterior extractors and $0.001$ for the embedding extractors \cite{KingmaB14}. The posterior extractors are built using the Phonet toolkit \cite{vasquez2019phonet} toolkit. The consonant-vowel embedding extractors are implemented by PyTorch \cite{paszke2019pytorch}. \subsection{Back-end classifier for SSD detection} SVM and LR classifiers for phone-, word- and subject-level detection are trained on speaker-level representations or paralinguistic features using sklearn \cite{pedregosa2011scikit}. We assign positive label `1' to the representations of disordered speakers and negative label `0' to the TD ones. The SVM uses a linear kernel. The regularization parameter of SVM and LR is $1.0$. \begin{table}[t!] \centering \caption{Classification performance of embedding and posterior extractors.} \resizebox{0.90\linewidth}{!}{ \begin{tabular}{|c|c|c|} \hline \textbf{Extractor} & \textbf{Metric} & \textbf{Performance} \\ \hline Consonant-vowel & \multirow{2}{*}{Accuracy} & 88.0 (0.9) \\ \cline{1-1}\cline{3-3} Phone & & 70.8 (1.7) \\ \hline \multirow{2}{*}{Speech attribute} & Max. UAR (Vocal) & 95.4 (1.0) \\ \cline{2-3} & Min. UAR (Velar) & 83.1 (0.6) \\ \hline \end{tabular} } \label{extractor_performance} \end{table} \begin{table}[t!] \centering \caption{Performance of subject-level SSD detection using the proposed approach.} \resizebox{\linewidth}{!}{ \begin{tabular}{|c|c|c|c|c|} \hline \multirow{2}{*}{\textbf{Method}} & \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}\textbf{Dim.}\\\textbf{Reduction}\end{tabular}} & \textbf{\textbf{Classifier}} & \multirow{2}{*}{\textbf{UAR}} & \multirow{2}{*}{\textbf{Macro F1}} \\ \cline{3-3} & & Subject & & \\ \hline eGeMAPs & \multirow{3}{*}{-} & \multirow{3}{*}{SVM} & 65.1 (5.3) & 63.9 (5.1) \\ \cline{1-1}\cline{4-5} x-vector~ & & & 65.7 (6.2) & 65.2 (6.1) \\ \cline{1-1}\cline{4-5} \begin{tabular}[c]{@{}c@{}}x-vector\textsubscript{(CUSENT)}\end{tabular} & & & 68.2 (5.9) & 67.1 (7.0) \\ \hline\hline \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}i-vector\textsubscript{(CUSENT)}\end{tabular}} & - & \multirow{8}{*}{SVM} & 69.9 (3.6) & 68.6 (4.0) \\ \cline{2-2}\cline{4-5} & LDA & & 72.0 (5.8) & 71.3 (5.3) \\ \cline{1-2}\cline{4-5} \multirow{2}{*}{i-vector} & - & & 71.7 (6.3) & 71.7 (6.3) \\ \cline{2-2}\cline{4-5} & LDA & & 72.5 (7.3) & 72.4 (7.7) \\ \cline{1-2}\cline{4-5} \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}i-vector\\~(\it{phone LPR})~\end{tabular}} & - & & 74.5 (7.9) & 73.8 (6.5) \\ \cline{2-2}\cline{4-5} & LDA & & 76.2 (6.5) & 76.0 (6.6) \\ \cline{1-2}\cline{4-5} \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}i-vector \\(\it{speech attribute LPR})~\end{tabular}} & - & & 76.9 (5.3) & 76.5 (5.6) \\ \cline{2-2}\cline{4-5} & LDA & & \textbf{78.2 (4.6)} & \textbf{78.0 (4.9)} \\ \hline \end{tabular} } \label{subject_level} \end{table} \section{Results and Discussion} The classification performance of the embedding and posterior extractors is evaluated on the speech data from TD speakers in each cross-validation fold. Results are reported in Table \ref{extractor_performance} in terms of classification accuracy and unweighted average recall (UAR). Overall, the extractors produce a fairly satisfactory performance in classifying the consonant-vowels, phones and speech attributes. The embeddings or posterior features extracted from child speech utterances are deemed applicable and effective to subject-level SSD detection. The 5-fold cross-validation results of subject-level SSD detection using the proposed approach are given in Table \ref{subject_level} in terms of UAR and the macro F1 score. With long utterances of multiple words, the i-vector approach surpasses x-vector and eGeMAPS. The i-vector approach remains competitive in the low-resource scenario. Training i-vector and x-vector extractors on out-of-domain adult speech data lead to comparable performance, where i-vector slightly outperforms x-vector. In-domain child speech is preferable in the training of the i-vector system. Using eGeMAPS is less competitive in the detection. Given SSD is mainly manifested in phonological errors, the paralinguistic information captured by eGeMAPS may be less informative about the contrast between TD and disordered speech. Using speech attribute LPR in the i-vector extraction achieves the best detection performance, followed by phone LPR. The speech attribute LPR describes multiple changes in articulation and aspiration status. It contains richer diagnostic information than the phone LPR. Reducing the dimensionality of i-vector with linear discriminant analysis (LDA) further improves the detection and reduces the mis-classification of disordered speakers, giving a UAR of $78.2$\% and a macro F1 score of $78.0$\%. The results of the best performed i-vector system are analysed using a two-tailed z-test. A significant threshold of 0.05 is assumed. The mis-classified subjects are found to be significantly younger than correctly classified subjects. Given word-level ground-truth annotations, the average number of errors in the false negative subjects is significantly less than in the true positive subjects. From the clinical perspective, TD children of younger age, i.e. about 3-4, are allowed to make more mistakes than older children in the articulation test. The development of their phonemic inventories and oral motor skills has just begun. The ambiguity caused by erroneous pronunciations in young TD and disordered subjects makes SSD detection more challenging. \begin{table}[t!] \centering \caption{Performance of subject-level SSD detection based on aggregating word-/phone-level detection results.} \resizebox{\linewidth}{!}{ \begin{tabular}{|c|c|c|c|c|} \hline \multirow{2}{*}{\textbf{Method}} & \multicolumn{2}{c|}{\textbf{Classifier}} & \multirow{2}{*}{\textbf{UAR}} & \multirow{2}{*}{\textbf{Macro F1}} \\ \cline{2-3} & Segment & Subject & & \\ \hline eGeMAPs & \multirow{3}{*}{LR} & \multirow{3}{*}{Majority} & 59.4 (8.0) & 58.5 (9.5) \\ \cline{1-1}\cline{4-5} x-vector & & & 63.7 (5.6) & 63.7 (6.0) \\ \cline{1-1}\cline{4-5} i-vector & & & 65.6 (1.9) & 65.9 (2.3) \\ \hline\hline \begin{tabular}[c]{@{}c@{}}Consonant-vowel \\embedding\end{tabular} & LR & SVM & \textbf{\textbf{75.6 (4.3)}} & \textbf{\textbf{72.6 (3.9)}} \\ \hline \end{tabular} } \label{word-level} \end{table} As a comparison to the proposed detection approach, results of subject-level SSD detection based on aggregating phone-level and word-level detection results are given in Table \ref{word-level}. Aggregating phone-level detection results from consonant-vowel embeddings deliver competitive performance. The detection performance with a UAR of $75.6$\% and a macro F1 score of $72.6$\% is the best among detection methods based on word-level and phone-level results. The performance is also on par with the i-vector approach using MFCCs and utterances of multiple words. Information about context-dependency in consonant errors is effective for detection. For SSD detection based on word-level results, the i-vector approach delivers a satisfactory performance with $65.6$\% in UAR and $65.9$\% in macro F1 score. $62\pm18$\% of the word utterances are classified as correct pronunciations in the disordered speakers. $18.4\pm14.6$\% of the word utterances are classified as erroneous in TD speakers. The results echo that disordered children can correctly produce a significant portion of the test words. TD children are also allowed to make age-appropriate errors. In the training of classifiers for word-level SSD detection, it would be sub-optimal to assume all word utterances from a speaker are errorless or related to SSD symptoms. \section{Conclusion}\label{conclusions} In this study, we demonstrate the use of knowledge-driven posterior-based features in subject-level SSD detection based on speaker representations. It has been shown that using fixed-dimensional speaker representation extracted from an aggregation of test words is a feasible and effective approach to detecting SSD in child speech. The proposed approach surpasses traditional methods that combine fine-grained classification results on individual target phones/words. In the low-resource scenario, the i-vector approach outperforms the x-vector one and paralinguistic features. For disorder symptoms that are mainly manifested in phonological errors, extraction of i-vector using posterior-based features can improve detection performance over conventional acoustic features. Our future work will focus on using self-supervised representation learning and neural confidence measure for subject-level SSD detection. \bibliographystyle{IEEEtran}
a9401b18e846b7f83118f690ed53ca81424e9c30
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} The explosion of smart devices and the ever-growing sensing and computing technologies have motivated the development of indoor location-based services (LBS)\cite{8409950}. With the coming of beyond 5G (B5G) and internet of things (IoT), LBS becomes indispensable. However, it is challenging to achieve high localization accuracy using traditional localization approaches. For example, the weak signals emitted from satellite cannot work well in indoor environments, making global navigation satellite system unserviceable. Moreover, other empirical and model-based technologies mismatch the underlying mechanism of complex indoor environments. Owning the ability of remedying these defects, the technique of received signal strength (RSS) fingerprint-based indoor positioning has received increasing attentions\cite{7174948}. An attractive solution for such localization is the centralized machine learning (ML) algorithm\cite{8726079}. In the off-line phase, a site survey is performed with clients by measuring the strength pattern of signals at different sampling positions in the area of interest (AoI). Such signals are emitted from access points (APs), including WiFi, Bluetooth, Zigbee, etc. Then, a ML model is trained in the server to map the RSS vector and the corresponding measuring position. In the on-line phase, a user can query its position by inputting the real-time measured signal pattern to the trained model. However, in the off-line phase, clients are required to send the raw data to the server for model training, causing disclosure of clients's position information. The privacy protection issue severely hinders the promotion and scalability of LBS\cite{8726079}. Besides, with a large-scale raw data and client amount, the gathering process leads to a high communication cost. To alleviate the over-loaded communication cost and protect the client privacy, federated learning (FL) has been introduced to the fingerprint-based localization system\cite{9148111,9250516,9103044}. The gist of FL is to learn a global model in a distributed manner while keeping raw data locally, and only model parameters are exchanged between clients and server. Therefore, FL-based localization is a promising approach to address the above-mentioned challenges. The existing FL-based localization algorithms \cite{9148111,9250516,9103044} are based on Federated Averaging\cite{A17}. However, it shows that the heterogeneous nature of fingerprint database limits the prediction performance of these algorithms. In detail, in practical fingerprint-based localization applications, database heterogeneity usually emerges due to the unbalanced client behaviour. For example, \begin{enumerate} \item Smart devices may have different hardwares, e.g., battery, sensor and computing unit. \item Different environmental factors like obstacles may differ sample states of smart devices. \item Smart devices may be ordered/taken by different owners, causing various moving states. \end{enumerate} Such unbalanced behaviours will result in unbalanced sampling characteristics in the AoI, e.g., sampling intervals, sampling amount and trajectories. Consequently, the database heterogeneity is generated, which is mainly reflected by the spatial distribution of sampling positions in the AoI. Therefore, the heterogeneous characteristic of fingerprint database should not be omitted in the design of localization algorithms, which has been neglected in existing FL-based localization algorithms\cite{9148111,9250516,9103044}. In this paper, we first characterize the heterogeneity of the fingerprint database, and then a novel heterogeneous FL-based localization algorithm with the area of convex hull-based aggregation (FedLoc-AC) is proposed. To the best of our knowledge, this is the first work to characterize the heterogeneity of fingerprint database and design FL-based localization algorithm with it. The main contributions of this paper are summarized as follows: \begin{enumerate} \item The fingerprint database heterogeneity exists in distributed localization tasks. To characterize it, we associate the heterogeneity with the spatial distribution of sampling positions, and propose a computable heterogeneous characteristic, i.e., the convex hull of sampling positions. \item To improve the localization accuracy, a novel FL-based localization algorithm, named as FedLoc-AC, is proposed by elaborating the proposed heterogeneous characteristic of fingerprint database. Besides, the convergence property of the FedLoc-AC is provided. Moreover, the adaption of FedLoc-AC in multi-floor cases is proposed. \item We conduct extensive experiments to verify the effectiveness of the proposed heterogeneous characteristic. In addition, experimental results, including real-word and 3D cases show the proposed FedLoc-AC can achieve considerable prediction gain compared to FedLoc in heterogeneous scenarios and has almost the same prediction error with it in homogeneous scenarios. \end{enumerate} The rest of this paper is structured as follows. In Section II, we describe the process of FL-based localization and address the problem of fingerprint database heterogeneity. In Section III, the fingerprint database heterogeneity is characterized, and then the FedLoc-AC is proposed based on it. We present experimental results in Section IV ,and conclude this paper in Section V. \section {FL-based Localization} \subsection{Fingerprint Database Construction} Consider a fingerprint-based indoor localization with the assistance of $N$ clients and $L$ APs in the AoI. These APs are deployed at fixed positions to broadcast WiFi beacons. The clients here refer to smart devices equipped with sensing, logging, storage, computing and communication entities. To perform the site survey in the AoI, each client moves to a certain number of positions to read the strength pattern of received signals emitted from APs. The RSSs sampled by the $i$-th client at a position can be formulated in a vector form as \begin{align} \mathbf{x}_{i}=\begin{bmatrix} \mathrm{RSS}_{i,1},& \mathrm{RSS}_{i,2}& ,\cdots, &\mathrm{RSS}_{i,L} \end{bmatrix}, \end{align} where $\mathrm{RSS}_{i,L}$ denotes the measured RSS at the $i$-th client, from the $j$-th AP. After finishing the site survey, the $i$-th client storages $M_{i}$ data pairs, consisting of measured RSSs and corresponding positions. Subsequently, a local database, denoted as $\mathcal{D}_{i}$ is constructed at the $i$-th client, which is expressed as \begin{align}\label{dataset} \mathcal{D}_{i}=\{(\mathbf{x}_{i}^{1},\mathbf{y}_{i}^{1}), (\mathbf{x}_{i}^{2},\mathbf{y}_{i}^{2}), \cdots, (\mathbf{x}_{i}^{M_{i}},\mathbf{y}_{i}^{M_{i}})\}, \end{align} where $\mathbf{y}_{i}$ is the corresponding measuring position of $\mathbf{x}_{i}$. \subsection{Federated Learning Process} \begin{figure} \setlength{\belowcaptionskip}{-0.4cm} \centering \includegraphics[width=0.45\textwidth]{workflow}\\ \caption{Block diagram of FL-based localization. Stage I: Fingerprint database construction (the green points represent the sampling positions in the site survey and the dotted line is the edge of corresponding convex hull). Stage II: The FL work flow. }\label{flow} \end{figure} In this subsection, we present the process of training a multiple perceptron (MLP) model for localization in a federated manner. For ease of understanding, a complete picture of FL framework is depicted in Fig.~\ref{flow}. The FL process consists of information interactions between the central server and clients with $T$ global epoches. At the $t+1$-th round, the process of such a FL system contains the following four steps: \begin{itemize} \item \textit{Local training:} each client completes the local update on the global model $\mathbf{w}^{t}$, received from the central server. The update is based on optimizing the model over the local fingerprint dataset. The mean absolute error (MAE) is selected as the local loss function, defined as \begin{subequations}\label{localobj} \begin{equation} \mathcal{L}_{i}(\mathbf{w})=\frac{1}{M_{i}}\sum_{m=1}^{M_{i}}l_{i}(\mathbf{x}_{i}^{m},\mathbf{y}_{i}^{m};\mathbf{w}), \end{equation} \begin{equation} l_{i}(\mathbf{x}_{i}^{m},\mathbf{y}_{i}^{m};\mathbf{w})=\|\mathcal{F}(\mathbf{x}_{i}^{m};\mathbf{w})-\mathbf{y}_{i}^{m}\|_{2}, \end{equation} \end{subequations} where $\mathbf{w}$ is the model to be optimized and $\mathcal{F}$ is the model function. The local update is finished by $E$ steps of stochastic gradient descent at $\mathbf{w}^{t}$ with a learning rate $\eta$. Let $\mathbf{w}_{i}^{t+1}$ denote the local updated model of the $i$-th client. \item \textit{Parameters uploading:} all clients transmit the local updated model to the central server. \item \textit{Model aggregation:} the central server aggregates the uploaded local model and generates new global model, expressed as \begin{align} \mathbf{w}_{i}^{t+1}=\sum_{i=1}^{N} p_{i}\mathbf{w}_{i}^{t+1}, \end{align} where $p_{i}$ represents the aggregating weight of the $i$-th client with $\sum_{i=1}^{N} p_{i}=1$. \item \textit{Parameter broadcasting:} the central server broadcasts the aggregated $\mathbf{w}^{t+1}$ to all clients for the next round of learning. \end{itemize} \subsection{Fingerprint Database Heterogeneity} The objective function in the FL-based localization can be formulated as \begin{align}\label{obj} \mathcal{L}(\mathbf{w})\triangleq \sum_{i=1}^{N} p_{i}\mathcal{L}_{i}(\mathbf{w}). \end{align} It implies that $p_{i}$ plays an important role in the prediction performance of trained model. In practical applications, database heterogeneity usually emerges due to unavoidable unbalanced device behaviours. Therefore the FL-based localization should be designed by considering this vital factor. Furthermore, the aggregating weights should be determined by the heterogeneity characteristic of fingerprint databases. As illustrated in Fig.~\ref{flow}, the spatial distribution of sampling positions is an important heterogeneity characteristic. For example, even with the same data size, the coverage area of fingerprint database differs from each other. In the next section, we will characterize the spatial distribution of fingerprint database by a well-known definition of convex hull\cite{boyd2004convex}. Then we will elaborate this characteristic to the aggregating design of FL-based localization. \section{The Proposed FedLoc-AC} \subsection{Heterogeneous Characteristic of Fingerprint Database} In Fig.~\ref{spatial}, we further explain the heterogeneous characteristic of fingerprint database, i.e., the spatial distribution of sampling positions. In detail, in the online phase, a user at position $\mathbf{y}$ is querying its position by inputting its real-time measured RSS vector to a MLP model, which is trained by the fingerprint database $\mathcal{D}$ in the off-line phase. Let $\mathbf{y}^{'}$ denote the single measuring position in $\mathcal{D}$ and $\mathcal{D}(\mathbf{y}^{'})$ denote the set of whole sampling positions in $\mathcal{D}$. Without loss of generality, the average prediction error at position $\mathbf{y}$, denoted as $e(\mathbf{y})$, is proportional to the minimum distance between $\mathbf{y}$ and $\mathcal{D}(\mathbf{y}^{'})$, expressed as \begin{align}\label{mderror} e(\mathbf{y})\propto d_{min}(\mathbf{y};\mathcal{D}(\mathbf{y}^{'}))=\min_{\mathbf{y}^{'}\in \mathcal{D}(\mathbf{y}^{'})}{\|\mathbf{y}-\mathbf{y}^{'}\|_2}. \end{align} After illustrating the effect of the spatial distribution to the estimation of a single position, we will expand it to the whole AOI. Since the mainly concerned performance of the trained model is the average prediction accuracy over the AoI, a comprehensive performance metric is given by \begin{align}\label{AoIe} \mathcal{E}=\int_{\mathbf{y}\in AoI} e(\mathbf{y}) f(\mathbf{y}) d \mathbf{y}=\frac{1}{S} \int_{\mathbf{y}\in AoI} e(\mathbf{y}) d \mathbf{y}, \end{align} where $f(\mathbf{y})$ is the probability density function of user position in the AoI and $S$ is the area of the AoI. We consider a uniform distribution of user position here. Substituting (\ref{mderror}) into (\ref{AoIe}), we obtain \begin{align} \mathcal{E}\propto \underbrace{\int_{\mathbf{y}\in AoI} \min_{\mathbf{y}^{'}\in \mathcal{D}(\mathbf{y}^{'})}{\|\mathbf{y}-\mathbf{y}^{'}\|_2} d \mathbf{y}}_{g(\mathcal{D}(\mathbf{y}^{'}))}. \end{align} Our goal is to find a performance metric of the fingerprint database $\mathcal{D}$ to evaluate its effect to $\mathcal{E}$. We introduce an experiential computable geometrical characteristic to represent $g(\mathcal{D}(\mathbf{y}^{'}))$ with negative relationship. That is the area of the convex hull of sampling positions, which is represented by the smallest convex set that contains the sampling positions\cite{boyd2004convex}. Let $C$ denote the convex hull and $S_{C}$ denote the area of it. The convex hull of sampling positions of the $i$-th device is given by \begin{align}\label{convexhullf} &C_{i} = \\ \nonumber &\{\theta_{1}\mathbf{y}_{i}^{1}+\cdots+\theta_{M_{i}}\mathbf{y}_{i}^{M_{i}}, \theta_{k}\geq0, k=1,...,M_{i}, \sum_{k=1}^{M_{i}}\theta_{k}=1\}. \end{align} Note that the notations in (\ref{convexhullf}) follow the formula (\ref{dataset}). \begin{figure} \setlength{\belowcaptionskip}{-0.5cm} \centering \includegraphics[width=0.45\textwidth]{spatial_dis}\\ \caption{The relationship between the spatial distribution of fingerprint database and the prediction error.}\label{spatial} \end{figure} \subsection{FedLoc-AC} In this subsection, we propose a FedLoc-AC. The gist of FedLoc-AC is to allocate the aggregated weights according to the area of convex hull of the fingerprint database, denoted as $S_{C_{i}},~i=1,2,\cdots, N$. The aggregating rule for the $i$-th client is designed as \begin{align} p_{i}=\frac{S_{C_{i}}}{\sum_{i=1}^{N} S_{C_{i}}}. \end{align} By doing so, the fingerprint database with a larger overlay area will contribute more to the global training model. The proposed algorithm is outlined in Algorithm.~\ref{EFedLocA}. Note that we simplify the client as $Cl$. \begin{algorithm} \caption{Heterogeneous FL-based localization} \label{EFedLocA} \LinesNumbered \KwIn{$T$, $\mathbf{w}^{0}$, $\eta$, $E$, $\mathcal{D}_{i}~ \forall i$} \KwOut{$\mathbf{w}^{T}$} Preparation: \While{$Cl_{i}\in {Cl_{1},Cl_{2},\ldots Cl_{N}}$}{ Find out the convex hull of $\mathcal{D}_{i}$, denoted as $C_{i}$, using Melkman algorithm\cite{melkman1987line} Compute the area of $C_{i}$, i.e, $S_{C_{i}}$ Send $C_{i}$ to the central server} Initialization: $t=1$. \While{$t\leq T$}{ \ Local training process: \While{$Cl_{i}\in {Cl_{1},Cl_{2},\ldots Cl_{N}}$}{\ $\mathbf{w} \leftarrow \mathbf{w}^{t-1}$ \ForEach{ $e \in {1,2\ldots E}$}{$\mathbf{w}\leftarrow \mathbf{w}-\eta \nabla \mathcal{L}_{i}(\mathbf{w})$\;}\ $\mathbf{w}_{i}^{t} \leftarrow \mathbf{w}$ Upload parameters $\mathbf{w}_{i}^{t}$} Model aggregating process: Update the global model parameters $\mathbf{w}^{t}$ as \ $\mathbf{w}^{t}=\sum_{i=1}^{N}\frac{S_{C_{i}}}{\sum_{i=1}^{N} S_{C_{i}}}\mathbf{w}_{i}^{t}$ The central server broadcasts global model parameters $t=t+1$} \end{algorithm} \begin{remark} The authors in \cite{8664630} have derived the convergence property of federated learning theoretically. We find that the convergence property of FedLoc-AC follows \cite{8664630} by some adjustments. More details can be found in the appendix. \end{remark} \begin{remark} Compared with the FedLoc \cite{9250516} in computational complexity, the FedLoc-AC needs the $i$-th client to compute $S_{C_{i}}$ additionally, whose complexity is $O(\mathcal{D}_{i})$. Due to the co-existing federated learning process in FedLoc and FedLoc-AC, such additional cost is negligible. \end{remark} \subsection{Extension to 3D Cases} Recently, positioning in a 3D case, especially a multi-floor building has attracted extensive attentions. However, predicting the three dimensional position of a user in a multi-floor building usually takes poor precision. An effective approach is to location by two stages. In the first stage, the floor of the user is located by a by a ML classifier. In the next stage, the position of the user on the located floor is predicted by a ML model, functioning only for the located floor. The FedLoc-AC can be adapted to this case under FL framework by only adding a floor classification step. Firstly, the floor classifier is trained with fingerprint databases of distributed clients in the multi-floor building by federated averaging algorithm (FedAvg)\cite{A17}. Then for each floor, a ML model is trained with fingerprint databases of distributed clients. The proposed method, e.g., FedLoc-AC, can be employed directly. With the floor classifier and several floor-specific ML models, the position of user can be predicted, as illustrated the above paragraph. \section{Experimental Results} In this section, we evaluate the performance of the proposed algorithm, compared with the centralized MLP and FedLoc\cite{9250516} under different scenarios. Besides, the effectiveness of proposed heterogeneous characteristic is verified. \textbf{Experimental Environment}: To construct typical and straightforward scenarios clearly, the simulated dataset are synthesized. The AoI is an indoor environment with $50\times 50~\mathrm{m}^2$. There are four WiFi nodes fixed at the corner of the AoI, emitting electromagnetic wave with power $P_{0}$. The propagation of electromagnetic wave in the AoI is simulated according to the radio-channel propagation model in \cite{5759777}. The related wireless propagation environment is set as follows. The transmit power of each AP is $10$ dBm, and the received power loss at the $1$ m reference distance is $-30$ dBm. To simulate the complicated indoor environment, the path loss is set to range from 3 to 8 and the variance of noise is set to range from 2 to 8 in the AoI. We consider both homogeneous and heterogeneous scenarios. In heterogeneous scenario, we consider a typical unbalanced device behaviors, causing fingerprint database heterogeneity, i.e., moving velocity. The details are showed as follows. \textbf{Homogeneous scenario}: The data collection and model training are completed by $8$ clients. Starting from the vertexes of the rectangle AoI, each client moves with a velocity of $0.5~\mathrm{m}/\mathrm{s}$ with a sampling interval of $3$ s. At each sampling position, the sample is obtained after averaging over $10$ measurements. After sampling at $200$ positions, each client constructs the local fingerprint database, and then cooperates with a central server to train a global model. The test database is generated at randomly positions in the AoI for $1200$ times. \textbf{Heterogeneous scenario}: The basic settings maintain the same with the homogeneous scenario, while a half of the participated clients act as straggles with a limited moving velocity of $0.05~\mathrm{m}/\mathrm{s}$, resulting in unbalanced sampling spacing. \textbf{Learning Structure}: TensorFlow libraries are utilized to implement the learning process by a MLP network. The MLP is trained using SGD consisting of a single hidden layer with $64$ hidden units, where ReLU units are selected as active function. We set $T=300$, $E=40$, and $ \eta=0.00001$. \subsection{Verifications of the Heterogeneous Characteristic} \begin{figure}[tbp] \setlength{\belowcaptionskip}{-0.5cm} \centering \subfloat[Average error via minimum distance]{\label{mde}\includegraphics[width=0.25\textwidth]{Md_RMSE_bar}} \subfloat[Average MSE via area of convex hull]{\label{areae}\includegraphics[width=0.25\textwidth]{Ar_RMSE_bar}} \caption{Verifications of the heterogeneous characteristic} \label{verification} \end{figure} In this subsection, we verify the conclusions in Section III.A through Monte Carlo simulations. Firstly, the positions of $1800$ user data are randomly generated in the AoI, and then the corresponding RSS vectors are measured. For each user data, the prediction error of the MLP model and the minimum distance between the user position to fingerprint positions are stored as a pair. Fig.~\ref{verification}\subref{mde} is a statistical version of the $1800$ data pairs. As seen, the average prediction error is in proportion to the minimum distance. Secondly, we generate $1000$ fingerprint databases randomly. For each fingerprint database, the area of convex hull and the MAE of test database are stored as a pair. Fig.~\ref{verification}\subref{areae} is a statistical version of the $1000$ data pairs. It demonstrates that the average MAE is in inverse proportion to the area of convex hull of fingerprint database. \subsection{Prediction Performance of Proposed FedLoc-AC} Fig.~\ref{generatedata} shows the testing MAE of focused approaches versus global epoches under the designed scenarios. In the heterogeneous scenario, the FedLoc-AC (the proposed algorithm) surpasses the FedLoc obviously in terms of the prediction accuracy with similar convergence rate. At the final round, the FedLoc-AC can achieve a $20\%$ performance gain compared with FedLoc. This improvement is reasonable. The fingerprint database of clients with stronger moving abilities are more representative to reflect the environment of the AoI. The proposed FedLoc-AC distributes larger weights to the stronger clients in the model aggregation while FedLoc averages the aggregating weights. In the homogeneous scenario, the proposed FedLoc-AC has almost the same performance with the FedLoc since the aggregating weights in FedLoc-AC are near average. Through converging under more rounds than the centralized learning, the FedLoc-AC can keep raw data locally. \begin{figure}[tbp] \setlength{\belowcaptionskip}{-0.5cm} \centering \subfloat[Heterogeneous scenario]{\label{vhete}\includegraphics[width=0.25\textwidth]{FLhetev}} \subfloat[Homogeneous scenario]{\label{nhete}\includegraphics[width=0.25\textwidth]{FLhomo}} \caption{Testing MAE of focused methods versus global epochs in designed scenarios.} \label{generatedata} \end{figure} \subsection{Real-world 3D cases} \begin{figure} \centering \includegraphics[width=0.45\textwidth]{FLLoor}\\ \caption{Test Accuracy of Floor Classifiers}\label{Floorsimu} \end{figure} \begin{figure}[tbp] \setlength{\belowcaptionskip}{-0.5cm} \centering \subfloat[Heterogeneous scenario]{\label{vhete}\includegraphics[width=0.25\textwidth]{FLheteUJL}} \subfloat[Homogeneous scenario]{\label{nhete}\includegraphics[width=0.25\textwidth]{FLhomoUJL}} \caption{Testing MAE of focused methods versus global epochs with UJIIndoorLoc database.} \label{UJLLocdate} \end{figure} The real-word dataset named UJIIndoorLoc \cite{7275492} is adopted to evaluate the proposed method and its extension version. The experimental data is sampled in the four-storey building with ''BUILDINGID'' equal to 0 in the UJIIndoorLoc database. We select the the training subset for model training and the validation subset for test. The client amount in the building is set to be 20. For floor classifier, we select MLP network as the classifier, consisting of a single hidden layer with 1024 hidden units, where ReLU units are selected as active function. Softmax units are selected as active function in the output layer. The learning is achieved by SGD with $\eta=0.000001$ and $E=20$. For floor-specific localization, the MLP is trained by SGD consists of two hidden layers with $128\times128$ ReLU units. We set $E=40$, and $ \eta=0.00001$. Fig.~\ref{Floorsimu} shows the testing accuracy of FL-based classifier and centralized classifier versus global epoches. As seen, the test accuracy of FL-based classifier rivals the centralized benchmark. When the floor is predicted by the FL-based classifier, to further predict the specific position on the floor is just the 2D case we focused on. Fig.~\ref{UJLLocdate} shows the test error of focused approaches versus global epoches on the floor with id equal to 1 in this building$\footnote{Also, we consider both homogeneous and heterogeneous scenarios. In the homogeneous scenario, the training database are random distributed to 8 clients. In the heterogeneous scenario, a half of clients act as straggles, whose local training databases have limited cover area in the AoI.}$. This result demonstrates the prediction superiority of the proposed FedLoc, consisting with Fig.~\ref{generatedata}. \subsection{extension to 3D case} \section{Conclusion} In this paper, we have focused on FL-based localization that trains a global model in a cooperative and distributed manner without exposing the raw data of clients. Considering the practical database heterogeneity, a novel FedLoc-AC algorithm has been considered, which aggregates the client model according to the proposed heterogeneous characteristic, i.e., the area of convex hull. Experimental results have verified the effectiveness of the heterogeneous characteristic and confirm the prediction superiority of FedLoc-AC, compared to the existing FedLoc. Improving the FedLoc-AC by finding more effective aggregating weights deserves further research. \section*{Appendix:~Convergence bound of FedLoc-AC} For theoretical analysis, the assumptions of the local loss function are listed as follows. \begin{assumption} We assume the following for the $i$-th client: \begin{enumerate} \item $\mathcal{L}_{i}(\mathbf{w})$ is convex. \item $\mathcal{L}_{i}(\mathbf{w})$ is $\rho$-Lipschitz, i.e., $ \|\mathcal{L}_{i}(\mathbf{w})-\mathcal{L}_{i}(\mathbf{w}^{'}) \|\leq\rho\|\mathbf{w}-\mathbf{w}^{'}\|$ for any $\mathbf{w}, \mathbf{w}^{'}$. \item $\mathcal{L}_{i}(\mathbf{w})$ is $\beta$-smooth, i.e., $ \|\nabla \mathcal{L}_{i}(\mathbf{w})- \nabla\mathcal{L}_{i}(\mathbf{w}^{'}) \|\leq\beta \|\mathbf{w}-\mathbf{w}^{'}\|$ for any $\mathbf{w}, \mathbf{w}^{'}$. \end{enumerate} \end{assumption} We also define the following metric to capture the divergence between the gradient of a local loss function, defined in (\ref{localobj}), and the gradient of the global loss function, defined in (\ref{obj}). \begin{definition} For any $i$ and $\mathbf{w}$, we define $\delta_{i}$ as an upper bound of $\|\nabla \mathcal{L}_{i}(\mathbf{w})- \nabla\mathcal{L}(\mathbf{w})\|$, i.e., \begin{align} \|\nabla \mathcal{L}_{i}(\mathbf{w})- \nabla\mathcal{L}(\mathbf{w})\|\leq \delta_{i}. \end{align} We also define $\delta\triangleq \frac{S_{C_{i}}\delta_{i}}{\sum_{i=1}^{N} S_{C_{i}}}$. \end{definition} The difference between the Definition 1 and the counterpart in \cite{8664630} are the definition of $\delta$, in where the proposed aggregation with heterogeneous databases are considered. Following \cite{8664630}, when $\eta<\frac{1}{\beta}$, we have \begin{align} L(\mathbf{w}^{T})-L(\mathbf{w}^{\ast})\leq \frac{1}{2\eta \varphi T}+\sqrt{\frac{1}{4 \eta^2 \varphi^2 T^2}+\frac{\rho h(E) }{\eta \varphi E}}+\rho h(E), \end{align} where $\varphi \triangleq \omega(1-\frac{\beta\eta}{2})$ , $\omega\triangleq\min_{t} \frac{1}{\|\mathbf{w}^(t-1)-\mathbf{w}^{\star}\|}$ and $h(x)\triangleq \frac{\delta}{\beta}((\eta \beta+1)^{x}-1)-\eta\delta x$ for any $x=0,1,2,...$. \ifCLASSOPTIONcaptionsoff \newpage \fi \bibliographystyle{IEEEtran}
3d7049cf5a957398ddc2a126b97a77377a742f49
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:introduction} Recent large surveys have revealed dozens of stellar streams in the halo of the Milky Way (MW), which are one-dimensional substructures of halo stars resulting from disruption of merging stellar systems, such as dwarf galaxies or globular clusters (GCs) \citep{Malhan2018a}. These stellar streams not only confirm the prediction of the standard $\Lambda$CDM cosmology that the galaxies form through hierarchical mergers, but also allow measurement of the large- and small-scale mass distribution in the Milky Way \citep{Koposov2010,Malhan2019,Bonaca2019,BanikBovy2021}. The GD-1 stream \citep{Grillmair2006} is one of the most studied stellar streams. This stream is characterized by its thinness ($\sim 70 \ensuremath{\,\mathrm{pc}}$) and its length (more than several tens of degrees) \citep{Carlberg2013}. The integrated light from \new{the visible part of} the GD-1 stream suggest that the progenitor system of this stream initially had a mass of $(1.58 \pm 0.07) \times 10^4 M_\odot$ \citep{deBoer2020}, \new{ although this mass estimate might be a lower limit if the stream is much more extended than currently recognized.}\footnote{ \new{ Depending on the accretion history of the Milky Way, the GD-1 stream may have been affected by long-term gravitational perturbations \citep{Carlberg2020ApJ...889..107C}. In such a case, the visible part of the GD-1 stream might be a segment of a longer stream; and thus the GD-1's progenitor mass might be larger than the estimate by \cite{deBoer2020}. }} These structural properties suggest that its progenitor system (which has been completely disrupted) was a GC-like system which began disruption at least $\sim 3 \ensuremath{\,\mathrm{Gyr}}$ ago \citep{Bowden2015MNRAS.449.1391B,Erkal2016}. Recently, there have been discoveries of multiple under-dense regions or `gaps' in the GD-1 stream \citep{Carlberg2013, deBoer2018, deBoer2020, PriceWhelan2018, Bonaca2019}. Although there is some argument that these gaps might be due to the formation process of the stream (such as the non-uniform stripping rate; \new{ epicyclic overdensities, \citealt{Kupper2010MNRAS.401..105K,Kupper2015ApJ...803...80K}; } or the disruption of the progenitor star cluster within a host dwarf galaxy, \citealt{Malhan2019ApJ...881..106M,Malhan2021MNRAS.501..179M,Qian2022MNRAS.511.2339Q}), currently the most widely accepted hypothesis to explain these gaps is that these gaps were generated by perturbations from massive compact objects, including the dark matter subhaloes in the MW \citep{Carlberg2009,Carlberg2016,Yoon2011ApJ...731...58Y,Erkal2015a,Erkal2015b,Erkal2016}. In general, when a stream experiences a close encounter with a dark matter subhalo with a mass of $\sim 10^5$-$10^7 M_\odot$, the impulsive force from the subhalo results in a differential velocity kick along the stream and forms a gap in the stream. Since the gap forming mechanism is well understood, the morphology of the gap and the velocity structure near the gap enable us to investigate the mass and size of the perturber, relative velocity of the perturber with respect to the stream, and the time of the encounter \citep{Erkal2015a}. Also, the number of gaps in a stream can put a constraint on the abundance of the dark matter subhalos if all of the gaps are generated by the dark matter subhalos \citep{Erkal2015b}. To use these gaps as a probe of the dark matter, we need to disprove that these gaps are not generated by baryonic effects, such as the perturbation from the Galactic bar \citep{Hattori2016,PriceWhelan2016MNRAS.455.1079P}, spiral arms of the MW \citep{BanikBovy2021}, giant molecular clouds in the stellar disk \citep{Amorisco2016}, dwarf galaxies \citep{Bonaca2019}, and GCs \citep{Bonaca2019,BanikBovy2021}. In disproving these effects, it is informative to note that the gaps are more difficult to generate if a perturber moves at a larger velocity relative to the stream; A higher-speed encounter results in a shorter interaction time with the stream and, therefore, a smaller effect. Given that the GD-1 stream is orbiting around the MW in a retrograde fashion, the perturbations from the bar, spiral arms, and giant molecular clouds -- all of which show a prograde motion -- have negligible effects in generating gaps in the GD-1 stream.\footnote{ Another well-studied stream, the Palomar 5 stream, also has some gaps \citep{Erkal2017MNRAS.470...60E}, but it has a prograde orbit. } Since the dwarf galaxies are far away from the GD-1 stream at the current epoch and in the past, dwarf galaxies also have negligible effect in generating gaps in the GD-1 stream \citep{Bonaca2019}. In this regard, it is crucial to investigate whether GCs can explain the gaps in the GD-1 stream. Previously, \cite{Bonaca2019} tried to pursue this strategy by using the catalog of $\sim 150$ GCs equipped with the astrometric data from Gaia DR2 \citep{Gaia2016A&A...595A...1G, Gaia2018A&A...616A...1G}. They integrated the orbit backward in time for 1 Gyr to conclude that the impacts from these GCs are negligible in the last 1 Gyr. In this paper, we updated their results by using a larger number of GCs (158 GCs) from \cite{Vasiliev2021} equipped with the astrometric data from Gaia EDR3 \citep{Gaia2021A&A...649A...1G}, and, more importantly, by adopting a long enough integration time (6 Gyr in our fiducial model). We note that \cite{BanikBovy2021} investigated how the baryonic perturbers (including GCs, giant molecular clouds, and spiral arms) affect the density power spectrum along the GD-1 stream by running simulations of the GD-1 stream in the last 3-7 Gyr. Our work is complementary to \cite{BanikBovy2021}, because we focus on the {\it probability} that all of the three gaps in the GD-1 stream were formed by GCs. This paper is organized as follows. In Section 2, we present the observed data of the GD-1 stream and the GCs. In Section 3, we describe how we set up our test-particle simulations. In Section 4, we show the results of our analysis, details of the gap-forming GCs, and the show-case stream models. In Section 5, we present some discussion of our results, including the estimated probability that all three gaps in the GD-1 stream were formed by GCs. In Section 6, we summarize our paper. \section{Data} Here we describe the data of the GD-1 stream and GCs. The coordinate system is defined in Appendix \ref{appendix:coordinate}. \subsection{Globular clusters} Using the astrometric data from Gaia EDR3 \citep{Gaia2021A&A...649A...1G}, \cite{Vasiliev2021} derived the position and velocity of 170 GCs in the Milky Way. We selected 158 GCs with the full 6D position-velocity data by omitting 12 GCs with incomplete data. The data include Right Ascension and Declination $(\alpha, \delta)$, distance $d$, line-of-sight velocity $v_{\ensuremath{\mathrm{los}}}$, and proper motion $(\mu_{\alpha*}, \mu_\delta)$, and their associated uncertainties including the correlation between the two proper motion components. We note that the final sample of GCs contains some of the newly discovered GCs for which previous studies (e.g., \citealt{Bonaca2019}) have not checked whether they have experienced a close encounter with the GD-1 stream. \subsection{Candidate stars of the GD-1 stream}\label{sec:Data_Malhan} By using STREAMFINDER algorithm \citep{Malhan2018a, Malhan2018b, Malhan2018c}, \cite{Malhan2019} compiled a catalog of 97 candidate stars of the GD-1 stream (see Table 2 of \citealt{Malhan2019}) for which line-of-sight velocity $v_{\ensuremath{\mathrm{los}}}$ is taken from spectroscopic surveys such as SEGUE \citep{Yanny2009} and LAMOST \citep{Zhao2012}. Since their original catalog is based on Gaia DR2 \citep{Gaia2018A&A...616A...1G}, we crossmatched these 97 stars with Gaia EDR3 \citep{Gaia2021A&A...649A...1G} to obtain more accurate astrometric data. Judging from $v_{\ensuremath{\mathrm{los}}}$, some of their sample stars are probably not a member of the GD-1 stream (see Fig. 4d of \citealt{Malhan2019}). However, we did not make any manual selection to discard these outliers, because such a hard cut might bias our inference on the properties of the GD-1 stream. Instead, we modeled the position and velocity of the GD-1 candidate stars with a mixture model of stream stars and background stars (cf., \citealt{Hogg2010arXiv}). \subsection{Density along the GD-1 stream} By using the photometric data from Pan-STARRS DR1 and astrometric data from Gaia DR2, \cite{deBoer2020} derived the global properties of the GD-1 stream, such as the density, distance, and proper motions along the stream. They found three gaps along the GD-1 stream at $\phi_1 = -36, -20$, and $-3 \deg$ in the GD-1 stream coordinate system $(\phi_1, \phi_2)$ (see Appendix \ref{appendix:coordinate}; \citealt{Koposov2010}). In this paper, we interpret that all of the three gaps are due to some sort of perturbations, although some authors interpret that the gap at $\phi_1 = -36 \deg$ corresponds to the location of the already-disrupted progenitor (e.g., \citealt{BanikBovy2021}). The main goal in this paper is to evaluate the probability that three gaps are formed within $-40 \deg \leq \phi_1 \leq 0 \deg$ by close encounters with known GCs. We note that we do {\it not} aim to re-create these three gaps {\it rigorously} at the observed locations. \begin{figure} \centering \includegraphics[width=3.2in]{fig1__fig_GD1_schematic_ver5.png} \caption{Schematic diagram for our simulations in this paper. } \label{fig:schematic} \end{figure} \section{Simulations} \label{sec:simulations} We analyzed the close encounter with the GD-1 stream and GCs in three steps, as described in Fig.~\ref{fig:schematic}. \begin{itemize} \item Step 1: By using a static ({\it unperturbed}) Galactic potential, we generated (i) an {\it unperturbed} model of the GD-1 stream represented by test particles; and (ii) $N_\mathrm{MC}=1000$ Monte Carlo orbit models for each GC reflecting the observed uncertainties. We treat each GC as a test particle moving in the Galactic potential in this step. \item Step 2: By using the {\it unperturbed} models (i) and (ii) in Step 1, we select GC orbits that could have encountered the GD-1 stream with a small impact parameter and a small relative velocity. \item Step 3: For each of the selected orbits in Step 2, we construct a time-dependent, {\it perturbed} potential, consisting of the static MW potential and the time-dependent potential from the GC that moves around the MW potential. Under this composite MW+GC potential model, we ran a test-particle simulation of the GD-1 stream {\it perturbed} by a GC due to a close encounter. \end{itemize} Throughout this paper, we used the AGAMA package \citep{Vasiliev2019_AGAMA} to run simulations. In the following, we describe details of these steps. \subsection{Model potential of the Milky Way} \label{sec:MWpotential} In this paper, we used the MW model potential in \cite{McMillan2017}. This model is static and axisymmetric, and it consists of atomic and molecular gas disks, thin and thick stellar disks, bulge, and a dark matter halo. In Step 3 of our experiments, we add a time-dependent potential caused by the gravitational force from a GC to the above-mentioned static MW potential. In such a case, we assume that the MW potential is rigid and that the MW does not wobble, because the mass of a GC is much smaller than that of the MW. \subsection{Step 1 (i): Unperturbed model of the GD-1 stream} To generate an {\it unperturbed} model of the GD-1 stream, we need to assume the orbit of its progenitor system. We assume that the GD-1's progenitor would be at $\alpha=148.91 \deg$ at the current epoch if it had not been completely disrupted. This location is chosen following \cite{BanikBovy2021}. By assuming that the GD-1 stream approximately delineates the orbit of its progenitor,\footnote{ \new{ In general, the orbit of the progenitor is misaligned with the stream \citep{Sanders2013MNRAS.433.1813S,Sanders2013MNRAS.433.1826S}. Although we start from this crude approximation, the final outcome of our simulation more or less reproduces the global properties of the GD-1 stream (see Fig.~\ref{fig:unperturbedGD1}). } } we derived the remaining 5D information of the GD-1's progenitor at the current epoch. Specifically, we fit the 6D phase-space data of the candidates of the GD-1 stream members in \cite{Malhan2019} with an orbit by adequately taking into account that some fraction of the stars is non-member stars. Our best-fit orbit of the GD-1's progenitor is characterized by \eq{ (\alpha^\mathrm{prog}, \delta^\mathrm{prog})|_{t=0}&=(148.91, 36.094) \deg,\\%(148.91, 36.0944389) \deg,\\ d^\mathrm{prog}|_{t=0}&= 7.550 \ensuremath{\,\mathrm{kpc}},\\%7.55009368 \ensuremath{\,\mathrm{kpc}},\\ (\mu_{\alpha*}^\mathrm{prog}, \mu_\delta^\mathrm{prog})|_{t=0}&=(-5.533,-12.600) \ensuremath{\,\mathrm{mas\ yr}^{-1}},\\%=(-5.53293288,-12.6006812) \ensuremath{\,\mathrm{mas\ yr}^{-1}},\\ v_{\ensuremath{\mathrm{los}}}^\mathrm{prog}|_{t=0}&=-14.576 \ensuremath{\,\mathrm{km\ s}^{-1}}. } These quantities are broadly consistent with the result in \cite{BanikBovy2021}. \new{ In general, the orbit of the GD-1's progenitor is quite uncertain, not only because the current location $(\alpha^\mathrm{prog}, \delta^\mathrm{prog})|_{t=0}$ of the invisible (disrupted) progenitor is arbitrary, but also because the MW potential has evolved over the last several Gyr. However, we use our best-fit orbit throughout this paper, because our aim is to quantify the encounter rate of the GD-1 stream with GCs and not to reproduce the entire properties of the GD-1 stream. } Given this phase-space information, we integrated the orbit of the GD-1's progenitor backward in time from $t=0$ (current epoch) to $t=-T$. We adopt $T=6 \ensuremath{\,\mathrm{Gyr}}$ as the fiducial value, and thus all the figures in this paper assumes this fiducial value. We comment on how the choice of $T$ affects our results in Section \ref{sec:dynamical_age}. Under the model potential we adopted \citep{McMillan2017}, the position and velocity of the GD-1's progenitor at $t=-T=-6\ensuremath{\,\mathrm{Gyr}}$ are given by\footnote{ See Appendix \ref{appendix:variousT} for the corresponding quantites for different choices of $T$. } \eq{ &(x^\mathrm{prog}, y^\mathrm{prog}, z^\mathrm{prog})|_{t=-T=-6\ensuremath{\,\mathrm{Gyr}}} \nonumber\\ &= (12.079089, 12.387276, -8.601204) \ensuremath{\,\mathrm{kpc}}, \\ &(v_x^\mathrm{prog}, v_y^\mathrm{prog}, v_z^\mathrm{prog})|_{t=-T=-6\ensuremath{\,\mathrm{Gyr}}} \nonumber\\ &= (-172.22552, 54.99903, -72.57744) \ensuremath{\,\mathrm{km\ s}^{-1}}. } The position and velocity of the GD-1's progenitor at $t=-T$ was used to create the initial condition of the GD-1 stream particles. As a simple prescription to mimic the generation of the GD-1 stream, we release $10^5$ test particles at $t=-T$ from the same position as the progenitor, $(x^\mathrm{prog}, y^\mathrm{prog}, z^\mathrm{prog})|_{t=-T}$, with a relative velocity with respect to the progenitor following an isotropic Gaussian distribution: \eq{ (v_x - v_x^\mathrm{prog})|_{t=-T} &\sim N(0, \sigma_v^2) , \\ (v_y - v_y^\mathrm{prog})|_{t=-T} &\sim N(0, \sigma_v^2) , \\ (v_z - v_z^\mathrm{prog})|_{t=-T} &\sim N(0, \sigma_v^2) . } Here, $N(0, \sigma^2)$ represents a Gaussian distribution with mean $0$ and dispersion $\sigma^2$. We regard these $10^5$ particles as the unperturbed GD-1 stream, and we integrate the orbit of these $10^5$ particles forward in time from $t=-T$ to $t=0$ (current epoch) under the unperturbed Galactic potential. After some experiments, we chose $\sigma_v = (0.5 \ensuremath{\,\mathrm{km\ s}^{-1}}) (T / 6 \ensuremath{\,\mathrm{Gyr}})^{-1}$ so that the length of the GD-1 stream model at the current epoch is comparable to the observed extent of the GD-1 stream. We recorded the snapshot of these particles every 1 Myr and used this information in Step 2. Fig.~\ref{fig:unperturbedGD1} shows the stellar distribution of the unperturbed model at the current epoch. We see that the unperturbed model reproduces the observed phase-space distribution of the stars except for the apparent outlier stars. This unperturbed model is used as the benchmark model with which we quantify the strength of perturbation from GCs (see Section \ref{sec:defineGD1} and Appendix \ref{appendix:conditionA}). We note that randomly chosen 100 stars in the unperturbed model is used in Step 2 to find GCs that may have experienced a close encounter with the GD-1 stream. \begin{figure*} \centering \includegraphics[width=5.0in]{fig2__No_perturbation_vs_mal.png} \caption{ Comparison of the unperturbed GD-1 stream model (blue dots) and the observed GD-1 candidate stars in \cite{Malhan2019} (red data points with error bar). On each panel, the the horizontal axis is $\phi_1$, while the vertical axis is either $(\phi_2, \varpi, v_{\ensuremath{\mathrm{los}}}, \mu_{\alpha*}, \mu_\delta)$. As seen in the top right plot showing $(\phi_1, v_{\ensuremath{\mathrm{los}}})$ distribution, some of the GD-1 candidate stars are outlier (non-member) stars with very different $v_{\ensuremath{\mathrm{los}}}$. Apart from these outlier stars, our unperturbed GD-1 stream model reproduces the global properties of the observed GD-1 stream. We note that this unperturbed GD-1 stream model is used as a reference throughout this paper. } \label{fig:unperturbedGD1} \end{figure*} \subsection{Step 1 (ii): Unperturbed orbits of the globular clusters with observational uncertainty} The GCs in the catalog of \cite{Vasiliev2021} typically have $\sim 3$ percent error in distance. This slight difference makes a noticeable difference in evaluating whether a given GC could have experienced a close encounter with the GD-1 stream in the last few Gyr, because a slight difference in the initial condition can cause a $\ensuremath{\,\mathrm{kpc}}$ scale difference in predicting the location of the GC in a few Gyr. To account for the observational uncertainty, we sampled the current position and velocity of each GC for $N_\mathrm{MC}=1000$ times from the error distribution. Namely, we randomly sampled $(d, \mu_{\alpha*}, \mu_\delta, v_{\ensuremath{\mathrm{los}}})$ for each GC, by fully taking into account the correlation between the error in $(\mu_{\alpha*}, \mu_\delta)$. We neglected the small uncertainty in $(\alpha, \delta)$. For each GC, we integrated the orbit backward in time from $t=0$ to $t=-T$ under the unperturbed Galactic potential. We recorded the position and velocity of each GC every 1 Myr (and used this information in Step 2). For convenience, we enumerated each of these Monte Carlo orbits by two integers $(j,k)$, where $j \; (0 \leq j \leq 169)$ denotes $j$th GC in the catalog of \cite{Vasiliev2021} and $k \; (0 \leq k \leq 999)$ denotes $k$th Monte Carlo orbit. For example, $(j,k)=(4,557)$ corresponds to $k=557$th Monte Carlo orbit of NGC1261, since NGC1261 is the 4th GC in the catalog. \subsection{Step 2: Globular clusters with close encounters} To find GCs that could have experienced a close encounter with the GD-1 stream, we used the results in Step 1 (i) and (ii). First, from the unperturbed model of the GD-1 stream computed in Step 1 (i), we randomly chose 100 particles. (We note that we sample 100 particles only once; and we use the identical 100 particles throughout Step 2.) We checked the relative distance and velocity of these 100 GD-1 particles with respect to each Monte Carlo orbit of a given GC (computed in Step 1 (ii)) as a function of time. For each Monte Carlo orbit $(j,k)$ of the GC, we searched for a close encounter with the GD-1 stream, which we defined as a moment when at least one particle in the stream is located within $d_\mathrm{min} < 0.5 \ensuremath{\,\mathrm{kpc}}$ from the GC having a relative velocity smaller than $v_\mathrm{rel} < 300 \ensuremath{\,\mathrm{km\ s}^{-1}}$. As a result, we found that 1383 Monte Carlo orbits of 28 GCs have experienced a close encounter with the GD-1 stream in the last $T=6 \ensuremath{\,\mathrm{Gyr}}$. We note that, up to this step, it was unclear whether each of these GCs could form a gap,\footnote{ For example, some GCs are not massive enough to form a gap. } which was investigated in Step 3. \input{table1.tex} \subsection{Step3: The GD-1 stream models perturbed by globular clusters} For the 1383 Monte Carlo orbits $(j,k)$ found in Step 2, we ran more detailed simulations. To efficiently run perturbed model of the GD-1 stream, we make some simplifying assumptions. In each simulation specified by $(j,k)$, we only consider one perturber, namely the $j$th GC with $k$th Monte Carlo orbit. In other words, we do not consider a situation where multiple perturbers exist. We treat the GD-1 stream particles as test particles that feel forces from the MW and $j$th GC (with $k$th Monte Carlo orbit). We do not take into account the self-gravity of the GD-1 stream. We assume that $j$th GC has a Plummer density profile with the total mass $M_{\mathrm{GC},j}$ adopted from the compilation by Holger Baumgardt.\footnote{ \url{https://people.smp.uq.edu.au/HolgerBaumgardt/globular/parameter.html} } We assume that the mass of GCs does not change as a function of time. We assume that the scale radius of the Plummer profile is $10 \ensuremath{\,\mathrm{pc}}$. We note that changing the scale radius of GCs in the range of 1-20 $\ensuremath{\,\mathrm{pc}}$ does not significantly affect our results. We assume that the GC only feels the force from the MW, and therefore the orbit of the GC in Step 2 is identical to that in Step 3. We also assume that the MW potential is rigid and does not move due to the motion of the GC, which is a natural assumption if we consider the perturbation from the GC only.\footnote{ In reality, however, the MW is not an isolated system due to the strong perturbation from the Large Magellanic Cloud \citep{Besla2010,Erkal2019,GaravitoCamargo2019,Koposov2019}, so our assumption is simplistic in this regard. } Under the above-mentioned assumptions, the gravitational potential that a GD-1 stream particle feels at location ${\bf x}$ and at time $t$ is given by \eq{ &\Phi_{\mathrm{total},jk}({\bf x}, t) \nonumber \\ &= \Phi_\mathrm{MW}({\bf x}) + \Phi_{\mathrm{Plummer}} (|{\bf x} - {\bf x}_{\mathrm{GC},jk}(t)|; M_{\mathrm{GC},j}) . \label{eq:Phi_t} } Here, $\Phi_\mathrm{MW}({\bf x})$ is the static MW potential (Section \ref{sec:MWpotential}). The $k$th orbit of the $j$th GC is denoted as ${\bf x}_{\mathrm{GC},jk}(t)$. The GC's potential is described by a Pummer potential \eq{ \Phi_{\mathrm{Plummer}}(r; M_{\mathrm{GC},j}) = - \frac{GM_{\mathrm{GC},j}}{\sqrt{r^2 + (10 \ensuremath{\,\mathrm{pc}})^2}}. } We represent the GD-1 stream with $10^5$ test particles, which is large enough to statistically robustly detect a gap in the GD-1 stream model. The initial conditions of the GD-1 stream particles are chosen in the same manner as in Step 1 (i). Importantly, we use the same random seed to generate the initial condition of the GD-1 stream model for all the simulations in Step 1 (i) and Step 3. We integrate the orbits of these $10^5$ test particles from $t=-T$ to $t=0$ under the perturbed, time-dependent potential (equation (\ref{eq:Phi_t})). After running the simulation, we judge whether each stream model contains a GD-1-like gap or not by a simple method in Section \ref{sec:defineGD1}. As a result, 57 Monte Carlo orbits of 16 GCs result in a GD-1-like gap, which will be discussed in Section \ref{sec:result}. \subsection{Definition of a GD-1-like gap in our simulation} \label{sec:defineGD1} To assess if a given model in our simulation contains a GD-1-like gap, we compare the {\it perturbed} model in Step 3 with the {\it unperturbed} model in Step 1 (i). Because we use the same random seed to create these models, whenever we detect a notable difference between these models, the difference can be attributed to the effect of the GC perturbation. To make a fair comparison, we first compute the linear density of the unperturbed and perturbed models of the GD-1 stream at the current epoch ($t=0$) along $\phi_1$-coordinate, $\rho_\mathrm{unperturbed}(\phi_1)$ and $\rho_\mathrm{perturbed}(\phi_1)$, respectively, by using the histogram of $\phi_1$ with a bin size of $\Delta\phi_1 = 2 \deg$. We define that a GD-1-like gap is seen in the model at the location $\phi_1$ when the perturbed model stream satisfies the following two conditions: \begin{itemize} \item condition (A) $\frac{\rho_\mathrm{perturbed}(\phi_1)}{ \rho_\mathrm{unperturbed}(\phi_1)} < 0.8$; and \item condition (B) $-40 \deg \leq \phi_1 \leq 0 \deg$. \end{itemize} The condition (A) is motivated by the fact that a clear gap in our simulations typically satisfy (A). The condition (B) is motivated by the fact that \cite{deBoer2020} identified three gaps in the GD-1 stream at $\phi_1 = -36 \deg, -20 \deg$, and $-3 \deg$. We illustrate our procedure in Appendix \ref{appendix:conditionA} and Fig.~\ref{fig:ConditionA}. \section{Result} \label{sec:result} As described in Section \ref{sec:simulations}, we checked in total 158,000 Monte Carlo orbits (1000 orbits for each of the 158 GCs). As a result, we found that 57 Monte Carlo orbits of 16 GCs resulted in a gap in the GD-1 stream model at $-40 \deg \leq \phi_1 \leq 0 \deg$. In Sections \ref{sec:GClist}--\ref{sec:GCorbit}, we describe some details of these GCs. In Section \ref{sec:showcase}, we present some show-case examples of the gap-forming models. \subsection{GC candidates that might have formed a gap in the GD-1 stream} \label{sec:GClist} Among the 158 GCs that we explored, we identified 16 GCs (57 Monte Carlo orbits) that formed a GD-1-like gap in the simulation. These 16 GCs are good candidates of GCs that might have formed the observed gaps in the GD-1 stream. These 16 GCs are listed in Table~\ref{table:probability}, along with the gap-forming probability $P_{\text{gap-forming}} = N_\text{gap-forming-orbit}/1000$, where $N_\text{gap-forming-orbit}$ denotes the number of gap-forming Monte Carlo orbits. As we see from Table~\ref{table:probability}, $P_{\text{gap-forming}}$ is generally low. However, there are 6 GCs that can form a GD-1-like gap with $P_{\text{gap-forming}} \geq \frac{3}{1000}$. NGC5272 (M3) and IC4499 are especially interesting GCs, which have the highest and second highest probability (0.022 and 0.009, respectively) of forming a GD-1-like gap. Most of the 57 Monte Carlo orbits listed in Table~\ref{table:probability} have only one close encounter with the GD-1 stream, forming a single gap in the GD-1 stream. Intriguingly, a few Monte Carlo orbits of NGC5272 (M3) have two close encounters with the GD-1 stream, forming one visible gap and another mild under-density region. \subsection{Gap-forming probability and the GC mass} \label{sec:GCmass} In Fig.~\ref{fig:mass_prob}(a), we show the relationship between the mass and the gap-forming probability for the 16 GCs listed in Table \ref{table:probability}. The 6 GCs with $P_{\text{gap-forming}} \geq \frac{3}{1000}$ are shown by red filled circle, while the 10 GCs with $0<P_{\text{gap-forming}} \leq \frac{2}{1000}$ are shown by black open circle. Except for NGC5272 (M3) and IC4499, there is a mild trend that more massive GCs have a higher gap-forming probability. This trend is understandable in the following manner: Given that the maximum impact parameter to form a GD-1-like gap is larger for more massive GCs, more massive GCs have a larger chance of forming a gap. In contrast, low-mass GCs need to pass very close to the GD-1 stream to form a gap, and thus lower-mass GCs have a smaller chance of forming a gap. The 10 GCs with $0<P_{\text{gap-forming}}\leq \frac{2}{1000}$ have only one or two Monte Carlo orbits among 1000 trials that result in a GD-1-like gap. The mass of these GCs is $10^{4.6}M_\odot \lesssim M_\mathrm{GC} \lesssim 10^{5.6}M_\odot$, which roughly covers around 20-80 percentiles of the mass of known GCs (see gray histogram in Fig.~\ref{fig:mass_prob}(b)). Thus, these 10 GCs have a typical mass of the MW GCs. Intriguingly, the two highest-$P_{\text{gap-forming}}$ GCs, NGC5272 (M3) and IC4499, are not very massive ($10^{5.6}M_\odot$ and $10^{5.2}M_\odot$, respectively). Therefore, their high value of $P_{\text{gap-forming}}$ is not because they are very massive but because their orbits are favorable to form a gap in the GD-1 stream. In Fig.~\ref{fig:mass_prob}(b), we show the normalized cumulative distribution of the GC mass for GCs with different ranges of $P_{\text{gap-forming}}$. As we can see from this figure, the median GC mass is approximately $10^{5.0} M_\odot$, $10^{5.25} M_\odot$, and $10^{5.7} M_\odot$, for GCs with $P_{\text{gap-forming}}=0$, $0<P_{\text{gap-forming}} \leq \frac{2}{1000}$, and $\frac{3}{1000} \leq P_{\text{gap-forming}}$, respectively. This result suggests that more massive GCs tend to have a larger probability of forming a gap in the GD-1 stream, supporting the mild trend seen in Fig.~\ref{fig:mass_prob}(a). Fig.~\ref{fig:mass_prob}(b) also shows that there is no GCs with $M_\mathrm{GC} \lesssim 10^{4.5} M_\odot$ that form a gap in the GD-1 stream in our simulation. This result suggests that it is extremely difficult ($P_{\text{gap-forming}}<\frac{1}{1000}$) to form a gap in the GD-1 stream by these low-mass GCs. \begin{figure} \centering \includegraphics[width=3.2in]{fig3a__summary_log10Mass_Prob_annotate_GCname_ver2.png}\\ \includegraphics[width=3.2in]{fig3b__summary_hist_Mass_prob.png} \caption{ (a) The relationship between the mass and the gap-forming probability for the 16 GCs listed in Table \ref{table:probability}. The 6 red dots are the GCs with $P_{\text{gap-forming}} \geq \frac{3}{1000}$. (b) The normalized cumulative distribution for the mass of GCs with different ranges of $P_{\text{gap-forming}}$. Those GCs with higher $P_{\text{gap-forming}}$ are typically more massive. Also, low-mass GCs ($M_\mathrm{GC} \lesssim 10^{4.5} M_\odot$) can hardly form a gap. } \label{fig:mass_prob} \end{figure} \begin{figure} \centering \includegraphics[width=3.2in]{fig4__fig_phi1_t__6GCs_ver3.png} \caption{ The epoch of the close encounter with a GC ($t_\mathrm{encounter}$) and the location of the GD-1-like gap ($\phi_\mathrm{1,gap}$). We show all of the 57 simulations listed in Table \ref{table:probability}. The 6 GCs with $P_\text{gap-forming} \geq \frac{3}{1000}$ are marked by various symbols. The other 10 GCs are shown by gray, filled circles. The size of the symbol represents the strength of the gap. We note that the encounter with NGC5272 (M3) at $t_\mathrm{encounter} \simeq -3.5 \ensuremath{\,\mathrm{Gyr}}$ and that with IC4499 at $t_\mathrm{encounter} \simeq -1.7 \ensuremath{\,\mathrm{Gyr}}$ can form gaps at $-40 \deg < \phi_1 < 0 \deg $ and $-20 \deg < \phi_1 < 0 \deg$, respectively. } \label{fig:phi1_t} \end{figure} \begin{figure} \centering \includegraphics[width=3.2in]{fig5a__fig_my_Lz_E__6GCs_ver2.png}\\ \includegraphics[width=3.2in]{fig5b__fig_my_peri_apo__6GCs.png} \caption{ The orbital properties of the GD-1 stream and GCs. (a) The azimuthal angular momentum and energy. (b) The apocentric and pericentric radii. The blue cross ($+$) corresponds to the GD-1 stream. The red dots correspond to the 6 GCs with $P_\text{gap-forming} \geq \frac{3}{1000}$; among which two GCs (NGC5272 (M3) and IC4499) with the highest-$P_\text{gap-forming}$ are highlighted with red $\odot$. The black open circles correspond to the 10 GCs with $0<P_\text{gap-forming} \leq \frac{2}{1000}$. The other GCs (namely, those GCs with $P_\text{gap-forming}=0$) are marked with gray dots. } \label{fig:GCorbits} \end{figure} \subsection{Epoch of the gap-forming encounters} \label{sec:Encounter_epoch} Fig.~\ref{fig:phi1_t} shows the relationship between the final gap location $\phi_{1,\mathrm{gap}}$ and the epoch of the encounter $t_\mathrm{encounter}$ for the 6 GCs with $P_\text{gap-forming} \geq \frac{3}{1000}$. We see that all of the gap-forming encounters shown here happen at $t<-1.5 \ensuremath{\,\mathrm{Gyr}}$. This result is consistent with the previous work by \cite{Bonaca2019} which claims that none of the GCs seems to have experienced a close encounter with the GD-1 stream in the last $1 \ensuremath{\,\mathrm{Gyr}}$. This result also suggests that tracing the past orbits of GCs up to a sufficiently long time ago (up to $t=-6 \ensuremath{\,\mathrm{Gyr}}$ in our simulation) is important to claim whether or not GCs can form a visible gap in the GD-1 stream. Another intriguing result seen in Fig.~\ref{fig:phi1_t} is that some GCs have their preferable epoch to interact with the GD-1 stream. This result is most prominently seen for NGC5272 (M3) and IC4499. For example, for all of the 22 orbits of NGC5272 (M3) that formed a GD-1-like gap, the GD-1 stream encounters this GC at $t_\mathrm{encounter} \simeq -3.5 \ensuremath{\,\mathrm{Gyr}}$. For these 22 orbits, the location of the GD-1 gap in the $\phi_1$ coordinate is distributed at $-40 \deg < \phi_1 < 0 \deg$. Thus, an encounter with NGC5272 (M3) at $t_\mathrm{encounter} \simeq -3.5 \ensuremath{\,\mathrm{Gyr}}$ can explain any of the observed gaps at $-40 \deg < \phi_1 < 0 \deg$. As another example, for all of the 9 orbits of IC4499 that formed a GD-1-like gap, the GD-1 stream encounters this GC at $t_\mathrm{encounter} \simeq -1.7 \ensuremath{\,\mathrm{Gyr}}$. For these 9 orbits, the location of the GD-1 gap in the $\phi_1$ coordinate is distributed at $-20 \deg < \phi_1 < 0 \deg$, and none of them are distributed at $\phi_1<-20 \deg$. Thus, an encounter with IC4499 at $t_\mathrm{encounter} \simeq -1.7 \ensuremath{\,\mathrm{Gyr}}$ can explain either of the gaps at $\phi_1=-3 \deg$ or $-20 \deg$ but can hardly explain the gap at $\phi_1 = -36 \deg$. \new{ To understand these preferable epochs to form a gap, we check the orbital phase of the GD-1 stream at $t\simeq-3.5 \ensuremath{\,\mathrm{Gyr}}$ when it encounters NGC5272 (M3) and at $t\simeq-1.7\ensuremath{\,\mathrm{Gyr}}$ when it encounters IC4499. Intriguingly, all of these encounters take place when the GD-1 stream is close to its pericenter ($R\simeq 14 \ensuremath{\,\mathrm{kpc}}$). The GD-1 stream becomes longest near the pericentric passage, and therefore the probability of a close encounter is increased due to the enlarged `cross section' of the GD-1 stream. As mentioned in Section \ref{sec:GClist}, these two GCs (NGC5272 (M3) and IC4499) have the highest probability of forming a gap in our fiducial simulations. Our finding hints that, in general, GCs that can encounter the GD-1 stream near the GD-1's pericenter are a promising perturber to form a gap. } \subsection{Gap-forming probability and the orbit of GCs} \label{sec:GCorbit} Fig.~\ref{fig:GCorbits} shows the orbital properties of the GD-1 stream and GCs investigated in this study. In both panels, the GD-1 stream is marked by blue cross and the 6 GCs with $P_\text{gap-forming} \geq \frac{3}{1000}$ are marked with red dots. As we see in Fig.~\ref{fig:GCorbits}(a), all of the GCs with $P_\text{gap-forming} \geq \frac{3}{1000}$ have retrograde or mildly prograde orbits ($L_z > -1000 \ensuremath{\,\mathrm{kpc}} \ensuremath{\,\mathrm{km\ s}^{-1}}$). This tendency is understandable because the GD-1 stream has a highly retrograde orbit with $L_{z,\text{GD-1}} \simeq 2800 \ensuremath{\,\mathrm{kpc}} \ensuremath{\,\mathrm{km\ s}^{-1}}$. When a GC with a certain azimuthal angular momentum $L_{z,\text{GC}}$ has a close encounter with the GD-1 stream at a Galactocentric cylindrical radius $R$, their relative velocity is at least $v_\mathrm{rel} \geq |v_{{\phi},\text{GD-1}} - v_{{\phi},\text{GC}}| = |L_{z,\text{GD-1}}-L_{z,\text{GC}}|/R$. Given that the radial excursion of the GD-1 stream is $14 \ensuremath{\,\mathrm{kpc}} \lesssim R \lesssim 20 \ensuremath{\,\mathrm{kpc}}$ (see Fig.~\ref{fig:GCorbits}(b)), those GCs with highly prograde orbits $L_{z,\text{GC}} < -2000 \ensuremath{\,\mathrm{kpc}} \ensuremath{\,\mathrm{km\ s}^{-1}}$ have at least $v_\mathrm{rel} \gtrsim 200 \ensuremath{\,\mathrm{km\ s}^{-1}}$. Thus, GCs with highly prograde orbits are hard form a gap in the GD-1 stream unless they are very massive. We note that the GD-1 stream and NGC3201 share similar orbital properties. Indeed, \cite{Malhan2022ApJ...926..107M} recently claimed that these systems are part of the same merging event dubbed `The Arjuna/Sequoia/I’itoi merger' (see also \citealt{Bonaca2021ApJ...909L..26B}). Although their orbital similarity is intriguing, the fact that most of the high-$P_\text{gap-forming}$ GCs have very different orbital properties means that even if a GC has an orbital property similar to that of the GD-1 stream, such a GC is not necessarily a good candidate for forming a gap. Rather, as we mentioned in the previous paragraph, the relative distance and velocity at their closest approach are more important factors to form a gap. \input{table2.tex} \subsection{Details on the show-case models} \label{sec:showcase} For an illustration purpose, for each of the 6 GCs with $P_\text{gap-forming} \geq \frac{3}{1000}$, we selected one show-case model. The details of the selected show-case models are summarized in Table~\ref{table:model}. The models are named {NGC2808\_698}, {NGC3201\_202}, $\;$ {NGC5272\_M3\_261}, {IC4499\_311}, {FSR1758\_731}, and {NGC7089\_M2\_138}. Here, the last three digits of these names correspond to the value of $k$. Figs.~\ref{fig:show_case_observables_three_rows_1} and \ref{fig:show_case_observables_three_rows_2} show the current-day properties of the GD-1 stream models corresponding to these show-case models. In Figs.~\ref{fig:show_case_observables_three_rows_1} and \ref{fig:show_case_observables_three_rows_2}, each show-case model is displayed with three rows. The top panel of each show-case model shows the one-dimensional density $\rho(\phi_1)$ with an arbitrary unit. The blue solid-line histogram shows the histogram of stars in each model. The gray dashed line shows the estimated linear density (arbitrarily scaled by a constant factor) derived in \cite{deBoer2020}. The contrast between the gap and its surrounding over-dense regions in our models is similar to that in the observed GD-1 stream. Also, the widths of the gaps in our models are comparable to the observed ones. The middle and bottom panels in each model in Figs.~\ref{fig:show_case_observables_three_rows_1} and \ref{fig:show_case_observables_three_rows_2} shows the morphology of the model in $(\phi_1, X)$ space, where $X$ corresponds to various observables. The show-case model NGC2808\_698 (Fig.~\ref{fig:show_case_observables_three_rows_1}) shows a hole-like structure in $(\phi_1, \phi_2)$ space, caused by the perturber (in this case NGC2808) that penetrated the stream. Interestingly, due to the hole-like structure, we see two parallel sequences of the stream at $-40 \deg < \phi_1 < -20 \deg$, which is reminiscent of the observed spur-like feature in the GD-1 stream \citep{PriceWhelan2018, Bonaca2019}. A similar hole-like structure in $(\phi_1, \phi_2)$ space is also seen in the show-case model NGC3201\_202. In this case, a hole-like feature is also seen in $(\phi_1, d)$ space, indicating that this feature is a three-dimensional structure. Given that we see a hole-like structure in multiple models, it may be one of the generic features that GCs can form. Among the 6 GCs, NGC2808, FSR1758, and NGC7089 (M2) are the most massive GCs with $M>6\times10^5 M_\odot$. Figs.~\ref{fig:show_case_observables_three_rows_1} and \ref{fig:show_case_observables_three_rows_2} show that these massive GCs can form a prominent gap, even if the relative velocity of the encounter is as large as $\simeq 300 \ensuremath{\,\mathrm{km\ s}^{-1}}$ (see also Table.~\ref{table:model}). In contrast, the show-case model IC4499\_311 results in a clear but narrow gap, due to (i) the relatively small mass of IC4499 ($1.55\times 10^5 M_\odot$); and (ii) the relatively recent encounter ($\sim 1.7 \ensuremath{\,\mathrm{Gyr}}$ ago). \begin{figure*} \centering \includegraphics[width=6.in] {fig6a__fig_showcase_three_rows_15_698.png} \\ \includegraphics[width=6.in] {fig6b__fig_showcase_three_rows_18_202.png} \\ \includegraphics[width=6.in] {fig6c__fig_showcase_three_rows_34_261.png} \caption{ Morphology of the show-case GD-1 stream models NGC2808\_698, NGC3201\_202, and NGC5272\_M3\_261. Each model is displayed with three rows, and all the horizontal axes are $\phi_1$. The upper-most wide panel shows the one-dimensional density $\rho(\phi_1)$ in our simulation (blue histogram) and in the observed data \citep{deBoer2020} (gray dashed line). The middle wide panel shows the full extent of the model stream in $(\phi_1, \phi_2)$ space. The lower 5 panels show the model stream near the gap region in $(\phi_1, X)$ space, where $X=\phi_2, d, \mu_{\alpha*}, \mu_\delta$, and $v_{\ensuremath{\mathrm{los}}}$, from left to right. The red vertical lines surrounding the gap are the same for the upper and lower panels. } \label{fig:show_case_observables_three_rows_1} \end{figure*} \begin{figure*} \centering \includegraphics[width=6.in] {fig7a__fig_showcase_three_rows_40_311.png} \\ \includegraphics[width=6.in] {fig7b__fig_showcase_three_rows_89_731.png} \\ \includegraphics[width=6.in] {fig7c__fig_showcase_three_rows_165_138.png} \caption{ The same as Fig.~\ref{fig:show_case_observables_three_rows_1}, but for the show-case GD-1 stream models IC4499\_311, FSR1758\_731, and NGC7089\_M2\_138. } \label{fig:show_case_observables_three_rows_2} \end{figure*} \section{Discussion} \subsection{Are globular clusters responsible for the GD-1 gaps?} \label{sec:discussion_probability} The 16 GCs with $P_\text{gap-forming} \geq \frac{1}{1000}$ can possibly form a gap in the GD-1 stream. If we assume, as a working hypothesis, that all three gaps in the GD-1 stream were created by the perturbation from these GCs, we can estimate its probability by using $P_\text{gap-forming}$ listed in Table \ref{table:probability}: \eq{ &P(\text{GCs formed 3 gaps in the GD-1 stream}) \nonumber \\ =& \sum_{l \in \{4,9, \dots, 165\}} \;\; \sum_{m\,>\,l} \;\; \sum_{n\,>\,m} [ P_\text{gap-forming}(l) \nonumber \\ & \times P_\text{gap-forming}(m) \times P_\text{gap-forming}(n) ] \nonumber \\ =& \new{1.7}\times 10^{-5}. \label{eq:probability} } Here, $P_\text{gap-forming}(j)$ corresponds to the gap-forming probability of $j$th GC, and $\{4,9, \dots, 165\}$ corresponds to the set of $j$ listed in Table~\ref{table:probability}. Given this tiny probability, our results suggest that perturbations from GCs are difficult to explain all three gaps in the GD-1 stream. Because other baryonic effects (e.g., from spiral arms, the Galactic bar, giant molecular clouds, or dwarf galaxies) are even more unlikely to form a gap (see Section \ref{sec:introduction}), our results favor a scenario in which at least one of the gaps in the GD-1 stream were formed by dark matter subhalos \citep{Carlberg2009,Carlberg2016,Erkal2015a,Erkal2015b,Erkal2016,Bonaca2019,BanikBovy2021}. Our results can also be used to estimate the expected number of gaps formed by GCs in the GD-1 stream, $N_\text{gap}(\text{GCs})$. By assuming that a GC can form at most one gap (and no GCs can form multiple gaps), we have \eq{ N_\text{gap}(\text{GCs}) = \sum_{l \in \{4,9, \dots, 165\}} P_\text{gap-forming}(l) = 0.057. \label{eq:N_gap} } We note that the gaps considered in this paper satisfy condition (A) in Section \ref{sec:defineGD1}, namely $\frac{\rho_\mathrm{perturbed}(\phi_1)}{ \rho_\mathrm{unperturbed}(\phi_1)} < 0.8$. As a reference, \cite{Erkal2016} estimated the number of gaps in the GD-1 stream formed by dark matter subhalos, $N_\text{gap}(\text{subhalos})$. According to their Table~2, the expected number of gaps with $\frac{\rho_\mathrm{perturbed}(\phi_1)}{ \rho_\mathrm{unperturbed}(\phi_1)} < 0.75$ formed by dark matter subhalos with $(10^5$-$10^9) M_\odot$ is $N_\text{gap}(\text{subhalos})=0.6$, which is $\sim10$ times larger than our estimate of $N_\text{gap}(\text{GCs})$. Although their value of $N_\text{gap}(\text{subhalos})$ is still smaller than $3$ (the observed number of gaps), this comparison also favors dark matter subhalos as the cause of the GD-1's gaps. \subsection{Dynamical age of the GD-1 stream} \label{sec:dynamical_age} In this paper, we assume that all the stars in the GD-1 stream escaped from the progenitor system at $t=-T$. The dynamical age of the stream, $T$, is set to be $T=6 \ensuremath{\,\mathrm{Gyr}}$ in the main analysis of this paper. To check how our choice of $T$ affects our result, we ran additional simulations with $T= 1, 2, 3$, and $4 \ensuremath{\,\mathrm{Gyr}}$ (see Appendix \ref{appendix:variousT}). (We note that we kept our description in Section \ref{sec:simulations} as general as possible so that the readers can see how the change in $T$ affects the numerical setup of the simulations.) For simulations with $T=1 \ensuremath{\,\mathrm{Gyr}}$ and $T=2 \ensuremath{\,\mathrm{Gyr}}$, we found that all the GCs have $P_\text{gap-forming} =0$. For simulations with $T=3 \ensuremath{\,\mathrm{Gyr}}$, we found only two GCs have $P_\text{gap-forming} \geq \frac{1}{1000}$ (see Table.~\ref{table:probability_3Gyr_4Gyr}), which means that GCs can form at most two gaps. For simulations with $T=4 \ensuremath{\,\mathrm{Gyr}}$, we found 5 GCs with $P_\text{gap-forming} \geq \frac{1}{1000}$ (see Table.~\ref{table:probability_3Gyr_4Gyr}). By combining the result from our fiducial models with $T=6 \ensuremath{\,\mathrm{Gyr}}$, we obtain \eq{ &P(\text{GCs formed 3 gaps in GD-1}) \nonumber \\ &= \begin{cases} 0 \phantom{.0\times10^{-8}} \;\; \text{(if $T=1 \ensuremath{\,\mathrm{Gyr}}$)}\\ 0 \phantom{.0\times10^{-8}} \;\; \text{(if $T=2 \ensuremath{\,\mathrm{Gyr}}$)}\\ 0 \phantom{.0\times10^{-8}} \;\; \text{(if $T=3 \ensuremath{\,\mathrm{Gyr}}$)}\\ 6.2\times10^{-8} \;\; \text{(if $T=4 \ensuremath{\,\mathrm{Gyr}}$)} \\ \new{1.7}\times10^{-5} \;\; \text{(if $T=6 \ensuremath{\,\mathrm{Gyr}}$)}. \label{eq:probability_variousT} \end{cases} } and \eq{ N_\text{gap}(\text{GCs}) = \begin{cases} 0\phantom{.000} \;\; \text{(if $T=1 \ensuremath{\,\mathrm{Gyr}}$)}\\ 0\phantom{.000} \;\; \text{(if $T=2 \ensuremath{\,\mathrm{Gyr}}$)}\\ 0.003 \;\; \text{(if $T=3 \ensuremath{\,\mathrm{Gyr}}$)}\\ 0.010 \;\; \text{(if $T=4 \ensuremath{\,\mathrm{Gyr}}$)} \\ 0.057 \;\; \text{(if $T=6 \ensuremath{\,\mathrm{Gyr}}$)}. \label{eq:N_gap_variousT} \end{cases} } We see that both the total probability and the expected number of gaps become smaller if we adopt a smaller value of $T$. We can understand this tendency in two ways. First, younger streams have fewer opportunities to interact with GCs. Second, it takes some time for a gap to grow and become visible. We note that the previous work by \cite{Bonaca2019} found that no GCs experienced a close encounter with the GD-1 stream in the last $1 \ensuremath{\,\mathrm{Gyr}}$. Their result is consistent with our result with $T=1 \ensuremath{\,\mathrm{Gyr}}$. Our results suggest that adopting a longer integration time increases the chance that GCs can form a gap in the GD-1 stream, but it is extremely hard to explain three gaps only by the GCs, even if we adopt a long integration time of $T=6\ensuremath{\,\mathrm{Gyr}}$. We note that \cite{BanikBovy2021} investigated the past orbit of the GD-1 stream up to $t=-7 \ensuremath{\,\mathrm{Gyr}}$. However, they aimed to assess the power spectrum of the density along the GD-1 steam; and not to focus on the individual gaps. Thus, our work is complementary to their work. \subsection{Choice of the model Galactic potential} \label{sec:different_potentials} \new{ In this paper, we used a model MW potential in \cite{McMillan2017} as the fiducial model. In order to check how our results are affected by the chosen MW potential, we did the same simulations with $T=6 \ensuremath{\,\mathrm{Gyr}}$ but with potential models in \cite{Bovy2015ApJS..216...29B} and \cite{Piffl2014MNRAS.445.3133P}. As a result, we found no dramatic changes from our fiducial simulations in the gap-forming probability \eq{ &P(\text{GCs formed 3 gaps in GD-1}) \nonumber \\ &= \begin{cases} 4.8\times10^{-5} \;\; \text{(if $T=6 \ensuremath{\,\mathrm{Gyr}}$, \citealt{Bovy2015ApJS..216...29B})} \\ 9.7\times10^{-5} \;\; \text{(if $T=6 \ensuremath{\,\mathrm{Gyr}}$, \citealt{Piffl2014MNRAS.445.3133P})} \label{eq:probability_6Gyr_different_potentials} \end{cases} } and the expected number of gaps \eq{ &N_\text{gap}(\text{GCs}) \nonumber \\ &= \begin{cases} 0.076 \;\; \text{(if $T=6 \ensuremath{\,\mathrm{Gyr}}$, \citealt{Bovy2015ApJS..216...29B})} \\ 0.105 \;\; \text{(if $T=6 \ensuremath{\,\mathrm{Gyr}}$, \citealt{Piffl2014MNRAS.445.3133P})}. \label{eq:N_gap_6Gyr_different_potentials} \end{cases} } We note that the list of GCs that form the gaps (i.e., the list of GCs in Table \ref{table:probability} in our fiducial model) slightly changes if we adopt different MW potentials. However, some GCs seem to be more likely to form gaps. For example, if we adopt the Galactic potential model in \cite{Bovy2015ApJS..216...29B}, the three important GCs with the highest $P_\text{gap-forming}$ are IC4499, NGC7089 (M2), and NGC3201, all of which appear in Table \ref{table:probability}. Also, if we adopt the Galactic potential model in \cite{Piffl2014MNRAS.445.3133P}, the two important GCs with the highest $P_\text{gap-forming}$ are IC4499 and NGC6101, both of which appear in Table \ref{table:probability}. Intriguingly, the gap-forming probability of IC4499 is always high $P_\text{gap-forming} \gtrsim 0.01$, independent of the adopted potential. } \subsection{Caveats in our analysis} \label{sec:caveats} As discussed in Section \ref{sec:discussion_probability}, we found that it is extremely unlikely that all three gaps in the GD-1 stream are formed by known GCs. Here we discuss the limitation of our analysis and possible future directions. In our simulation, we treated the stars in the GD-1 stream as test particles that feel the gravitational force from the MW and a perturbing GC. We assume that all the stars were stripped from the \new{center of the} GC-like progenitor system at $t=-T$. In reality, the stripping process may be continuous, \new{ and the stars escape from the progenitor from the inner and outer Lagrange points \citep{Kupper2010MNRAS.401..105K, Kupper2012MNRAS.420.2700K, Kupper2015ApJ...803...80K, Mastrobuono-Battisti2013MmSAI..84..240M, Sanders2013MNRAS.433.1813S, Sanders2013MNRAS.433.1826S, Bovy2014ApJ...795...95B, Fardal2015MNRAS.452..301F, Guillaume2016MNRAS.460.2711T, Ibata2020ApJ...891..161I}. } Also, we do not take into account the host system of the progenitor system that could affect the morphology of the GD-1 stream \citep{Malhan2022ApJ...926..107M,Qian2022MNRAS.511.2339Q}. If we were to reproduce the density profile of the GD-1 stream as a function of $\phi_1$, the effects mentioned above are important and the only way to faithfully take these effects into account is to run $N$-body simulations \new{ or particle spray simulations (see Appendix \ref{appendix:Lagrange}). } However, because we are interested in the probability that the gaps were formed by the GCs, our approach is good enough for our purpose. In this paper, we assumed that the MW potential is static and axisymmetric. These assumptions are simplistic, given that the MW is growing in time due to mass accretion \citep{Buist2015}, that the MW has a rotating bar \citep{Hattori2016,PriceWhelan2016MNRAS.455.1079P}, and that the Large Magellanic Cloud has been perturbing the MW \citep{Besla2010,Erkal2019,GaravitoCamargo2019,Koposov2019,Conroy2021Natur.592..534C,Petersen2021NatAs...5..251P,Shipp2021ApJ...923..149S}. These effects can alter the values of $P_\text{gap-forming}$ for each GC. However, since we did not tune the MW potential to maximize or minimize $P_\text{gap-forming}$ (instead, we just adopted one of the widely-used MW model potentials \new{in our main analysis}), our estimate of the probability that the GCs formed all three gaps in the GD-1 stream, \new{$1.7\times10^{-5}$} (see equation (\ref{eq:probability})), is probably not too far from reality. \new{ Indeed, our additional analysis in Section \ref{sec:different_potentials}, in which we varied the potential, supports this view.} Thus, even though our simulation neglects some important physics, we believe our main conclusion is robust: the probability that GCs are responsible for all three gaps in the GD-1 stream is extremely low. \section{Conclusion} In this paper, we estimated the probability that Galactic GCs can form a gap in the GD-1 stream by using test-particle simulations. The summary of this paper is as follows. \begin{itemize} \item In our fiducial simulations (in which the GD-1 stream is $T=6 \ensuremath{\,\mathrm{Gyr}}$ old), 16 GCs formed a gap in the GD-1 stream at $-40 \deg < \phi_1 < 0 \deg$ (Table \ref{table:probability}). Among them, 6 GCs can form a GD-1-like gap with a gap-forming probability $P_\text{gap-forming} \geq 0.003$. NGC5272 (M3) ($P_\text{gap-forming}=0.022$) and IC4499 ($P_\text{gap-forming}=0.009$) have much higher $P_\text{gap-forming}$ than other GCs. \item There is a moderate trend that more massive GCs tend to have a larger $P_\text{gap-forming}$ (Fig.~\ref{fig:mass_prob}). However, the relative distance and velocity \new{ at their closest approach to the GD-1 stream } are much more critical factors than the mass of the GCs. \item As shown in Figs.~\ref{fig:show_case_observables_three_rows_1} and ~\ref{fig:show_case_observables_three_rows_2}, our perturbed models can capture some of the morphological properties of the observed GD-1 stream, such as the length, widths, and strength of the gaps. \item The probability that all three gaps in the GD-1 stream were formed by the GCs is extremely low. In our fiducial model with $T=6 \ensuremath{\,\mathrm{Gyr}}$, this probability is $P=\new{1.7}\times10^{-5}$ (Section \ref{sec:discussion_probability}). This probability decreases if we adopt smaller $T$ (see equation (\ref{eq:probability_variousT})). Assuming $T \leq 3 \ensuremath{\,\mathrm{Gyr}}$ results in $P=0$, which explains the result of \cite{Bonaca2019} who assumed $T=1 \ensuremath{\,\mathrm{Gyr}}$. \item The expected number of gaps in the GD-1 stream due to the flyby of GCs is $N_\mathrm{gap}(\text{GCs})=0.057$ in our fiducial model (equation (\ref{eq:N_gap})). This number is smaller than that due to the flyby of subhalos ($N_\mathrm{gap}(\text{subhalos})=0.6$) by a factor of 10 \citep{Erkal2016}. \item Given (i) that the probability that all three gaps in the GD-1 stream are formed by the GCs is extremely low, and (ii) that the retrograde orbit of the GD-1 stream makes other baryonic perturbers (e.g., spiral arms, the Galactic bar, or giant molecular clouds) even less likely to form the gaps, at least one of the gaps in the GD-1 stream is probably formed by the dark matter subhalos \citep{Carlberg2009,Carlberg2016,Yoon2011ApJ...731...58Y, Erkal2015a,Erkal2015b,Erkal2016,Bonaca2019,BanikBovy2021}. \item To sophisticate our analysis, we need to run $N$-body simulations of the encounters of the GD-1 stream and GCs by also including the effect from the Large Magellanic Cloud \citep{Erkal2019,Koposov2019,Shipp2021ApJ...923..149S}, or from the host halo of the GD-1's progenitor \citep{Malhan2021MNRAS.501..179M, Qian2022MNRAS.511.2339Q}. \end{itemize} \acknowledgments The authors thank the referee for thorough reading and constructive comments that improved the original manuscript. DY and KH thank NAOJ for financial aid during the 2021 summer student program. We thank Junichi Baba for sharing his $N$-body code that gave insights into our work. KH thanks lecturers of $N$-body winter school 2021 held by NAOJ for stimulating lectures. KH is supported by JSPS KAKENHI Grant Numbers JP21K13965 and JP21H00053. Numerical computations were in part carried out on GRAPE system at Center for Computational Astrophysics, National Astronomical Observatory of Japan. This research was supported in part through computational resources and services provided by Advanced Research Computing (ARC), a division of Information and Technology Services (ITS) at the University of Michigan, Ann Arbor. 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. Guoshoujing Telescope (the Large Sky Area Multi-Object Fiber Spectroscopic Telescope LAMOST) is a National Major Scientific Project built by the Chinese Academy of Sciences. Funding for the project has been provided by the National Development and Reform Commission. LAMOST is operated and managed by the National Astronomical Observatories, Chinese Academy of Sciences. 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 website is www.sdss.org. SDSS-IV is managed by the Astrophysical Research Consortium for the Participating Institutions of the SDSS Collaboration. \begin{comment} including the Brazilian Participation Group, the Carnegie Institution for Science, Carnegie Mellon University, Center for Astrophysics | Harvard \& Smithsonian, the Chilean Participation Group, the French Participation Group, 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. \end{comment} \facility{Gaia, LAMOST, SDSS/SEGUE} \software{ Agama \citep{Vasiliev2019_AGAMA},\; corner.py \citep{ForemanMackey2016}, matplotlib \citep{Hunter2007}, numpy \citep{vanderWalt2011}, scipy \citep{Jones2001}} \bibliographystyle{aasjournal}
16c15e63c56be891797f15beac54fc3a52627135
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Evaluation}\label{sec:evaluation} We have implemented \textsc{ZK-SecreC}\xspace compiler in about 20 kLoC of Haskell code, which includes the parser, type-checker, \lstinline+@public+ precomputation engine, and translator to circuits. With it, we illustrate the expressiveness and efficiency of the \textsc{ZK-SecreC}\xspace language on a number of small examples. We have implemented them, and translated them to arithmetic circuits. The \textsc{ZK-SecreC}\xspace source of our examples is given in the supplementary material. Table~\ref{tbl:circsize} shows the size of generated circuits, including the number of inputs (both for the instance, and the witness), and different arithmetic operations. We distinguish between linear and non-linear (i.e. multiplication) operations, as only the latter are costly for a cryptographic ZKP technique. If our generated circuits compute modulo $2^{61}-1$, then they can be ingested by EMP toolkit~\cite{emp-toolkit}, in which case we also report the running time, network traffic, and memory use of Prover and Verifier. The Verifier process, running on a laptop, talks to a Prover process running on a server. They are connected over a link with 5 ms latency and bandwidth of around 450 Mbit/s. \input{benchmarks-table-submit} \paragraph{Knowing the factors} Our first example is the program in Fig.~\ref{language:factor}, with performance reported in row ``F'' of Table~\ref{tbl:circsize}. \paragraph{Historical millionaires} In this example~\cite{Viaduct}, two millionaires are comparing their net worths over time, and want to figure out whose minimum net worth was larger. In~\cite{Viaduct}, this was an example for secure two-party computation. In our setting, we let both arrays of historical net worths (expressed as integers) to be a part of the witness, and check that the smallest element of the first array is larger than the smallest element of the second array. As such, the instance of the relation appears to be empty, and the relation itself trivially satisfied. The setting is still interesting if we consider it to be part of some larger application where Prover has committed to both arrays, the commitments are part of the instance, and the verification that the witness matches the commitments happens elsewhere. \paragraph{Subset check} In this example, which is part of a larger application developed in \textsc{ZK-SecreC}\xspace, the input consists of two arrays, one held by Verifier and the other one by Prover, and Prover wants to convince Verifier that all elements of the first array are also elements of the second. We show this by sorting the concatenation of two arrays and checking that each element which originated from the first array is followed by an element which is equal to it. \paragraph{ECDSA verification} In this example (again part of a larger application), Verifier has a public key for the ECDSA digital signature scheme~\cite{kerry2013fips}. Prover wants to convince Verifier that he has a message digest and a signature that verifies with respect to the public key. We express this by implementing the ECDSA verification procedure in \textsc{ZK-SecreC}\xspace. The main part of this verification is the computation of two scalar multiplications in the elliptic curve group, where the scalars originate from the signature and the digest. In one of them, the multiplied point is the public key. We use the standard double-and-add method for computing the scalar multiple. In the second multiplication, the multiplied point is the generator of the group. The second point is public, and we use a windowed method to compute its scalar multiples. The implementation of point doublings and additions follows their standard definitions, which require the inversion of certain elements of the field, which we have implemented with the standard compute-and-verify technique. In ECDSA verification, computations are performed in two different fields. The computing of scalar multiplications takes place in the field $\mathbb{Z}_P$, over which the elliptic curve has been defined. But some multiplications and comparisons also take place in the field $\mathbb{Z}_Q$, where $Q$ is the cardinality of the elliptic curve group. \textsc{ZK-SecreC}\xspace thus supports the use of several different moduli (e.g. \lstinline+uint[P]+ and \lstinline+uint[Q]+) in the same program. In this case, the compilation procedure creates several circuits. In order to relate the computations by different moduli, there is an operation for asserting the equality of two values in \lstinline+$post+ stage, these values may belong to different types \lstinline+uint[N]+. These assertions are translated into assertions about the equality of values in the wires of different circuits. It is up to the cryptographic ZKP technique to correctly interpret the produced circuits and relationships between them. Techniques like MPC-in-the-head~\cite{DBLP:conf/stoc/IshaiKOS07,ZKBoo} can likely handle them, using the ring conversions developed for secure multiparty computation protocols~\cite{DBLP:journals/ijisec/BogdanovNTW12}. In Table~\ref{tbl:circsize} we report the sizes of the circuit for different standardized curves~\cite{kerry2013fips}, adding up the numbers of operations for both moduli. As EMP toolkit does not support fields of this size, we do not report any running times. \paragraph{Single-Source Shortest Paths (SSSP)} In this example, the input, known by Prover, is a directed graph with weighted edges. The graph has an \emph{initial vertex}, from which all other vertices are reachable. The graph is represented in sparse manner, i.e. the representation consists of the number of vertices $n$, the number of edges $m$ (also known to Verifier), and, for each edge, its starting vertex, its ending vertex, and its length (all known only to Prover). Prover wants to convince Verifier that the distances from a the initial vertex to all other vertices have certain values. Here Prover finds the shortest distances by himself, as well as the shortest-path tree represented by giving for each vertex (except the initial) the last edge on the shortest path from the origin to this vertex. He makes both of these sets of data available to the computation, after which the circuit checks that they match with the edges. The check consists of three parts. First, for each vertex we check that its reported distance from the origin is equal to the length of the last edge on the shortest path (found through the shortest-path tree), plus the distance of the source vertex of that last edge. Second, for each edge we check that it is \emph{relaxed }, i.e. the distance to its starting vertex, plus its length, is not less than the distance to its ending vertex. Third, we check that the shortest-path tree is indeed a tree rooted in the origin vertex. We do this by pointer-jumping~\cite[Sec.~30.1]{cormen2009introduction} the shortest-path tree for $\lceil \log n\rceil$ times, and check that in the result, all pointers point to the origin vertex. Due to the sparse representation of both the graph itself and the shortest-path tree, the SSSP example makes extensive use of dictionaries (Sec.~\ref{ssec:dictionaries}). It is a nice example of interleaving computation and verification. The shortest distances, and the shortest-path tree are verified in the circuit, which involves the computation of permutations sorting the keys used in the dictionaries, which are verified by comparing the neighboring elements in the sorted list of keys, which requires the computation of bit extractions of these elements, the correctness of which is again verified. \section{Proofs of Theorems~\ref{thm:can_compile}--\ref{thm:correct_compilation}}\label{compilation-proofs} \begin{lemma}\label{compilation:alltoplemma} Let $u\in U$ and let $q$ be a qualified type such that $\uopl{allpre}_d(q)$ for $d=\mbox{\lstinline+@public+}$. If $\uopl{allpure}(u)$ is $q$-exact in $\mbox{\lstinline+@public+}$ then $\uopl{allpuretop}(u)$ is $q$-exact. \end{lemma} \begin{proof} Let $q=(\qualty{t_0}{s_0}{d_0})$. By assumptions, $s_0=\mbox{\lstinline+$pre+}$ and $d_0=\mbox{\lstinline+@public+}$. By definition, $\uopl{allpure}(u)=\uopl{pure} v$ for some~$v$. We proceed by induction on the structure of~$t_0$. \begin{itemize} \item Let $t_0$ be a primitive type. Then, by exactness, $v\in t_0$. This is possible only if $u=v$. Hence $\uopl{allpuretop}(u)=(\uopl{pure} v,\top)$. This pair is $q$-exact by Definition~\ref{compilation:exact}. \item Let $t_0=\listty{q'}$ for some qualified type~$q'$. By $\uopl{allpre}_d(q)$, we must have $\uopl{allpre}_d(q')$. By exactness, $v=(\monadic{v}_1,\ldots,\monadic{v}_n)$ where $n\in\mathbb{N}$ and $\monadic{v}_i$ is $q'$-exact in $\mbox{\lstinline+@public+}$ for every $i=1,\ldots,n$. By definition of $\uopl{allpure}$, all $\monadic{v}_i$ are of the form $\uopl{allpure}(u_i)$ for some $u_i\in U$ such that $u=(u_1,\ldots,u_n)$. By the induction hypothesis, $\uopl{allpuretop}(u_i)$ are $q'$-exact. Thus $\uopl{allpuretop}(u)=(\uopl{pure}(\uopl{allpuretop}(u_1),\ldots,\uopl{allpuretop}(u_n)),\top)$ is $q'$-exact. \end{itemize} \end{proof} \begin{lemma}\label{compilation:getlemma} If $v\in U$ and $\pi\in(\mathbb{N}^*)^2$ then $\uopl{allpuretop}(v)\bullet\pi=\uopl{allpure}(v)$. \end{lemma} \begin{proof} We proceed by induction on the structure of~$v$. If $v$ is of a primitive type then \[ \uopl{allpuretop}(v)\bullet\pi =(\uopl{pure} v,\top)\bullet\pi =\uopl{pure} v =\uopl{allpure}(v)\mbox{.} \] If $v=(v_1,\ldots,v_n)$ then \[ \begin{array}{lcl} \uopl{allpuretop}(v)\bullet\pi &=&(\uopl{pure}(\uopl{allpuretop}(v_1),\ldots,\uopl{allpuretop}(v_n)),\top)\bullet\pi\\ &=&\uopl{pure}(\uopl{allpuretop}(v_1)\bullet\pi,\ldots,\uopl{allpuretop}(v_n)\bullet\pi)\mbox{.} \end{array} \] On the other hand, \[ \uopl{allpure}(v) =\uopl{pure}(\uopl{allpure}(v_1),\ldots,\uopl{allpure}(v_n))\mbox{.} \] The desired claim follows by the induction hypothesis. \end{proof} \begin{lemma}\label{compilation:updexactlemma} Let $d_1,\ldots,d_n$ be domains and $q$ be a qualified type. Moreover, let $q_k=(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_k})$ for every $k=1,\ldots,n$ and $q'=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1})$. Assume $(\monadic{v},\monadic{c})$ being $q'$-exact, let $(\monadic{i}_k,\top)$ be $q_k$-exact for every $k=1,\ldots,n$, and let $(\monadic{v}',\monadic{c}')$ be $q$-exact. Then $\uopl{upd}_{\mathrm{C}}((\monadic{v},\monadic{c}),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}',\monadic{c}'))$ (assuming that it is well defined) is $q'$-exact. \end{lemma} \begin{proof} We proceed by induction on~$n$. If $n=0$ then $q'=q$ and $\uopl{upd}_{\mathrm{C}}((\monadic{v},\monadic{c}),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}',\monadic{c}'))=(\monadic{v}',\monadic{c}')$ which is $q$-exact by assumption. Let now $n>0$ and assume that the claim holds for $n-1$. Denote $q'_1=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_2})$. In order to show that $\uopl{upd}_{\mathrm{C}}((\monadic{v},\monadic{c}),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}',\monadic{c}'))$ is $q'$-exact, we have to prove the implications in Definition~\ref{compilation:exact}: \begin{itemize} \item If $d_1=\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\ldots,(\monadic{v}_{l_1},\monadic{c}_{l_1}))$ where all pairs $(\monadic{v}_k,\monadic{c}_k)$ ($k=1,\ldots,l_1$) are $q'_1$-exact and $\monadic{i}_1=\uopl{pure} i_1$ with $i_1\in\mathbb{N}$. Then $\uopl{upd}_{\mathrm{C}}((\monadic{v},\monadic{c}),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}',\monadic{c}'))=(\monadic{v}'',\top)$ where $\monadic{v}''=\mcomp{a\gets\monadic{v};\; i_1\gets\monadic{i}_1;\;\uopl{pure}([i_1\mapsto\uopl{upd}_{\mathrm{C}}(a_{i_1},\monadic{i}_2\ldots\monadic{i}_n,(\monadic{v}',\monadic{c}'))]a)}$; as the latter is well-defined, $i_1\leq l_1$. As $\uopl{upd}_{\mathrm{C}}((\monadic{v}_{i_1},\monadic{c}_{i_1}),\monadic{i}_2\ldots\monadic{i}_n,(\monadic{v}',\monadic{c}'))$ is $q'_1$-exact by the induction hypothesis, all components of $v''$ are $q'_1$-exact as required. \item As the qualified type $q'$ has stage $\mbox{\lstinline+$pre+}$, $\top$ as the circuit part of the compound value corresponds to the definition. \item Finally, suppose that $d_1\ne\mbox{\lstinline+@public+}$. By $q'$-exactness of $(\monadic{v},\monadic{c})$, we have $\monadic{v}=\top$. Hence $\uopl{upd}_{\mathrm{C}}((\monadic{v},\monadic{c}),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}',\monadic{c}'))=(\top,\top)$, matching the definition. \end{itemize} This establishes the required claim. \end{proof} \begin{lemma}\label{compilation:updlemma} Let $d_1,\ldots,d_n$ be domains and $q$ be a qualified type. Denote $q_k=(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_k})$ for every $k=1,\ldots,n$ and $q'=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1})$. Let $\pi\in\left(\mathbb{N}^*\right)^2$ be a pair of circuit input sequences (for $\mbox{\lstinline+@prover+}$ and $\mbox{\lstinline+@verifier+}$). Let $(\monadic{a},\monadic{c}_0)$ be $q'$-exact and $\monadic{a}'$ be $q'$-exact in circuit; for all $k=1,\ldots,n$, let $(\monadic{i}_k,\top)$ be $q_k$-exact and $\monadic{i}'_k$ be $q_k$-exact in circuit; let $(\monadic{v},\monadic{c}_1)$ be $q$-exact and $\monadic{v}'$ be \mbox{$q$-exact} in circuit. Moreover, assume that $(\monadic{a},\monadic{c}_0)\bullet\pi\sim\monadic{a}'$, for every $k=1,\ldots,n$ we have $(\monadic{i},\top)\bullet\pi\sim\monadic{i}'_k$, and $(\monadic{v},\monadic{c}_1)\bullet\pi\sim\monadic{v}'$. If $\uopl{upd}_{\mathrm{C}}((\monadic{a},\monadic{c}_0),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v},\monadic{c}_1))$ is well-defined then $\uopl{upd}(\monadic{a}',\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}')$ is well-defined, too, whereby $\uopl{upd}_{\mathrm{C}}((\monadic{a},\monadic{c}_0),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v},\monadic{c}_1))\bullet\pi\sim\uopl{upd}(\monadic{a}',\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}')$. \end{lemma} \begin{proof} We proceed by induction on~$n$. If $n=0$ then $q'=q$, and $\uopl{upd}_{\mathrm{C}}((\monadic{a},\monadic{c}_0),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v},\monadic{c}_1))=(\monadic{v},\monadic{c}_1)$, $\uopl{upd}(\monadic{a}',\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v})=\monadic{v}'$. By assumption, $(\monadic{v},\monadic{c}_1)\bullet\pi\sim\monadic{v}'$. Let now $n>0$ and assume that the claim holds for $n-1$. Denoting $q'_1=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_2})$, consider two cases: \begin{itemize} \item Assume that $d_1=\mbox{\lstinline+@public+}$. By the exactness assumptions, $\monadic{a}=\uopl{pure}((\monadic{a}_1,\monadic{c}'_1),\ldots,(\monadic{a}_{l_1},\monadic{c}'_{l_1}))$ and $\monadic{a}'=\uopl{pure}(\monadic{a}'_1,\ldots,\monadic{a}'_{l_1})$ with $(\monadic{a}_k,\monadic{c}'_k)$ being $q'_1$-exact and $a'_k$ being $q'_1$-exact in circuit, whereby $(\monadic{a},\monadic{c}_0)\bullet\pi\sim\monadic{a}'$ implies $(\monadic{a}_k,\monadic{c}'_k)\bullet\pi\sim\monadic{a}'_k$ for every $k=1,\ldots,n$. Similarly, we must have $\monadic{i}_1=\monadic{i}'_1=\uopl{pure} i_1$ with $i_1\in\mathbb{N}$. As $\uopl{upd}_{\mathrm{C}}((\monadic{a},\monadic{c}_0),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v},\monadic{c}_1))$ is well-defined, so is $\uopl{upd}_{\mathrm{C}}((\monadic{a}_{i_1},\monadic{c}'_{i_1}),\monadic{i}_2\ldots\monadic{i}_n,(\monadic{v},\monadic{c}_1))$ and $i_1\leq l_1$. By the induction hypothesis, $\uopl{upd}(\monadic{a}_{i_1},\monadic{i}'_2\ldots\monadic{i}'_n,\monadic{v}')$ is well-defined and $\uopl{upd}_{\mathrm{C}}((\monadic{a}_{i_1},\monadic{c}'_{i_1}),\monadic{i}_2\ldots\monadic{i}_n,(\monadic{v},\monadic{c}_1))\bullet\pi\sim\uopl{upd}(\monadic{a}_{i_1},\monadic{i}'_2\ldots\monadic{i}'_n,\monadic{v}')$. All this implies that $\uopl{upd}(\monadic{a}',\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}')$ is also well-defined. Using the definitions of $\uopl{upd}_{\mathrm{C}}$ and $\uopl{upd}$, we obtain $\uopl{upd}_{\mathrm{C}}((\monadic{a},\monadic{c}_0),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v},\monadic{c}_1))\bullet\pi\sim\uopl{upd}(\monadic{a}',\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}')$ as desired. \item Now assume that $d_1\ne\mbox{\lstinline+@public+}$. Then $(\monadic{a},\monadic{c}_0)=(\top,\top)$ and $\monadic{a}'=\top$ by exactness and exactness in circuit. Hence also $\uopl{upd}_{\mathrm{C}}((\monadic{a},\monadic{c}_0),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v},\monadic{c}_1))=(\top,\top)$ and $\uopl{upd}(\monadic{a}',\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}')=\top$ which is well-defined. The desired claim follows since $(\top,\top)\bullet\pi=\top$. \end{itemize} \end{proof} \begin{theorem}[Theorem~\ref{thm:can_compile}] Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$. Let $\gamma\in\mathbf{Env}_\mathrm{C}$ be $\Gamma$-exact. Let $\phi\in\mathbf{In}^3$ such that, for all subexpressions of~$e$ of the form $\ofty{\getexpr{d}{k}}{q'}$ where $d=\mbox{\lstinline+@public+}$, the value $\uopl{allpure}(\phi_{d}(k))$ is $q'$-exact in~$d$. Let $\nu\in\mathbb{N}^2$. Unless an array lookup fails due to an index being out of bounds, we have $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ for some $\monadic{v}$, $\monadic{c}$, $\gamma'$, $\omicron$ and $\nu'$, whereby $(\monadic{v},\monadic{c})$ is $q$-exact and $\gamma'$ is $\Gamma$-exact. \end{theorem} \begin{proof} Let $q=(\qualty{t_0}{s_0}{d_0})$. We proceed by induction on the structure of~$e$. Assume that no array lookup fails due to an index being out of bounds. \begin{itemize} \item If $e=\epsilon$ then $t_0=\mbox{\lstinline+()+}$, $s_0=\mbox{\lstinline+$pre+}$, $d_0=\mbox{\lstinline+@public+}$. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ (\monadic{v},\monadic{c})=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'=\gamma\mbox{,}\quad\omicron=\epsilon\mbox{,}\quad\nu'=\nu\mbox{.} \] The pair $(\monadic{v},\monadic{c})$ is $q$-exact since $\mbox{\textoneoldstyle}\in\mbox{\lstinline+()+}$. Finally, $\gamma'$ is $\Gamma$-exact by assumption about~$\gamma$. \item If $e=\overline{n}$ where $n\in\mathbb{N}$ then $t_0=\uintmodty{\mbox{\lstinline+N+}}$. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\branching{\uopl{pure} n&\mbox{if $d_0=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\uopl{pure}(\mknode{\uopl{con}(n)})&\mbox{if $s_0=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}})\mbox{,}\\\gamma'=\gamma\mbox{,}\quad\omicron=\epsilon\mbox{,}\quad\nu'=\nu\mbox{.} \end{array} \] The pair $(\monadic{v},\monadic{c})$ is $q$-exact since $|\mknode{\uopl{con}(n)}|=\uopl{pure} n=\uopl{pure}(\mknode{\uopl{con}(n)}(\pi))$. Finally, $\gamma'$ is $\Gamma$-exact by assumption about~$\gamma$. \item If $e=\overline{b}$ where $b\in\mathbb{B}$ then $t_0=\boolmodty{\mbox{\lstinline+N+}}$. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\branching{\uopl{pure} b&\mbox{if $d_0=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\uopl{pure}(\mknode{\uopl{con}(|b|)})&\mbox{if $s_0=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}})\mbox{,}\\\gamma'=\gamma\mbox{,}\quad\omicron=\epsilon\mbox{,}\quad\nu'=\nu\mbox{.} \end{array} \] The pair $(\monadic{v},\monadic{c})$ is $q$-exact since $|\mknode{\uopl{con}(|b|)}|=\uopl{pure}|b|=\uopl{pure}(\mknode{\uopl{con}(|b|)}(\pi))$. Finally, $\gamma'$ is $\Gamma$-exact by assumption about~$\gamma$. \item If $e=x$ then $\lookup{\Gamma}{x}=q$. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ (\monadic{v},\monadic{c})=\lookup{\gamma}{x}\mbox{,}\quad\gamma'=\gamma\mbox{,}\quad\omicron=\epsilon\mbox{,}\quad\nu'=\nu\mbox{.} \] By assumption, $\gamma$ is $\Gamma$-exact, whence $\lookup{\gamma}{x}$ is $q$-exact and $\gamma'$ is $\Gamma$-exact as needed. \item If $e=\addexpr{e_1}{e_2}$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{.} \end{array} \] By the induction hypothesis about $e_1$, we have $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q$-exact and $\gamma_1$ is $\Gamma$-exact. Hence by the induction hypothesis about $e_2$, we have $\semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)$ where $(\monadic{v}_2,\monadic{c}_2)$ is $q$-exact and $\gamma_2$ is $\Gamma$-exact. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} \monadic{v}=\mcomp{i_1\gets\monadic{v}_1;\; i_2\gets\monadic{v}_2;\;\uopl{pure}(i_1+i_2)}\mbox{,}\\ \monadic{c}=\mcomp{c_1\gets\monadic{c}_1;\; c_2\gets\monadic{c}_2;\;\uopl{pure}(\mknode{\uopl{op}(+)}(c_1,c_2))}\mbox{,}\\ \gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{,}\quad\nu'=\nu_2\mbox{.} \end{array} \] The desired claim about~$\gamma'$ holds because of $\gamma_2$ being $\Gamma$-exact. For proving that $(\monadic{v},\monadic{c})$ is $q$-exact, we have to establish all implications in Definition~\ref{compilation:exact}. \begin{itemize} \item If $s_0=\mbox{\lstinline+$post+}$ then $\monadic{c}_1=\uopl{pure} c_1$ and $\monadic{c}_2=\uopl{pure} c_2$ by exactness. Hence we obtain $\monadic{c}=\uopl{pure}(\mknode{\uopl{op}(+)}(c_1,c_2))$. Suppose that $\monadic{v}=\uopl{pure} n$, $n\in\mathbb{N}$. Then $\monadic{v}_1=\uopl{pure} i_1$, $\monadic{v}_2=\uopl{pure} i_2$, $n=i_1+i_2$. Moreover, $|c_1|=\uopl{pure} i_1=\uopl{pure}(c_1(\pi))$ and $|c_2|=\uopl{pure} i_2=\uopl{pure}(c_2(\pi))$. This implies $|c|=\uopl{pure}(i_1+i_2)=\uopl{pure} n$ and $|c|=\uopl{pure}(c_1(\pi)+c_2(\pi))=\uopl{pure}(\mknode{\uopl{op}(+)}(c_1,c_2)(\pi))$ as desired. \item If $d_0=\mbox{\lstinline+@public+}$ then $\monadic{v}_1=\uopl{pure} i_1$ and $\monadic{v}_2=\uopl{pure} i_2$ where $i_1,i_2\in\mathbb{N}$. Hence $\monadic{v}=\uopl{pure}(i_1+i_2)$, $i_1+i_2\in\mathbb{N}$ as desired. \item If $s_0=\mbox{\lstinline+$pre+}$ then $\monadic{c}_1=\monadic{c}_2=\top$. Hence $\monadic{c}=\top$. \item If $d_0\ne\mbox{\lstinline+@public+}$ then $\monadic{v}_1=\monadic{v}_2=\top$. Hence $\monadic{v}=\top$. \end{itemize} \item If $e=\assertexpr{e_1}$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$post+}}{d_1}\mbox{,}\\ t_0=\mbox{\lstinline+()+}\mbox{,}\quad s_0=\mbox{\lstinline+$pre+}\mbox{,}\quad d_0=\mbox{\lstinline+@public+}\mbox{.} \end{array} \] Denote $q'=(\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$post+}}{d_1})$. By the induction hypothesis about $e_1$, we have $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q'$-exact and $\gamma_1$ is $\Gamma$-exact. The former guarantees $\monadic{c}_1=\uopl{pure} c_1$ for some $c_1\in T$. Therefore we have $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\uopl{pure}\mbox{\textoneoldstyle},\top)\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\omicron_1c_1\mbox{,}\quad\nu'=\nu_1\mbox{.} \end{array} \] The desired claim about~$\gamma'$ holds because of $\gamma_1$ being $\Gamma$-exact. The pair $(\monadic{v},\monadic{c})$ is $q$-exact since $\mbox{\textoneoldstyle}\in\mbox{\lstinline+()+}$. \item If $e=\getexpr{d}{k}$ then $s_0=\mbox{\lstinline+$pre+}$ and $d_0=d$. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ (\monadic{v},\monadic{c})=\branching{\uopl{allpuretop}(\phi_d(k))&\mbox{if $d=\mbox{\lstinline+@public+}$}\\(\top,\top)&\mbox{otherwise}}\mbox{,}\quad\gamma'=\gamma\mbox{,}\quad\omicron=\epsilon\mbox{,}\quad\nu'=\nu\mbox{.} \] If $d=\mbox{\lstinline+@public+}$ then, by assumption, $\uopl{allpure}(\phi_d(k))$ is $q$-exact in $\mbox{\lstinline+@public+}$, which implies $\uopl{allpuretop}(\phi_d(k))$ being $q$-exact by Lemma~\ref{compilation:alltoplemma}. Hence if $d=\mbox{\lstinline+@public+}$ then $(\monadic{v},\monadic{c})$ is $q$-exact. Otherwise, $(\top,\top)$ is $q$-exact by Definition~\ref{compilation:exact}. Finally, $\gamma'$ is $\Gamma$-exact by the assumption about~$\gamma$. \item If $e=\ifexpr{e_1}{e_2}{e_3}$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_3:q\mbox{,}\\ \gen{d_1}\supseteq\gen{s_0}\cup\gen{d_0}\mbox{.} \end{array} \] Denote $q'=\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1}$. By the induction hypothesis about~$e_1$, we have $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q'$-exact and $\gamma_1$ is $\Gamma$-exact. Consider three cases: \begin{itemize} \item Suppose $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$. By the induction hypothesis about~$e_2$, we have $\semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)$ where $(\monadic{v}_2,\monadic{c}_2)$ is $q$-exact and $\gamma_2$ is $\Gamma$-exact. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\monadic{v}_2,\monadic{c}_2)\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{,}\quad\nu'=\nu_2\mbox{.} \end{array} \] The desired claim follows. \item Suppose $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$. By the induction hypothesis about~$e_3$, we have $\semc{e_3}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_3,\monadic{c}_3),\gamma_3,\omicron_3,\nu_3)$ where $(\monadic{v}_3,\monadic{c}_3)$ is $q$-exact and $\gamma_3$ is $\Gamma$-exact. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\monadic{v}_3,\monadic{c}_3)\mbox{,}\quad\gamma'=\gamma_3\mbox{,}\quad\omicron=\omicron_1\omicron_3\mbox{,}\quad\nu'=\nu_3\mbox{.} \end{array} \] The desired claim follows. \item If $\monadic{v}_1\ne\uopl{pure} b$ for $b\in\mathbb{B}$ then we obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ (\monadic{v},\monadic{c})=(\top,\top)\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\omicron_1\mbox{,}\quad\nu'=\nu_1\mbox{.} \] By $\gamma_1$ being $\Gamma$-exact, we obtain the desired result about~$\gamma'$. Moreover, $q'$-exactness of $(\monadic{v}_1,\monadic{c}_1)$ implies $d_1\ne\mbox{\lstinline+@public+}$. Now $\gen{d_1}\supseteq\gen{s_0}\cup\gen{d_0}$ implies $d_0\ne\mbox{\lstinline+@public+}$ and $s_0=\mbox{\lstinline+$pre+}$. Consequently, $(\top,\top)$ is $q$-exact as desired. \end{itemize} \item If $e=\forexpr{x}{e_1}{e_2}{e_3}$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}\mbox{,}\\ (x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma\mbox{\ $\vdash$\ } e_3:q_1\mbox{,}\\ t_0=\listty{q_1}\mbox{,}\quad s_0=\mbox{\lstinline+$pre+}\mbox{.} \end{array} \] Denote $q'=(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0})$. By the induction hypothesis about $e_1$, we have $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q'$-exact and $\gamma_1$ is $\Gamma$-exact. Hence by the induction hypothesis about $e_2$, we have $\semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)$ where $(\monadic{v}_2,\monadic{c}_2)$ is $q'$-exact and $\gamma_2$ is $\Gamma$-exact. Note that $q'$-exactness implies $\monadic{c}_1=\monadic{c}_2=\top$. Consider two cases: \begin{itemize} \item Suppose $\monadic{v}_1=\uopl{pure} i_1$ and $\monadic{v}_2=\uopl{pure} i_2$. By $q'$-exactness, $d_0=\mbox{\lstinline+@public+}$. Denote $n=\max(0,i_2-i_1)$. All pairs of the form $(\uopl{pure}(i_1+k),\top)$ are $q'$-exact as $(\uopl{pure} i_1,\top)$ is \mbox{$q'$-exact} by the above. Hence $\left((x,(\uopl{pure} i_1,\top)),\gamma_2\right)$ is $\Gamma'$-exact where $\Gamma'=((x:q'),\Gamma)$. By the induction hypothesis about~$e_3$, we have $\semc{e_3}((x,(\uopl{pure} i_1,\top)),\gamma_2)\phi\nu_2=\uopl{pure}((\monadic{v}_3,\monadic{c}_3),\gamma_3,\omicron_3,\nu_3)$ where $(\monadic{v}_3,\monadic{c}_3)$ is $q_1$-exact and $\gamma_3$ is $\Gamma'$-exact. As the updated environment $[x\mapsto(\uopl{pure}(i_1+1),\top)]\gamma_3$ is also $\Gamma'$-exact, the induction hypothesis also implies $\semc{e_3}([x\mapsto(\uopl{pure}(i_1+1),\top)]\gamma_3)\phi\nu_3=\uopl{pure}((\monadic{v}_4,\monadic{c}_4),\gamma_4,\omicron_4,\nu_4)$ where $(\monadic{v}_4,\monadic{c}_4)$ being $q_1$-exact and $\gamma_4$ being $\Gamma'$-exact. Analogously, for all $k=5,\ldots,n+2$, we obtain $\semc{e_3}([x\mapsto(\uopl{pure}(i_1+k-3),\top)]\gamma_{k-1})\phi\nu_{k-1}=\uopl{pure}((\monadic{v}_k,\monadic{c}_k),\gamma_k,\omicron_k,\nu_k)$ where $(\monadic{v}_k,\monadic{c}_k)$ is $q_1$-exact and $\gamma_k$ is $\Gamma'$-exact. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\uopl{pure}((\monadic{v}_3,\monadic{c}_3),\ldots,(\monadic{v}_{n+2},\monadic{c}_{n+2})),\top)\mbox{,}\\\gamma'=\uopl{tail}\gamma_{n+2}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+2}\mbox{,}\quad\nu'=\nu_{n+2}\mbox{.} \end{array} \] Hence $(\monadic{v},\monadic{c})$ is $q$-exact since $d_0=\mbox{\lstinline+@public+}$ and $s_0=\mbox{\lstinline+$pre+}$. As $\gamma_{n+2}$ is $\Gamma'$-exact, $\uopl{tail}\gamma_{n+2}$ is $\Gamma$-exact, implying also the desired claim about~$\gamma'$. \item If $\monadic{v}_1\ne\uopl{pure} n$ or $\monadic{v}_2\ne\uopl{pure} n$ for $n\in\mathbb{N}$ then we obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ (\monadic{v},\monadic{c})=(\top,\top)\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{,}\quad\nu'=\nu_2\mbox{.} \] By $\gamma_2$ being $\Gamma$-exact, we obtain the desired result about~$\gamma'$. Moreover, $q'$-exactness of $(\monadic{v}_i,\monadic{c}_i)$ for $i=1,2$ implies $d_0\ne\mbox{\lstinline+@public+}$. As $s_0=\mbox{\lstinline+$pre+}$, this implies $(\top,\top)$ being $q$-exact. \end{itemize} \item If $e=\wireexpr{e_1}$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_0}{\mbox{\lstinline+$post+}}{d_0}\mbox{,}\\ t_0\in\left\lbrace\uintmodty{\mbox{\lstinline{N}}},\boolmodty{\mbox{\lstinline{N}}}\right\rbrace\mbox{.} \end{array} \] Denote $q'=\qualty{t_0}{\mbox{\lstinline+$post+}}{d_0}$. By the induction hypothesis about $e_1$, we have $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q'$-exact and $\gamma_1$ is $\Gamma$-exact. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\monadic{v}_1,\branching{\uopl{pure}(\mknode{\uopl{con}(n)})&\mbox{if $\monadic{v}_1=\uopl{pure} n$, $n\in\mathbb{N}$}\\\uopl{pure}(\mknode{\uopl{con}(|b|)})&\mbox{if $\monadic{v}_1=\uopl{pure} b$, $b\in\mathbb{B}$}\\\uopl{pure}(\mknode{\uopl{in}_d({(\nu_1)}_d)})&\mbox{if $\monadic{v}_1=\top$}})\mbox{,}\\\gamma'=\gamma_1\mbox{,}\quad\omicron=\omicron_1\mbox{,}\quad\nu'=\lam{d'}{\branching{(\nu_1)_{d'}+1&\mbox{if $d'=d$}\\(\nu_1)_{d'}&\mbox{otherwise}}}\mbox{.} \end{array} \] To establish that $(\monadic{v},\monadic{c})$ is $q$-exact, note that in all cases $\monadic{c}=\uopl{pure} c$ for some circuit~$c$. Furthermore, consider two cases: \begin{itemize} \item Suppose that $\monadic{v}=\uopl{pure} n$ for some $n\in\mathbb{N}$. Since $\monadic{v}=\monadic{v}_1$, we must have $c=\mknode{\uopl{con}(n)}$. Hence $|c|=\uopl{pure} n=\uopl{pure}(c(\pi))$. \item Suppose that $\monadic{v}=\uopl{pure} b$ for some $b\in\mathbb{B}$. Since $\monadic{v}=\monadic{v}_1$, we must have $c=\mknode{\uopl{con}(|b|)}$. Hence $|c|=\uopl{pure}|b|=\uopl{pure}(c(\pi))$. \end{itemize} The clauses of Definition~\ref{compilation:exact} about $\monadic{v}$ hold by $\monadic{v}=\monadic{v}_1$ and $(\monadic{v}_1,\monadic{c}_1)$ being $q'$-exact. Finally, $\gamma'$ is $\Gamma$-exact since $\gamma'=\gamma_1$ and $\gamma_1$ is $\Gamma$-exact. \item If $e=(\castexpr{e_1}{q})$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_0}{s_1}{d_1}\mbox{,}\\ s_1\mathrel{\mathchar"13C\mathchar"3A} s_0\mbox{,}\quad d_1\mathrel{\mathchar"13C\mathchar"3A} d_0\mbox{.} \end{array} \] Denote $q_1=\qualty{t_0}{s_1}{d_1}$. The induction hypothesis implies $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q_1$-exact and $\gamma_1$ is $\Gamma$-exact. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ (\monadic{v},\monadic{c})=(\branching{\monadic{v}_1&\mbox{if $d_0=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\monadic{c}_1&\mbox{if $s_0=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}})\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\omicron_1\mbox{,}\quad\nu'=\nu_1\mbox{.} \] To establish that $(\monadic{v},\monadic{c})$ is $q$-exact, consider cases: \begin{itemize} \item Suppose that $s_0=\mbox{\lstinline+$post+}$. Then $\monadic{c}=\monadic{c}_1$. By $s_1\mathrel{\mathchar"13C\mathchar"3A} s_0$, we also have $s_1=\mbox{\lstinline+$post+}$. By $(\monadic{v}_1,\monadic{c}_1)$ being $q_1$-exact, $\monadic{c}=\uopl{pure} c$ for some circuit~$c$. If $\monadic{v}=\uopl{pure} v$ for some~$v$ then $d_0=\mbox{\lstinline+@public+}$ and $\monadic{v}_1=\monadic{v}$. By $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$, also $d_1=\mbox{\lstinline+@public+}$. Consequently, $q_0=q_1$, whence $(\monadic{v},\monadic{c})$ is $q$-exact because $(\monadic{v}_1,\monadic{c}_1)$ is $q_1$-exact. \item Suppose that $d_0=\mbox{\lstinline+@public+}$ and $t_0$ is a primitive type. Then $\monadic{v}=\monadic{v}_1$. As $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$ implies $d_1=\mbox{\lstinline+@public+}$, we have $\monadic{v}_1=\uopl{pure} v$ with $v\in t_0$ by $(\monadic{v}_1,\monadic{c}_1)$ being $q_1$-exact. \item Suppose that $d_0=\mbox{\lstinline+@public+}$ and $t_0=\listty{q'}$. Then $\monadic{v}=\monadic{v}_1$. As $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$ implies $d_1=\mbox{\lstinline+@public+}$ and $(\monadic{v}_1,\monadic{c}_1)$ is $q_1$-exact, we have $\monadic{v}_1=\uopl{pure}((\monadic{v}'_1,\monadic{c}'_1),\ldots,(\monadic{v}'_l,\monadic{c}'_l))$ where all $(\monadic{v}'_i,\monadic{c}'_i)$ are $q'$-exact. \item Suppose that $d_0\ne\mbox{\lstinline+@public+}$. Then $\monadic{v}=\top$ by definition. \end{itemize} Hence $(\monadic{v},\monadic{c})$ is $q$-exact indeed. Finally, $\gamma'$ is $\Gamma$-exact since $\gamma'=\gamma_1$ and $\gamma_1$ is $\Gamma$-exact. \item If $e=(\assignexpr{e_1}{e_2})$ then $q=\qualty{\mbox{\lstinline+()+}}{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}}$. Let $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$ where $x$ is a variable. By Lemma~\ref{typesystem:lhslemma}, there exist domains $d_1,\ldots,d_n$ such that \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } x:q'\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } y_i:q_i\mbox{ for every $i=1,\ldots,n$,}\\ \Gamma\mbox{\ $\vdash$\ } e_1:q_{n+1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q_{n+1}\mbox{,} \end{array} \] where $q_i=\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_i}$ for each $i=1,\ldots,n$ and \[ q'=\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q_{n+1}}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{.} \] By the induction hypothesis, we have \[ \begin{array}{l} \semc{y_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \semc{y_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{,}\\ \dotfill\\ \semc{y_n}\gamma_{n-1}\phi\nu_{n-1}=\uopl{pure}((\monadic{v}_n,\monadic{c}_n),\gamma_n,\omicron_n,\nu_n)\mbox{,}\\ \semc{e_2}\gamma_n\phi\nu_n=\uopl{pure}((\monadic{v}_{n+1},\monadic{c}_{n+1}),\gamma_{n+1},\omicron_{n+1},\nu_{n+1})\mbox{,} \end{array} \] where $(\monadic{v}_i,\monadic{c}_i)$ is $q_i$-exact and $\gamma_i$ is $\Gamma$-exact for every $i=1,\ldots,n+1$. Hence we obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\uopl{pure}\mbox{\textoneoldstyle},\top)\mbox{,}\\\gamma'=[x\mapsto\uopl{upd}_{\mathrm{C}}(\lookup{\gamma}{x},\monadic{v}_1\ldots\monadic{v}_n,(\monadic{v}_{n+1},\monadic{c}_{n+1}))]\gamma_{n+1}\mbox{,}\\\omicron=\omicron_1\ldots\omicron_{n+1}\mbox{,}\\\nu'=\nu_{n+1}\mbox{.} \end{array} \] Obviously $(\uopl{pure}\mbox{\textoneoldstyle},\top)$ is $q$-exact. By Lemma~\ref{compilation:updexactlemma}, $\uopl{upd}_{\mathrm{C}}(\lookup{\gamma}{x},\monadic{v}_1\ldots\monadic{v}_n,(\monadic{v}_{n+1},\monadic{c}_{n+1}))$ is $q'$-exact. Hence also $\gamma'$ is $\Gamma$-exact. \item If $e=\loadexpr{e_1}{e_2}$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{.} \end{array} \] Denote $q_1=\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_1}$ and $q'=\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_1}$. By the induction hypothesis about $e_1$, we have $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q_1$-exact and $\gamma_1$ is $\Gamma$-exact. Hence by the induction hypothesis about~$e_2$, we have $\semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)$ where $(\monadic{v}_2,\monadic{c}_2)$ is $q'$-exact and $\gamma_2$ is $\Gamma$-exact. Let $\monadic{r}=\mcomp{a\gets\monadic{v}_1;\; i\gets\monadic{v}_2;\;\uopl{pure} a_i}$; then $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=\branching{(\monadic{v}',\monadic{c}')&\mbox{if $\monadic{r}=\uopl{pure}(\monadic{v}',\monadic{c}')$}\\(\top,\top)&\mbox{otherwise}}\mbox{,}\\ \gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{,}\quad\nu'=\nu_2\mbox{,} \end{array} \] Consider two cases: \begin{itemize} \item If $d_1=\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\uopl{pure}((\monadic{v}'_1,\monadic{c}'_1),\ldots,(\monadic{v}'_l,\monadic{c}'_l))$ where $(\monadic{v}'_k,\monadic{c}'_k)$ is $q$-exact for every $k=1,\ldots,l$, and $\monadic{v}_2=\uopl{pure} i$ for some $i\in\mathbb{N}$. Therefore $\monadic{r}=\uopl{pure}(\monadic{v}'_i,\monadic{c}'_i)$ and $(\monadic{v},\monadic{c})=(\monadic{v}'_i,\monadic{c}'_i)$. The latter pair is $q$-exact by the above. \item If $d_1\ne\mbox{\lstinline+@public+}$ then $d_0\ne\mbox{\lstinline+@public+}$ and $s_0=\mbox{\lstinline+$pre+}$ because of $q_1$ being well-structured by Theorem~\ref{typesystem:thm}. By exactness, $\monadic{v}_1=\top$. Therefore also $\monadic{r}=\top$ and $(\monadic{v},\monadic{c})=(\top,\top)$. The latter pair is $q$-exact because of $d_0\ne\mbox{\lstinline+@public+}$ and $s_0=\mbox{\lstinline+$pre+}$. \end{itemize} Finally, $\gamma'$ is $\Gamma$-exact since $\gamma'=\gamma_2$ and $\gamma_2$ is $\Gamma$-exact. \item If $e=\stmtcomp{\letexpr{x}{e_1}}{e_2}$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ (x:\qualty{t_1}{s_1}{d_1}),\Gamma\mbox{\ $\vdash$\ } e_2:\qualty{t_0}{s_0}{d_0}\mbox{.} \end{array} \] Denote $q_1=(\qualty{t_1}{s_1}{d_1})$. By the induction hypothesis, $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q_1$-exact and $\gamma_1$ is $\Gamma$-exact. This implies $\left((x,(\monadic{v}_1,\monadic{c}_1)),\gamma_1\right)$ being $\Gamma'$-exact where $\Gamma'=((x:q_1),\Gamma)$. Hence by the induction hypothesis, $\semc{e_2}((x,(\monadic{v}_1,\monadic{c}_1)),\gamma_1)\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)$ where $(\monadic{v}_2,\monadic{c}_2)$ is $q$-exact and $\gamma_2$ is $\Gamma'$-exact. Obviously $\uopl{tail}\gamma_2$ is \mbox{$\Gamma$-exact}. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ (\monadic{v},\monadic{c})=(\monadic{v}_2,\monadic{c}_2)\mbox{,}\quad\gamma'=\uopl{tail}\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{,}\quad\nu'=\nu_2\mbox{.} \] The desired claim follows. \item If $e=\stmtcomp{e_1}{e_2}$ then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{t_0}{s_0}{d_0}\mbox{.} \end{array} \] Denote $q_1=(\qualty{t_1}{s_1}{d_1})$. By the induction hypothesis, $\semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)$ where $(\monadic{v}_1,\monadic{c}_1)$ is $q_1$-exact and $\gamma_1$ is $\Gamma$-exact. Hence by the induction hypothesis, $\semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)$ where $(\monadic{v}_2,\monadic{c}_2)$ is $q$-exact and $\gamma_2$ is $\Gamma$-exact. We obtain $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ where \[ (\monadic{v},\monadic{c})=(\monadic{v}_2,\monadic{c}_2)\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{,}\quad\nu'=\nu_2\mbox{.} \] The desired claim follows. \end{itemize} \end{proof} \begin{theorem}[Theorem \ref{thm:correct_compilation}] Let $\Gamma \mbox{\ $\vdash$\ } e:\qualty{t}{s}{d}! D$ with well-structured~$\Gamma$. Let $\gamma\in\mathbf{Env}_\mathrm{C}$ be $\Gamma$-exact, $\phi\in\mathbf{In}^3$ be a triple of type correct input dictionaries, and $\nu\in\mathbb{N}^2$. Let $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$. Let $\pi\in(\mathbb{N}^*)^2$, $\gamma'\in\mathbf{Env}$, $\omicron'\in\mathbf{Out}^2$ be such that $\gamma'$ is $\Gamma$-exact in circuit, $\gamma\bullet\pi\sim\gamma'$ and $\nu\bullet\pi\sim\omicron'$. Then: \begin{enumerate} \item If $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$ then $\tilde{\omicron}$ accepts $\pi$; moreover, $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ and $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$; \item If $\sem{e}\gamma'\phi\omicron'$ fails (i.e., it is not of the form $\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$), while all circuits that arise during compilation need only inputs in~$\pi$, then $\tilde{\omicron}$~{}does not accept~$\pi$. \end{enumerate} \end{theorem} \begin{proof} We proceed by induction on the structure of~$e$. \begin{itemize} \item If $e=\epsilon$ then \[ t=\mbox{\lstinline+()+}\mbox{,}\quad s=\mbox{\lstinline+$pre+}\mbox{,}\quad d=\mbox{\lstinline+@public+}\mbox{.} \] Furthermore, $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ (\monadic{v},\monadic{c})=(\uopl{pure}\mbox{\textoneoldstyle},\top)\mbox{,}\quad\tilde{\gamma}=\gamma\mbox{,}\quad\tilde{\omicron}=\epsilon\mbox{,}\quad\tilde{\nu}=\nu\mbox{,} \] and $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$ where \[ \monadic{v}'=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\tilde{\gamma}'=\gamma'\mbox{,}\quad\tilde{\omicron}'=\omicron'\mbox{.} \] The empty output circuit vacuously accepts~$\pi$. As $\tilde{\gamma}=\gamma$ and $\tilde{\gamma}'=\gamma'$, the claim $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ follows from assumptions. As $\tilde{\nu}=\nu$ and $\tilde{\omicron}'=\omicron'$, the claim $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$ also follows from assumptions. Finally, \[ (\monadic{v},\monadic{c})\bullet\pi=(\uopl{pure}\mbox{\textoneoldstyle},\top)\bullet\pi=\uopl{pure}\mbox{\textoneoldstyle}=\monadic{v}'\mbox{,} \] implying $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$. \item If $e=\overline{n}$ where $n\in\mathbb{N}$ then \[ t=\uintmodty{\mbox{\lstinline+N+}}\mbox{.} \] Furthermore, $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\branching{\uopl{pure} n&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\uopl{pure}(\mknode{\uopl{con}(n)})&\mbox{if $s=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}})\mbox{,}\\\tilde{\gamma}=\gamma\mbox{,}\quad\tilde{\omicron}=\epsilon\mbox{,}\quad\tilde{\nu}=\nu\mbox{,} \end{array} \] and $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$ where \[ \monadic{v}'=\branching{\uopl{pure} n&\mbox{if $s=\mbox{\lstinline+$post+}$ or $d=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}}\mbox{,}\quad\tilde{\gamma}'=\gamma'\mbox{,}\quad\tilde{\omicron}'=\omicron'\mbox{.} \] The empty output circuit vacuously accepts~$\pi$. As $\tilde{\gamma}=\gamma$ and $\tilde{\gamma}'=\gamma'$, the claim $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ follows from assumptions. As $\tilde{\nu}=\nu$ and $\tilde{\omicron}'=\omicron'$, the claim $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$ also follows from assumptions. Finally, if $d=\mbox{\lstinline+@public+}$ then \[ (\monadic{v},\monadic{c})\bullet\pi=(\uopl{pure} n,\monadic{c})\bullet\pi=\uopl{pure} n=\monadic{v}'\mbox{,} \] and if $d\ne\mbox{\lstinline+@public+}$ but $s=\mbox{\lstinline+$post+}$ then \[ (\monadic{v},\monadic{c})\bullet\pi=(\top,\uopl{pure}(\mknode{\uopl{con}(n)}))\bullet\pi=\uopl{pure}(\mknode{\uopl{con}(n)}(\pi))=\uopl{pure} n=\monadic{v}'\mbox{,} \] implying $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$. \item If $e=\overline{b}$ where $b\in\mathbb{B}$ then \[ t=\boolmodty{\mbox{\lstinline+N+}}\mbox{.} \] Furthermore, $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\branching{\uopl{pure} b&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\uopl{pure}(\mknode{\uopl{con}(|b|)})&\mbox{if $s=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}})\mbox{,}\\\tilde{\gamma}=\gamma\mbox{,}\quad\tilde{\omicron}=\epsilon\mbox{,}\quad\tilde{\nu}=\nu\mbox{,} \end{array} \] and $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$ where \[ \monadic{v}'=\branching{\uopl{pure} b&\mbox{if $s=\mbox{\lstinline+$post+}$ or $d=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}}\mbox{,}\quad\tilde{\gamma}'=\gamma'\mbox{,}\quad\tilde{\omicron}'=\omicron'\mbox{.} \] The empty output circuit vacuously accepts~$\pi$. As $\tilde{\gamma}=\gamma$ and $\tilde{\gamma}'=\gamma'$, the claim $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ follows from assumptions. As $\tilde{\nu}=\nu$ and $\tilde{\omicron}'=\omicron'$, the claim $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$ also follows from assumptions. Finally, if $d=\mbox{\lstinline+@public+}$ then \[ (\monadic{v},\monadic{c})\bullet\pi=(\uopl{pure} b,\monadic{c})\bullet\pi=\uopl{pure}|b|\sim\uopl{pure} b=\monadic{v}'\mbox{,} \] and if $d\ne\mbox{\lstinline+@public+}$ but $s=\mbox{\lstinline+$post+}$ then \[ \begin{array}{lcl} (\monadic{v},\monadic{c})\bullet\pi &=&(\top,\uopl{pure}(\mknode{\uopl{con}(|b|)}))\bullet\pi\\ &=&\uopl{pure}(\mknode{\uopl{con}(|b|)}(\pi))=\uopl{pure} |b|\sim\uopl{pure} b=\monadic{v}'\mbox{.} \end{array} \] \item If $e=x$ then $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ (\monadic{v},\monadic{c})=\lookup{\gamma}{x}\mbox{,}\quad\tilde{\gamma}=\gamma\mbox{,}\quad\tilde{\omicron}=\epsilon\mbox{,}\quad\tilde{\nu}=\nu\mbox{,} \] and $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$ where \[ \monadic{v}'=\lookup{\gamma'}{x}\mbox{,}\quad\tilde{\gamma}'=\gamma'\mbox{,}\quad\tilde{\omicron}'=\omicron'\mbox{.} \] The empty output circuit vacuously accepts~$\pi$. As $\tilde{\gamma}=\gamma$ and $\tilde{\gamma}'=\gamma'$, the claim $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ follows from assumptions. As $\tilde{\nu}=\nu$ and $\tilde{\omicron}'=\omicron'$, the claim $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$ also follows from assumptions. Finally, \[ (\monadic{v},\monadic{c})\bullet\pi=(\lookup{\gamma}{x})\bullet\pi=\lookup{(\gamma\bullet\pi)}{x}\sim\gamma' x=\monadic{v}'\mbox{.} \] \item Let $e=\addexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ t=\uintmodty{\mbox{\lstinline+N+}}\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{,} \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} \monadic{v}=\mcomp{i_1\gets\monadic{v}_1;\; i_2\gets\monadic{v}_2;\;\uopl{pure}(i_1+i_2)}\mbox{,}\\ \monadic{c}=\mcomp{c_1\gets\monadic{c}_1;\; c_2\gets\monadic{c}_2;\;\uopl{pure}(\mknode{\uopl{op}(+)}(c_1,c_2))}\mbox{,}\\ \tilde{\gamma}=\gamma_2\mbox{,}\quad\tilde{\omicron}=\omicron_1\omicron_2\mbox{,}\quad\tilde{\nu}=\nu_2\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)\mbox{,}\\ \sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)\mbox{,}\\ \monadic{v}'=\mcomp{v_1\gets\monadic{v}'_1;\; v_2\gets\monadic{v}'_2;\;\uopl{pure}(v_1+v_2)}\mbox{,}\quad\tilde{\gamma}'=\gamma'_2\mbox{,}\quad\tilde{\omicron}'=\omicron'_2\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. By the induction hypothesis again, $\omicron_2$ accepts~$\pi$, whereby $\gamma_2\bullet\pi\sim\gamma'_2$, $\nu_2\bullet\pi\sim\omicron'_2$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$. Hence $\tilde{\omicron}$ accepts~$\pi$, whereby $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ and $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$. Suppose that $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$. Consider two cases: \begin{itemize} \item If $d=\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\uopl{pure} v_1$, $\monadic{v}_2=\uopl{pure} v_2$ and $\monadic{v}=\uopl{pure}(v_1+v_2)$ where $v_1,v_2\in\mathbb{N}$. Thus $(\monadic{v}_1,\monadic{c}_1)\bullet\pi=\uopl{pure} v_1$, $(\monadic{v}_2,\monadic{c}_2)\bullet\pi=\uopl{pure} v_2$ and $(\monadic{v},\monadic{c})\bullet\pi=\uopl{pure}(v_1+v_2)$. Hence $\uopl{pure} v_1\sim\monadic{v}'_1$ and $\uopl{pure} v_2\sim\monadic{v}'_2$, implying $\monadic{v}'_1=\uopl{pure} v_1$ and $\monadic{v}'_2=\uopl{pure} v_2$. Therefore $\monadic{v}'=\uopl{pure}(v_1+v_2)$, leading to $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$ as needed. \item If $s=\mbox{\lstinline+$post+}$ and $d_0\ne\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{c}_1=\uopl{pure} c_1$, $\monadic{c}_2=\uopl{pure} c_2$ and $\monadic{c}=\mcomp{c_1\gets\monadic{c}_1;\; c_2\gets\monadic{c}_2;\;\uopl{pure}(\mknode{\uopl{op}(+)}(c_1,c_2))}$. Thus $(\monadic{v}_1,\monadic{c}_1)\bullet\pi=\uopl{pure}(c_1(\pi))$, $(\monadic{v}_2,\monadic{c}_2)\bullet\pi=\uopl{pure}(c_2(\pi))$ and $(\monadic{v},\monadic{c})\bullet\pi=\uopl{pure}(c_1(\pi)+c_2(\pi))$. Let $c_1(\pi)=v_1$ and $c_2(\pi)=v_2$; then $\uopl{pure} v_1\sim\monadic{v}'_1$ and $\uopl{pure} v_2\sim\monadic{v}'_2$, implying $\monadic{v}'_1=\uopl{pure} v_1$ and $\monadic{v}'_2=\uopl{pure} v_2$. Therefore $\monadic{v}'=\uopl{pure}(v_1+v_2)$, leading to $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$ as needed. \end{itemize} Conversely, assume that $\tilde{\omicron}$ accepts~$\pi$. Then both $\omicron_1$ and $\omicron_2$ accept~$\pi$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)$ where $\gamma_1\bullet\pi\sim\gamma'_1$ and $\nu_1\bullet\pi\sim\omicron'_1$. By the induction hypothesis, $\sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)$. Therefore $\sem{e}\gamma'\phi\omicron'$ does not fail. \item Let $e=\assertexpr{e_1}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$post+}}{d'}\mbox{,}\\ t=\mbox{\lstinline+()+}\mbox{,}\quad s=\mbox{\lstinline+$pre+}\mbox{,}\quad d=\mbox{\lstinline+@public+}\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1) \end{array} \] with $\monadic{c}_1=\uopl{pure} c_1$, and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\uopl{pure}\mbox{\textoneoldstyle},\top)\mbox{,}\\ \tilde{\gamma}=\gamma_1\mbox{,}\quad\tilde{\omicron}=\omicron_1c_1\mbox{,}\quad\tilde{\nu}=\nu_1\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)\mbox{,}\\ \monadic{v}'_1\ne\uopl{pure}\mbox{\bfseries ff}\mbox{,}\quad\monadic{v}'=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\tilde{\gamma}'=\gamma'_1\mbox{,}\quad\tilde{\omicron}'=\omicron'_1\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. If $d'=\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\uopl{pure} v_1$ where $v_1\in\mathbb{B}$ and $|c_1|=\uopl{pure}|v_1|=\uopl{pure}(c_1(\pi))$. Hence $(\monadic{v}_1,\monadic{c}_1)\bullet\pi=\uopl{pure}|v_1|=\uopl{pure}(c_1(\pi))$. If $d'\ne\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\top$. Therefore $(\monadic{v}_1,\monadic{c}_1)\bullet\pi=\uopl{pure}(c_1(\pi))$ again. By $\uopl{pure}(c_1(\pi))\sim\monadic{v}'_1$, we obtain $\monadic{v}'_1=\uopl{pure} v'_1$ where $|v'_1|=c_1(\pi)$. As $\monadic{v}'_1\ne\uopl{pure}\mbox{\bfseries ff}$, we must have $v'_1=\mbox{\bfseries tt}$, whence $c_1(\pi)=0$. Altogether, we proved that $\tilde{\omicron}$ accepts~$\pi$. We have also obtained that $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ and $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$. In addition, $(\monadic{v},\monadic{c})\bullet\pi=\uopl{pure}\mbox{\textoneoldstyle}=\monadic{v}'$. Conversely, assume that $\tilde{\omicron}$ accepts~$\pi$. Then $\omicron_1$ accepts~$\pi$ and $c_1(\pi)=0$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)$ where $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$ and $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. If $d'=\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\uopl{pure} v_1$ where $v_1\in\mathbb{B}$ and $|c_1|=\uopl{pure}|v_1|=\uopl{pure}(c_1(\pi))$. Hence $(\monadic{v}_1,\monadic{c}_1)\bullet\pi=\uopl{pure}|v_1|=\uopl{pure}(c_1(\pi))$. If $d'\ne\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\top$. Therefore $(\monadic{v}_1,\monadic{c}_1)\bullet\pi=\uopl{pure}(c_1(\pi))$ again. As $c_1(\pi)\sim\monadic{v}'_1$ and $c_1(\pi)=0$, we must have $\monadic{v}'_1=\uopl{pure}\mbox{\bfseries tt}$. Consequently, $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},\gamma'_1,\omicron'_1)$. The desired result follows. \item If $e=\getexpr{d'}{k}$ where $d'$ is a domain and $k$ is an input key then \[ \uopl{allpre}_{d'}(q)\mbox{,} \] which implies $d=d'$ and $s=\mbox{\lstinline+$pre+}$. Furthermore, $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=\branching{\uopl{allpuretop}(\phi_{d'}(k))&\mbox{if $d'=\mbox{\lstinline+@public+}$}\\(\top,\top)&\mbox{otherwise}}\mbox{,}\\\tilde{\gamma}=\gamma\mbox{,}\quad\tilde{\omicron}=\epsilon\mbox{,}\quad\tilde{\nu}=\nu\mbox{,} \end{array} \] and $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$ where \[ \monadic{v}'=\branching{\uopl{allpure}(\phi_{d'}(k))&\mbox{if $d'=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}}\mbox{,}\quad\tilde{\gamma}'=\gamma'\mbox{,}\quad\tilde{\omicron}'=\omicron'\mbox{.} \] The empty output circuit vacuously accepts~$\pi$. As $\tilde{\gamma}=\gamma$ and $\tilde{\gamma}'=\gamma'$, the claim $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ follows from assumptions. As $\tilde{\nu}=\nu$ and $\tilde{\omicron}'=\omicron'$, the claim $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$ also follows from assumptions. Finally, $\uopl{allpuretop}_{d'}(\phi_{d'}(k))\bullet\pi=\uopl{allpure}_{d'}(\phi_{d'}(k))$ by Lemma~\ref{compilation:getlemma}, whence $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$ in the case $d=\mbox{\lstinline+@public+}$. \item Let $e=\ifexpr{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d'}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_3:q\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then, for some $\monadic{v}'_1$, $\gamma'_1$, $\omicron'_1$, \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d'=\mbox{\lstinline+@public+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. Consider three cases: \begin{itemize} \item Let $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$. Then \[ \semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{,} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\monadic{v}_2,\monadic{c}_2)\mbox{,}\quad\tilde{\gamma}=\gamma_2\mbox{,}\quad\tilde{\omicron}=\omicron_1\omicron_2\mbox{,}\quad\tilde{\nu}=\nu_2\mbox{.} \end{array} \] If $d'\ne\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\top$. Thus $d'=\mbox{\lstinline+@public+}$ must hold. Hence $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$ which implies $\monadic{v}'_1=\uopl{pure}\mbox{\bfseries tt}$. Consequently, \[ \begin{array}{l} \sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)\mbox{,}\\ \monadic{v}'=\monadic{v}'_2\mbox{,}\quad\tilde{\gamma}'=\gamma'_2\mbox{,}\quad\tilde{\omicron}'=\omicron'_2\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_2$ accepts~$\pi$, whereby $\gamma_2\bullet\pi\sim\gamma'_2$, $\nu_2\bullet\pi\sim\omicron'_2$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$. Hence $\omicron_1\omicron_2$ accepts~$\pi$, whereby $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$, $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$. \item The case $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$ is similar to the previous case. \item If $\monadic{v}_1\ne\uopl{pure} b$ for $b\in\mathbb{B}$ then, by exactness, $d'\ne\mbox{\lstinline+@public+}$ and $\monadic{v}_1=\top$. Hence $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\top,\top)\mbox{,}\quad\tilde{\gamma}=\gamma_1\mbox{,}\quad\tilde{\omicron}=\omicron_1\mbox{,}\quad\tilde{\nu}=\nu_1\mbox{.} \end{array} \] As $d'\ne\mbox{\lstinline+@public+}$ and $e_1$ has stage $\mbox{\lstinline+$pre+}$, we must have $\monadic{v}'_1=\top$ by exactness in circuit. Consequently, \[ \monadic{v}'=\top\mbox{,}\quad\tilde{\gamma}'=\gamma'_1\mbox{,}\quad\tilde{\omicron}'=\omicron'_1\mbox{.} \] We obtain all the desired claims. \end{itemize} Conversely, suppose that $\tilde{\omicron}$ accepts~$\pi$. In all possible cases, this implies that $\omicron_1$ accepts~$\pi$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d'=\mbox{\lstinline+@public+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. Consider three cases: \begin{itemize} \item Let $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$. Then \[ \semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{,} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\monadic{v}_2,\monadic{c}_2)\mbox{,}\quad\tilde{\gamma}=\gamma_2\mbox{,}\quad\tilde{\omicron}=\omicron_1\omicron_2\mbox{,}\quad\tilde{\nu}=\nu_2\mbox{.} \end{array} \] If $d'\ne\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\top$. Thus $d'=\mbox{\lstinline+@public+}$ must hold. Hence $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$ which implies $\monadic{v}'_1=\uopl{pure}\mbox{\bfseries tt}$. The assumption that $\tilde{\omicron}$ accepts~$\pi$ implies that $\omicron_2$ accepts~$\pi$. By the induction hypothesis, $\sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)$, whereby $\gamma_2\bullet\pi\sim\gamma'_2$, $\nu_2\bullet\pi\sim\omicron'_2$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$. We obtain $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)$ which implies the desired result. \item The case $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$ is similar to the previous case. \item If $\monadic{v}_1\ne\uopl{pure} b$ for $b\in\mathbb{B}$ then, by exactness, $d'\ne\mbox{\lstinline+@public+}$ and $\monadic{v}_1=\top$. As $d'\ne\mbox{\lstinline+@public+}$ and $e_1$ has stage $\mbox{\lstinline+$pre+}$, we must have $\monadic{v}'_1=\top$ by exactness in circuit. Hence $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\top,\gamma'_1,\omicron'_1)$ which implies the desired result. \end{itemize} \item Let $e=\forexpr{x}{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d}\mbox{,}\\ (x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d}),\Gamma\mbox{\ $\vdash$\ } e_3:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ t=\listty{\qualty{t_1}{s_1}{d_1}}\mbox{,}\quad s=\mbox{\lstinline+$pre+}\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)\mbox{,}\\ \sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d=\mbox{\lstinline+@public+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. Again by the induction hypothesis, $\omicron_2$ accepts~$\pi$, whereby $\gamma_2\bullet\pi\sim\gamma'_2$, $\nu_2\bullet\pi\sim\omicron'_2$, and $d=\mbox{\lstinline+@public+}$ implies $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$. Consider two cases: \begin{itemize} \item Let $\monadic{v}_1=\uopl{pure} i_1$ and $\monadic{v}_2=\uopl{pure} i_2$, where $i_1,i_2\in\mathbb{N}$. Denoting $n=\max(0,i_2-i_1)$, we obtain \[ \begin{array}{l} \semc{e_3}\left((x,(\uopl{pure} i_1,\top)),\gamma_2\right)\phi\nu_2=\uopl{pure}((\monadic{v}_3,\monadic{c}_3),\gamma_3,\omicron_3,\nu_3)\mbox{,}\\ \semc{e_3}([x\mapsto(\uopl{pure}(i_1+1),\top)]\gamma_3)\phi\nu_3=\uopl{pure}((\monadic{v}_4,\monadic{c}_4),\gamma_4,\omicron_4,\nu_4)\mbox{,}\\ \dotfill\\ \semc{e_3}([x\mapsto(\uopl{pure}(i_1+n-1),\top)]\gamma_{n+1})\phi\nu_{n+1}=\uopl{pure}((\monadic{v}_{n+2},\monadic{c}_{n+2}),\gamma_{n+2},\omicron_{n+2},\nu_{n+2})\mbox{,}\\ \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\uopl{pure}((\monadic{v}_3,\monadic{c}_3),\ldots,(\monadic{v}_{n+2},\monadic{c}_{n+2})),\top)\mbox{,}\quad\tilde{\gamma}=\uopl{tail}\gamma_{n+2}\mbox{,}\quad\tilde{\omicron}=\omicron_1\ldots\omicron_{n+2}\mbox{,}\quad\tilde{\nu}=\nu_{n+2}\mbox{.} \end{array} \] If $d\ne\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\monadic{v}_2=\top$. Thus $d=\mbox{\lstinline+@public+}$ must hold. Hence $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$, $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$ which imply $\monadic{v}'_1=\uopl{pure} i_1$, $\monadic{v}'_2=\uopl{pure} i_2$. Consequently, \[ \begin{array}{l} \sem{e_3}\left((x,\uopl{pure} i_1),\gamma'_2\right)\phi\omicron'_2=\uopl{pure}(\monadic{v}'_3,\gamma'_3,\omicron'_3)\mbox{,}\\ \sem{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma'_3)\phi\omicron'_3=\uopl{pure}(\monadic{v}'_4,\gamma'_4,\omicron'_4)\mbox{,}\\ \dotfill\\ \sem{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma'_{n+1})\phi\omicron'_{n+1}=\uopl{pure}(\monadic{v}'_{n+2},\gamma'_{n+2},\omicron'_{n+2})\mbox{,}\\ \monadic{v}'=\uopl{pure}(\monadic{v}'_3,\ldots,\monadic{v}'_{n+2})\mbox{,}\quad\tilde{\gamma}'=\uopl{tail}\gamma'_{n+2}\mbox{,}\quad\tilde{\omicron}'=\omicron'_{n+2}\mbox{.} \end{array} \] As $\gamma_2\bullet\pi\sim\gamma'_2$ and $(\uopl{pure} i_1,\top)\bullet\pi\sim\uopl{pure} i_1$, we have $\left((x,(\uopl{pure} i_1,\top)),\gamma_2\right)\bullet\pi\sim\left((x,\uopl{pure} i_1),\gamma'_2\right)$. Hence by the induction hypothesis, $\omicron_3$ accepts~$\pi$, whereby $\gamma_3\bullet\pi\sim\gamma'_3$, $\nu_3\bullet\pi\sim\omicron'_3$, and $d_1=\mbox{\lstinline+@public+}$ or $s_1=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_3,\monadic{c}_3)\bullet\pi\sim\monadic{v}'_3$. Similarly, we get $\omicron_k$ accepting~$\pi$, $\gamma_k\bullet\pi\sim\gamma'_k$, $\nu_k\bullet\pi\sim\omicron'_k$, and $d_1=\mbox{\lstinline+@public+}$ or $s_1=\mbox{\lstinline+$post+}$ implying $(\monadic{v}_k,\monadic{c}_k)\bullet\pi\sim\monadic{v}'_k$ for every $k=4,\ldots,n+2$. Obviously also $\uopl{tail}\gamma_{n+2}\bullet\pi\sim\uopl{tail}\gamma'_{n+2}$. Altogether, we have proved that $\omicron_1\ldots\omicron_{n+2}$ accepts~$\pi$, whereby $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ and $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$. Assume $d=\mbox{\lstinline+@public+}$. If $d_1=\mbox{\lstinline+@public+}$ or $s_1=\mbox{\lstinline+$post+}$ then \[ (\monadic{v},\monadic{c})\bullet\pi =\uopl{pure}((\monadic{v}_3,\monadic{c}_3)\bullet\pi,\ldots,(\monadic{v}_{n+2},\monadic{c}_{n+2})\bullet\pi) \sim\uopl{pure}(\monadic{v}'_3,\ldots,\monadic{v}'_{n+2}) =\monadic{v}' \] as required. If $d_1\ne\mbox{\lstinline+@public+}$ and $s_1=\mbox{\lstinline+$pre+}$ then, by exactness and exactness in circuit, $(\monadic{v}_k,\monadic{c}_k)=(\top,\top)$ and $\monadic{v}'_k=\top$. Hence $(\monadic{v}_k,\monadic{c}_k)\bullet\pi\sim\monadic{v}'_k$ in this case, too, whence all the desired claims follow. \item If $\monadic{v}_1\ne\uopl{pure} i_1$ or $\monadic{v}_2\ne\uopl{pure} i_2$ for $i_1,i_2\in\mathbb{N}$ then, by exactness, $d\ne\mbox{\lstinline+@public+}$ and $\monadic{v}_1=\monadic{v}_2=\top$. Hence $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\top,\top)\mbox{,}\quad\tilde{\gamma}=\gamma_2\mbox{,}\quad\tilde{\omicron}=\omicron_1\omicron_2\mbox{,}\quad\tilde{\nu}=\nu_2\mbox{.} \end{array} \] As $d\ne\mbox{\lstinline+@public+}$ and $e_1,e_2$ have stage $\mbox{\lstinline+$pre+}$, we must have $\monadic{v}'_1=\monadic{v}'_2=\top$ by exactness in circuit. Consequently, \[ \monadic{v}'=\top\mbox{,}\quad\tilde{\gamma}'=\gamma'_2\mbox{,}\quad\tilde{\omicron}'=\omicron'_2\mbox{.} \] We obtain all the desired claims. \end{itemize} Conversely, suppose that $\tilde{\omicron}$ accepts~$\pi$. In all possible cases, this implies that $\omicron_1$ and $\omicron_2$ accept~$\pi$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d=\mbox{\lstinline+@public+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. By the induction hypothesis, $\sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)$, whereby $\gamma_2\bullet\pi\sim\gamma'_2$, $\nu_2\bullet\pi\sim\omicron'_2$, and $d=\mbox{\lstinline+@public+}$ implies $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$. Consider two cases: \begin{itemize} \item Let $\monadic{v}_1=\uopl{pure} i_1$ and $\monadic{v}_2=\uopl{pure} i_2$ where $i_1,i_2\in\mathbb{N}$. Denoting $n=\max(0,i_2-i_1)$, we obtain \[ \begin{array}{l} \semc{e_3}\left((x,(\uopl{pure} i_1,\top)),\gamma_2\right)\phi\nu_2=\uopl{pure}((\monadic{v}_3,\monadic{c}_3),\gamma_3,\omicron_3,\nu_3)\mbox{,}\\ \semc{e_3}([x\mapsto(\uopl{pure}(i_1+1),\top)]\gamma_3)\phi\nu_3=\uopl{pure}((\monadic{v}_4,\monadic{c}_4),\gamma_4,\omicron_4,\nu_4)\mbox{,}\\ \dotfill\\ \semc{e_3}([x\mapsto(\uopl{pure}(i_1+n-1),\top)]\gamma_{n+1})\phi\nu_{n+1}=\uopl{pure}((\monadic{v}_{n+2},\monadic{c}_{n+2}),\gamma_{n+2},\omicron_{n+2},\nu_{n+2})\mbox{,}\\ \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\uopl{pure}((\monadic{v}_3,\monadic{c}_3),\ldots,(\monadic{v}_{n+2},\monadic{c}_{n+2})),\top)\mbox{,}\\\tilde{\gamma}=\uopl{tail}\gamma_{n+2}\mbox{,}\quad\tilde{\omicron}=\omicron_1\ldots\omicron_{n+2}\mbox{,}\quad\tilde{\nu}=\nu_{n+2}\mbox{.} \end{array} \] If $d\ne\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\monadic{v}_2=\top$. Thus $d=\mbox{\lstinline+@public+}$ must hold. Hence $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$ and $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$, which imply $\monadic{v}'_1=\uopl{pure} i_1$, $\monadic{v}'_2=\uopl{pure} i_2$. The assumption that $\tilde{\omicron}$ accepts~$\pi$ implies that $\omicron_3,\ldots,\omicron_{n+2}$ all accept~$\pi$. As $\gamma_2\bullet\pi\sim\gamma'_2$ and $(\uopl{pure} i_1,\top)\bullet\pi\sim\uopl{pure} i_1$, we have $\left((x,(\uopl{pure} i_1,\top)),\gamma_2\right)\bullet\pi\sim\left((x,\uopl{pure} i_1),\gamma'_2\right)$. By the induction hypothesis, $\sem{e_3}\left((x,\uopl{pure} i_1),\gamma'_2\right)\phi\omicron'_2=\uopl{pure}(\monadic{v}'_3,\gamma'_3,\omicron'_3)$, whereby $\gamma_3\bullet\pi\sim\gamma'_3$, $\nu_3\bullet\pi\sim\omicron'_3$, and $d_1=\mbox{\lstinline+@public+}$ or $s_1=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_3,\monadic{c}_3)\bullet\pi\sim\monadic{v}'_3$. Similarly, we get $\sem{e_k}([x\mapsto\uopl{pure}(i_1+k-3)]\gamma'_{k-1})\phi\omicron'_{k-1}=\uopl{pure}(\monadic{v}'_k,\gamma'_k,\omicron'_k)$ where $\gamma_k\bullet\pi\sim\gamma'_k$, $\nu_k\bullet\pi\sim\omicron'_k$, and $d_1=\mbox{\lstinline+@public+}$ or $s_1=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_k,\monadic{c}_k)\bullet\pi\sim\monadic{v}'_k$ for every $k=4,\ldots,n+2$. We obtain $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\uopl{pure}(\monadic{v}'_3,\ldots,\monadic{v}'_{n+2}),\gamma'_{n+2},\omicron'_{n+2})$ which implies the desired result. \item If $\monadic{v}_1\ne\uopl{pure} i_1$ or $\monadic{v}_1\ne\uopl{pure} i_2$ for $i_1,i_2\in\mathbb{N}$ then, by exactness, $d\ne\mbox{\lstinline+@public+}$ and $\monadic{v}_1=\monadic{v}_2=\top$. As $d\ne\mbox{\lstinline+@public+}$ and $e_1,e_2$ have stage $\mbox{\lstinline+$pre+}$, we must have $\monadic{v}'_1=\monadic{v}'_2=\top$ by exactness in circuit. Hence $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\top,\gamma'_2,\omicron'_2)$ which implies the desired result. \end{itemize} \item Let $e=\wireexpr{e_1}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t}{\mbox{\lstinline+$pre+}}{d}\mbox{,}\\ t\in\set{\uintmodty{\mbox{\lstinline+N+}},\boolmodty{\mbox{\lstinline+N+}}}\mbox{,}\quad s=\mbox{\lstinline+$post+}\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\monadic{v}_1,\branching{\uopl{pure}(\mknode{\uopl{con}(n)})&\mbox{if $\monadic{v}_1=\uopl{pure} n$, $n\in\mathbb{N}$}\\\uopl{pure}(\mknode{\uopl{con}(|b|)})&\mbox{if $\monadic{v}_1=\uopl{pure} b$, $b\in\mathbb{B}$}\\\uopl{pure}(\mknode{\uopl{in}_d(\left(\nu_1\right)_d)})&\mbox{if $\monadic{v}_1=\top$}})\mbox{,}\\ \tilde{\gamma}=\gamma_1\mbox{,}\quad\tilde{\omicron}=\omicron_1\mbox{,}\quad\tilde{\nu}=\lam{d'}{\branching{\left(\nu_1\right)_{d'}+1&\mbox{if $d'=d$}\\\left(\nu_1\right)_{d'}&\mbox{otherwise}}}\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)\mbox{,}\\ \monadic{v}'=\branching{\monadic{v}'_1&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\uopl{head}\left(\omicron'_1\right)_d&\mbox{otherwise}}\mbox{,}\\\tilde{\gamma}'=\gamma'_1\mbox{,}\quad\tilde{\omicron}'=\lam{d'}{\branching{\uopl{tail}\left(\omicron'_1\right)_{d'}&\mbox{if $d'=d$}\\\left(\omicron'_1\right)_{d'}&\mbox{otherwise}}}\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d=\mbox{\lstinline+@public+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. Hence $\tilde{\omicron}$ accepts~$\pi$ and $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$. We also get $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$ since dropping one more item from the input list results in the tail of the result that would be obtained otherwise. To complete, we have to prove $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$. Consider two cases: \begin{itemize} \item If $d=\mbox{\lstinline+@public+}$ then $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. By exactness and exactness in circuit, $\monadic{v}_1=\uopl{pure} v_1$ and $\monadic{v}'_1=\uopl{pure} v'_1$ where $v_1,v'_1\in t$. Thus $(\monadic{v},\monadic{c})\bullet\pi=(\monadic{v}_1,\monadic{c}_1)\bullet\pi\in\set{\uopl{pure} v_1,\uopl{pure}|v_1|}$ where the outcome depends on whether $t=\uintmodty{\mbox{\lstinline+N+}}$ or $t=\boolmodty{\mbox{\lstinline+N+}}$. In both cases, $\monadic{v}'_1=\uopl{pure} v_1$, leading to $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$ as needed. \item If $d\ne\mbox{\lstinline+@public+}$ then, by exactness, $\monadic{v}_1=\top$. Hence \[ \begin{array}{lcl} (\monadic{v},\monadic{c})\bullet\pi &=&(\top,\uopl{pure}(\mknode{\uopl{in}_d(\left(\nu_1\right)_d)}))\bullet\pi\\ &=&\uopl{pure}(\mknode{\uopl{in}_d(\left(\nu_1\right)_d)}(\pi))\\ &=&\uopl{pure}(\pi_d(\left(\nu_1\right)_d))\mbox{.} \end{array} \] From $\nu_1\bullet\pi\sim\omicron'_1$, we get $\uopl{map}\uopl{pure}\left(\uopl{drop}\left(\nu_1\right)_d\pi_d\right)\sim\left(\omicron'_1\right)_d$, and taking the first elements in the lists occurring in the latter statement gives $\uopl{pure}(\pi_d(\left(\nu_1\right)_d))\sim\uopl{head}\left(\omicron'_1\right)_d$ as needed. \end{itemize} Conversely, assume that $\tilde{\omicron}$ accepts~$\pi$. Then $\omicron_1$ accepts~$\pi$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)$ where $\gamma_1\bullet\pi\sim\gamma'_1$ and $\nu_1\bullet\pi\sim\omicron'_1$. Then $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma},\tilde{\omicron}')$ where $\monadic{v}'=\branching{\monadic{v}'_1&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\uopl{head}\left(\omicron'_1\right)_d&\mbox{otherwise}}$. The latter is well-defined if $d=\mbox{\lstinline+@public+}$; if $d\ne\mbox{\lstinline+@public+}$ then it is well defined, provided that $\left(\omicron'_1\right)_d$ is non-empty. As $\nu_1\bullet\pi\sim\omicron'_1$, this condition is equivalent to $(\nu_1)_d$ being smaller than the length of $\pi_d$. Since $(\monadic{v},\monadic{c})=(\top,\uopl{pure}(\mknode{\uopl{in}_d((\nu_1)_d)}))$ and $(\monadic{v},\monadic{c})\bullet\pi$ is well-defined, $(\nu_1)_d$ must indeed be smaller than the length of~$\pi_d$. The desired claim follows. \item Let $e=\castexpr{e_1}{q}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t}{s'}{d'}\mbox{,}\\ s'\mathrel{\mathchar"13C\mathchar"3A} s\mbox{,}\quad d'\mathrel{\mathchar"13C\mathchar"3A} d\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\branching{\monadic{v}_1&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\monadic{c}_1&\mbox{if $s=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}})\mbox{,}\\ \tilde{\gamma}=\gamma_1\mbox{,}\quad\tilde{\omicron}=\omicron_1\mbox{,}\quad\tilde{\nu}=\nu_1\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)\mbox{,}\\ \monadic{v}'=\branching{\monadic{v}'_1&\mbox{if $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}}\mbox{,}\\\tilde{\gamma}'=\gamma'_1\mbox{,}\quad\tilde{\omicron}'=\omicron'_1\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d'=\mbox{\lstinline+@public+}$ or $s'=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. Hence $\tilde{\omicron}$ accepts~$\pi$, whereby $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ and $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$. Suppose that $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$. Then $d'=\mbox{\lstinline+@public+}$ or $s'=\mbox{\lstinline+$post+}$ since $d'\mathrel{\mathchar"13C\mathchar"3A} d$ and $s'\mathrel{\mathchar"13C\mathchar"3A} s$. Thus $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$ and $\monadic{v}'=\monadic{v}'_1$. Consider two cases: \begin{itemize} \item If $d=\mbox{\lstinline+@public+}$ then $(\monadic{v},\monadic{c})\bullet\pi=(\monadic{v},\monadic{c}_1)\bullet\pi=(\monadic{v}_1,\monadic{c}_1)\bullet\pi$ and the desired claim follows. \item If $d\ne\mbox{\lstinline+@public+}$ and $s=\mbox{\lstinline+$post+}$ then $s'=\mbox{\lstinline+$post+}$. If $d'\ne\mbox{\lstinline+@public+}$ then $\monadic{v}_1=\top$ by exactness, whence $(\monadic{v},\monadic{c})=(\monadic{v}_1,\monadic{c}_1)$ and the desired claim follows. Suppose now that $d'=\mbox{\lstinline+@public+}$. By types being well-structured, $t=\uintmodty{\mbox{\lstinline+N+}}$ or $t=\boolmodty{\mbox{\lstinline+N+}}$, whence exactness implies $\monadic{v}_1=\uopl{pure} v_1$ where $v_1\in\mathbb{N}$ or $v_1\in\mathbb{B}$. Thus $(\monadic{v}_1,\monadic{c}_1)\bullet\pi=(\uopl{pure} v_1,\monadic{c}_1)\bullet\pi\sim\uopl{pure} v_1$. As by exactness, $\monadic{c}_1=\uopl{pure} c_1$ and $\uopl{pure}(c_1(\pi))\sim\uopl{pure} v_1$, we obtain \[ (\monadic{v},\monadic{c})\bullet\pi=(\top,\monadic{c}_1)\bullet\pi=\uopl{pure}(c_1(\pi))\sim\uopl{pure} v_1\mbox{.} \] But $(\uopl{pure} v_1,\uopl{pure} c_1)\bullet\pi\sim\uopl{pure} v_1$, too, while we also know that $(\uopl{pure} v_1,\uopl{pure} c_1)\bullet\pi\sim\monadic{v}'_1$. Hence $\uopl{pure} v_1\sim\monadic{v}'_1$ and the desired claim follows. \end{itemize} Conversely, assume that $\tilde{\omicron}$ accepts~$\pi$. Then $\omicron_1$ accepts~$\pi$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)$ for some $\monadic{v}'_1,\gamma'_1,\omicron'_1$. Hence $\sem{e}\gamma'\phi\omicron'$ does not fail. \item Let $e=\assignexpr{e_1}{e_2}$ where $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$. By Lemma~\ref{typesystem:lhslemma}, \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } x:q'\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } y_k:q_k\mbox{ for every $k=1,\ldots,n$,}\\ \Gamma\mbox{\ $\vdash$\ } e_1:q_{n+1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q_{n+1}\mbox{,}\\ t=\mbox{\lstinline+()+}\mbox{,}\quad s=\mbox{\lstinline+$pre+}\mbox{,}\quad d=\mbox{\lstinline+@public+}\mbox{,} \end{array} \] where $q_k=\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_k}$ for each $k=1,\ldots,n$, and \[ q'=\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q_{n+1}}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{.} \] Denote $q_{n+1}=(\qualty{t_{n+1}}{s_{n+1}}{d_{n+1}})$. Furthermore, \[ \begin{array}{l} \semc{y_1}\gamma\phi\nu=\uopl{pure}((\monadic{i}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \semc{y_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{i}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{,}\\ \dotfill\\ \semc{y_n}\gamma_{n-1}\phi\nu_{n-1}=\uopl{pure}((\monadic{i}_n,\monadic{c}_n),\gamma_n,\omicron_n,\nu_n)\mbox{,}\\ \sem{e_2}\gamma_n\phi\nu_n=\uopl{pure}((\monadic{v}_1,\monadic{c}_{n+1}),\gamma_{n+1},\omicron_{n+1},\nu_{n+1})\mbox{,} \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\uopl{pure}\mbox{\textoneoldstyle},\top)\mbox{,}\\ \tilde{\gamma}=[x\mapsto\uopl{upd}_{\mathrm{C}}(\gamma(x),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}_1,\monadic{c}_{n+1}))]\gamma_{n+1}\mbox{,}\quad\tilde{\omicron}=\omicron_1\ldots\omicron_{n+1}\mbox{,}\quad\tilde{\nu}=\nu_{n+1}\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{y_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{i}'_1,\gamma'_1,\omicron'_1)\mbox{,}\\ \sem{y_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{i}'_2,\gamma'_2,\omicron'_2)\mbox{,}\\ \dotfill\\ \sem{y_n}\gamma'_{n-1}\phi\omicron'_{n-1}=\uopl{pure}(\monadic{i}'_n,\gamma'_n,\omicron'_n)\mbox{,}\\ \sem{e_2}\gamma'_n\phi\omicron'_n=\uopl{pure}(\monadic{v}'_1,\gamma'_{n+1},\omicron'_{n+1})\mbox{,}\\ \monadic{v}'=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\tilde{\gamma}'=[x\mapsto\uopl{upd}(\gamma'(x),\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}'_1)]\gamma'_{n+1}\mbox{,}\quad\tilde{\omicron}'=\omicron'_{n+1}\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d_1=\mbox{\lstinline+@public+}$ implies $(\monadic{i}_1,\monadic{c}_1)\bullet\pi\sim\monadic{i}'_1$. Similarly, we see that $\omicron_k$ accepts~$\pi$, whereby $\gamma_k\bullet\pi\sim\gamma'_k$, $\nu_k\bullet\pi\sim\omicron'_k$, and $d_k=\mbox{\lstinline+@public+}$ implies $(\monadic{i}_k,\monadic{c}_k)\bullet\pi\sim\monadic{i}'_k$ for every $k=2,\ldots,n$. Furthermore, the induction hypothesis implies $\omicron_{n+1}$ accepting~$\pi$, whereby $\gamma_{n+1}\bullet\pi\sim\gamma'_1$, $\nu_{n+1}\bullet\pi\sim\omicron'_{n+1}$, and $d_{n+1}=\mbox{\lstinline+@public+}$ or $s_{n+1}=\mbox{\lstinline+$post+}$ implying $(\monadic{v}_1,\monadic{c}_{n+1})\bullet\pi\sim\monadic{v}'_1$. Hence $\tilde{\omicron}$ accepts~$\pi$ and $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$. We also have $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$ since $(\uopl{pure}\mbox{\textoneoldstyle},\top)\bullet\pi=\uopl{pure}\mbox{\textoneoldstyle}$. Finally, note that $d_k\ne\mbox{\lstinline+@public+}$ for any $k=1,\ldots,n$ implies $(\monadic{i}_k,\monadic{c}_k)=(\top,\top)$ and $\monadic{i}'_k=\top$ by exactness and exactness in circuit, respectively. As $(\top,\top)\bullet\pi=\top$, we have $(\monadic{i}_k,\monadic{c}_k)\bullet\pi\sim\monadic{i}'_k$ for every $k=1,\ldots,n$. In addition, if $d_{n+1}\ne\mbox{\lstinline+@public+}$ and $s_{n+1}=\mbox{\lstinline+$pre+}$ then $(\monadic{v}_1,\monadic{c}_{n+1})=(\top,\top)$ and $\monadic{v}'_1=\top$ by exactness and exactness in circuit, respectively, whence $(\monadic{v}_1,\monadic{c}_{n+1})\bullet\pi\sim\monadic{v}'_1$ in all cases. By Lemma~\ref{compilation:updlemma}, $\uopl{upd}_{\mathrm{C}}(\gamma(x),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}_1,\monadic{c}_{n+1}))\bullet\pi\sim\uopl{upd}(\gamma'(x),\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}'_1)$. Consequently, $[x\mapsto\uopl{upd}_{\mathrm{C}}(\gamma(x),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}_1,\monadic{c}_{n+1}))]\gamma_{n+1}\bullet\pi\sim[x\mapsto\uopl{upd}(\gamma'(x),\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}'_1)]\gamma'_{n+1}$ and the desired claim follows. Conversely, assume that $\tilde{\omicron}$ accepts~$\pi$. Then $\omicron_1,\ldots,\omicron_{n+1}$ all accept~$\pi$. By the induction hypothesis, $\sem{y_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{i}'_1,\gamma'_1,\omicron'_1)$ where $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$ and $d_1=\mbox{\lstinline+@public+}$ implies $(\monadic{i}_1,\monadic{c}_1)\bullet\pi\sim\monadic{i}'_1$. Similarly, we see for every $k=2,\ldots,n$ that $\sem{y_k}\gamma'_{k-1}\phi\omicron'_{k-1}=\uopl{pure}(\monadic{i}'_k,\gamma'_k,\omicron'_k)$ where $\gamma_k\bullet\pi\sim\gamma'_k$, $\nu_k\bullet\pi\sim\omicron'_k$ and $d_k=\mbox{\lstinline+@public+}$ implies $(\monadic{i}_k,\monadic{c}_k)\bullet\pi\sim\monadic{i}'_k$. Furthermore, $\sem{e_2}\gamma'_n\phi\omicron'_n=\uopl{pure}(\monadic{v}'_1,\gamma'_{n+1},\omicron'_{n+1})$ where $d_{n+1}=\mbox{\lstinline+@public+}$ or $s_{n+1}=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_1,\monadic{c}_{n+1})\bullet\pi\sim\monadic{v}'_1$. Similarly to the first part of the proof, we see that $(\monadic{i}_k,\monadic{c}_k)\bullet\pi\sim\monadic{i}'_k$ and $(\monadic{v}_1,\monadic{c}_{n+1})\bullet\pi\sim\monadic{v}'_1$ in all cases. By Lemma~\ref{compilation:updlemma}, $\uopl{upd}(\gamma'(x),\monadic{i}'_1\ldots\monadic{i}'_n,\monadic{v}'_1)$ is well-defined. Therefore $\sem{e}\gamma'\phi\omicron'$ does not fail. \item Let $e=\loadexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{a},\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{i},\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{,} \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=\branching{(\monadic{v}_1,\monadic{c}_3)&\mbox{if $\mcomp{a\gets\monadic{a};\; i\gets\monadic{i};\;\uopl{pure} a_i}=\uopl{pure}(\monadic{v}_1,\monadic{c}_3)$}\\(\top,\top)&\mbox{otherwise}}\mbox{,}\\ \tilde{\gamma}=\gamma_2\mbox{,}\quad\tilde{\omicron}=\omicron_1\omicron_2\mbox{,}\quad\tilde{\nu}=\nu_2\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{a}',\gamma'_1,\omicron'_1)\mbox{,}\\ \sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{i}',\gamma'_2,\omicron'_2)\mbox{,}\\ \monadic{v}'=\mcomp{a\gets\monadic{a}';\; i\gets\monadic{i}';\; a_i}\mbox{,}\quad\tilde{\gamma}'=\gamma'_2\mbox{,}\quad\tilde{\omicron}'=\omicron'_2\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d_1=\mbox{\lstinline+@public+}$ implies $(\monadic{a},\monadic{c}_1)\bullet\pi\sim\monadic{a}'$. By the induction hypothesis again, $\omicron_2$ accepts~$\pi$, whereby $\gamma_2\bullet\pi\sim\gamma'_2$, $\nu_2\bullet\pi\sim\omicron'_2$, and $d_1=\mbox{\lstinline+@public+}$ implies $(\monadic{i},\monadic{c}_2)\bullet\pi\sim\monadic{i}'$. Hence $\tilde{\omicron}$ accepts~$\pi$, whereby $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ and $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$. Suppose that $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$. Then $d_1=\mbox{\lstinline+@public+}$ because types are well-structured. Thus $(\monadic{a},\monadic{c}_1)\bullet\pi\sim\monadic{a}'$ and $(\monadic{i},\monadic{c}_2)\bullet\pi\sim\monadic{i}'$. By exactness and exactness in circuit, $\monadic{a}=\uopl{pure}((\monadic{a}_1,\monadic{c}'_1),\ldots,(\monadic{a}_l,\monadic{c}'_l))$ and $\monadic{a}'=\uopl{pure}(\monadic{a}'_1,\ldots,\monadic{a}'_{l'})$. By $(\monadic{a},\monadic{i})\bullet\pi\sim\monadic{a}'$, we obtain $l=l'$ and $(\monadic{a}_k,\monadic{c}'_k)\bullet\pi\sim\monadic{a}'_k$ for every $k=1,\ldots,l$. For similar reasons, we obtain $\monadic{i}=\monadic{i}'=\uopl{pure} i$. Thus $(\monadic{v},\monadic{c})=(\monadic{a}_i,\monadic{c}'_i)$ and $\monadic{v}'=\monadic{a}'_i$. The desired result follows by $(\monadic{a}_i,\monadic{c}'_i)\bullet\pi\sim\monadic{a}'_i$. Conversely, assume that $\tilde{\omicron}$ accepts~$\pi$. Then both $\omicron_1$ and $\omicron_2$ accept~$\pi$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{a}',\gamma'_1,\omicron'_1)$ where $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$ and $d_1=\mbox{\lstinline+@public+}$ implies $(\monadic{a},\monadic{c}_1)\bullet\pi\sim\monadic{a}'$. By the induction hypothesis, $\sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{i}',\gamma'_2,\omicron'_2)$, whereby $d_1=\mbox{\lstinline+@public+}$ implies $(\monadic{i},\monadic{c}_2)\bullet\pi\sim\monadic{i}'$. Consider two cases: \begin{itemize} \item If $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ then, like in the first half of the proof, we obtain $\monadic{a}=\uopl{pure}((\monadic{a}_1,\monadic{c}'_1),\ldots,(\monadic{a}_l,\monadic{c}'_l))$, $\monadic{a}'=\uopl{pure}(\monadic{a}'_1,\ldots,\monadic{a}'_l)$ and $\monadic{i}=\monadic{i}'=\uopl{pure} i$, whereby $i\leq l$ since $(\monadic{v},\monadic{c})$ is well-defined. Hence $\sem{e}\gamma'\phi\omicron'$ is of the form $\uopl{pure}(\monadic{v}',\tilde{\gamma},\tilde{\omicron}')$, implying the desired result. \item If $d\ne\mbox{\lstinline+@public+}$ and $s=\mbox{\lstinline+$pre+}$ then, by exactness in circuit, $\monadic{a}'=\top$ and $\monadic{i}'=\top$, whence $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\top,\gamma'_2,\omicron'_2)$, implying the desired result. \end{itemize} \item Let $e=\stmtcomp{\letexpr{x}{e_1}}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ (x:\qualty{t_1}{s_1}{d_1}),\Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \semc{e_2}((x,(\monadic{v}_1,\monadic{c}_1)),\gamma_1)\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{,} \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\monadic{v}_2,\monadic{c}_2)\mbox{,}\quad\tilde{\gamma}=\uopl{tail}\gamma_2\mbox{,}\quad\tilde{\omicron}=\omicron_1\omicron_2\mbox{,}\quad\tilde{\nu}=\nu_2\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)\mbox{,}\\ \sem{e_2}((x,\monadic{v}'_1),\gamma'_1)\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)\mbox{,}\\ \monadic{v}'=\monadic{v}'_2\mbox{,}\quad\tilde{\gamma}'=\uopl{tail}\gamma'_2\mbox{,}\quad\tilde{\omicron}'=\omicron'_2\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d_1=\mbox{\lstinline+@public+}$ or $s_1=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. If $d_1\ne\mbox{\lstinline+@public+}$ and $s_1=\mbox{\lstinline+$pre+}$ then $(\monadic{v}_1,\monadic{c}_1)=(\top,\top)$ and $\monadic{v}'_1=\top$ by exactness and exactness in circuit, respectively. Hence $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$ in all cases, establishing $((x,(\monadic{v}_1,\monadic{c}_1)),\gamma_1)\bullet\pi\sim((x,\monadic{v}'_1),\gamma'_1)$. By the induction hypothesis again, $\omicron_2$ accepts~$\pi$, whereby $\gamma_2\bullet\pi\sim\gamma'_2$, $\nu_2\bullet\pi\sim\omicron'_2$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$. Hence $\tilde{\omicron}$ accepts~$\pi$, whereby $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$ and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$. We obviously obtain also $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$. Conversely, assume that $\tilde{\omicron}$ accepts~$\pi$. Then both $\omicron_1$ and $\omicron_2$ accept~$\pi$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)$ where $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d_1=\mbox{\lstinline+@public+}$ or $s_1=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. Like in the proof of the first half, we obtain $((x,(\monadic{v}_1,\monadic{c}_1)),\gamma_1)\bullet\pi\sim((x,\monadic{v}'_1),\gamma'_1)$. By the induction hypothesis, $\sem{e_2}((x,\monadic{v}'_1),\gamma'_1)\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)$. Therefore $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_2,\uopl{tail}\gamma'_2,\omicron'_2)$ and the desired result follows. \item Let $e=\stmtcomp{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{.} \end{array} \] Furthermore, \[ \begin{array}{l} \semc{e_1}\gamma\phi\nu=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\mbox{,}\\ \semc{e_2}\gamma_1\phi\nu_1=\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\mbox{,} \end{array} \] and $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$ where \[ \begin{array}{l} (\monadic{v},\monadic{c})=(\monadic{v}_2,\monadic{c}_2)\mbox{,}\quad\tilde{\gamma}=\gamma_2\mbox{,}\quad\tilde{\omicron}=\omicron_1\omicron_2\mbox{,}\quad\tilde{\nu}=\nu_2\mbox{.} \end{array} \] Firstly, suppose that $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$. Then \[ \begin{array}{l} \sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)\mbox{,}\\ \sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)\mbox{,}\\ \monadic{v}'=\monadic{v}'_2\mbox{,}\quad\tilde{\gamma}'=\gamma'_2\mbox{,}\quad\tilde{\omicron}'=\omicron'_2\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1$ accepts~$\pi$, whereby $\gamma_1\bullet\pi\sim\gamma'_1$, $\nu_1\bullet\pi\sim\omicron'_1$, and $d_1=\mbox{\lstinline+@public+}$ or $s_1=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_1,\monadic{c}_1)\bullet\pi\sim\monadic{v}'_1$. By the induction hypothesis again, $\omicron_2$ accepts~$\pi$, whereby $\gamma_2\bullet\pi\sim\gamma'_2$, $\nu_2\bullet\pi\sim\omicron'_2$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v}_2,\monadic{c}_2)\bullet\pi\sim\monadic{v}'_2$. Hence $\tilde{\omicron}$ accepts~$\pi$, whereby $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$, $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$. Conversely, assume that $\tilde{\omicron}$ accepts~$\pi$. Then both $\omicron_1$ and $\omicron_2$ accept~$\pi$. By the induction hypothesis, $\sem{e_1}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_1,\gamma'_1,\omicron'_1)$ where $\gamma_1\bullet\pi\sim\gamma'_1$ and $\nu_1\bullet\pi\sim\omicron'_1$. By the induction hypothesis, $\sem{e_2}\gamma'_1\phi\omicron'_1=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)$. Therefore $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}'_2,\gamma'_2,\omicron'_2)$, implying the desired result. \end{itemize} \end{proof} \section{Compilation}\label{sec:compilation} \textsc{ZK-SecreC}\xspace programs are compiled into arithmetic circuits corresponding to the circuit semantics defined in Sect.~\ref{sec:semantics}. An \emph{arithmetic circuit $\mathcal{C}$ over a ring $R$} is a directed acyclic graph, the nodes of which are partitioned into \emph{input}, \emph{constant}, and \emph{operation} nodes, such that each operation node has exactly two incoming arcs and other nodes have none. Additionally, $\mathcal{C}$ assigns an element of~$R$ to each constant node, an operation --- either addition or multiplication --- to each operation node, and a domain --- either \lstinline+@prover+ or \lstinline+@verifier+ --- to each input node in it, and specifies a subset of nodes as output nodes. Also, $\mathcal{C}$~defines an enumeration of its input nodes of each domain. Let $\mathcal{V}$ be the set of all nodes in~$\mathcal{C}$ and $\mathcal{I}\subseteq\mathcal{V}$ the set of all input nodes. An assignment $\alpha\in R^{\mathcal{I}}$ of values to the input nodes extends naturally to an assignment $\alpha^\star\in R^{\mathcal{V}}$ to all nodes (the values for the constant nodes are given in the definition of~$\mathcal{C}$ and the value for each operation node is found by applying the operation in it to the values of its predecessors). We say that $\mathcal{C}$ \emph{accepts input $\alpha\in R^{\mathcal{I}}$}, if $\alpha^\star$ assigns~$0$ to all output nodes. If $R$ is a finite field of characteristic \lstinline+N+, then such circuits can be evaluated by various ZKP techniques (perhaps with additional restrictions on \lstinline+N+). \begin{figure}[b]\figsize \renewcommand{\arraycolsep}{2pt} \begin{tabular}{@{}l@{}} $\begin{array}{lcl} V_\mathrm{C}&=&\mathbb{N}\cup\mathbb{B}\cup()\cup(M\apV_\mathrm{C}\times M\, T)^*\quad\mbox{the set of composite values} \end{array}$\\[1.5ex] $\begin{array}{lcl} C_\mathrm{C}\, A&=&\mathbf{Env}_\mathrm{C}\to\mathbf{In}^3\to\mathbb{N}^2\to\mathds{1}+A\times\mathbf{Env}_\mathrm{C}\times\mathbf{Out}_\mathrm{C}\times\mathbb{N}^2\\ \end{array}$\\[1.5ex] $\begin{array}{lcl@{\quad}l} \mathbf{Env}_\mathrm{C}&=&(X\times(M\apV_\mathrm{C}\times M\, T))^+&\mbox{composite value environments}\\ \mathbf{Out}_\mathrm{C}&=&T^*&\mbox{streams of subcircuits} \end{array}$\\[4.5ex] $\begin{array}{lcl@{\quad}l} \semc{e}&:&C_\mathrm{C}\,(M\apV_\mathrm{C}\times M\, T)&\mbox{the result of compilation of expression~$e$}\\ \end{array}$ \end{tabular} \caption{\label{compilation:types} Types of semantic objects} \end{figure} Denote the set of all circuits by~$T$. Compilation to an arithmetic circuit proceeds in the lines of the dynamic semantics, using a new monad~$C_\mathrm{C}$. To get all types right, we replace the sets $V$, $\mathbf{Env}$, $\mathbf{Out}$ defined in Fig.~\ref{semantics:types} by $V_\mathrm{C}$, $\mathbf{Env}_\mathrm{C}$, $\mathbf{Out}_\mathrm{C}$ defined in Fig.~\ref{compilation:types}. The main difference is that $M\, V$ is replaced with $M\apV_\mathrm{C}\times M\, T$ at most places, meaning that value-circuit pairs occur here as results of computation. We call these pairs \emph{composite values}. The compiler still has to carry values along with circuits for making stage casts from $\mbox{\lstinline+$post+}$ to $\mbox{\lstinline+$pre+}$ if necessary. The value and the circuit component of a composite value can independently of each other be missing. For instance, if $e$ is in $\qual{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}}$ then the value component is known but there is no circuit but if $e$ is in $\qual{\mbox{\lstinline+$post+}}{\mbox{\lstinline+@prover+}}$ then the circuit exists but the value is unknown. In $\qual{\mbox{\lstinline+$post+}}{\mbox{\lstinline+@public+}}$, both components are given. The set $\mathbf{Out}_\mathrm{C}$ contains output streams of subtrees of the circuit under construction rooted at its output nodes (this is to define the output nodes). The monad~$C_\mathrm{C}$ has an extra inner state not occurring in dynamic semantics, a pair of natural numbers, for counting how many input nodes of domains $\mbox{\lstinline+@prover+}$ and $\mbox{\lstinline+@verifier+}$ have been created. \begin{figure*}\figsize \renewcommand{\arraycolsep}{2pt}\renewcommand{\arraystretch}{1.2} \[ \begin{array}{lcl} \semc{\epsilon}\gamma\phi\nu&=&\uopl{pure}((\uopl{pure}\mbox{\textoneoldstyle},\top),\gamma,\epsilon,\nu)\\ \semc{\overline{n}}\gamma\phi\nu&=&\uopl{pure}((\branching{\uopl{pure} n&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\uopl{pure}(\mknode{\uopl{con}(n)})&\mbox{if $s=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}}),\gamma,\epsilon,\nu)\\ \semc{\overline{b}}\gamma\phi\nu&=&\uopl{pure}((\branching{\uopl{pure} b&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\uopl{pure}(\mknode{\uopl{con}(|b|)})&\mbox{if $s=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}}),\gamma,\epsilon,\nu)\\ \semc{x}\gamma\phi\nu&=&\uopl{pure}(\lookup{\gamma}{x},\gamma,\epsilon,\nu)\\ \semc{\addexpr{e_1}{e_2}}\gamma_0\phi\nu_0&=&\mcompv{((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\gets\semc{e_1}\gamma_0\phi\nu_0;\;\\((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\gets\semc{e_2}\gamma_1\phi\nu_1;\;\\\uopl{pure}((\monadic{s},\monadic{t}),\gamma_2,\omicron_1\omicron_2,\nu_2)}\\ \multicolumn{2}{r}{\mbox{where}}&\monadic{s}=\mcomp{i_1\gets\monadic{v}_1;\; i_2\gets\monadic{v}_2;\;\uopl{pure}(i_1+i_2)},\\&&\monadic{t}=\mcomp{c_1\gets\monadic{c}_1;\; c_2\gets\monadic{c}_2;\;\uopl{pure}(\mknode{\uopl{op}{(+)}}(c_1,c_2))}\\ \semc{\assertexpr{e}}\gamma_0\phi\nu_0&=&\mcomp{((\monadic{v}_1,\!\monadic{c}_1),\!\gamma_1,\!\omicron_1,\!\nu_1)\gets\semc{e}\gamma_0\phi\nu_0;\;\uopl{guard}(\monadic{c}_1\ne\top);\;\uopl{pure}((\uopl{pure}\mbox{\textoneoldstyle},\!\top),\!\gamma_1,\!\omicron_1c_1,\!\nu_1)}\\ \multicolumn{2}{r}{\mbox{where}}&\monadic{c}_1=\uopl{pure}(c_1)\\ \semc{\getexpr{d}{k}}\gamma\phi\nu&=&\branching{\uopl{pure}(\uopl{allpuretop}(\phi_d(k)),\gamma,\epsilon,\nu)&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\uopl{pure}((\top,\top),\gamma,\epsilon,\nu)&\mbox{otherwise}}\\ \semc{\castexpr{e}{\qualty{t}{s}{d}}}\gamma_0\phi\nu_0&=&\mcompv{((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\gets\semc{e}\gamma_0\phi\nu_0;\;\\\uopl{pure}((\branching{\monadic{v}_1&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}},\branching{\monadic{c}_1&\mbox{if $s=\mbox{\lstinline+$post+}$}\\\top&\mbox{otherwise}}),\gamma_1,\omicron_1,\nu_1)}\\ \semc{\assignexpr{l}{e}}\gamma_0\phi\nu_0&=&\mcompv{(\monadic{a},\monadic{c})\gets\uopl{pure}(\lookup{\gamma_0}{x});\;\\\forall k=1,\ldots,n:((\monadic{i}_k,\monadic{c}_k),\gamma_k,\omicron_k,\nu_k)\gets\semc{y_k}\gamma_{k-1}\phi\nu_{k-1};\;\\((\monadic{v},\monadic{c}'),\gamma',\omicron',\nu')\gets\semc{e}\gamma_n\phi\nu_n;\;\\\uopl{pure}((\uopl{pure}\mbox{\textoneoldstyle},\top),[x\mapsto\uopl{upd}_{\mathrm{C}}((\monadic{a},\monadic{c}),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v},\monadic{c}'))]\gamma',\omicron_1\ldots\omicron_n\omicron',\nu')}\\ \multicolumn{2}{r}{\mbox{where}}&\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}=l\\ \semc{\loadexpr{l}{e}}\gamma_0\phi\nu_0&=&\mcompv{((\monadic{a},\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\gets\semc{l}\gamma_0\phi\nu_0;\;\\((\monadic{i},\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\gets\semc{e}\gamma_1\phi\nu_1;\;\\\monadic{r}\gets\uopl{pure}(\mcomp{a\gets\monadic{a};\; i\gets\monadic{i};\;\uopl{pure} a_i});\;\\\branching{\uopl{pure}((\monadic{v},\monadic{c}),\gamma_2,\omicron_1\omicron_2,\nu_2)&\mbox{if $\monadic{r}=\uopl{pure}(\monadic{v},\monadic{c})$}\\\uopl{pure}((\top,\top),\gamma_2,\omicron_1\omicron_2,\nu_2)&\mbox{otherwise}}} \end{array} \] \caption{\label{fig:compilationsmall} Compilation to an arithmetic circuit: ``Small'' expressions} \end{figure*} \begin{figure*}\figsize \renewcommand{\arraycolsep}{2pt}\renewcommand{\arraystretch}{1.2} \[ \begin{array}{lcl@{}} \semc{\ifexpr{e_1}{e_2}{e_3}}\gamma_0\phi\nu_0&=&\mcompv{((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\gets\semc{e_1}\gamma_0\phi\nu_0;\;\\\branching{\mcomp{(\!(\monadic{v}_2,\!\monadic{c}_2),\!\gamma_2,\!\omicron_2,\!\nu_2)\gets\semc{e_2}\gamma_1\phi\nu_1;\;\uopl{pure}(\!(\monadic{v}_2,\!\monadic{c}_2),\!\gamma_2,\!\omicron_1\omicron_2,\!\nu_2)}&\mbox{if $\monadic{v}_1\!=\!\uopl{pure}\mbox{\bfseries tt}$}\\\mcomp{(\!(\monadic{v}_3,\!\monadic{c}_3),\!\gamma_3,\!\omicron_3,\!\nu_3)\gets\semc{e_3}\gamma_1\phi\nu_1;\;\uopl{pure}(\!(\monadic{v}_3,\!\monadic{c}_3),\!\gamma_3,\!\omicron_1\omicron_3,\!\nu_3)}&\mbox{if $\monadic{v}_1\!=\!\uopl{pure}\mbox{\bfseries ff}$}\\\uopl{pure}(\!(\top,\!\top),\!\gamma_1,\!\omicron_1,\!\nu_1)&\mbox{otherwise}}}\\ \semc{\forexpr{x}{e_1}{e_2}{e_3}}\gamma_0\phi\nu_0&=&\mcompv{((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\gets\semc{e_1}\gamma_0\phi\nu_0;\;\\((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\gets\semc{e_2}\gamma_1\phi\nu_1;\;\\\branching{\uopl{main}(\max(0,i_2-i_1))&\mbox{where $\monadic{v}_j=\uopl{pure} i_j$}\\\uopl{pure}((\top,\top),\gamma_2,\omicron_1\omicron_2,\nu_2)&\mbox{if $\monadic{v}_1=\top$ or $\monadic{v}_2=\top$}}}\\ \multicolumn{2}{r@{}}{\mbox{where}}&\uopl{main}(n)=\mcompv{((\monadic{a}_1,\monadic{c}'_1),\gamma'_1,\omicron'_1,\nu'_1)\gets\semc{e_3}((x,(\uopl{pure} i_1,\top)),\gamma_2)\phi\nu_2;\;\\\forall k\!\!=\!\!2,\!...,\!n\!:\!(\!(\!\monadic{a}_{k},\!\monadic{c}'_{\!k}\!),\!\gamma'_{\!k},\!\omicron'_{\!k},\!\!\nu'_{\!k})\!\!\gets\!\!\semc{\!e_3\!}\!(\!(x,\!(\uopl{pure}(\!i_1\!+\!k\!-\!1)\!,\!\top)\!),\gamma'_{k\!-\!1})\phi\nu'_{k\!-\!1}\!;\;\\\uopl{pure}((\uopl{pure}((\monadic{a}_1,\monadic{c}'_1),\!...,\!(\monadic{a}_n,\monadic{c}'_n)),\top),\uopl{tail}\gamma'_n,\omicron_1\omicron_2\omicron'_1...\omicron'_n,\nu'_n)}\\ \semc{\wireexpr{e}}\gamma\phi\nu&=&\mcompv{((\monadic{v}',\monadic{c}'),\gamma',\omicron',\nu')\gets\semc{e}\gamma\phi\nu;\;\\\uopl{pure}((\monadic{v}',\branching{\uopl{pure}(\mknode{\uopl{con}(n)})&\mbox{if $\monadic{v}'=\uopl{pure} n$, $n\in\mathbb{N}$}\\\uopl{pure}(\mknode{\uopl{con}(|b|)})&\mbox{if $\monadic{v}'=\uopl{pure} b$, $b\in\mathbb{B}$}\\\uopl{pure}(\mknode{\uopl{in}_d(\nu'_d)})&\mbox{if $\monadic{v}'=\top$}}),\gamma',\omicron',\nu'')}\\ \multicolumn{2}{r}{\mbox{where}}&\mbox{$d$ is the domain of~$e$ and $\nu''=\lam{d'}{\branching{\nu'_{d'}+1&\mbox{if $d'=d$}\\\nu'_{d'}&\mbox{otherwise}}}$}\\ \semc{\stmtcomp{\letexpr{x}{e_1}}{e_2}}\gamma_0\phi\nu_0&=&\mcompv{((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\gets\semc{e_1}\gamma_0\phi\nu_0;\;\\((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\gets\semc{e_2}((x,(\monadic{v}_1,\monadic{c}_1)),\gamma_1)\phi\nu_1;\;\\\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\uopl{tail}\gamma_2,\omicron_1\omicron_2,\nu_2)}\\ \semc{\stmtcomp{e_1}{e_2}}\gamma_0\phi\nu_0&=&\mcompv{((\monadic{v}_1,\monadic{c}_1),\gamma_1,\omicron_1,\nu_1)\gets\semd{e_1}\gamma_0\phi\nu_0;\;\\((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_2,\nu_2)\gets\semd{e_2}\gamma_1\phi\nu_1;\;\\\uopl{pure}((\monadic{v}_2,\monadic{c}_2),\gamma_2,\omicron_1\omicron_2)} \end{array} \] \caption{\label{fig:compilationlarge} Compilation to an arithmetic circuit: ``Large'' expressions and statements} \end{figure*} Our compilation semantics $\semc{\cdot}$ is presented in Figures~\ref{fig:compilationsmall} and~\ref{fig:compilationlarge}. We denote by $\mknode{\mathit{t}}(c_1,\ldots,c_n)$ the circuit with a node of the given class~$t$ as root and the circuits referenced by $c_1,\ldots,c_n$ as subtrees. Here, $n$ is $0$ or $2$ depending on~$t$, and $t$ can be $\uopl{con}(v)$ (a node of constant value~$v$), $\uopl{op}(\oplus)$ (a node of operation~$\oplus$), or $\uopl{in}_d(k)$ (the input node number~$k$ of domain~$d$). So the compiler builds up the arithmetic circuit from small pieces as subtrees. As explained above, we consider a node to be an output node iff it is a root of some output subcircuit. Output occurs in the \lstinline{assert} case only. Any Boolean~$b$ is replaced with its representative integer~$|b|$ where $|\mbox{\bfseries tt}|=0$, $|\mbox{\bfseries ff}|=1$ because the circuit only does (modular) arithmetic. Representing~$\mbox{\bfseries tt}$ by~$0$ arises from the fact that a \textsc{ZK-SecreC}\xspace program succeeds if all arguments of occurrences of \lstinline{assert} evaluate to~$\mbox{\bfseries tt}$ whereas the circuit checks if all its outputs are zero. Input nodes are created if a \lstinline{wire} construct is applied to a value in domain \lstinline{@prover} or \lstinline{@verifier}. This way, Verifier's and Prover's private values passed to the circuit via the \lstinline{wire} construct form an assignment that the circuit either accepts or not. Note that the $\uopl{upd}_{\mathrm{C}}$ function used in the assignment clause is here defined slightly differently from $\uopl{upd}$: \[\renewcommand{\arraycolsep}{2pt} \begin{array}{@{}lcl@{}} \uopl{upd}_{\mathrm{C}}((\monadic{v},\monadic{c}),\monadic{i}_1\ldots\monadic{i}_n,(\monadic{v}',\monadic{c}'))&=&\branching{(\monadic{v}',\monadic{c}')&\mbox{if $n=0$}\\\left(\monadic{v}'',\top\right)&\mbox{if $n>0$}}\\ \multicolumn{2}{r}{\mbox{where}}&\monadic{v}''=\mcomp{a\gets\monadic{a};\; i_1\gets\monadic{i}_1;\;\uopl{pure}([i_1\!\mapsto\!\uopl{upd}_{\mathrm{C}}(a_{i_1},\!\monadic{i}_2\ldots\monadic{i}_n,\!(\monadic{v}',\!\monadic{c}'))]a)}\mbox{.} \end{array} \] In the clause for \lstinline+get+, we use a new variant of the $\uopl{allpure}$ operation, $\uopl{allpuretop}$, that lifts a value in $U$ to $M\apV_\mathrm{C}\times M\, T$ in a straightforward manner by inserting $\uopl{pure}$ and $\top$ at each level: \[ \uopl{allpuretop}(v)=\branching{(\uopl{pure} v,\top)&\mbox{if $v$ is of a primitive type}\\(\uopl{pure}(\uopl{allpuretop}(v_1),\ldots,\uopl{allpuretop}(v_n)),\top)&\mbox{if $v=(v_1,\ldots,v_n)$}} \] In the following, we refer to the following auxiliary operation $|\cdot|:T\to M\,\mathbb{N}$ that evaluates a given circuit: \[\figsize |c|=\branching{\uopl{pure} n&\mbox{if $c=\mknode{\uopl{con}(n)}$}\\\mcomp{i_1\gets|c_1|;\; i_2\gets|c_2|;\;\uopl{pure}(i_1\oplus i_2)}&\mbox{if $c=\mknode{\uopl{op}(\oplus)}(c_1,c_2)$}\\\top&\mbox{if $c=\mknode{\uopl{in}_d(k)}$}} \] The results must be monadic since the input nodes do not refer to particular values and must be mapped to~$\top$. We also need an analogous operation that takes the circuit input into account. For any circuit~$c$ and $\pi\in(\mathbb{N}^*)^2$ (a sequence of input values for both Prover and Verifier), we define \[\figsize c(\pi)=\branching{n&\mbox{if $c=\mknode{\uopl{con}(n)}$}\\c_1(\pi)\oplus c_2(\pi)&\mbox{if $c=\mknode{(\uopl{op}(\oplus))}(c_1,c_2)$}\\\pi_d(i)&\mbox{if $c=\mknode{\uopl{in}_d(i)}$}} \] This operation always results in a pure value. If the output of compilation of an expression of a statement is $\omicron$ then the resulting circuit accepts an input~$\pi$ iff $\omicron_i(\pi)=0$ for all~$i$ such that $\omicron_i$ exists (where $\omicron_i$ denotes the $i$th component of the sequence~$\omicron$). We can prove Theorems~\ref{thm:can_compile} and~\ref{thm:correct_compilation} below. Theorem~\ref{thm:can_compile} establishes conditions under which well-typed programs can be compiled into a circuit. Theorem~\ref{thm:correct_compilation} states that compilation into a circuit preserves semantics. For establishing the claims in a mathematically precise form, we need several new notions. Definition~\ref{compilation:exact} introduces one more exactness property that is analogous to those in Sect.~\ref{sec:semantics}. Definition~\ref{compilation:eval} introduces an operation that calculates a monadic value that represents the given composite value. It uses the first component of the given composite value if it is pure, and finds the value of the circuit (in the second component of the composite value) on the given input if the circuit exists. This operation is needed to establish correspondence between composite values the compiler is computing with and the monadic values in the circuit semantics. Definition~\ref{compilation:equiv} introduces an equivalence relation on $M\, V$ that identifies integer and Boolean values that are encoded the same in the circuit. Definition~\ref{compilation:env} lifts the introduced operations pointwise to value environments. \begin{definition}\label{compilation:exact} For any well-structured qualified type $q=\qualty{t}{s}{d}$ and $(\monadic{v},\monadic{c})\in M\apV_\mathrm{C}\times M\, T$, we say that $(\monadic{v},\monadic{c})$ is \emph{$q$-exact} if all the following implications hold: \begin{enumerate} \item If $s=\mbox{\lstinline+$post+}$ then there is a circuit~$c$ such that $\monadic{c}=\uopl{pure} c , whereby $\monadic{v}=\uopl{pure} n$ with $n\in\mathbb{N}$ implies $|c|=\uopl{pure} n$, and $\monadic{v}=\uopl{pure} b$ with $b\in\mathbb{B}$ implies $|c|=\uopl{pure}|b|$, and in both latter cases $|c|=\uopl{pure}(c(\pi))$ for any input sequence~$\pi$. \item If $d=\mbox{\lstinline+@public+}$ and $t$~{}is a primitive type then $\monadic{v}=\uopl{pure} v$ where $v\in t$; \item If $d=\mbox{\lstinline+@public+}$ and $t=\listty{q'}$ then $\monadic{v}=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\ldots,(\monadic{v}_n,\monadic{c}_n))$ where $n\in\mathbb{N}$ and all $(\monadic{v}_1,\monadic{c}_1),\ldots,(\monadic{v}_n,\monadic{c}_n)\in M\apV_\mathrm{C}\times M\, T$ are $q'$-exact; \item If $s=\mbox{\lstinline+$pre+}$ then $\monadic{c}=\top$; \item If $d\ne\mbox{\lstinline+@public+}$ then $\monadic{v}=\top$. \end{enumerate} \end{definition} \begin{definition}\label{compilation:eval} Define $(\_,\_)\bullet\_:(M\apV_\mathrm{C}\times M\, T)\times(\mathbb{N}^*)^2\to M\, V$ as follows: For every pair $(\monadic{v},\monadic{c})\in M\apV_\mathrm{C}\times M\, T$ and circuit input $\pi\in(\mathbb{N}^*)^2$, \[ (\monadic{v},\monadic{c})\bullet\pi=\branching{\uopl{pure} n&\mbox{if $\monadic{v}=\uopl{pure} n$, $n\in\mathbb{N}$}\\\uopl{pure}|b|&\mbox{if $\monadic{v}=\uopl{pure} b$, $b\in\mathbb{B}$}\\\uopl{pure}\mbox{\textoneoldstyle}&\mbox{if $\monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}$}\\\uopl{pure}((\monadic{v}_1,\monadic{c}_1)\bullet\pi,\ldots,(\monadic{v}_n,\monadic{c}_n)\bullet\pi)&\mbox{if $\monadic{v}=\uopl{pure}((\monadic{v}_1,\monadic{c}_1),\ldots,(\monadic{v}_n,\monadic{c}_n))$}\\\uopl{pure}(c(\pi))&\mbox{if $\monadic{v}=\top$ but $\monadic{c}=\uopl{pure} c$}\\\top&\mbox{if $\monadic{v}=\top$ and $\monadic{c}=\top$}} \] \end{definition} \begin{definition}\label{compilation:equiv} Define a binary predicate $\sim$ on $M\, V$ as follows: For every pair $(\monadic{v},\monadic{v}')\in M\, V\times M\, V$, we write $\monadic{v}\sim\monadic{v}'$ iff one of the following alternatives holds: \begin{enumerate} \item $\monadic{v}=\uopl{pure} v$ and $\monadic{v}'=\uopl{pure} v'$ where $v=v'$ or $|v|=v'$ or $v=|v'|$ or $|v| = |v'|$ (where $|\cdot|$ is applied to Boolean values but not to integers); \item $\monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}=\monadic{v}'$; \item $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$ and $\monadic{v}'=\uopl{pure}(\monadic{v}'_1,\ldots,\monadic{v}'_n)$ where $\monadic{v}_1\sim\monadic{v}'_1, \ldots, \monadic{v}_n\sim\monadic{v}'_n$; \item $\monadic{v}=\top=\monadic{v}'$. \end{enumerate} \end{definition} \begin{definition}\label{compilation:env} \begin{enumerate} \item Let $\Gamma$ be a well-structured type environment. We say that $\gamma\in\mathbf{Env}_\mathrm{C}$ is \emph{$\Gamma$-exact} iff $\uopl{vars}\gamma=\uopl{vars}\Gamma$ and, for every association $(x_i:q_i)$ occurring in $\Gamma$, the value in the corresponding association $(x_i,(\monadic{v}_i,\monadic{c}_i))$ is $q_i$-exact. \item For $\gamma\in\mathbf{Env}_\mathrm{C}$ and $\pi\in(\mathbb{N}^*)^2$, we define $\gamma\bullet\pi\in\mathbf{Env}$ by lifting the bullet operation pointwise to association lists. \item For $\gamma,\gamma'\in\mathbf{Env}$, we write $\gamma\sim\gamma'$ iff $\uopl{vars}\gamma=\uopl{vars}\gamma'$ and $\lookup{\gamma}{x}\sim\lookup{\gamma'}{x}$ for each defined variable~$x$. \end{enumerate} \end{definition} We also extend $\sim$ pointwise to sequences (of equal length) of monadic values and, furthermore, to tuples of such sequences. For any natural number~$n$ and list~$l$, we write $\uopl{drop} n\, l$ to denote the part of list~$l$ remaining if the first $n$ elements are removed. We write $\uopl{map} f\, l$ for the result of applying~$f$ to all elements of~$l$. Using these auxiliary operations, we extend the bullet notation to denote $\nu\bullet\pi=\lam{d}{\uopl{map}\uopl{pure}\left(\uopl{drop}\nu_d\pi_d\right)}$ where $\nu\in\mathbb{N}^2$, $\pi\in(\mathbb{N}^*)^2$ and $d$ ranges over $\set{\mbox{\lstinline+@prover+},\mbox{\lstinline+@verifier+}}$. \begin{theorem}\label{thm:can_compile} Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$. Let $\gamma\in\mathbf{Env}_\mathrm{C}$ be $\Gamma$-exact. Let $\phi\in\mathbf{In}^3$ such that, for all subexpressions of~$e$ of the form $\ofty{\getexpr{d}{k}}{q'}$ where $d=\mbox{\lstinline+@public+}$, the value $\uopl{allpure}(\phi_{d}(k))$ is $q'$-exact in~$d$. Let $\nu\in\mathbb{N}^2$. Unless an array lookup fails due to an index being out of bounds, we have $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\gamma',\omicron,\nu')$ for some $\monadic{v}$, $\monadic{c}$, $\gamma'$, $\omicron$ and $\nu'$, whereby $(\monadic{v},\monadic{c})$ is $q$-exact and $\gamma'$ is $\Gamma$-exact. \end{theorem} In the following theorem: \begin{itemize} \item Letters without tilde denote the original states and those with tilde denote result states; \item Letters without prime denote compiler states while those with prime denote states in circuit semantics. \end{itemize} \begin{theorem}\label{thm:correct_compilation} Let $\Gamma \mbox{\ $\vdash$\ } e:\qualty{t}{s}{d}! D$ with well-structured~$\Gamma$. Let $\gamma\in\mathbf{Env}_\mathrm{C}$ be $\Gamma$-exact, $\phi\in\mathbf{In}^3$ be a triple of type correct input dictionaries, and $\nu\in\mathbb{N}^2$. Let $\semc{e}\gamma\phi\nu=\uopl{pure}((\monadic{v},\monadic{c}),\tilde{\gamma},\tilde{\omicron},\tilde{\nu})$. Let $\pi\in(\mathbb{N}^*)^2$, $\gamma'\in\mathbf{Env}$, $\omicron'\in\mathbf{Out}^2$ be such that $\gamma'$ is $\Gamma$-exact in circuit, $\gamma\bullet\pi\sim\gamma'$ and $\nu\bullet\pi\sim\omicron'$. Then: \begin{enumerate} \item If $\sem{e}\gamma'\phi\omicron'=\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$ then $\tilde{\omicron}$ accepts $\pi$; moreover, $\tilde{\gamma}\bullet\pi\sim\tilde{\gamma}'$ and $\tilde{\nu}\bullet\pi\sim\tilde{\omicron}'$, and $d=\mbox{\lstinline+@public+}$ or $s=\mbox{\lstinline+$post+}$ implies $(\monadic{v},\monadic{c})\bullet\pi\sim\monadic{v}'$; \item If $\sem{e}\gamma'\phi\omicron'$ fails (i.e., it is not of the form $\uopl{pure}(\monadic{v}',\tilde{\gamma}',\tilde{\omicron}')$), while all circuits that arise during compilation need only inputs in~$\pi$, then $\tilde{\omicron}$~{}does not accept $\pi$. \end{enumerate} \end{theorem} The theorems are proved by structural induction on~$e$. The details are given in Appendix~\ref{compilation-proofs}. \section{Useful constructions}\label{sec:extensions}\label{ssec:dictionaries} Our choice of the details of the type system is validated by the ease of implementing certain constructions that often occur in the statements to be proved in ZK. We will describe them next, after two simple extensions to \textsc{ZK-SecreC}\xspace. First, whenever $s_1,\ldots,s_n$ are identifiers and $t_1,\ldots,t_n$ are qualified types, then $\{s_1:t_1,\ldots,s_n:t_n\}$ is a qualified type. Records are defined by specifying the values of all fields, and the values of the fields can be read. The record itself is implicitly qualified \lstinline+$pre @public+. \textsc{ZK-SecreC}\xspace allows to declare type synonyms for record types using the keyword \lstinline{struct}. Second, parameters of functions can also be passed by reference. Changes to a by-reference parameter inside the called function are visible in the calling function. A parameter preceded by the keyword \lstinline+ref+ in a function declaration is passed by reference. \paragraph{Bit extraction} Arithmetic circuits naturally support addition and multiplication of values. To compare two values, they have to be split into bits as in Fig.~\ref{language:factor}. We see that each invocation of \lstinline+less_than+ causes the bits of both of its arguments being computed. Hence the value of variable \lstinline+z+ is split into bits twice, resulting in different lists of bits created by the \lstinline+wire+ expression in the function \lstinline+bitextract+, but with equal values. It is conceivable that an optimizing compiler is able to detect that these lists of bits have to be equal. However, in a DSL like \textsc{ZK-SecreC}\xspace, we prefer to be able to explicitly indicate the availability of such language-specific optimizations. If the value of a variable \lstinline+v+ of type \lstinline+uint[N] $post @D+ could be split into bits, then we could define it with the following type instead (note polymorphism over \lstinline+N+, as well as \lstinline+@D+): \begin{lstlisting} struct uint_with_bits[N : Nat, @D] { value : uint[N] $post @D, hasBits : bool $pre @public, bits : list[bool[N] $post @D] } \end{lstlisting} When creating or updating the value, we define the field \lstinline+value+ and set \lstinline+hasBits+ to \lstinline+false+. The function \lstinline+bitextract+ checks the field \lstinline+hasBits+ of its argument (which is passed by reference) and returns the content of the field \lstinline+bits+ if it is true. The function performs the actual splitting into bits only if the field \lstinline+hasBits+ is false; in this case it updates \lstinline+bits+ and sets \lstinline+hasBits+. \paragraph{Dictionaries} Dictionaries generalize arrays, allowing the keys (indices) to come from any set, not just from a segment of integers, and supporting the operations \lstinline+load(key)+ and \lstinline+store(key,value)+. In \textsc{ZK-SecreC}\xspace, lists (which play the role of arrays) have rather restrictive typing rules associated with them, making sure that computations with them can be converted into circuit operations. Having the keys in \lstinline+$post+ and in an arbitrary domain requires the use of \emph{Oblivious RAM} (ORAM)~\cite{DBLP:journals/jacm/GoldreichO96}, which has had a number of solutions proposed in the context of ZK proofs~\cite{DBLP:conf/ccs/Neff01,buffet,DBLP:conf/asiacrypt/BootleCGJM18}. A general method for ORAM in ZKP context~\cite{buffet} performs no correctness checks while the \lstinline+load+ and \lstinline+store+ operations are executed. Rather, all checks for a particular dictionary will be performed when it is no longer used; these checks involve sorting the list of operations by the values of keys, and checking that the equality of certain keys implies the equality of accompanying values. We refer to~\cite{buffet} for details. The type and the supported operations of a dictionary are given in Fig.~\ref{fig:dictionaries}. During the execution, the performed operations have to be recorded. Both the \lstinline+load+ and \lstinline+store+ operations log the key, the value, and the performed operation (where \lstinline+false+ means loading, and \lstinline+true+ means storing). When logging, the key and the value (which may be private) are kept in the stage \lstinline+$post+, thereby fixing the values in the circuit. The performed operation, however, is public, because \lstinline+load+ and \lstinline+store+ can only be invoked in a public context. The functions \lstinline+find+ and \lstinline+update+ work with values in the stage \lstinline+$pre+ only, looking up a binding or updating them; their specification is mundane. The function \lstinline+finalize+ is run on the field \lstinline+log+ of a dictionary before that dictionary goes out of scope, it implements the checks in~\cite{buffet}. \textsc{ZK-SecreC}\xspace contains syntactic sugar for dictionary creation, and loading and storing of values. It also automatically adds the calls to \lstinline+finalize+ at the end of the block containing the creation of the dictionary. \begin{figure} \begin{lstlisting} struct keyValuePair[N : Nat,$S,@D] { key : uint[N] $S @D, val : uint[N] $S @D } struct operation[N : Nat,@D] { kv : keyValuePair[N,$post,@D], op : bool $pre @public } struct map[N : Nat,@D] { bindings : list[keyValuePair[N,$pre,@D]], log : list[operation[N,@D]] } fn create[N : Nat,@D]() -> map[N,@D] { { bindings = [], log = [] } } fn load[N : Nat,@D](ref d : map[N,@D], k : uint[N] $post @D) -> uint[N] $post @D { let v : uint[N] $post @D = wire { find(d.bindings, k as $pre) }; d.log = cons({ kv = { key = k, val = v }, op = false }, d.log); v } fn store[N : Nat,@D](ref d : map[N,@D], k : uint[N] $post @D, v : uint[N] $post @D) { d.bindings = update(d.bindings, k as $pre, v as $pre); d.log = cons({ kv = { key = k, val = v }, op = true }, d.log); } fn finalize[N : Nat,@D](ops : list[operation[N,@D]]) { // sorting and assertions omitted } \end{lstlisting} \caption{Implementing dictionaries}\label{fig:dictionaries} \end{figure} Depending on the number of loads and stores, as well as other characteristics of the operations of the dictionary, different ways of performing finalization may be most efficient~\cite{xJSnark}. If these characteristics can be derived or predicted from public data, the best way can be chosen in \lstinline+finalize+. \section{Introduction}\label{intro} Zero-knowledge proofs (ZKP)~\cite{DBLP:conf/stoc/GoldwasserMR85} are two-party protocols between Prover and Verifier, where the former attempts to convince the latter that he has a piece of knowledge that validates a statement, while not revealing anything about this knowledge. Here this statement is seen as a binary relation $R$ that takes as inputs the \emph{instance} --- common knowledge of Prover and Verifier ---, and the \emph{witness} --- Prover's private knowledge ---, and decides whether the latter validates the former. Among the first practical instances of ZKP was privacy-preserving identification~\cite{DBLP:journals/joc/Schnorr91}, where both the client and the server knew client's public key $h$ --- an element in a cyclic group $\mathbb{G}$ of size $p$ with a hard discrete logarithm problem ---, and the client proved to the server that he knew the discrete logarithm $x$ of $h$ (to the basis of a generator $g$). Considering $g$ a public parameter, the relation $R$ here is a subset of $\mathbb{G}\times\mathbb{Z}_p$, where $\mathbb{Z}_p=\{0,1,\ldots,p-1\}$ is the ring of integers modulo $p$. We have $(h,x)\in R$ iff $g^x=h$. Both the client and the server knew the first component, but only the client knew the second one. The protocol convinced the server of having established communication with someone who knows $x$ such that $(h,x)\in R$, but gave no further information about $x$. Later advances in ZKP~\cite{DBLP:conf/stoc/IshaiKOS07,ZKBoo,DBLP:conf/eurocrypt/Groth16,bunz2018bulletproofs} allow the creation of ZKP for statements that are significantly bigger and more complex than the described identification protocol, with privacy-preserving distributed ledgers~\cite{DBLP:conf/sp/MiersG0R13,narula2018zkledger} showing a large variety. More applications from a heterogeneous variety of areas are expected in the future~\cite{ZKProofApplicationsTrackProceeding}. All these applications need tools for expressing the binary relation. All cryptographic techniques for ZKP expect the relation to be expressed as an arithmetic circuit over some finite ring (for most techniques, a field, often with additional constraints), handling only a very limited number of operations. For example, even if there existed a field $\mathbb{F}$ that suitably embedded $\mathbb{G}$ and $\mathbb{Z}_p$ from our first example, and there were ZKP techniques for circuits over $\mathbb{F}$, the relation $R$ probably would not be directly representable as an arithmetic circuit over $\mathbb{F}$, because exponentiation is not among the supported operations. Additions and multiplications are supported, hence we could express $R$ if we represented $x$ as a sequence of bits. These bits can be computed by Prover, and added to the second component of $R$ (changing its type in the process). If $R$ is but a part of a larger relation, then we may need $x$ being represented in various ways. Prover can add all these representations to the inputs of that relation. But then Verifier needs to be convinced that all these representations correspond to the same value of $x$, hence there need to be checks for that. When expressing a relation for the subsequent use of ZKP techniques, we want to state what extra values should be added to the witness and the instance in order to make the circuit simpler (or computable at all), and which checks should be included. Describing and encoding a circuit and the \emph{expansion} of its inputs directly is error-prone; it is difficult to specify the circuit, as well as to understand what it does. Such state of affairs may be acceptable if ZK proofs are expected to be given only for a small number of relations $R$, but a high-level domain-specific language and associated compilation tools for specifying the relations $R$ are desirable for wide-spread adoption. The specification should mostly be in terms used by common programming languages, exposing only those ZKP-specific details that are highly significant for obtaining a circuit that is handled efficiently by the cryptographic technique and does not reveal Prover's inputs. The specified relation should be automatically translated into the arithmetic circuit, while being optimized for the performance profiles of ZKP techniques. Besides the construction of the arithmetic circuit, the language and compilation tools must help in the preparation of common and Prover's inputs for it. The features of the language have to support the execution by the two parties and a common ZKP protocol between them, with these components not fully trusting each other. In this paper, we propose \textsc{ZK-SecreC}\xspace --- a programming language for specifying relations between instances and witnesses, together with a toolchain that produces circuits suitable as inputs for ZKP techniques. In their design, we have aimed to tackle the following issues. \paragraph{Execution at multiple locations} A \textsc{ZK-SecreC}\xspace program specifies, and the \textsc{ZK-SecreC}\xspace compiler produces the description of a circuit, which both Prover and Verifier use as one of the inputs to a cryptographic technique for ZK proofs. Besides running the cryptographic protocol, both parties may need to run some parts of the program locally for the purpose of increasing the efficiency of computations. A \textsc{ZK-SecreC}\xspace program can thus specify local computations, and the compiler can produce code that Verifier will and Prover should execute with their inputs. \paragraph{Compilation into a circuit} Having the arithmetic circuit as an intermediate representation makes our compiler agnostic towards the used cryptographic techniques, and allows the compilation result to be retargeted easily, so that it may be created once and then used multiple times by Prover to convince Verifier that it knows the witnesses for several different instances. Even though the circuit may only contain a very restricted set of operations, targeting only a particular ZKP technology will not significantly increase the supported set. Our type system for \textsc{ZK-SecreC}\xspace makes sure that non-supported operations cannot be added to the arithmetic circuit, and that the shape of the circuit and the operations in its nodes are public. \paragraph{Witness and instance expansion} Adding more inputs to the circuit and verifying that they are correctly related to previous inputs is a pervasive technique for improving the efficiency of computations of the relation. \textsc{ZK-SecreC}\xspace allows to freely mix computations on circuit and off circuit. The results of the latter become additional inputs of the circuit. Tackling these issues allows us to support the deployment model that we consider likely for many use-cases of ZKP; the model is depicted in Fig.~\ref{fig:deploymentmodel}. \begin{figure} \includegraphics[width=\textwidth]{ZKSC-deployment.pdf} \caption{Deploying ZK proofs with \textsc{ZK-SecreC}\xspace tools. (1) Prover and Verifier agree on the description of the relation $R$. (2) The relation $R$ is compiled, perhaps by a service provider, perhaps by Prover and Verifier themselves, producing the description of the circuit, and executables for processing the instance and witness. (3) Prover and Verifier agree on the instance for which the proof will be made; the Prover must also have a witness. (4) Prover and Verifier expand the given instance and witness. (5) The implementation of a (cryptographic) ZKP technology gets as input the circuit, and the instance and the witness in the form ingested by the circuit. (6) ZKP protocol is executed. (7) Verifier obtains the verification result.}\label{fig:deploymentmodel} \end{figure} \paragraph{Semantics} The statement to be proven is commonly seen as a binary relation, but its meaning is really the left projection of that relation. The semantics of \textsc{ZK-SecreC}\xspace precisely defines the meaning of its program . The language constructions and the type system of \textsc{ZK-SecreC}\xspace capture the essential details common to all ZK proofs. A ZK proof aims to give both confidentiality and integrity guarantees. \textsc{ZK-SecreC}\xspace precisely fixes the possible movements of data between different domains, enforcing the ``no read up'' and ``no write down'' properties without exceptions. The viability of such strong restrictions shows that the confidentiality guarantees are similar for all ZK proofs, and do not really depend on the particular relation, to which the ZK proofs technique has been applied. On the other hand, the necessary checks for making sure that the relation is satisfied are very much a part of the description of that relation; their inclusion is the responsibility of the programmer encoding this relation in \textsc{ZK-SecreC}\xspace. Hence, the language cannot offer much of \emph{formal} support in verifying that the desired integrity properties have been specified by the programmer. We start this paper in Sect.~\ref{sec:zkscexample} with an example program in \textsc{ZK-SecreC}\xspace, showing off its features. We continue with the description of the syntax of \textsc{ZK-SecreC}\xspace in Sect.~\ref{sec:syntax} and its type system in Sect.~\ref{sec:typesystem}. The execution of a well-typed program can be split between different domains in the manner that we desire, with necessary data available at each domain. An arithmetic circuit, suitable as an input to a ZKP technique, can also be statically extracted from a well-typed program. In Sect.~\ref{sec:semantics} we give a formal semantics of \textsc{ZK-SecreC}\xspace, stating the language that is accepted by a \textsc{ZK-SecreC}\xspace program. Following up on it, we describe the compilation into an arithmetic circuit in Sect.~\ref{sec:compilation}. We continue with the evaluation of expressivity and efficiency of \textsc{ZK-SecreC}\xspace, first showing in Sect.~\ref{sec:extensions} how some data structures and methods useful for ZKP can be straightforwardly encoded, and then discussing in Sect.~\ref{sec:evaluation} the circuits output by \textsc{ZK-SecreC}\xspace compiler for various example problems. We finish the paper in Sect.~\ref{sec:relwork} by comparing \textsc{ZK-SecreC}\xspace against other existing languages and means of specifying statements proved in ZK. The appendices provide full proofs of the lemmas and theorems. \section{\textsc{ZK-SecreC}\xspace on an Example}\label{sec:zkscexample} Let us start the description of the language with an example. Suppose that Prover and Verifier both know a large integer~$z$. Prover wants to convince Verifier that he also knows a factor~$x$ of~$z$ such that $1<x<z$. In ZKP terms, $z$~is the \emph{instance} and $x$~is the \emph{witness}. The relation between $z$ and~$x$ can be specified in \textsc{ZK-SecreC}\xspace as shown in Fig.~\ref{language:factor}. This program specifies an arithmetic circuit that Prover and Verifier have to execute on top of a ZKP technology of their choice, as well as the local computations they both should perform. \begin{figure}[tbp] \begin{lstlisting} fn bitextract_pre[@D](x : uint[N] $pre @D, fbw : uint $pre @public) -> list[bool[N] $pre @D] { let rec xx = for i in 0 .. fbw { // generates a list of length fbw if (i == 0) { x } else { xx[i - 1] / 2 } }; for i in 0 .. fbw { // generates a list of booleans, which is returned let b = xx[i] b == 1 } } fn check_bitextract[@D](x : uint[N] $post @D, xb : list[bool[N] $post @D]) { let mut s = xb[length(xb) - 1] as uint[N]; // variable s is mutable for i in 0 .. length(xb) - 1 { s = 2 * s + xb[length(xb) - i - 2] as uint[N]; }; assert_zero(x - s); } fn bitextract[@D](x : uint[N] $post @D, fbw : uint $pre @public) -> list[bool[N] $post @D] { let xb_pre = bitextract_pre(x as $pre, fbw); let xb = for i in 0 .. length(xb_pre) { wire { xb_pre[i] } }; if (@prover <= @D) { check_bitextract(x, xb); }; xb } fn less_than[@D1, @D2, @D](x : uint[N] $post @D1, y : uint[N] $post @D2, fbw : uint $pre @public) -> bool[N] $post @D where @D1 <= @D, @D2 <= @D { let xb = bitextract(x as @D, fbw); let yb = bitextract(y as @D, fbw); // lexicographic comparison of lists of bits xb and yb omitted } fn main() { let fbw : uint $pre @public = get_public("fixed bit width"); let z : uint[N] $post @verifier = wire { get_instance("z") }; let x : uint[N] $post @prover = wire { get_witness("x") }; let y = wire { z as $pre as @prover / x as $pre }; assert_zero(x * y - (z as @prover)); assert(less_than(x, z, fbw)); assert(less_than(y, z, fbw)); } \end{lstlisting} \caption{\label{language:factor} A \textsc{ZK-SecreC}\xspace program for verifying that Prover knows a proper factor of a given positive integer} \end{figure} Execution of the program starts from the function \lstinline{main}. It first loads a public constant \lstinline+fbw+, determining the size of the inputs handled by the circuit. As next, the two inputs $z$ and $x$ are loaded, with the former being visible to both Prover and Verifier, while the latter is seen by Prover only. Both inputs of the program are made inputs to the arithmetic circuit that the compilation of the program produces, using the \lstinline+wire+ construct. The \emph{stage} \lstinline+$pre+ denotes that the value is only available for the local computations by Prover and Verifier, while \lstinline+$post+ denotes its availability in the circuit. The \emph{domain} \lstinline+@prover+ denotes that only Prover knows this value, while \lstinline+@verifier+ denotes that Verifier also has knowledge of it, and \lstinline+@public+ means that this value is known at compile time. Note that the domain only informs about the availability of the value in \emph{local} computations. The ZKP technology will interpret the operations of the arithmetic circuit over some finite field, and its structure may be important in specifying the relation. We have found that hiding the size of the field from the programmer is not a sensible choice, as too much depends on it. However, the code can be polymorphic over that size. Hence the \emph{data type} \lstinline+uint[N]+ denotes unsigned integers modulo an integer \lstinline+N+ (a compile-time parameter). Unbounded integers, available only in \lstinline+$pre+ stage, have the data type \lstinline+uint+. In the next line, Prover \emph{expands the witness}. In order to show that $x$ divides~$z$, Prover has to come up with a value~$y$ satisfying $x\cdot y=z$. The division operation is only available for local computations. Hence, in the program, the values \lstinline+z+ and \lstinline+x+ are turned back into values available for local computations using the \lstinline+as $pre+ operation, and divided; the result of the division is turned to another input of the arithmetic circuit. The domain of \lstinline+z as $pre+ is still \lstinline+@verifier+, hence it is cast up to \lstinline+@prover+, because the division operator expects its arguments to have equal types. The type of~\lstinline+y+ is automatically inferred as \lstinline+uint[N] $post @prover+. The types of \lstinline+fbw+, \lstinline+z+, and \lstinline+x+ could have been inferred automatically, too. The next line in the function \lstinline+main+ specifies the check that the expression \lstinline+x*y-z+ is evaluated to zero, i.e., the product of \lstinline+x+ and \lstinline+y+ indeed equals \lstinline+z+. Multiplication and subtraction operations are available in \lstinline+$post+ stage (both expect arguments to have equal types), likewise is the check that a number is zero. Even though the previous line has stated that Prover should compute $y$ as $z/x$, Verifier cannot trust that it was computed like this, hence this check is necessary. The computations done in the circuit are trusted by Verifier. The last two lines in \lstinline+main+ check that $x<z$ and $y<z$. The comparison is made by obtaining the bitwise representations (of width \lstinline+fbw+) of both arguments, which can be straightforwardly compared. We see that the function \lstinline+less_than+ is polymorphic in its argument and result domains. The size \lstinline+N+ also matters for booleans, because they are represented as integers when translated to the arithmetic circuit. The bit representations are computed by the function \lstinline+bitextract+. Well, they are actually computed in the stage \lstinline+$pre+ by the function \lstinline+bitextract_pre+, making use of operations not available in the arithmetic circuit. The result is then added as inputs to the circuit by \lstinline+bitextract+ that also checks its correctness if needed. The correctness check is necessary only if the argument and the result are in the domain \lstinline+@prover+. In the case of domains of lower privacy, Verifier can check correctness of the result directly. Representing some integer as a sequence of bits is a typical instance/witness expansion. As this example shows, \textsc{ZK-SecreC}\xspace (intentionally) enables interleaving circuit computation with local computation and specifying both of them within one language. Although one cannot be sure that computations outside the circuit are performed exactly like in the code, specifying the intended behavior using the same notation is good for readability and reduces the amount of code (as \textsc{ZK-SecreC}\xspace allows stage polymorphism). As mingling of circuit computation and local computation can be arbitrarily complex, attempts to keep the corresponding pieces of code separate lead to big difficulties. \section{Appendix} \end{document} \section{Related Work}\label{sec:relwork} The ZKP use-case proliferation has brought with it a number of tools for either generating the circuits for some cryptographic ZK technique, or for directly describing the computation that runs under a ZKP technique. If the toolset contains a domain-specific language, then its features may often be given the following description in terms \textsc{ZK-SecreC}\xspace. The included DSL has mainly imperative features, it is strongly typed, and the possible qualifiers of the types are \lstinline+$post @prover+ and \lstinline+$pre @public+. The latter type is used in computations defining the structure of the circuit (e.g. for loop counters), while the computations with the former are translated into the circuit or invoked using the ZKP technique. The instance and witness to the computation both receive the qualifiers \lstinline+$post @prover+. The language also allows local computations. Typically, it allows casts from \lstinline+$pre @public+ to \lstinline+$post @prover+, and perhaps to use \lstinline+$post @prover+ values also in the computations at \lstinline+$pre @public+, the results of which must be cast back to \lstinline+$post @prover+. Such languages include \textsc{circom}~\cite{circom} and ZoKrates~\cite{zokrates}. The latter also includes branchings over \lstinline+$post @prover+ conditions, translating them into executions of both branches, followed by an oblivious choice. We have purposefully excluded such construction, believing it will confuse the developer. The languages to generate circuits (or rank-1 constraint systems) also include \textsc{Sn\r{a}rkl}~\cite{DBLP:conf/padl/StewartML18}, a DSL embedded in Haskell. The necessary local computations are introduced during compilation, in the style of \textsc{Pinocchio}~\cite{DBLP:journals/cacm/ParnoHG016} and Setty et al.~\cite{DBLP:conf/uss/SettyVPBBW12}. \textsc{Pinocchio} is an early example of a system for \emph{verifiable computation}, aiming to make the correctness of the execution of C programs verifiable in a manner that is cheaper than re-running the program. This approach, refined in~\cite{Geppetto}, as well as in~\cite{ben2014succinct,DBLP:conf/sp/WahbyHGSW16} for hardware-like descriptions, uses a common high-level language to define the circuit, with any \lstinline+$pre+-stage computation inserted through compiler optimizations. We consider the language of the xJSnark system~\cite{xJSnark} to be the closest to \textsc{ZK-SecreC}\xspace. It follows the description given above. For local computations, it offers blocks of code which take values with both \lstinline+$post @prover+ and \lstinline+$pre @public+ qualifiers, and return the results back to \lstinline+$post @prover+. While it is more expressive than~\cite{circom,zokrates}, we consider our type system to be superior to its method for mixing local computations with those on the circuit. Indeed, our type system offers distinction between \lstinline+$pre @prover+ and \lstinline+$pre @verifier+, and the integrity properties inherent in them. We made use of this distinction in Fig.~\ref{language:factor}. Additionally, in \textsc{ZK-SecreC}\xspace, values in the \lstinline+$pre+-stage can be long-lived, the usefulness of which we showed in Sec.~\ref{ssec:dictionaries}. Finally, we can be polymorphic over stages, allowing same or similar computations performed either locally or in the circuit to be expressed only once. Hastings et al.~\cite{DBLP:conf/sp/HastingsHNZ19} review 11 different MPC suites from the point of view of the language support the offer for the specification of secure MPC protocols. While the proposed languages often distinguish between private and public values, only Wysteria~\cite{Wysteria,Wys-star} offers constructions to specify the computations done by one or several parties, either locally or using a secure multiparty computation protocol. Their handling of parties is very expressive and general, but the notion of malicious parties is lacking. The recent Viaduct suite~\cite{Viaduct} expands on Wysteria's type system with integrity types, and incorporates also ZK proofs and other secure computation techniques besides MPC in its back-end. However, Viaduct's type system does not distinguish between \lstinline+@verifier+ and \lstinline+@public+, and thus does not support the compilation into a circuit. The distinctions between other qualifiers of \textsc{ZK-SecreC}\xspace are present in Viaduct. Additionally, the handling of data structures by Viaduct's type system is simplified, with e.g. no distinction between read- and write-access to arrays. \section{Proofs of Theorems \ref{semantics:compthm}--\ref{semantics:correctness}}\label{semantics-proofs} We start with proving some auxiliary lemmas. \begin{lemma}\label{semantics:reintlemma} \begin{enumerate} \item Let $q=(\qualty{t}{s}{d})$ be a qualified type and $P$ be a predicate defined on qualified types. If $\monadic{v}\in M\, V$ is $q$-exact in~$P$ then $\monadic{v}$ is $q$-exposed in~$P$. \item Let $\Gamma$ be a well-structured type environment and $P$ be a predicate defined on qualified types. If $\gamma\in\mathbf{Env}$ is $\Gamma$-exact in~$P$ then $\gamma$ is $\Gamma$-exposed in~$P$. \end{enumerate} \end{lemma} \begin{proof} \begin{enumerate} \item If $P(q)$ is false then the claim holds trivially by Definition~\ref{semantics:exposeddef}. Assume $P(q)$ being true. We proceed by induction on the structure of the data type~$t$. If $t$ is a primitive type then the claim again follows directly from Definitions~\ref{semantics:exposeddef} and \ref{semantics:exactdef}. If $t=\listty{q'}$ then, by Definition~\ref{semantics:exactdef}, $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$ where all $\monadic{v}_i$ are $q'$-exact in~$P$. By the induction hypothesis, $\monadic{v}_i$ are $q'$-exposed in~$P$. Hence by Definition~\ref{semantics:exposeddef}, $\monadic{v}$ is $q$-exposed in~$P$. \item Let $\uopl{vars}\Gamma=(x_1,\ldots,x_n)$ and the corresponding types be $q_1,\ldots,q_n$. By $\gamma$ being $\Gamma$-exact in~$P$, $\gamma=((x_1,\monadic{v}_1),\ldots,(x_n,\monadic{v}_n))$ for some $\monadic{v}_1,\ldots,\monadic{v}_n$ such that, for every $i=1,\ldots,n$, the corresponding value $\monadic{v}_i$ is $q_i$-exact in~$P$. By part~(1), $\monadic{v}_i$ is $q_i$-exposed in~$P$. Hence $\gamma$ is \mbox{$\Gamma$-exposed} in~$P$. \end{enumerate} \end{proof} \begin{lemma}\label{semantics:approxlemma} \begin{enumerate} \item Let $q=(\qualty{t}{s}{d})$ be a qualified type and $P,Q$ be predicates on qualified types such that $Q(q')\Rightarrow P(q')$ for all qualified types~$q'$. If $\monadic{v}\in M\, V$ is $q$-exposed in~$P$ then $\monadic{v}$ is $q$-exposed in~$Q$. \item Let $\Gamma$ be a well-structured type environment and $P,Q$ be predicates on qualified types such that $Q(q')\Rightarrow P(q')$ for all qualified types~$q'$. If $\gamma\in\mathbf{Env}$ is $\Gamma$-exposed in~$P$ then $\gamma$ is $\Gamma$-exposed in~$Q$. \end{enumerate} \end{lemma} \begin{proof} \begin{enumerate} \item If $Q(q)$ does not hold then the desired claim holds by clause~3 of Definition~\ref{semantics:exposeddef}. Assume now $Q(q)$. Then also $P(q)$. We proceed by induction on the structure of the data type~$t$. If $t$ is a primitive type then clause~1 of Definition~\ref{semantics:exposeddef} implies $\monadic{v}=\uopl{pure} v$, $v\in t$, which in turn gives $\monadic{v}$ being $q$-exposed in~$Q$. If $t=\listty{q'}$ then clause~2 of Definition~\ref{semantics:exposeddef} implies $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$ where $\monadic{v}_i$ being $q'$-exposed in~$P$ for all $i=1,\ldots,n$. By the induction hypothesis, all $\monadic{v}_i$ are $q'$-exposed in~$Q$. So, by clause~2 of Definition~\ref{semantics:exposeddef}, $\monadic{v}$ is $q$-exposed in~$Q$. \item Let $\uopl{vars}\Gamma=(x_1,\ldots,x_n)$ and the corresponding types be $q_1,\ldots,q_n$. Let $\gamma$ be $\Gamma$-exposed in~$P$. Then $\gamma=((x_1,\monadic{v}_1),\ldots,(x_n,\monadic{v}_n))$ where, for every $i=1,\ldots,n$, $\monadic{v}_i$ is $q_i$-exposed in~$P$. By part~(1), $\monadic{v}_i$ is $q_i$-exposed in~$Q$. Hence $\gamma$ is $\Gamma$-exposed in~$Q$. \end{enumerate} \end{proof} \begin{lemma}\label{semantics:approxcirclemma} Let $q$ be a qualified type such that $\uopl{allpre}_{d_0}q$ where $d_0=\mbox{\lstinline+@public+}$. If $\monadic{v}$ is $q$-exact in $\mbox{\lstinline+@prover+}$ then $\monadic{v}$ is $q$-exact in circuit. \end{lemma} \begin{proof} Let $q=(\qualty{t}{s}{d})$. We proceed by induction on the structure of~$t$. If $t$ is a primitive type then, by $\monadic{v}$ being $q$-exact in $\mbox{\lstinline+@prover+}$, $\monadic{v}=\uopl{pure} v$ where $v\in t$. But $\uopl{allpre}_{d_0}q$ implies $d=d_0=\mbox{\lstinline+@public+}$. Hence $\uopl{pure} v$ is $q$-exact in circuit. Now assume $t=\listty{q'}$. By $\monadic{v}$ being $q$-exact in $\mbox{\lstinline+@prover+}$, $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$ where $n\in\mathbb{N}$ and all $\monadic{v}_i$ are $q'$-exact in $\mbox{\lstinline+@prover+}$. Note that $\uopl{allpre}_{d_0}q$ implies $\uopl{allpre}_{d_0}q'$. Hence by the induction hypothesis, all $\monadic{v}_i$ are $q'$-exact in circuit. Consequently, $\monadic{v}$ is $q$-exact in circuit. \end{proof} \begin{lemma}\label{semantics:castcoinlemma} Let $q_0=\qualty{t}{s}{d_0}$ and $q_1=\qualty{t}{s}{d_1}$ where $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$. Let $d$ be any domain. If $\monadic{v}\coin{q_1}{d}\monadic{v}'$ then $\monadic{v}\coin{q_0}{d}\monadic{v}'$. \end{lemma} \begin{proof} Suppose $d_0\mathrel{\mathchar"13C\mathchar"3A} d$. Then also $d_1\mathrel{\mathchar"13C\mathchar"3A} d$. If $t$ is a primitive type then $\monadic{v}\coin{q_1}{d}\monadic{v}'$ implies $\monadic{v}=\uopl{pure} v=\monadic{v}'$ where $v\in t$. Hence $\monadic{v}\coin{q_0}{d}\monadic{v}'$. If $t=\listty{q'}$ then $\monadic{v}\coin{q_1}{d}\monadic{v}'$ implies $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$, $\monadic{v}'=\uopl{pure}(\monadic{v}'_1,\ldots,\monadic{v}'_n)$ where $\monadic{v}_i\coin{q'}{d}\monadic{v}'_i$ for every $i=1,\ldots,n$. Consequently, $\monadic{v}\coin{q_0}{d}\monadic{v}'$. If $d_0$ is a strict superdomain of~$d$ then the claim holds vacuously. \end{proof} \begin{lemma}\label{semantics:coinlemma} \begin{enumerate} \item Let $q=(\qualty{t}{s}{d})$ be a qualified type and $P$~be a predicate defined on qualified types. The relation $\coin{q}{P}$ is an equivalence on monadic values that are $q$-exposed in~$P$. \item Let $\Gamma$ be a well-structured type environment and $P$~be a predicate defined on qualified types. The relation $\coin{\Gamma}{P}$ is an equivalence on value environments that are $\Gamma$-exposed in~$P$. \end{enumerate} \end{lemma} \begin{proof} In both parts, we have to establish reflexivity, transitivity and symmetry. \begin{enumerate} \item If $P(q)$ does not hold then all $\monadic{v}\in M\, V$ are $q$-coincident in~$P$, whence all required properties hold. Now assume $P(q)$. We proceed by induction on the structure of the data type~$t$. Let $t$ be a primitive type. For reflexivity, take $\monadic{v}$ which is $q$-exposed in~$P$. Then $\monadic{v}=\uopl{pure} v$ where $v\in t$. As $\monadic{v}=\monadic{v}$, this implies $\monadic{v}\coin{q}{P}\monadic{v}$. For transitivity, assume $\monadic{v}\coin{q}{P}\monadic{v}'$ and $\monadic{v}'\coin{q}{P}\monadic{v}''$. Then $\monadic{v}=\monadic{v}'=\monadic{v}''=\uopl{pure} v$ where $v\in t$. Consequently, $\monadic{v}\coin{q}{P}\monadic{v}''$. For symmetry, assume $\monadic{v}\coin{q}{P}\monadic{v}'$. Then $\monadic{v}=\monadic{v}'=\uopl{pure} v$ where $v\in t$. Consequently, $\monadic{v}'\coin{q}{P}\monadic{v}$. Now let $t=\listty{q'}$ and $q'=(\qualty{t'}{s'}{d'})$. For reflexivity, take $\monadic{v}$ which is $q$-exposed in~$P$. Then $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$ where $\monadic{v}_i$ is $q'$-exposed in~$P$ for every $i=1,\ldots,n$. By the induction hypothesis, reflexivity applies to each~$i$ and gives $\monadic{v}_i\coin{q'}{P}\monadic{v}_i$. Hence $\monadic{v}\coin{q}{P}\monadic{v}$. For transitivity, assume $\monadic{v}\coin{q}{P}\monadic{v}'$ and $\monadic{v}'\coin{q}{P}\monadic{v}''$. Then $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$, $\monadic{v}'=\uopl{pure}(\monadic{v}'_1,\ldots,\monadic{v}'_n)$, $\monadic{v}''=\uopl{pure}(\monadic{v}''_1,\ldots,\monadic{v}''_n)$, where $\monadic{v}_i\coin{q'}{P}\monadic{v}'_i$ and $\monadic{v}'_i\coin{q'}{P}\monadic{v}''_i$ for every $i=1,\ldots,n$. By the induction hypothesis, transitivity applies to each~$i$ and gives $\monadic{v}_i\coin{q'}{P}\monadic{v}''_i$. Hence $\monadic{v}\coin{q}{P}\monadic{v}''$. For symmetry, assume $\monadic{v}\coin{q}{P}\monadic{v}'$. Then $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$, $\monadic{v}'=\uopl{pure}(\monadic{v}'_1,\ldots,\monadic{v}'_n)$ where $\monadic{v}_i\coin{q'}{P}\monadic{v}'_i$ for every $i=1,\ldots,n$. By the induction hypothesis, symmetry applies to each~$i$ and gives $\monadic{v}'_i\coin{q'}{P}\monadic{v}_i$. Hence $\monadic{v}'\coin{q'}{P}\monadic{v}$. \item Let $\uopl{vars}\Gamma=(x_1,\ldots,x_n)$ and the corresponding types be $q_1,\ldots,q_n$. For reflexivity, take $\gamma$ being $\Gamma$-exposed in~$P$. Then $\gamma=((x_1,\monadic{v}_1),\ldots,(x_n,\monadic{v}_n))$ where $\monadic{v}_i$ is $q_i$-exposed for every $i=1,\ldots,n$. By part~(1), $\monadic{v}_i\coin{q_i}{P}\monadic{v}_i$ for every $i=1,\ldots,n$. The desired claim follows. For transitivity, assume $\gamma\coin{\Gamma}{P}\gamma'$ and $\gamma'\coin{\Gamma}{P}\gamma''$. Then we must have $\gamma=((x_1,\monadic{v}_1),\ldots,(x_n,\monadic{v}_n))$, $\gamma'=((x_1,\monadic{v}'_1),\ldots,(x_n,\monadic{v}'_n))$ and $\gamma''=((x_1,\monadic{v}''_1),\ldots,(x_n,\monadic{v}''_n))$ where $\monadic{v}_i\coin{q_i}{P}\monadic{v}'_i$ and $\monadic{v}'_i\coin{q_i}{P}\monadic{v}''_i$ for every $i=1,\ldots,n$. By part~(1), $\monadic{v}_i\coin{q_i}{P}\monadic{v}''_i$ for every $i=1,\ldots,n$. The desired claim follows. For symmetry, assume $\gamma\coin{\Gamma}{P}\gamma'$. Then $\gamma=((x_1,\monadic{v}_1),\ldots,(x_n,\monadic{v}_n))$ and $\gamma'=((x_1,\monadic{v}'_1),\ldots,(x_n,\monadic{v}'_n))$ where $\monadic{v}_i\coin{q_i}{P}\monadic{v}'_i$ for every $i=1,\ldots,n$. By part~(1), $\monadic{v}'_i\coin{q_i}{P}\monadic{v}_i$ for every $i=1,\ldots,n$. The desired claim follows. \end{enumerate} \end{proof} \begin{lemma} Let $\Gamma$ be a well-structured type environment. Let $x$ be a variable occurring in $\uopl{vars}\Gamma$ and let $q=\lookup{\Gamma}{x}$. \begin{thmlist} \item\label{semantics:lookupexposedlemma} Let $P$ be a predicate defined on qualified types. If $\gamma\in\mathbf{Env}$ is $\Gamma$-exposed in~$P$ then $\lookup{\gamma}{x}$ is $q$-exposed in~$P$. \item\label{semantics:lookupexactlemma} Let $P$ be a predicate defined on qualified types. If $\gamma\in\mathbf{Env}$ is $\Gamma$-exact in~$P$ then $\lookup{\gamma}{x}$ is $q$-exact in~$P$. \item\label{semantics:lookupcoinlemma} Let $P$, $Q$ be predicates defined on qualified types such that $Q(q')\Rightarrow P(q')$ for every qualified type~$q'$. Let $\gamma,\gamma'\in\mathbf{Env}$ be $\Gamma$-exact in~$P$ and $Q$, respectively. If $\gamma\coin{\Gamma}{Q}\gamma'$ then $\lookup{\gamma}{x}\coin{q}{Q}\lookup{\gamma'}{x}$. \end{thmlist} \end{lemma} \begin{proof} Let $\uopl{vars}\Gamma=(x_1,\ldots,x_n)$ and the corresponding types be $q_1,\ldots,q_n$. \begin{enumerate} \item Let $\gamma$ be $\Gamma$-exposed in~$P$. Then $\gamma=((x_1,\monadic{v}_1),\ldots,(x_n,\monadic{v}_n))$ where $\monadic{v}_i$ is $q_i$-exposed in~$P$ for every $i=1,\ldots,n$. Let $k$ be the least index such that $x_k=x$. Then $q=\lookup{\Gamma}{x}=q_k$ and $\lookup{\gamma}{x}=\monadic{v}_k$. Hence $\lookup{\gamma}{x}$ is $q$-exposed in~$P$. \item Similar to the proof of Lemma~\ref{semantics:lookupexposedlemma}. \item Let $\gamma,\gamma'\in\mathbf{Env}$ be $\Gamma$-exact in~$P$ and $Q$, respectively, such that $\gamma\coin{\Gamma}{Q}\gamma'$. Then we have $\gamma=((x_1,\monadic{v}_1),\ldots,(x_n,\monadic{v}_n))$ and $\gamma'=((x_1,\monadic{v}'_1),\ldots,(x_n,\monadic{v}'_n))$ where, for every $i=1,\ldots,n$, $\monadic{v}_i$ and $\monadic{v}'_i$ are $q_i$-exact in $P$ and $Q$, respectively, and $\monadic{v}_i\coin{q_i}{Q}\monadic{v}'_i$. Let $k$ be the least index such that $x_k=x$. Then $q=\lookup{\Gamma}{x}=q_k$ and $\lookup{\gamma}{x}=\monadic{v}_k$, $\lookup{\gamma'}{x}=\monadic{v}'_k$. Hence $\lookup{\gamma}{x}\coin{q}{Q}\lookup{\gamma'}{x}$. \end{enumerate} \end{proof} \begin{lemma}\label{semantics:updexactlemma} Let $P$ be any data insensitive predicate defined on qualified types. Let $d_1,\ldots,d_n$ be domains and $q$ be a qualified type. Moreover, let $q_k=(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_k})$ for every $k=1,\ldots,n$ and $q'=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1})$. Assume $\monadic{a}$ being $q'$-exact in~$P$, let $\monadic{i}_k$ be $q_k$-exact in~$P$ for every $k=1,\ldots,n$, and let $\monadic{v}$ be $q$-exact in~$P$. Then $\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})$ (assuming that it is well defined) is $q'$-exact in~$P$. \end{lemma} \begin{proof} We proceed by induction on~$n$. If $n=0$ then $q'=q$ and $\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})=\monadic{v}$ which is $q$-exact in~$P$ by assumption. Let now $n>0$ and assume that the claim holds for $n-1$. Denoting $q'_1=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_2})$, consider two cases: \begin{itemize} \item If $P(q')$ is true then, by data insensitivity, also $P(q_1)$ holds. By exactness, $\monadic{a}=\uopl{pure}(\monadic{a}_1,\ldots,\monadic{a}_{l_1})$ where all $\monadic{a}_k$ ($k=1,\ldots,l_1$) are $q'_1$-exact in~$P$, and also $\monadic{i}_1=\uopl{pure} i_1$ with $i_1\in\mathbb{N}$. As $\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})$ is well-defined, $i_1\leq l_1$. Now $\uopl{upd}(\monadic{a}_{i_1},\monadic{i}_2\ldots\monadic{i}_n,\monadic{v})$ is $q'_1$-exact in~$P$ by the induction hypothesis. Hence also $\uopl{pure}(\monadic{a}_1,\ldots,\monadic{a}_{i_1-1},\uopl{upd}(\monadic{a}_{i_1},\monadic{i}_2\ldots\monadic{i}_n,\monadic{v}),\monadic{a}_{i_1+1},\ldots,\monadic{a}_{l_1})$ must be $q'$-exact in~$P$. The desired claim follows. \item If $P(q')$ does not hold then, by exactness, $\monadic{a}=\top$. Hence $\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})=\top$ which is $q'$-exact in~$P$. \end{itemize} \end{proof} \begin{lemma}\label{semantics:updcoin0lemma} Let $P,Q$ be data insensitive predicates defined on qualified types such that $Q(q'')\Rightarrow P(q'')$ for every qualified type $q''$. Let $d_1,\ldots,d_n$ be domains and $q$ be a qualified type such that $Q(q)$ does not hold. Denote $q'=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1})$ and $q_k=(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_k})$ for every $k=1,\ldots,n$. Let $\monadic{a}$ be $q'$-exposed in~$P$, let $\monadic{i}_k$ be $q_k$-exposed in~$P$ for every $k=1,\ldots,n$ and let $\monadic{v}$ be $q$-exposed in~$P$. Then $\monadic{a}\coin{q'}{Q}\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})$ (provided that the right-hand side is well-defined). \end{lemma} \begin{proof} We proceed by induction on~$n$. If $n=0$ then $\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})=\monadic{v}$ and $q'=q$. By Definition~\ref{semantics:coincidentdef}, $\monadic{a}\coin{q}{Q}\monadic{v}$ since $Q(q)$ is false. Now suppose that $n>0$ and the claim holds for $n-1$. Denoting $q'_1=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_2})$, consider two cases: \begin{itemize} \item If $P(q')$ holds then, by data insensitivity, also $P(q_1)$ is true. We have $\monadic{a}=\uopl{pure}(\monadic{a}_1,\ldots,\monadic{a}_{l_1})$ and $\monadic{i}_1=\uopl{pure} i_1$ where all $\monadic{a}_k$ are $q'_1$-exposed and $l_1,i_1\in\mathbb{N}$ (and, by $\uopl{upd}(\monadic{a},\monadic{i_1}\ldots\monadic{i}_n,\monadic{v})$ being well-defined, $i_1\leq l_1$). Hence \[ \uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})=\uopl{pure}(\monadic{a}_1,\ldots,\monadic{a}_{i_1-1},\uopl{upd}(\monadic{a}_{i_1},\monadic{i}_2\ldots\monadic{i}_n,\monadic{v}),\monadic{a}_{i_1+1},\ldots,\monadic{a}_{l_1})\mbox{.} \] For every $k=1,\ldots,l_1$ except~$k=i_1$, the $k$th component of $\monadic{a}$ and that of $\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})$ are equal. By the induction hypothesis, $\monadic{a}_{i_1}\coin{q'_1}{Q}\uopl{upd}(\monadic{a}_{i_1},\monadic{i}_2\ldots\monadic{i}_n,\monadic{v})$. Consequently, we obtain $\monadic{a}\coin{q'}{Q}\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})$. \item If $P(q')$ does not hold then $Q(q')$ does not hold either. Therefore $\monadic{a}\coin{q'}{Q}\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})$ by clause~3 of Definition~\ref{semantics:coincidentdef}. \end{itemize} \end{proof} \begin{lemma}\label{semantics:updexactcoinlemma} Let $P,Q$ be data insensitive predicates defined on qualified types such that $Q(q'')\Rightarrow P(q'')$ for every qualified type $q''$. Let $d_1,\ldots,d_n$ be domains and $q$ be a qualified type. Denote $q_k=(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_k})$ for every $k=1,\ldots,n$ and $q'=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1})$. Let $\monadic{a}_P,\monadic{a}_Q$ be $q'$-exact in $P$ and $Q$, respectively; for all $k=1,\ldots,n$, let $\monadic{i}_P^k,\monadic{i}_Q^k$ be $q_k$-exact in $P$ and $Q$, respectively; let $\monadic{v}_P,\monadic{v}_Q$ be $q$-exact in $P$ and $Q$, respectively. Moreover, assume that $\monadic{a}_P\coin{q'}{Q}\monadic{a}_Q$, for every $k=1,\ldots,n$ we have $\monadic{i}_P^k\coin{q_k}{Q}\monadic{i}_Q^k$, and $\monadic{v}_P\coin{q}{Q}\monadic{v}_Q$. If $\uopl{upd}(\monadic{a}_P,\monadic{i}_P^1\ldots\monadic{i}_P^n,\monadic{v}_P)$ is well-defined then $\uopl{upd}(\monadic{a}_Q,\monadic{i}_Q^1\ldots\monadic{i}_Q^n,\monadic{v}_Q)$ is well-defined, too, whereby $\uopl{upd}(\monadic{a}_P,\monadic{i}_P^1\ldots\monadic{i}_P^n,\monadic{v}_P)\coin{q'}{Q}\uopl{upd}(\monadic{a}_Q,\monadic{i}_Q^1\ldots\monadic{i}_Q^n,\monadic{v}_Q)$. \end{lemma} \begin{proof} We proceed by induction on~$n$. If $n=0$ then $q'=q$, whereby $\uopl{upd}(\monadic{a}_P,\monadic{i}_P^1\ldots\monadic{i}_P^n,\monadic{v}_P)=\monadic{v}_P$ and $\uopl{upd}(\monadic{a}_Q,\monadic{i}_Q^1\ldots\monadic{i}_Q^n,\monadic{v}_Q)=\monadic{v}_Q$. By assumption, $\monadic{v}_P\coin{q}{Q}\monadic{v}_Q$. Let now $n>0$ and assume that the claim holds for $n-1$. Denoting $q'_1=(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_2})$, consider two cases: \begin{itemize} \item If $Q(q')$ holds then also $P(q')$ holds. By data insensitivity, $Q(q_1)$ and $P(q_1)$ are true, too. Hence $\monadic{a}_P\coin{q'}{Q}\monadic{a}_Q$ implies $\monadic{a}_P=\uopl{pure}(\monadic{a}_P^1,\ldots,\monadic{a}_P^{l_1})$, $\monadic{a}_Q=\uopl{pure}(\monadic{a}_Q^1,\ldots,\monadic{a}_Q^{l_1})$ where $\monadic{a}_P^k\coin{q'_1}{Q}\monadic{a}_Q^k$ for every $k=1,\ldots,n$ and $\monadic{i}_P^1\coin{q_1}{Q}\monadic{i}_Q^1$ implies $\monadic{i}_P^1=\monadic{i}_Q^1=\uopl{pure} i_1$ with $i_1\in\mathbb{N}$. By the induction hypothesis, $\uopl{upd}(\monadic{a}_Q^{i_1},\monadic{i}_Q^2\ldots\monadic{i}_Q^n,\monadic{v}_Q)$ is well-defined and $\uopl{upd}(\monadic{a}_P^{i_1},\monadic{i}_P^2\ldots\monadic{i}_P^n,\monadic{v}_P)\coin{q'_1}{Q}\uopl{upd}(\monadic{a}_Q^{i_1},\monadic{i}_Q^2\ldots\monadic{i}_Q^n,\monadic{v}_Q)$. As $\uopl{upd}(\monadic{a}_P,\monadic{i}_P^1\ldots\monadic{i}_P^n,\monadic{v}_P)$ is well-defined, $i_1\leq l_1$. All this implies that $\uopl{upd}(\monadic{a}_Q,\monadic{i}_Q^1\ldots\monadic{i}_Q^n,\monadic{v}_Q)$ is also well-defined and, since \[ \begin{array}{l} \uopl{upd}(\monadic{a}_P,\monadic{i}_P^1\ldots\monadic{i}_P^n,\monadic{v}_P)=\uopl{pure}(\monadic{a}_P^1,\ldots,\monadic{a}_P^{i_1-1},\uopl{upd}(\monadic{a}_P^{i_1},\monadic{i}_P^2\ldots\monadic{i}_P^n,\monadic{v}_P),\monadic{a}_P^{i_1+1},\ldots,\monadic{a}_P^{l_1})\mbox{,}\\ \uopl{upd}(\monadic{a}_Q,\monadic{i}_Q^1\ldots\monadic{i}_Q^n,\monadic{v}_Q)=\uopl{pure}(\monadic{a}_Q^1,\ldots,\monadic{a}_Q^{i_1-1},\uopl{upd}(\monadic{a}_Q^{i_1},\monadic{i}_Q^2\ldots\monadic{i}_Q^n,\monadic{v}_Q),\monadic{a}_Q^{i_1+1},\ldots,\monadic{a}_Q^{l_1})\mbox{,} \end{array} \] we obtain $\uopl{upd}(\monadic{a}_P,\monadic{i}_P^1\ldots\monadic{i}_P^n,\monadic{v}_P)\coin{q'}{Q}\uopl{upd}(\monadic{a}_Q,\monadic{i}_Q^1\ldots\monadic{i}_Q^n,\monadic{v}_Q)$ as desired. \item Assume that $Q(q')$ is false. By assumption, $\monadic{a}_Q$ is $q'$-exact in~$Q$, whence $\monadic{a}_Q=\top$. Hence also $\uopl{upd}(\monadic{a}_Q,\monadic{i}_Q^1\ldots\monadic{i}_Q^n,\monadic{v}_Q)=\top$ which is well-defined. The claim $\uopl{upd}(\monadic{a}_P,\monadic{i}_P^1\ldots\monadic{i}_P^n,\monadic{v}_P)\coin{q'}{Q}\top$ holds vacuously. \end{itemize} \end{proof} \begin{lemma}\label{semantics:outputlemma} Let $d$ be any domain and let $\omicron,\omicron'\in\mathbf{Out}^2$ be both exact in~$d$. Then the pointwise concatenation $\omicron\omicron'$ is exact in~$d$. \end{lemma} \begin{proof} Trivial. \end{proof} \begin{lemma}\label{semantics:outputcoinlemma} Let $d,d'$ be domains such that $d'\mathrel{\mathchar"13C\mathchar"3A} d$ and let $\omicron_1,\omicron_2,\omicron'_1,\omicron'_2\in\mathbf{Out}^2$ such that $\omicron_1\coinpure{d'}\omicron'_1$ and $\omicron_2\coinpure{d'}\omicron'_2$. Then $\omicron_1\omicron_2\coinpure{d'}\omicron'_1\omicron'_2$. \end{lemma} \begin{proof} Trivial. \end{proof} \begin{theorem}[Theorem~\ref{semantics:localthm}] Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$ and $\gamma\in\mathbf{Env}$ be $\Gamma$-exact in~$d$ for some domain~$d$. Assume that for all subexpressions of~$e$ of the form $\ofty{\getexpr{d'}{k}}{q'}$ where $d'\mathrel{\mathchar"13C\mathchar"3A} d$, the value $\uopl{allpure}(\phi_{d'}(k))$ is $q'$-exact in~$d$. If $\semd{e}\gamma\phi=\uopl{pure}(\monadic{v},\gamma',\omicron)$ then $\monadic{v}$~{}is $q$-exact, $\gamma'$~{}is $\Gamma$-exact and $\omicron$~{}is exact in~$d$. \end{theorem} \begin{proof} Let $q=t_0\ s_0\ d_0$. We proceed by induction on the structure of~$e$: \begin{itemize} \item Let $e=\epsilon$. Then $t_0=\mbox{\lstinline+()+}$, $d_0=\mbox{\lstinline+@public+}$ and we have $\monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}$, $\gamma'=\gamma$, $\omicron=\epsilon$. As $d_0\mathrel{\mathchar"13C\mathchar"3A} d$ and $t_0$ is primitive, establishing that $\monadic{v}$ is $q$-exact in~$d$ reduces to clause~1 of Definition~\ref{semantics:exactdef}. It holds since $\mbox{\textoneoldstyle}\in\mbox{\lstinline+()+}$. The environment~$\gamma'$ is $\Gamma$-exact in~$d$ by assumption and the output~$\epsilon$ is exact in~$d$ trivially. \item Let $e=\overline{n}$ where $n\in\mathbb{N}$. Then $t_0=\uintmodty{\mbox{\lstinline+N+}}$, $\gamma'=\gamma$, $\omicron=\epsilon$. We have to study two cases: \begin{itemize} \item If $d_0\mathrel{\mathchar"13C\mathchar"3A} d$ then $\monadic{v}=\uopl{pure} n$. As $t_0$ is primitive, establishing that $\monadic{v}$ is $q$-exact in~$d$ reduces to clause~1 of Definition~\ref{semantics:exactdef}. It holds since $n$ is an integer. \item If $d_0$ is a strict superdomain of~$d$ then $\monadic{v}=\top$ and establishing that $\monadic{v}$ is $q$-exact in~$d$ reduces to clause~3 of Definition~\ref{semantics:exactdef}. The former equality is exactly what clause~3 requires. \end{itemize} The environment~$\gamma'$ is $\Gamma$-exact in~$d$ by assumption and the output~$\epsilon$ is exact in~$d$ trivially. \item Let $e=\overline{b}$ where $b\in\mathbb{B}$. This case is analogous to the previous one. \item Let $e=x$. Then $\lookup{\Gamma}{x}=q$ and $\monadic{v}=\lookup{\gamma}{x}$, $\gamma'=\gamma$, $\omicron=\epsilon$. Hence $\monadic{v}$ is $q$-exact in~$d$ by the assumption that $\gamma$ is $\Gamma$-exact in~$d$ and Lemma~\ref{semantics:lookupexactlemma}. Also $\gamma'$ being $\Gamma$-exact in~$d$ directly follows from assumption and the output~$\epsilon$ is exact in~$d$ trivially. \item Let $e=\addexpr{e_1}{e_2}$. Then $t_0=\uintmodty{\mbox{\lstinline+N+}}$ and \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,} \end{array} \] and also \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\mcomp{v_1\gets\monadic{v}_1;\; v_2\gets\monadic{v}_2;\;\uopl{pure}(v_1+v_2)},\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\monadic{v}_1$ is $q$-exact, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$ is exact in~$d$. Now by the induction hypothesis about~$e_2$, $\monadic{v}_2$ is $q$-exact, $\gamma_2$ is $\Gamma$-exact and $\omicron_2$ is exact in~$d$. Finally, we have to consider two cases: \begin{itemize} \item If $d_0\mathrel{\mathchar"13C\mathchar"3A} d$ then, by $\monadic{v}_1$ and $\monadic{v}_2$ being $q$-exact in~$d$, we have $\monadic{v}_1=\uopl{pure} v_1$ and $\monadic{v}_2=\uopl{pure} v_2$ for integers $v_1,v_2$. Hence $\monadic{v}=\uopl{pure}(v_1+v_2)$ which shows that $\monadic{v}$ is $q$-exact in~$d$ by clause~1 of Definition~\ref{semantics:exactdef}. \item If $d_0$ is a strict superdomain of~$d$ then, by $\monadic{v}_1$ and $\monadic{v}_2$ being $q$-exact in~$d$, we have $\monadic{v}_1=\monadic{v}_2=\top$ and hence also $\monadic{v}=\top$. By clause~3 of Definition~\ref{semantics:exactdef}, $\monadic{v}$ is $q$-exact in~$d$. \end{itemize} The desired exactness claim about~$\gamma'$ holds by the above and $\omicron$ is exact in~$d$ by Lemma~\ref{semantics:outputlemma}. \item Let $e=\assertexpr{e_1}$. Then $t_0=\mbox{\lstinline+()+}$, $d_0=\mbox{\lstinline+@public+}$ and \[ \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$post+}}{d_1}! D \] and also \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \monadic{v}_1\ne\uopl{pure}\mbox{\bfseries ff}\mbox{,}\quad\monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\omicron_1\mbox{.} \end{array} \] As $d_0\mathrel{\mathchar"13C\mathchar"3A} d$ and $t_0$ is primitive, establishing that $\monadic{v}$ is $q$-exact in~$d$ reduces to clause~1 of Definition~\ref{semantics:exactdef} which holds as $\mbox{\textoneoldstyle}\in\mbox{\lstinline+()+}$. By the induction hypothesis about~$e_1$, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$ is exact in~$d$ which establish the desired exactness claims about~$\gamma'$ and $\omicron$. \item Let $e=\ofty{\getexpr{d''}{k}}{q}$. Then $\uopl{allpre}_{d''}(q)$, implying $d_0=d''$. Moreover, $\gamma'=\gamma$, whence $\gamma'$ is $\Gamma$-exact in~$d$ by assumption. The output $\epsilon$ is exact in~$d$ trivially. For the remaining desired exactness claim, consider two cases: \begin{itemize} \item If $d''\mathrel{\mathchar"13C\mathchar"3A} d$ then $\monadic{v}=\uopl{allpure}(\phi_{d''}(k))$ which is $q$-exact in~$d$ by assumption of the theorem. \item If $d''$ is a strict superdomain of~$d$ then $\monadic{v}=\top$ and establishing that $\monadic{v}$ is $q$-exact in~$d$ reduces to clause~3 of Definition~\ref{semantics:exactdef}. The former equality is exactly what clause~3 requires. \end{itemize} \item Let $e=\ifexpr{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_3:q! D_3\mbox{,}\\ \gen{d_1}\supseteq\gen{s_0}\cup \gen{d_0}\cup D_2\cup D_3\mbox{,} \end{array} \] and \[ \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{.} \] By the induction hypothesis about $e_1$, $\monadic{v}_1$ is $(\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1})$-exact, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$ is exact in~$d$. We have to consider three cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$ then $\semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)$, $\monadic{v}=\monadic{v}_2$, $\gamma'=\gamma_2$, $\omicron=\omicron_1\omicron_2$. By the induction hypothesis about $e_2$, $\monadic{v}_2$ is $q$-exact, $\gamma_2$ is $\Gamma$-exact and $\omicron_2$ is exact in~$d$. Hence the desired claim follows. \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$ then $\semd{e_3}\gamma_1\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)$, $\monadic{v}=\monadic{v}_3$, $\gamma'=\gamma_3$, $\omicron=\omicron_1\omicron_3$. By the induction hypothesis about $e_3$, $\monadic{v}_3$ is $q$-exact, $\gamma_3$ is $\Gamma$-exact and $\omicron_3$ is exact in~$d$. Hence the desired claim follows. \item If $\monadic{v}_1\ne\uopl{pure} b$ for $b\not\in\mathbb{B}$ then $\monadic{v}=\top$, $\gamma'=\gamma_1$, $\omicron=\omicron_1$. As $\monadic{v}_1$ is $(\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1})$-exact in~$d$, the only possibility is $\monadic{v}_1=\top$, whereby $d_1$ has to be a strict superdomain of~$d$. But $\gen{d_1}\supseteq\gen{d_0}$ implies $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$, meaning that also $d_0$ must be a strict superdomain of~$d$. Hence by clause~3 of Definition~\ref{semantics:exactdef}, $\top$ is $q$-exact in~$d$. The desired claim follows. \end{itemize} \item Let $e=\forexpr{x}{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_2\mbox{,}\\ (x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma\mbox{\ $\vdash$\ } e_3:\qualty{t_1}{s_1}{d_1}! D_3\mbox{,}\\ \gen{d_0}\supseteq\gen{s_1}\cup\gen{d_1}\cup D_3\mbox{,}\\ t_0=\listty{\qualty{t_1}{s_1}{d_1}}\mbox{,}\quad s_0=\mbox{\lstinline+$pre+}\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\monadic{v}_1$ is $(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0})$-exact, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$ is exact in~$d$. Now by the induction hypothesis about~$e_2$, $\monadic{v}_2$ is $(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0})$-exact, $\gamma_2$ is $\Gamma$-exact and $\omicron_2$ is exact in~$d$. We have to consider two cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure} i_1$, $\monadic{v}_2=\uopl{pure} i_2$ then, by exactness, $i_1,i_2\in\mathbb{N}$. Denoting $n=\max(0,i_2-i_1)$, \[ \begin{array}{l} \semd{e_3}((x,\uopl{pure} i_1),\gamma_2)\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma_3)\phi=\uopl{pure}(\monadic{v}_4,\gamma_4,\omicron_4)\mbox{,}\\ \dotfill\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma_{n+1})\phi=\uopl{pure}(\monadic{v}_{n+2},\gamma_{n+2},\omicron_{n+2})\mbox{,}\\ \monadic{v}=\uopl{pure}(\monadic{v}_3,\ldots,\monadic{v}_{n+2})\mbox{,}\quad\gamma'=\uopl{tail}\gamma_{n+2}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+2}\mbox{.} \end{array} \] As $\gamma_2$ is $\Gamma$-exact and $\uopl{pure} i_1$ is $(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0})$-exact in~$d$, the updated environment $(x,\uopl{pure} i_1),\gamma_2$ is $((x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma)$-exact in~$d$. Hence the induction hypothesis about $e_3$ applies and gives $\monadic{v}_3$ being $(\qualty{t_1}{s_1}{d_1})$-exact, $\gamma_3$ being $((x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma)$-exact and $\omicron_3$ being exact in~$d$. Replacing $i_1$ by $i_1+1$ does not violate exactness, so $[x\mapsto\uopl{pure}(i_1+1)]\gamma_3$ is also $((x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma)$-exact in~$d$. Hence the induction hypothesis about $e_3$ applies and gives $\monadic{v}_4$ being $(\qualty{t_1}{s_1}{d_1})$-exact, $\gamma_4$ being $((x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma)$-exact and $\omicron_4$ being exact in~$d$. Analogously we obtain $\monadic{v}_k$ being $(\qualty{t_1}{s_1}{d_1})$-exact and $\omicron_k$ being exact for all $k=3,4,\ldots,n+2$, as well as $\gamma_{n+2}$ being $((x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma)$-exact in~$d$. Obviously the latter implies $\uopl{tail}\gamma_{n+2}$ being $\Gamma$-exact in~$d$. By clause~2 of Definition~\ref{semantics:exactdef}, $\uopl{pure}(\monadic{v}_3,\ldots,\monadic{v}_{n+2})$ is $(\qualty{\listty{\qualty{t_1}{s_1}{d_1}}}{\mbox{\lstinline+$pre+}}{d_0})$-exact in~$d$. The desired claim follows. \item If $\monadic{v}_1=\top$ or $\monadic{v}_2=\top$ then $\monadic{v}=\top$, $\gamma'=\gamma_2$, $\omicron=\omicron_1\omicron_2$ and, by exactness, $d_0$ is a strict supertype of~$d$. Hence $\top$ is also $q$-exact in~$d$ by clause~3 of Definition~\ref{semantics:exactdef}. The desired claim follows. \end{itemize} \item Let $e=\wireexpr{e_1}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_0}{\mbox{\lstinline+$pre+}}{d_0}! D_1\mbox{,}\\ s_0=\mbox{\lstinline+$post+}\mbox{,}\quad\mbox{$t_0$ is $\uintmodty{\mbox{\lstinline+N+}}$ or $\boolmodty{\mbox{\lstinline+N+}}$}\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \monadic{v}=\monadic{v}_1\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\lam{d'}{\branching{(\omicron_1)_{d'}\monadic{v}_1&\mbox{if $d'=d_0$}\\(\omicron_1)_{d'}&\mbox{otherwise}}}\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\monadic{v}_1$ is $(\qualty{t_0}{\mbox{\lstinline+$pre+}}{d_0})$-exact, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$ is exact in~$d$. Then $\monadic{v}_1$ is also $(\qualty{t_0}{\mbox{\lstinline+$post+}}{d_0})$-exact in~$d$. As $t_0$ is $\uintmodty{\mbox{\lstinline+N+}}$ or $\boolmodty{\mbox{\lstinline+N+}}$, $\monadic{v}_1=\uopl{pure} v_1$ for some $v_1\in\mathbb{N}\cup\mathbb{B}$ if $d_0\mathrel{\mathchar"13C\mathchar"3A} d$ and $\monadic{v}_1=\top$ if $d_0$ is a strict superdomain of~$d$. As $\monadic{v}_1$ is concatenated to $(\omicron_1)_{d_0}$, the component corresponding to~$d_0$ of $\omicron$ contains only pure values if $d_0\mathrel{\mathchar"13C\mathchar"3A} d$ and only tops if $d_0$ is a strict superdomain of~$d$. Thus $\omicron$ is exact in~$d$. The desired claim follows. \item Let $e=\castexpr{e_1}{d_0}$. Let the domain of $e_1$ be $d_1$, i.e., \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_0}{s_0}{d_1}! D\mbox{,}\\ d_1\mathrel{\mathchar"13C\mathchar"3A} d_0\mbox{,}\quad\gen{d_0}\supseteq\gen{t_0}\mbox{.} \end{array} \] We have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \monadic{v}=\branching{\monadic{v}_1&\mbox{if $d_0\mathrel{\mathchar"13C\mathchar"3A} d$}\\\top&\mbox{otherwise}}\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\omicron_1\mbox{.} \end{array} \] By the induction hypothesis, $\monadic{v}_1$ is $(\qualty{t_0}{s_0}{d_1})$-exact and $\gamma_1$ is $\Gamma$-exact in~$d$. Consider two cases: \begin{itemize} \item If $d_0\mathrel{\mathchar"13C\mathchar"3A} d$ then $\monadic{v}=\monadic{v}_1$. As $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$, we also have $d_1\mathrel{\mathchar"13C\mathchar"3A} d$. Hence $\monadic{v}_1$ being $(\qualty{t_0}{s_0}{d_1})$-exact in~$d$ implies $\monadic{v}_1$ being $(\qualty{t_0}{s_0}{d_0})$-exact in~$d$. The desired claim follows. \item If $d_0$ is a strict supertype of~$d$ then $\monadic{v}=\top$. The desired claim follows as $\top$ is $(\qualty{t_0}{s_0}{d_0})$-exact in~$d$. \end{itemize} \item Let $e=(\assignexpr{e_1}{e_2})$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ t_0=\mbox{\lstinline+()+}\mbox{,}\quad s_0=\mbox{\lstinline+$pre+}\mbox{,}\quad d_0=\mbox{\lstinline+@public+}\mbox{.} \end{array} \] Let $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$ and denote $\monadic{a}=\lookup{\gamma}{x}$; then \[ \begin{array}{l} \semd{y_1}\gamma\phi=\uopl{pure}(\monadic{i}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{y_2}\gamma_1\phi=\uopl{pure}(\monadic{i}_2,\gamma_2,\omicron_2)\mbox{,}\\ \dotfill\\ \semd{y_n}\gamma_{n-1}\phi=\uopl{pure}(\monadic{i}_n,\gamma_n,\omicron_n)\mbox{,}\\ \semd{e_2}\gamma_n\phi=\uopl{pure}(\monadic{v}_1,\gamma_{n+1},\omicron_{n+1})\mbox{,}\\ \monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'=[x\mapsto\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v}_1)]\gamma_{n+1}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+1}\mbox{.} \end{array} \] By Lemma~\ref{typesystem:lhslemma}, $\Gamma\mbox{\ $\vdash$\ } y_i:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d'_i}$ for each $i=1,\ldots,n$ and \[ \Gamma\mbox{\ $\vdash$\ } x:\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{\qualty{t'}{s'}{d'_{n+1}}}}{\mbox{\lstinline+$pre+}}{d'_n}}}{\mbox{\lstinline+$pre+}}{d'_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d'_1}\mbox{.} \] Hence $\monadic{a}$ is $(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{\qualty{t'}{s'}{d'_{n+1}}}}{\mbox{\lstinline+$pre+}}{d'_n}}}{\mbox{\lstinline+$pre+}}{d'_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d'_1})$-exact in~$d$ by exactness of~$\gamma$. By the induction hypothesis about~$y_1$, $\monadic{i}_1$ is $(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d'_1})$-exact, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$~{}is exact in~$d$. Now by the induction hypothesis about~$y_2$, $\monadic{i}_2$ is $(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d'_2})$-exact, $\gamma_2$ is $\Gamma$-exact and $\omicron_2$ is exact in~$d$. Similarly, we obtain that, for each $i=1,2,\ldots,n$, $y_i$ is $(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d'_i})$-exact, $\gamma_i$ is $\Gamma$-exact and $\omicron_k$ is exact in~$d$. The induction hypothesis about~$e_2$ implies that $\monadic{v}_1$ is $(\qualty{t_1}{s_1}{d_1})$-exact, $\gamma_{n+1}$ is $\Gamma$-exact and $\omicron_{n+1}$ is exact in~$d$. Now $\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v}_1)$ is $(\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{\qualty{t'}{s'}{d'_{n+1}}}}{\mbox{\lstinline+$pre+}}{d'_n}}}{\mbox{\lstinline+$pre+}}{d'_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d'_1})$-exact in~$d$ by Lemma~\ref{semantics:updexactlemma}. Hence $[x\mapsto\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v}_1)]\gamma_{n+1}$ is $\Gamma$-exact in~$d$. As $\uopl{pure}\mbox{\textoneoldstyle}$ is $(\qualty{\mbox{\lstinline+()+}}{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}})$-exact in~$d$, we are done. \item Let $e=\loadexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\listty{q}}{s_1}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{s_1}{d_1}\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{a},\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{i},\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\mcomp{a\gets\monadic{a};\; i\gets\monadic{i};\; a_i}\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about $e_1$, $\monadic{a}$ is $(\qualty{\listty{q}}{s_1}{d_1})$-exact, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$ is exact in~$d$. Now by the induction hypothesis about $e_2$, $\monadic{i}$ is $(\qualty{\mbox{\lstinline+uint+}}{s_1}{d_1})$-exact, $\gamma_2$ is $\Gamma$-exact and $\omicron_2$~{}is exact in~$d$. Consider two cases: \begin{itemize} \item If $d_1\mathrel{\mathchar"13C\mathchar"3A} d$ then, by exactness, $\monadic{a}=\uopl{pure}(\monadic{a}_1,\ldots,\monadic{a}_n)$ for some $n\in\mathbb{N}$ and $\monadic{i}=\uopl{pure} i$ for some $i\in\mathbb{N}$, whereby $\monadic{a}_1,\ldots,\monadic{a}_n$ are $q$-exact in~$d$. Moreover, to obtain a pure value, we must have $i\leq n$. Hence $\monadic{v}=\monadic{a}_i$ exists and is $q$-exact in~$d$. \item If $d_1$ is a strict supertype of~$d$ then, by exactness, $\monadic{a}=\top$ and $\monadic{i}=\top$, whence $\monadic{v}=\top$. As $\Gamma$ is well-structured, $\qualty{\listty{q}}{s_1}{d_1}$ is well-structured by Theorem~\ref{typesystem:thm}. Hence $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$, implying that $d_0$ is a strict supertype of~$d$. By clause~3 of Definition~\ref{semantics:exactdef}, $\top$ is $q$-exact in~$d$. \end{itemize} \item Let $e=\stmtcomp{\letexpr{x}{e_1}}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q_1! D_1\mbox{,}\\ (x:q_1),\Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}((x,\monadic{v}_1),\gamma_1)\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\monadic{v}_2\mbox{,}\quad\gamma'=\uopl{tail}\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\monadic{v}_1$ is $q_1$-exact, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$ is exact in~$d$. Hence $(x,\monadic{v}_1),\gamma_1$ is $((x:q_1),\Gamma)$-exact in~$d$. Now the induction hypothesis about~$e_2$ applies and implies $\monadic{v}_2$ being $q$-exact, $\gamma_2$ being $((x:q_1),\Gamma)$-exact and $\omicron_2$ being exact in~$d$. Then $\uopl{tail}\gamma_2$ is $\Gamma$-exact in~$d$. The desired claim follows. \item Let $e=\stmtcomp{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q_1! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\monadic{v}_2\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\monadic{v}_1$ is $q_1$-exact, $\gamma_1$ is $\Gamma$-exact and $\omicron_1$ is exact in~$d$. Now by the induction hypothesis about~$e_2$, $\monadic{v}_2$ is $q$-exact, $\gamma_2$ is $\Gamma$-exact and $\omicron_2$ is exact in~$d$. The desired claim follows. \end{itemize} \end{proof} \begin{theorem}[Theorem~\ref{semantics:effthm}] Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$ and $\gamma\in\mathbf{Env}$ be $\Gamma$-exact in~$d$ for some domain~$d$. Assume that for all subexpressions of~$e$ of the form $\ofty{\getexpr{d'}{k}}{q'}$ where $d'\mathrel{\mathchar"13C\mathchar"3A} d$, the value $\uopl{allpure}(\phi_{d'}(k))$ is $q'$-exact in~$d$. If $\semd{e}\gamma\phi=\uopl{pure}(\monadic{v},\gamma',\omicron)$ then, for any domain~$d''$ such that $d''\mathrel{\mathchar"13C\mathchar"3A} d$ and $d''\notin D$, we have $\gamma\coin{\Gamma}{d''}\gamma'$. \end{theorem} \begin{proof} By Theorem~\ref{semantics:localthm}, $\gamma'$ is $\Gamma$-exact in~$d$. By Lemma~\ref{semantics:reintlemma}, $\gamma$ and $\gamma'$ are $\Gamma$-exposed in~$d$. Take $d''$ such that $d''\mathrel{\mathchar"13C\mathchar"3A} d$ and $d''\notin D$. By Lemma~\ref{semantics:approxlemma}, $\gamma$ and $\gamma'$ are also $\Gamma$-exposed in~$d''$. Let $q=\qualty{t_0}{s_0}{d_0}$. We proceed by induction on the structure of~$e$. If $e=\epsilon$ or $e=\overline{n}$ where $n\in\mathbb{N}$ or $e=\overline{b}$ where $b\in\mathbb{B}$ or $e=x$ or $e=\getexpr{d'}{k}$ then $\gamma=\gamma'$. Hence by Lemma~\ref{semantics:coinlemma}, $\gamma\coin{\Gamma}{d''}\gamma'$. If $e=\assertexpr{e_1}$ or $e=\wireexpr{e_1}$ then the claim holds vacuously since $D=\gen{\mbox{\lstinline+@public+}}$. We study the remaining cases. \begin{itemize} \item Let $e=\addexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ D=\gen{s_0}\cup D_1\cup D_2\mbox{,} \end{array} \] whence we must have $d''\notin D_1$ and $d''\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\gamma_2\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$ and $\gamma_1\coin{\Gamma}{d''}\gamma_2$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coin{\Gamma}{d''}\gamma_2$. The desired claim follows. \item Let $e=\ifexpr{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_3:q! D_3\mbox{,}\\ \gen{d_1}\supseteq\gen{s_0}\cup\gen{d_0}\cup D_2\cup D_3\mbox{,}\quad D=D_1\cup D_2\cup D_3\mbox{,} \end{array} \] whence we must have $d''\notin D_1$, $d''\notin D_2$ and $d''\notin D_3$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{.} \end{array} \] Consider three cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$ then \[ \begin{array}{l} \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\gamma_2\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$ and $\gamma_1\coin{\Gamma}{d''}\gamma_2$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coin{\Gamma}{d''}\gamma_2$. The desired claim follows. \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$ then \[ \begin{array}{l} \semd{e_3}\gamma_1\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \gamma'=\gamma_3\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$ and $\gamma_1\coin{\Gamma}{d''}\gamma_3$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coin{\Gamma}{d''}\gamma_3$. The desired claim follows. \item If $\monadic{v}_1\ne\uopl{pure} b$ where $b\in\mathbb{B}$ then $\gamma'=\gamma_1$. By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$. The desired claim follows. \end{itemize} \item Let $e=\forexpr{x}{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_2\mbox{,}\\ (x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma\mbox{\ $\vdash$\ } e_3:\qualty{t_1}{s_1}{d_1}! D_3\mbox{,}\\ \gen{d_0}\supseteq\gen{s_1}\cup\gen{d_1}\cup D_3\mbox{,}\quad D=D_1\cup D_2\cup D_3\mbox{,} \end{array} \] whence we have $d''\notin D_1$, $d''\notin D_2$ and $d''\notin D_3$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \end{array} \] Consider two cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure} i_1$ and $\monadic{v}_2=\uopl{pure} i_2$ for $i_1,i_2\in\mathbb{N}$ then, denoting $n=\max(0,i_2-i_1)$, we have \[ \begin{array}{l} \semd{e_3}((x,\uopl{pure} i_1),\gamma_2)\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma_3)\phi=\uopl{pure}(\monadic{v}_4,\gamma_4,\omicron_4)\mbox{,}\\ \dotfill\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma_{n+1})\phi=\uopl{pure}(\monadic{v}_{n+2},\gamma_{n+2},\omicron_{n+2})\mbox{,}\\ \gamma'=\uopl{tail}\gamma_{n+2}\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$ and $\gamma_1\coin{\Gamma}{d''}\gamma_2$, and also $(x,\uopl{pure} i_1),\gamma_2\coin{\Gamma'}{d''}\gamma_3$ and $[x\mapsto\uopl{pure}(i_1+k-3)]\gamma_{k-1}\coin{\Gamma'}{d''}\gamma_k$ for each $k=4,\ldots,n+2$ where $\Gamma'=((x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma)$. Then also $\gamma_2\coin{\Gamma}{d''}\uopl{tail}\gamma_3$ and $\uopl{tail}\gamma_{k-1}\coin{\Gamma}{d''}\uopl{tail}\gamma_k$ for every $k=4,\ldots,n+2$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coin{\Gamma}{d''}\uopl{tail}\gamma_{n+2}$. The desired claim follows. \item If $\monadic{v}_1\ne\uopl{pure} i_1$ or $\monadic{v}_2\ne\uopl{pure} i_2$ with $i_1,i_2\in\mathbb{N}$ then $\gamma'=\gamma_2$. By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$ and $\gamma_1\coin{\Gamma}{d''}\gamma_2$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coin{\Gamma}{d''}\gamma_2$. The desired claim follows. \end{itemize} \item Let $e=\castexpr{e_1}{d_0}$. Then \[ \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D\mbox{,} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \gamma'=\gamma_1\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$. The desired claim follows. \item Let $e=(\assignexpr{e_1}{e_2})$. Let $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$. By Lemma~\ref{typesystem:lhslemma}, \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } y_i:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_i}! D_i\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } x:\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{\qualty{t}{s}{d_{n+1}}}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1}! D_0 \end{array} \] and \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t}{s}{d_{n+1}}! D_1\cup\ldots\cup D_n\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{t}{s}{d_{n+1}}! D_{n+1}\mbox{,}\\ D=\gen{s}\cup\gen{d_{n+1}}\cup D_1\cup\ldots\cup D_{n+1}\mbox{,} \end{array} \] for some $D_1,\ldots,D_{n+1}$. Hence we must have $d''\notin D_k$ for every $k=1,\ldots,n+1$ and $d''\notin\gen{d_{n+1}}$ meaning that $d_{n+1}$ is a strict superdomain of~$d''$. We also have \[ \begin{array}{l} \semd{y_1}\gamma\phi=\uopl{pure}(\monadic{i}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{y_2}\gamma_1\phi=\uopl{pure}(\monadic{i}_2,\gamma_2,\omicron_2)\mbox{,}\\ \dotfill\\ \semd{y_n}\gamma_{n-1}\phi=\uopl{pure}(\monadic{i}_n,\gamma_n,\omicron_n)\mbox{,}\\ \semd{e_2}\gamma_n\phi=\uopl{pure}(\monadic{v},\gamma_{n+1},\omicron_{n+1})\mbox{,}\\ \gamma'=[x\mapsto\uopl{upd}(\lookup{\gamma}{x},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})]\gamma_{n+1}\mbox{.} \end{array} \] By the induction hypothesis, $\gamma_{k-1}\coin{\Gamma}{d''}\gamma_k$ for each $k=1,\ldots,n+1$ (denoting $\gamma_0=\gamma$). Let $\uopl{vars}\Gamma=(z_1,\ldots,z_l)$ and let the corresponding types be $q_1,\ldots,q_l$. Let $k$ be the least index such that $z_k=x$. For every $i\ne k$, we have $\lookup{\gamma_{n+1}}{z_i}=\lookup{\gamma'}{z_i}$. Hence, by Lemma~\ref{semantics:coinlemma}, $\lookup{\gamma}{z_i}\coin{q_i}{d''}\lookup{\gamma'}{z_i}$. Moreover, Lemma~\ref{semantics:updcoin0lemma} implies $\lookup{\gamma}{z_k}\coin{q_k}{d''}\uopl{upd}(\lookup{\gamma}{z_k},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})$. Consequently, $\gamma\coin{\Gamma}{d''}\gamma'$. The desired claim follows. \item Let $e=\loadexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_1}! D_2\mbox{,}\\ D=D_1\cup D_2\mbox{,} \end{array} \] whence we have $d''\notin D_1$ and $d''\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{a},\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{i},\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\gamma_2\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$ and $\gamma_1\coin{\Gamma}{d''}\gamma_2$. The desired claim follows by Lemma~\ref{semantics:coinlemma}. \item Let $e=(\stmtcomp{\letexpr{x}{e_1}}{e_2})$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D_1\mbox{,}\\ (x:\qualty{t_1}{s_1}{d_1}),\Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ D=\gen{d_1}\cup D_1\cup D_2\mbox{,} \end{array} \] whence $d''\notin D_1$ and $d''\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}((x,\monadic{v}_1),\gamma_1)\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\uopl{tail}\gamma_2\mbox{.} \end{array} \] The induction hypothesis implies $\gamma\coin{\Gamma}{d''}\gamma_1$ and $(x,\monadic{v}_1),\gamma_1\coin{\Gamma'}{d''}\gamma_2$ where $\Gamma'=((x:\qualty{t_1}{s_1}{d_1}),\Gamma)$. The latter implies $\gamma_1\coin{\Gamma}{d''}\uopl{tail}\gamma_2$. The desired claim follows by Lemma~\ref{semantics:coinlemma}. \item Let $e=\stmtcomp{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ D=D_1\cup D_2\mbox{,} \end{array} \] whence $d''\notin D_1$ and $d''\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\gamma_2\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coin{\Gamma}{d''}\gamma_1$ and $\gamma_1\coin{\Gamma}{d''}\gamma_2$. The desired claim follows by Lemma~\ref{semantics:coinlemma}. \end{itemize} \end{proof} \begin{theorem}[Theorem~\ref{semantics:outputthm}] Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$ and $\gamma\in\mathbf{Env}$ be $\Gamma$-exact in~$d$ for some domain~$d$. Assume that for all subexpressions of~$e$ of the form $\ofty{\getexpr{d'}{k}}{q'}$ where $d'\mathrel{\mathchar"13C\mathchar"3A} d$, the value $\uopl{allpure}(\phi_{d'}(k))$ is $q'$-exact in~$d$. If $\semd{e}\gamma\phi=\uopl{pure}(\monadic{v},\gamma',\omicron)$ and $\mbox{\lstinline+@public+}\notin D$ then $\omicron=\epsilon$. \end{theorem} \begin{proof} Let $q=\qualty{t_0}{s_0}{d_0}$. We proceed by induction on the structure of~$e$. If $e=\epsilon$ or $e=\overline{n}$ where $n\in\mathbb{N}$ or $e=\overline{b}$ where $b\in\mathbb{B}$ or $e=x$ or $e=\getexpr{d'}{k}$ then $\omicron=\epsilon$. If $e=\assertexpr{e_1}$ or $e=\wireexpr{e_1}$ then the claim holds vacuously since $D=\gen{\mbox{\lstinline+@public+}}$. We study the remaining cases. \begin{itemize} \item Let $e=\addexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ D=\gen{s_0}\cup D_1\cup D_2\mbox{,} \end{array} \] whence we must have $\mbox{\lstinline+@public+}\notin D_1$ and $\mbox{\lstinline+@public+}\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\gamma_1$ and $\gamma_2$ are $q$-exact in~$d$. By the induction hypothesis, $\omicron_1=\epsilon$ and $\omicron_2=\epsilon$. Hence $\omicron=\epsilon$. \item Let $e=\ifexpr{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_3:q! D_3\mbox{,}\\ \gen{d_1}\supseteq\gen{s_0}\cup\gen{d_0}\cup D_2\cup D_3\mbox{,}\quad D=D_1\cup D_2\cup D_3\mbox{,} \end{array} \] whence we must have $\mbox{\lstinline+@public+}\notin D_1$, $\mbox{\lstinline+@public+}\notin D_2$ and $\mbox{\lstinline+@public+}\notin D_3$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{.} \end{array} \] Consider three cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$ then \[ \begin{array}{l} \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\gamma_1$ and $\gamma_2$ are $\Gamma$-exact in~$d$. By the induction hypothesis, $\omicron_1=\epsilon$ and $\omicron_2=\epsilon$. Hence $\omicron=\epsilon$. \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$ then \[ \begin{array}{l} \semd{e_3}\gamma_1\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \omicron=\omicron_1\omicron_3\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\gamma_1$ and $\gamma_3$ are $\Gamma$-exact in~$d$. By the induction hypothesis, $\omicron_1=\epsilon$ and $\omicron_3=\epsilon$. Hence $\omicron=\epsilon$. \item If $\monadic{v}_1\ne\uopl{pure} b$ where $b\in\mathbb{B}$ then $\omicron=\omicron_1$. By the induction hypothesis, $\omicron_1=\epsilon$. The desired claim follows. \end{itemize} \item Let $e=\forexpr{x}{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_2\mbox{,}\\ (x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma\mbox{\ $\vdash$\ } e_3:\qualty{t_1}{s_1}{d_1}! D_3\mbox{,}\\ \gen{d_0}\supseteq\gen{s_1}\cup\gen{d_1}\cup D_3\mbox{,}\quad D=D_1\cup D_2\cup D_3\mbox{,} \end{array} \] whence we have $\mbox{\lstinline+@public+}\notin D_1$, $\mbox{\lstinline+@public+}\notin D_2$ and $\mbox{\lstinline+@public+}\notin D_3$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\monadic{v}_1$ and $\monadic{v}_2$ are $(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0})$-exact in~$d$ and $\gamma_1$ and $\gamma_2$ are $\Gamma$-exact in~$d$. Consider two cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure} i_1$ and $\monadic{v}_2=\uopl{pure} i_2$ for $i_1,i_2\in\mathbb{N}$ then, denoting $n=\max(0,i_2-i_1)$, we have \[ \begin{array}{l} \semd{e_3}((x,\uopl{pure} i_1),\gamma_2)\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma_3)\phi=\uopl{pure}(\monadic{v}_4,\gamma_4,\omicron_4)\mbox{,}\\ \dotfill\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma_{n+1})\phi=\uopl{pure}(\monadic{v}_{n+2},\gamma_{n+2},\omicron_{n+2})\mbox{,}\\ \omicron=\omicron_1\ldots\omicron_{n+2}\mbox{.} \end{array} \] By the above, $((x,\uopl{pure} i_1),\gamma_2)$ is $\Gamma'$-exact in~$d$ where $\Gamma'=((x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma)$. By Theorem~\ref{semantics:localthm}, $\gamma_3,\ldots,\gamma_{n+2}$ are also $\Gamma'$-exact in~$d$ since increasing $i_1$ does not change this property. Hence by the induction hypothesis, $\omicron_1=\ldots=\omicron_{n+2}=\epsilon$, implying $\omicron=\epsilon$. \item If $\monadic{v}_1\ne\uopl{pure} i_1$ or $\monadic{v}_2\ne\uopl{pure} i_2$ with $i_1,i_2\in\mathbb{N}$ then $\omicron=\omicron_1\omicron_2$. By the induction hypothesis, $\omicron_1=\epsilon$ and $\omicron_2=\epsilon$. Hence $\omicron=\epsilon$. \end{itemize} \item Let $e=\castexpr{e_1}{d_0}$. Then \[ \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D\mbox{,} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \omicron=\omicron_1\mbox{.} \end{array} \] By the induction hypothesis, $\omicron_1=\epsilon$. The desired claim follows. \item Let $e=(\assignexpr{e_1}{e_2})$. Let $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$. By Lemma~\ref{typesystem:lhslemma}, \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } y_i:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_i}! D_i\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } x:\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{\qualty{t}{s}{d_{n+1}}}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1}! D_0 \end{array} \] and \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t}{s}{d_{n+1}}! D_1\cup\ldots\cup D_n\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{t}{s}{d_{n+1}}! D_{n+1}\mbox{,}\\ D=\gen{s}\cup\gen{d_{n+1}}\cup D_1\cup\ldots\cup D_{n+1}\mbox{,} \end{array} \] for some $D_1,\ldots,D_{n+1}$. Hence we must have $\mbox{\lstinline+@public+}\notin D_k$ for every $k=1,\ldots,n+1$. We also have \[ \begin{array}{l} \semd{y_1}\gamma\phi=\uopl{pure}(\monadic{i}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{y_2}\gamma_1\phi=\uopl{pure}(\monadic{i}_2,\gamma_2,\omicron_2)\mbox{,}\\ \dotfill\\ \semd{y_n}\gamma_{n-1}\phi=\uopl{pure}(\monadic{i}_n,\gamma_n,\omicron_n)\mbox{,}\\ \semd{e_2}\gamma_n\phi=\uopl{pure}(\monadic{v},\gamma_{n+1},\omicron_{n+1})\mbox{,}\\ \omicron=\omicron_1\ldots\omicron_{n+1}\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\gamma_1,\ldots,\gamma_n$ are $\Gamma$-exact in~$d$. By the induction hypothesis, $\omicron_1=\ldots=\omicron_{n+1}=\epsilon$, implying $\omicron=\epsilon$. \item Let $e=\loadexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_1}! D_2\mbox{,}\\ D=D_1\cup D_2\mbox{,} \end{array} \] whence we have $\mbox{\lstinline+@public+}\notin D_1$ and $\mbox{\lstinline+@public+}\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{a},\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{i},\gamma_2,\omicron_2)\mbox{,}\\ \omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\gamma_1$ and $\gamma_2$ are $\Gamma$-exact in~$d$. By the induction hypothesis, $\omicron_1=\epsilon$ and $\omicron_2=\epsilon$. Hence $\omicron=\epsilon$. \item Let $e=(\stmtcomp{\letexpr{x}{e_1}}{e_2})$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D_1\mbox{,}\\ (x:\qualty{t_1}{s_1}{d_1}),\Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ D=\gen{d_1}\cup D_1\cup D_2\mbox{,} \end{array} \] whence $\mbox{\lstinline+@public+}\notin D_1$ and $\mbox{\lstinline+@public+}\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}((x,\monadic{v}_1),\gamma_1)\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\monadic{v}_1$ is $(\qualty{t_1}{s_1}{d_1})$-exact and $\gamma_1$ is $\Gamma$-exact in~$d$. Hence $\left((x,\monadic{v}_1),\gamma_1\right)$ is $\Gamma'$-exact in~$d$ where $\Gamma'=((x:\qualty{t_1}{s_1}{d_1}),\Gamma)$. The induction hypothesis implies $\omicron_1=\epsilon$ and $\omicron_2=\epsilon$. Hence $\omicron=\epsilon$. \item Let $e=\stmtcomp{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ D=D_1\cup D_2\mbox{,} \end{array} \] whence $\mbox{\lstinline+@public+}\notin D_1$ and $\mbox{\lstinline+@public+}\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\gamma_1$ and $\gamma_2$ are $\Gamma$-exact in~$d$. By the induction hypothesis, $\omicron_1=\epsilon$ and $\omicron_2=\epsilon$. Hence $\omicron=\epsilon$. \end{itemize} \end{proof} \begin{theorem}[Theorem~\ref{semantics:effcircthm}] Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$ and $\gamma\in\mathbf{Env}$ be $\Gamma$-exact in $d$ for $d=\mbox{\lstinline+@prover+}$. Assume that for all subexpressions of~$e$ of the form $\ofty{\getexpr{d'}{k}}{q'}$, the value $\uopl{allpure}(\phi_{d'}(k))$ is $q'$-exact in~$d$. If $\semd{e}\gamma\phi=\uopl{pure}(\monadic{v},\gamma',\omicron)$ and $\mbox{\lstinline+@public+}\notin D$ then $\gamma\coincirc{\Gamma}\gamma'$. \end{theorem} \begin{proof} By Theorem~\ref{semantics:localthm}, $\gamma'$ is $\Gamma$-exact in $\mbox{\lstinline+@prover+}$. By Lemma~\ref{semantics:reintlemma}, $\gamma$ and $\gamma'$ are $\Gamma$-exposed in $\mbox{\lstinline+@prover+}$. By Lemma~\ref{semantics:approxlemma}, $\gamma$ and $\gamma'$ are also $\Gamma$-exposed in circuit. Let $q=\qualty{t_0}{s_0}{d_0}$. We proceed by induction on the structure of~$e$. If $e=\epsilon$ or $e=\overline{n}$ where $n\in\mathbb{N}$ or $e=\overline{b}$ where $b\in\mathbb{B}$ or $e=x$ or $e=\getexpr{d'}{k}$ then $\gamma=\gamma'$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coincirc{\Gamma}\gamma'$. If $e=\assertexpr{e_1}$ or $e=\wireexpr{e_1}$ then the claim holds vacuously since $D=\gen{\mbox{\lstinline+@public+}}$. We study the remaining cases. \begin{itemize} \item Let $e=\addexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ D=\gen{s_0}\cup D_1\cup D_2\mbox{,} \end{array} \] whence we must have $\mbox{\lstinline+@public+}\notin D_1$ and $\mbox{\lstinline+@public+}\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\gamma_2\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coincirc{\Gamma}\gamma_1$ and $\gamma_1\coincirc{\Gamma}\gamma_2$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coincirc{\Gamma}\gamma_2$. Hence $\gamma\coincirc{\Gamma}\gamma'$. \item Let $e=\ifexpr{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_3:q! D_3\mbox{,}\\ \gen{d_1}\supseteq\gen{s_0}\cup\gen{d_0}\cup D_2\cup D_3\mbox{,}\quad D=D_1\cup D_2\cup D_3\mbox{,} \end{array} \] whence we must have $\mbox{\lstinline+@public+}\notin D_1$, $\mbox{\lstinline+@public+}\notin D_2$ and $\mbox{\lstinline+@public+}\notin D_3$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\monadic{v}_1$ is $(\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1})$-exact in $\mbox{\lstinline+@prover+}$, whence we have to consider two cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$ then \[ \begin{array}{l} \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\gamma_2\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coincirc{\Gamma}\gamma_1$ and $\gamma_1\coincirc{\Gamma}\gamma_2$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coincirc{\Gamma}\gamma_2$. Hence $\gamma\coincirc{\Gamma}\gamma'$. \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$ then \[ \begin{array}{l} \semd{e_3}\gamma_1\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \gamma'=\gamma_3\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coincirc{\Gamma}\gamma_1$ and $\gamma_1\coincirc{\Gamma}\gamma_3$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coincirc{\Gamma}\gamma_3$. Hence $\gamma\coincirc{\Gamma}\gamma'$. \end{itemize} \item Let $e=\forexpr{x}{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_2\mbox{,}\\ (x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma\mbox{\ $\vdash$\ } e_3:\qualty{t_1}{s_1}{d_1}! D_3\mbox{,}\\ \gen{d_0}\supseteq\gen{s_1}\cup\gen{d_1}\cup D_3\mbox{,}\quad D=D_1\cup D_2\cup D_3\mbox{,} \end{array} \] whence we have $\mbox{\lstinline+@public+}\notin D_1$, $\mbox{\lstinline+@public+}\notin D_2$ and $\mbox{\lstinline+@public+}\notin D_3$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \end{array} \] By Theorem~\ref{semantics:localthm}, $\monadic{v}_1$ and $\monadic{v}_2$ are $(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0})$-exact in $\mbox{\lstinline+@prover+}$, whence $\monadic{v}_1=\uopl{pure} i_1$ and $\monadic{v}_2=\uopl{pure} i_2$ for $i_1,i_2\in\mathbb{N}$. Denoting $n=\max(0,i_2-i_1)$, we have \[ \begin{array}{l} \semd{e_3}((x,\uopl{pure} i_1),\gamma_2)\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma_3)\phi=\uopl{pure}(\monadic{v}_4,\gamma_4,\omicron_4)\mbox{,}\\ \dotfill\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma_{n+1})\phi=\uopl{pure}(\monadic{v}_{n+2},\gamma_{n+2},\omicron_{n+2})\mbox{,}\\ \gamma'=\uopl{tail}\gamma_{n+2}\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coincirc{\Gamma}\gamma_1$ and $\gamma_1\coincirc{\Gamma}\gamma_2$, and also $\left((x,\uopl{pure} i_1),\gamma_2\right)\coincirc{\Gamma'}\gamma_3$ and $[x\mapsto\uopl{pure}(i_1+k-3)]\gamma_{k-1}\coincirc{\Gamma'}\gamma_k$ for each $k=4,\ldots,n+2$ where $\Gamma'=((x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma)$. Then also $\gamma_2\coincirc{\Gamma}\uopl{tail}\gamma_3$ and $\uopl{tail}\gamma_{k-1}\coincirc{\Gamma}\uopl{tail}\gamma_k$ for every $k=4,\ldots,n+2$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coincirc{\Gamma}\uopl{tail}\gamma_{n+2}$. Hence $\gamma\coincirc{\Gamma}\gamma'$. \item Let $e=\castexpr{e_1}{d_0}$. Then \[ \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D\mbox{,} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \gamma'=\gamma_1\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coincirc{\Gamma}\gamma_1$. Hence $\gamma\coincirc{\Gamma}\gamma'$. \item Let $e=(\assignexpr{e_1}{e_2})$. Let $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$. By Lemma~\ref{typesystem:lhslemma}, \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } y_i:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_i}! D_i\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } x:\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{\qualty{t}{s}{d_{n+1}}}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1}! D_0 \end{array} \] and \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t}{s}{d_{n+1}}! D_1\cup\ldots\cup D_n\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{t}{s}{d_{n+1}}! D_{n+1}\mbox{,}\\ D=\gen{s}\cup\gen{d_{n+1}}\cup D_1\cup\ldots\cup D_{n+1}\mbox{,} \end{array} \] for some $D_1,\ldots,D_{n+1}$. Hence we must have $\mbox{\lstinline+@public+}\notin D_k$ for every $k=1,\ldots,n+1$ and $\mbox{\lstinline+@public+}\notin\gen{d_{n+1}}$ meaning that $d_{n+1}$ is a strict superdomain of~$\mbox{\lstinline+@public+}$. We also have \[ \begin{array}{l} \semd{y_1}\gamma\phi=\uopl{pure}(\monadic{i}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{y_2}\gamma_1\phi=\uopl{pure}(\monadic{i}_2,\gamma_2,\omicron_2)\mbox{,}\\ \dotfill\\ \semd{y_n}\gamma_{n-1}\phi=\uopl{pure}(\monadic{i}_n,\gamma_n,\omicron_n)\mbox{,}\\ \semd{e_2}\gamma_n\phi=\uopl{pure}(\monadic{v},\gamma_{n+1},\omicron_{n+1})\mbox{,}\\ \gamma'=[x\mapsto\uopl{upd}(\lookup{\gamma}{x},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})]\gamma_{n+1}\mbox{.} \end{array} \] By the induction hypothesis, $\gamma_{k-1}\coincirc{\Gamma}\gamma_k$ for each $k=1,\ldots,n+1$ (denoting $\gamma_0=\gamma$). Let $\uopl{vars}\Gamma=(z_1,\ldots,z_l)$ and let the corresponding types be $q_1,\ldots,q_l$. Let $k$ be the least index such that $z_k=x$. For every $i\ne k$, we have $\lookup{\gamma_{n+1}}{z_i}=\lookup{\gamma'}{z_i}$. Hence, by Lemma~\ref{semantics:coinlemma}, $\lookup{\gamma}{z_i}\coincirc{q_i}\lookup{\gamma'}{z_i}$. Moreover, Lemma~\ref{semantics:updcoin0lemma} implies $\lookup{\gamma}{z_k}\coincirc{q_k}\uopl{upd}(\lookup{\gamma}{z_k},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})$. Consequently, $\gamma\coincirc{\Gamma}\gamma'$. The desired claim follows. \item Let $e=\loadexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_1}! D_2\mbox{,}\\ D=D_1\cup D_2\mbox{,} \end{array} \] whence we have $\mbox{\lstinline+@public+}\notin D_1$ and $\mbox{\lstinline+@public+}\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{a},\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{i},\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\gamma_2\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coincirc{\Gamma}\gamma_1$ and $\gamma_1\coincirc{\Gamma}\gamma_2$. By Lemma~\ref{semantics:coinlemma}, $\gamma\coincirc{\Gamma}\gamma_2$. Hence $\gamma\coincirc{\Gamma}\gamma'$. \item Let $e=(\stmtcomp{\letexpr{x}{e_1}}{e_2})$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D_1\mbox{,}\\ (x:\qualty{t_1}{s_1}{d_1}),\Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ D=\gen{d_1}\cup D_1\cup D_2\mbox{,} \end{array} \] whence $\mbox{\lstinline+@public+}\notin D_1$ and $\mbox{\lstinline+@public+}\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}((x,\monadic{v}_1),\gamma_1)\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\uopl{tail}\gamma_2\mbox{.} \end{array} \] The induction hypothesis implies $\gamma\coincirc{\Gamma}\gamma_1$ and $\left((x,\monadic{v}_1),\gamma_1\right)\coincirc{\Gamma'}\gamma_2$ where $\Gamma'=((x:\qualty{t_1}{s_1}{d_1}),\Gamma)$. The latter implies $\gamma_1\coincirc{\Gamma}\uopl{tail}\gamma_2$. The desired claim follows by Lemma~\ref{semantics:coinlemma}. \item Let $e=\stmtcomp{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q\mbox{,}\\ D=D_1\cup D_2\mbox{,} \end{array} \] whence $\mbox{\lstinline+@public+}\notin D_1$ and $\mbox{\lstinline+@public+}\notin D_2$. We also have \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \gamma'=\gamma_2\mbox{.} \end{array} \] By the induction hypothesis, $\gamma\coincirc{\Gamma}\gamma_1$ and $\gamma_1\coincirc{\Gamma}\gamma_2$. The desired claim follows by Lemma~\ref{semantics:coinlemma}. \end{itemize} \end{proof} \begin{theorem}[Theorem~\ref{semantics:safety}] If $\semd{e}\gamma\phi=\uopl{pure}(\monadic{v},\gamma',\omicron)$ and $\phi'_{d'}=\phi_{d'}$ for every $d'\mathrel{\mathchar"13C\mathchar"3A} d$ then $\semd{e}\gamma\phi'=\semd{e}\gamma\phi$. \end{theorem} \begin{proof} Let $\phi':\mathbf{In}^3$ be such that $\phi_{d'}=\phi'_{d'}$ for every $d'\mathrel{\mathchar"13C\mathchar"3A} d$. We proceed by induction on the structure of~$e$. \begin{itemize} \item If $e=\epsilon$, $e=\overline{n}$ where $n\in\mathbb{N}$, $e=\overline{b}$ where $b\in\mathbb{B}$, or $e=x$, then $\semd{e}\gamma\phi'=\semd{e}\gamma\phi$ because the semantics in these cases does not depend on the input dictionaries. \item Let $e=\addexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\mcomp{v_1\gets\monadic{v}_1;\; v_2\gets\monadic{v}_2;\;\uopl{pure}(v_1+v_2)}\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about $e_1$ and $e_2$, \[ \begin{array}{l} \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi'=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \end{array} \] Hence $\semd{\addexpr{e_1}{e_2}}\gamma\phi'=\uopl{pure}(\mcomp{v_1\gets\monadic{v}_1;\; v_2\gets\monadic{v}_2;\;\uopl{pure}(v_1+v_2)},\gamma_2,\omicron_1\omicron_2)=\semd{\addexpr{e_1}{e_2}}\gamma\phi$ as needed. \item Let $e=\assertexpr{e_1}$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \monadic{v}_1\ne\uopl{pure}\mbox{\bfseries ff}\mbox{,}\quad\monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\omicron_1\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, \[ \begin{array}{l} \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{.} \end{array} \] Hence $\semd{\assertexpr{e_1}}\gamma\phi'=\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},\gamma_1,\omicron_1)=\semd{\assertexpr{e_1}}\gamma\phi$. \item Let $e=\ofty{\getexpr{d''}{k}}{q}$. Then $\semd{e}\gamma\phi'=\semd{e}\gamma\phi$ since the semantics depends only on inputs of subdomains of~$d$. \item Let $e=\ifexpr{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1) \end{array} \] and, by the induction hypothesis about~$e_1$, \[ \begin{array}{l} \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{.} \end{array} \] Consider three cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$ then \[ \begin{array}{l} \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\monadic{v}_2\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about~$e_2$, \[ \semd{e_2}\gamma_1\phi'=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \] Hence $\semd{\ifexpr{e_1}{e_2}{e_3}}\gamma\phi'=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_1\omicron_2)=\semd{\ifexpr{e_1}{e_2}{e_3}}\gamma\phi$. \item If $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$ then \[ \begin{array}{l} \semd{e_3}\gamma_1\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \monadic{v}=\monadic{v}_3\mbox{,}\quad\gamma'=\gamma_3\mbox{,}\quad\omicron=\omicron_1\omicron_3\mbox{.} \end{array} \] By the induction hypothesis about~$e_3$, \[ \semd{e_3}\gamma_1\phi'=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{.} \] Hence $\semd{\ifexpr{e_1}{e_2}{e_3}}\gamma\phi'=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_1\omicron_3)=\semd{\ifexpr{e_1}{e_2}{e_3}}\gamma\phi$. \item If $\monadic{v}_1\ne\uopl{pure} b$ where $b\in\mathbb{B}$ then $\monadic{v}=\top$, $\gamma'=\gamma_1$ and $\omicron=\omicron_1$. Since we similarly have $\semd{\ifexpr{e_1}{e_2}{e_3}}\gamma\phi'=\uopl{pure}(\top,\gamma_1,\omicron_1)$, the desired claim follows. \end{itemize} \item Let $e=\forexpr{x}{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,} \end{array} \] and, by the induction hypothesis about $e_1$ and $e_2$, \[ \begin{array}{l} \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma\phi'=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \end{array} \] Consider two cases: \begin{itemize} \item If $\monadic{v}_1=\uopl{pure} i_1$ and $\monadic{v}_2=\uopl{pure} i_2$ for $i_1,i_2\in\mathbb{N}$ then, denoting $n=\max(0,i_2-i_1)$, we have \[ \begin{array}{l} \semd{e_3}((x,\uopl{pure} i_1),\gamma_2)\phi=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma_3)\phi=\uopl{pure}(\monadic{v}_4,\gamma_4,\omicron_4)\mbox{,}\\ \dotfill\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma_{n+1})\phi=\uopl{pure}(\monadic{v}_{n+2},\gamma_{n+2},\omicron_{n+2})\mbox{,}\\ \monadic{v}=\uopl{pure}(\monadic{v}_3,\ldots,\monadic{v}_{n+2})\mbox{,}\quad\gamma'=\uopl{tail}\gamma_{n+2}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+2}\mbox{.} \end{array} \] By the induction hypothesis about $e_3$, \[ \begin{array}{l} \semd{e_3}((x,\uopl{pure} i_1),\gamma_2)\phi'=\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_3)\mbox{,}\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma_3)\phi'=\uopl{pure}(\monadic{v}_4,\gamma_4,\omicron_4)\mbox{,}\\ \dotfill\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma_{n+1})\phi'=\uopl{pure}(\monadic{v}_{n+2},\gamma_{n+2},\omicron_{n+2})\mbox{.} \end{array} \] Hence $\semd{\forexpr{x}{e_1}{e_2}{e_3}}\gamma\phi'=\uopl{pure}(\uopl{pure}(\monadic{v}_3,\ldots,\monadic{v}_{n+2}),\uopl{tail}\gamma_{n+2},\omicron_1\ldots\omicron_{n+2})$ and the desired claim follows. \item If $\monadic{v}_1\ne\uopl{pure} i_1$ or $\monadic{v}_2\ne\uopl{pure} i_2$ with $i_1,i_2\in\mathbb{N}$ then $\monadic{v}=\top$, $\gamma'=\gamma_2$ and $\omicron=\omicron_1\omicron_2$. As we similarly get $\semd{\forexpr{x}{e_1}{e_2}{e_3}}\gamma\phi'=\uopl{pure}(\top,\gamma_2,\omicron_1\omicron_2)$, the desired claim follows. \end{itemize} \item Let $e=\wireexpr{e_1}$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \monadic{v}=\monadic{v}_1\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\lam{d'}{\branching{(\omicron_1)_{d'}\monadic{v}_1&\mbox{if $e_1$ is in domain~$d'$}\\(\omicron_1)_{d'}&\mbox{otherwise}}}\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, \[ \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{.} \] Hence \[ \begin{array}{lcl} \semd{\wireexpr{e_1}}\gamma\phi' &=&\uopl{pure}(\monadic{v}_1,\gamma_1,\lam{d'}{\branching{(\omicron_1)_{d'}\monadic{v}_1&\mbox{if $e_1$ is in domain~$d'$}\\(\omicron_1)_{d'}&\mbox{otherwise}}})\\ &=&\semd{\wireexpr{e_1}}\gamma\phi \end{array} \] and the desired claim follows. \item Let $e=\castexpr{e_1}{d_0}$. Let the domain of~$e_1$ be $d_1$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \monadic{v}=\branching{\monadic{v}_1&\mbox{if $d_0\mathrel{\mathchar"13C\mathchar"3A} d$}\\\top&\mbox{otherwise}}\mbox{,}\quad\gamma'=\gamma_1\mbox{,}\quad\omicron=\omicron_1\mbox{.} \end{array} \] By the induction hypothesis, \[ \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{.} \] Hence $\semd{\castexpr{e_1}{d_0}}\gamma\phi'=\uopl{pure}(\branching{\monadic{v}_1&\mbox{if $d_0\mathrel{\mathchar"13C\mathchar"3A} d$}\\\top&\mbox{otherwise}},\gamma_1,\omicron_1)=\semd{\castexpr{e_1}{d_0}}\gamma\phi$ and the desired claim follows. \item Let $e=(\assignexpr{e_1}{e_2})$. Let $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$. Then \[ \begin{array}{l} \semd{y_1}\gamma\phi=\uopl{pure}(\monadic{i}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{y_2}\gamma_1\phi=\uopl{pure}(\monadic{i}_2,\gamma_2,\omicron_2)\mbox{,}\\ \dotfill\\ \semd{y_n}\gamma_{n-1}\phi=\uopl{pure}(\monadic{i}_n,\gamma_n,\omicron_n)\mbox{,}\\ \semd{e_2}\gamma_n\phi=\uopl{pure}(\monadic{r},\gamma_{n+1},\omicron_{n+1})\mbox{,}\\ \monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'=[x\mapsto\uopl{upd}(\lookup{\gamma}{x},\monadic{i}_1\ldots\monadic{i}_n,\monadic{r})]\gamma_{n+1}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+1}\mbox{.} \end{array} \] By the induction hypothesis, \[ \begin{array}{l} \semd{y_1}\gamma\phi'=\uopl{pure}(\monadic{i}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{y_2}\gamma_1\phi'=\uopl{pure}(\monadic{i}_2,\gamma_2,\omicron_2)\mbox{,}\\ \dotfill\\ \semd{y_n}\gamma_{n-1}\phi'=\uopl{pure}(\monadic{i}_n,\gamma_n,\omicron_n)\mbox{,}\\ \semd{e_2}\gamma_n\phi'=\uopl{pure}(\monadic{r},\gamma_{n+1},\omicron_{n+1})\mbox{.} \end{array} \] Hence \[ \semd{\assignexpr{e_1}{e_2}}\gamma\phi'=\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},[x\mapsto\uopl{upd}(\lookup{\gamma}{x},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})]\gamma_{n+1},\omicron_1\ldots\omicron_{n+1})=\semd{\assignexpr{e_1}{e_2}}\gamma\phi \] and the desired claim follows. \item Let $e=\loadexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{a},\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{i},\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\mcomp{a\gets\monadic{a};\; i\gets\monadic{i};\; a_i}\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis, \[ \begin{array}{l} \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{a},\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi'=\uopl{pure}(\monadic{i},\gamma_2,\omicron_2)\mbox{.}\\ \end{array} \] Hence $\semd{\loadexpr{e_1}{e_2}}\gamma\phi'=\uopl{pure}(\mcomp{a\gets\monadic{a};\; i\gets\monadic{i};\; a_i},\gamma_2,\omicron_1\omicron_2)=\semd{\loadexpr{e_1}{e_2}}$ and the desired claim follows. \item Let $e=\stmtcomp{\letexpr{x}{e_1}}{e_2}$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}((x,\monadic{v}_1),\gamma_1)\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\monadic{v}_2\mbox{,}\quad\gamma'=\uopl{tail}\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis, \[ \begin{array}{l} \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}((x,\monadic{v}_1),\gamma_1)\phi'=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \end{array} \] Hence $\semd{\stmtcomp{\letexpr{x}{e_1}}{e_2}}\gamma\phi'=\uopl{pure}(\monadic{v}_2,\uopl{tail}\gamma_2,\omicron_1\omicron_2)=\semd{\stmtcomp{\letexpr{x}{e_1}}{e_2}}\gamma\phi$ and the desired claim follows. \item Let $e=\stmtcomp{e_1}{e_2}$. Then \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{,}\\ \monadic{v}=\monadic{v}_2\mbox{,}\quad\gamma'=\gamma_2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis, \[ \begin{array}{l} \semd{e_1}\gamma\phi'=\uopl{pure}(\monadic{v}_1,\gamma_1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_1\phi'=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_2)\mbox{.} \end{array} \] Hence $\semd{\stmtcomp{e_1}{e_2}}\gamma\phi'=\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_1\omicron_2)=\semd{\stmtcomp{e_1}{e_2}}\gamma\phi$ and the desired claim follows. \end{itemize} \end{proof} \begin{theorem}[Theorem~\ref{semantics:soundness}] Let $\Gamma\mbox{\ $\vdash$\ } e:q! D$ with well-structured $\Gamma$. Let $d,d'$ be domains such that $d'\mathrel{\mathchar"13C\mathchar"3A} d$. Let $\gamma_d,\gamma_{d'}\in\mathbf{Env}$ be $\Gamma$-exact in~$d$ and $d'$, respectively, and let $\gamma_d\coin{\Gamma}{d'}\gamma_{d'}$. Assume that for all subexpressions of~$e$ of the form $\ofty{\getexpr{d''}{k}}{q'}$, the value $\uopl{allpure}(\phi_{d''}(k))$ is $q'$-exact in~$d''$. Assume that there exist $\monadic{v}_d,\gamma'_d,\omicron$ such that $\semd{e}\gamma_d\phi=\uopl{pure}(\monadic{v}_d,\gamma'_d,\omicron)$. Then there exist $\monadic{v}_{d'},\gamma'_{d'},\omicron'$ such that $\sem{e}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$, whereby $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$, $\gamma_d\coin{\Gamma}{d'}\gamma_{d'}$ and $\omicron\coinpure{d'}\omicron'$. \end{theorem} \begin{proof} Let $q=\qualty{t_0}{s_0}{d_0}$. We proceed by induction on the structure of~$e$: \begin{itemize} \item Let $e=\epsilon$. Then $\monadic{v}_d=\uopl{pure}\mbox{\textoneoldstyle}$, $\gamma'_d=\gamma_d$, $\omicron=\epsilon$ and $\sem{\epsilon}_{d'}\gamma_{d'}\phi=\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},\gamma_{d'},\epsilon)$. The desired claim follows since $\uopl{pure}\mbox{\textoneoldstyle}\coin{q}{d'}\uopl{pure}\mbox{\textoneoldstyle}$ and, by assumption, $\gamma_d\coin{\Gamma}{d'}\gamma_{d'}$. \item Let $e=\overline{n}$ where $n\in\mathbb{N}$. Then $\monadic{v}_d=\branching{\uopl{pure} n&\mbox{if $d_0\mathrel{\mathchar"13C\mathchar"3A} d$}\\\top&\mbox{otherwise}}$, $\gamma'_d=\gamma_d$, $\omicron=\epsilon$. On the other hand, $\sem{\overline{n}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\branching{\uopl{pure} n&\mbox{if $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$}\\\top&\mbox{otherwise}},\gamma_{d'},\epsilon)$. Consider two cases: \begin{itemize} \item If $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$ then also $d_0\mathrel{\mathchar"13C\mathchar"3A} d$, whence $\monadic{v}_d=\uopl{pure} n=\monadic{v}_{d'}$. Consequently, $\monadic{v}_d\coin{q}{d'}\monadic{v}'$. \item If $d_0$ is a strict superdomain of~$d'$ then $\monadic{v}_d\coin{q}{d'}\monadic{v}'$ vacuously. \end{itemize} Moreover, $\gamma_{d}\coin{\Gamma}{d'}\gamma_{d'}$ by assumption. The desired claim follows. \item The case $e=\overline{b}$ with $b\in\mathbb{B}$ is similar to the previous case. \item If $e=x$ then $\monadic{v}_d=\lookup{\gamma_d}{x}$, $\gamma'_d=\gamma_d$, $\omicron=\epsilon$. On the other hand, $\sem{x}_{d'}\gamma_{d'}\phi=\uopl{pure}(\lookup{\gamma_{d'}}{x},\gamma_{d'},\epsilon)$. The desired claim follows since, by assumption, $\gamma_d\coin{\Gamma}{d'}\gamma_{d'}$ which also implies $\lookup{\gamma_d}{x}\coin{q}{d'}\lookup{\gamma_{d'}}{x}$ by Lemma~\ref{semantics:lookupcoinlemma}. \item Let $e=\addexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)\mbox{,}\\ \monadic{v}_d=\mcomp{v_d^1\gets\monadic{v}_d^1;\; v_d^2\gets\monadic{v}_d^2;\;\uopl{pure}(v_d^1+v_d^2)}\mbox{,}\quad\gamma'_d=\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about $e_1$, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'}^1,\gamma_{d'}^1,\omicron'_1)$ where $\monadic{v}_d^1\coin{q}{d'}\monadic{v}_{d'}^1$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$ and $\omicron_1\coinpure{d'}\omicron'_1$. Hence by the induction hypothesis about $e_2$, $\sem{e_2}_{d'}\gamma_{d'}^1\phi=\uopl{pure}(\monadic{v}_{d'}^2,\gamma_{d'}^2,\omicron'_2)$ where $\monadic{v}_d^2\coin{q}{d'}\monadic{v}_{d'}^2$, $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$ and $\omicron_2\coinpure{d'}\omicron'_2$. Thus \[ \begin{array}{l} \sem{\addexpr{e_1}{e_2}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')\mbox{,}\\ \monadic{v}_{d'}=\mcomp{v_{d'}^1\gets\monadic{v}_{d'}^1;\; v_{d'}^2\gets\monadic{v}_{d'}^2;\;\uopl{pure}(v_{d'}^1+v_{d'}^2)}\mbox{,}\quad\gamma'_{d'}=\gamma_{d'}^2\mbox{,}\quad\omicron'=\omicron'_1\omicron'_2\mbox{.} \end{array} \] Consider two cases: \begin{itemize} \item If $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$ then also $d_0\mathrel{\mathchar"13C\mathchar"3A} d$ and we have $\monadic{v}_d^1=\uopl{pure} v_d^1$, $\monadic{v}_2=\uopl{pure} v_d^2$, $\monadic{v}_{d'}^1=\uopl{pure} v_{d'}^1$, $\monadic{v}_{d'}^2=\uopl{pure} v_{d'}^2$ by exactness. This implies $\monadic{v}_d=\uopl{pure}(v_d^1+v_d^2)$ and $\monadic{v}_{d'}=\uopl{pure}(v_{d'}^1+v_{d'}^2)$. By $\monadic{v}_d^1\coin{q}{d'}\monadic{v}_{d'}^1$ and $\monadic{v}_d^2\coin{q}{d'}\monadic{v}_{d'}^2$, we have $v_d^1=v_{d'}^1$ and $v_d^2=v_{d'}^2$, whence $\monadic{v}_d=\monadic{v}_{d'}$. Consequently, $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$. \item If $d_0$ is a strict supertype of~$d'$ then $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$ vacuously. \end{itemize} Along with $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$ and $\omicron_1\omicron_2\coinpure{d'}\omicron'_1\omicron'_2$, this implies the desired claim. \item Let $e=\assertexpr{e_1}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q'\mbox{,}\\ q'=\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$post+}}{d_1} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \monadic{v}_d^1\ne\uopl{pure}\mbox{\bfseries ff}\mbox{,}\quad\monadic{v}_d=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'_d=\gamma_d^1\mbox{,}\quad\omicron=\omicron_1\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'}^1,\gamma_{d'}^1,\omicron'_1)$ where $\monadic{v}_d^1\coin{q'}{d'}\monadic{v}_{d'}^1$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$ and $\omicron_1\coinpure{d'}\omicron'_1$. If $d_1\mathrel{\mathchar"13C\mathchar"3A} d'$ then $\monadic{v}_d^1\coin{q'}{d'}\monadic{v}_{d'}^1$ implies $\monadic{v}_d^1=\uopl{pure}\mbox{\bfseries tt}=\monadic{v}_{d'}^1$, establishing $\monadic{v}_{d'}^1\ne\uopl{pure}\mbox{\bfseries ff}$. If $d_1$ is a strict superdomain of $d'$ then, by exactness, $\monadic{v}_{d'}^1=\top\ne\uopl{pure}\mbox{\bfseries ff}$. Therefore, \[ \begin{array}{l} \sem{\assertexpr{e_1}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')\mbox{,}\\ \monadic{v}_{d'}=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'_{d'}=\gamma_{d'}^1\mbox{,}\quad\omicron'=\omicron'_1\mbox{.} \end{array} \] The desired claim follows since $\uopl{pure}\mbox{\textoneoldstyle}\coin{q}{d'}\uopl{pure}\mbox{\textoneoldstyle}$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$ and $\omicron_1\coinpure{d'}\omicron'_1$. \item Let $e=\ofty{\getexpr{d''}{e_1}}{q}$. Then $\monadic{v}_d=\branching{\uopl{allpure}(\phi_{d''}(k))&\mbox{if $d''\mathrel{\mathchar"13C\mathchar"3A} d$}\\\top&\mbox{otherwise}}$, $\gamma'_d=\gamma_d$ and $\omicron=\epsilon$. On the other hand, $\sem{\getexpr{d''}{e_1}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$ where $\monadic{v}_{d'}=\branching{\uopl{allpure}(\phi_{d''}(k))&\mbox{if $d''\mathrel{\mathchar"13C\mathchar"3A} d'$}\\\top&\mbox{otherwise}}$, $\gamma'_{d'}=\gamma_{d'}$, $\omicron'=\epsilon$. Consider three cases: \begin{itemize} \item If $d''\mathrel{\mathchar"13C\mathchar"3A} d'$ then $d''\mathrel{\mathchar"13C\mathchar"3A} d$, whence $\monadic{v}_d=\uopl{allpure}(\phi_{d''}(k))=\monadic{v}_{d'}$ and therefore $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$; \item If $d''$ is a strict superdomain of~$d'$ then $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d''}$ vacuously. \end{itemize} Moreover, $\gamma_d\coin{\Gamma}{d'}\gamma_{d'}$ by assumption. The desired claim follows. \item Let $e=\ifexpr{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q'! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_3:q! D_3\mbox{,}\\ q'=\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{,}\quad \gen{d_1}\supseteq\gen{s_0}\cup\gen{d_0}\cup D_2\cup D_3\mbox{,} \end{array} \] and \[ \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{.} \] By the induction hypothesis, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'}^1,\gamma_{d'}^1,\omicron'_1)$ where $\monadic{v}_d^1\coin{q'}{d'}\monadic{v}_{d'}^1$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$ and $\omicron_1\coinpure{d'}\omicron'_1$. Consider three cases: \begin{itemize} \item If $\monadic{v}_d^1=\uopl{pure}\mbox{\bfseries tt}$ then $\semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)$ and $\monadic{v}_d=\monadic{v}_d^2$, $\gamma'_d=\gamma_d^2$, $\omicron=\omicron_1\omicron_2$. By the induction hypothesis, $\sem{e_2}_{d'}\gamma_{d'}^1\phi=\uopl{pure}(\monadic{v}_{d'}^2,\gamma_{d'}^2,\omicron'_2)$ where $\monadic{v}_d^2\coin{q}{d'}\monadic{v}_{d'}^2$, $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$, $\omicron_2\coinpure{d'}\omicron'_2$. If $d_1\mathrel{\mathchar"13C\mathchar"3A} d'$ then $\monadic{v}_{d'}^1=\uopl{pure}\mbox{\bfseries tt}$, whence $\sem{\ifexpr{e_1}{e_2}{e_3}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$ where $\monadic{v}_{d'}=\monadic{v}_{d'}^2$, $\gamma'_{d'}=\gamma_{d'}^2$, $\omicron'=\omicron'_1\omicron'_2$. The desired claim follows. If $d_1$ is a strict supertype of~$d'$ then, by exactness, $\monadic{v}_{d'}^1=\top$. Therefore we obtain $\sem{\ifexpr{e_1}{e_2}{e_3}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$ where $\monadic{v}_{d'}=\top$, $\gamma'_{d'}=\gamma_{d'}^1$, $\omicron'=\omicron'_1$. As $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$, also $d_0$ is a strict supertype of~$d'$, vacuously implying $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$. Finally, note that $d'\in D_2$ would imply $d_1\mathrel{\mathchar"13C\mathchar"3A} d'$ and introduce contradiction, thus $d'\notin D_2$. By Theorem~\ref{semantics:effthm}, $\gamma_d^1\coin{\Gamma}{d'}\gamma_d^2$. As also $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$, Lemma~\ref{semantics:coinlemma} establishes $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^1$. By $D_2$ being upward closed, we also have $\mbox{\lstinline+@public+}\notin D_2$, whence Theorem~\ref{semantics:outputthm} gives $\omicron_2=\epsilon$. Thus $\omicron=\omicron_1$. The desired result follows. \item The case $\monadic{v}_d^1=\uopl{pure}\mbox{\bfseries ff}$ is similar to the previous case. \item If $\monadic{v}_d^1=\top$ then $\monadic{v}_d=\top$, $\gamma'_d=\gamma_d^1$, $\omicron=\omicron_1$. By exactness, $d_1$ is a strict supertype of~$d$. Hence $d_1$ is a strict supertype of~$d'$, implying $\monadic{v}_{d'}^1=\top$. We get $\sem{\ifexpr{e_1}{e_2}{e_3}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$ where $\monadic{v}_{d'}=\top$, $\gamma'_{d'}=\gamma_{d'}^1$, $\omicron'=\omicron'_1$. The desired claim follows. \end{itemize} \item Let $e=\forexpr{x}{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q'! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q'! D_2\mbox{,}\\ (x:q'),\Gamma\mbox{\ $\vdash$\ } e_3:q''! D_3\mbox{,}\\ q'=\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}\mbox{,}\quad q''=\qualty{t_1}{s_1}{d_1}\mbox{,}\quad t_0=\listty{q''}\mbox{,}\quad s_0=\mbox{\lstinline+$pre+}\mbox{,}\\ \gen{d_0}\supseteq\gen{s_1}\cup\gen{d_1}\cup D_3\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)\mbox{.} \end{array} \] By the induction hypothesis, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'}^1,\gamma_{d'}^1,\omicron'_1)$ where $\monadic{v}_d^1\coin{q'}{d'}\monadic{v}_{d'}^1$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$, $\omicron_1\coinpure{d'}\omicron'_1$. Now the induction hypothesis gives $\sem{e_2}_{d'}\gamma_{d'}^1\phi=\uopl{pure}(\monadic{v}_{d'}^2,\gamma_{d'}^2,\omicron'_2)$ where $\monadic{v}_d^2\coin{q'}{d'}\monadic{v}_{d'}^2$, $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$, $\omicron_2\coinpure{d'}\omicron'_2$. Consider two cases: \begin{itemize} \item If $\monadic{v}_d^1=\uopl{pure} i_1$, $\monadic{v}_d^2=\uopl{pure} i_2$ then, denoting $n=\max(0,i_2-i_1)$, we have \[ \begin{array}{l} \semd{e_3}((x,\uopl{pure} i_1),\gamma_d^2)\phi=\uopl{pure}(\monadic{v}_d^3,\gamma_d^3,\omicron_3)\mbox{,}\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma_d^3)\phi=\uopl{pure}(\monadic{v}_d^4,\gamma_d^4,\omicron_4)\mbox{,}\\ \dotfill\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma_d^{n+1})\phi=\uopl{pure}(\monadic{v}_d^{n+2},\gamma_d^{n+2},\omicron_{n+2})\mbox{,}\\ \monadic{v}_d=\uopl{pure}(\monadic{v}_d^3,\ldots,\monadic{v}_d^{n+2})\mbox{,}\quad\gamma'_d=\uopl{tail}\gamma_d^{n+2}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+2}\mbox{.} \end{array} \] As $\uopl{pure} i_1\coin{q'}{d'}\uopl{pure} i_1$ and $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$, we have $(x,\uopl{pure} i_1),\gamma_d^2\coin{\Gamma'}{d'}\left((x,\uopl{pure} i_1),\gamma_{d'}^2\right)$ where $\Gamma'=((x:q'),\Gamma)$. By the induction hypothesis, $\sem{e_3}_{d'}((x,\uopl{pure} i_1),\gamma_{d'}^2)\phi=\uopl{pure}(\monadic{v}_{d'}^3,\gamma_{d'}^3,\omicron'_3)$ where $\monadic{v}_d^3\coin{q''}{d'}\monadic{v}_{d'}^3$, $\gamma_d^3\coin{\Gamma'}{d'}\gamma_{d'}^3$ and $\omicron_3\coinpure{d'}\omicron'_3$. Replacing $i_1$ with $i_1+k$ does not violate the necessary properties, so we similarly get $\sem{e_3}_{d'}([x\mapsto\uopl{pure}(i_1+k-3)]\gamma_{d'}^{k-1})\phi=\uopl{pure}(\monadic{v}_{d'}^k,\gamma_{d'}^k,\omicron'_k)$ where $\monadic{v}_d^k\coin{q''}{d'}\monadic{v}_{d'}^k$, $\gamma_d^k\coin{\Gamma'}{d'}\gamma_{d'}^k$ and $\omicron_k\coinpure{d'}\omicron'_k$, for every $k=4,\ldots,n+2$. If $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$ then the above implies $\monadic{v}_{d'}^1=\uopl{pure} i_1$ and $\monadic{v}_{d'}^2=\uopl{pure} i_2$, whence we obtain $\sem{\forexpr{x}{e_1}{e_2}{e_3}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$ where $\monadic{v}_{d'}=\uopl{pure}(\monadic{v}_{d'}^3,\ldots,\monadic{v}_{d'}^{n+2})$, $\gamma'_{d'}=\gamma_{d'}^{n+2}$ and $\omicron'=\omicron'_1\ldots\omicron'_{n+2}$. Thus $\monadic{v}_d\coin{q_0}{d'}\monadic{v}_{d'}$, $\gamma'_d\coin{\Gamma}{d'}\gamma'_{d'}$, $\omicron\coinpure{d'}\omicron'$ and the desired claim follows. If $d_0$ is a strict superdomain of~$d'$ then $\monadic{v}_{d'}^1=\monadic{v}_{d'}^2=\top$ and $\sem{\forexpr{x}{e_1}{e_2}{e_3}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$ where $\monadic{v}_{d'}=\top$, $\gamma'_{d'}=\gamma_{d'}^2$, $\omicron'=\omicron'_1\omicron'_2$. Then $\monadic{v}_d^{n+2}\coin{q_0}{d'}\top$ vacuously. Assuming $d'\in D_3$ would give $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$ by $\gen{d_0}\supseteq D_3$, hence $d'\notin D_3$. So Theorem~\ref{semantics:effthm} implies \[ \begin{array}{l} \left((x,\uopl{pure} i_1),\gamma_d^2\right)\coin{\Gamma'}{d'}\gamma_d^3\mbox{,}\\{} [x\mapsto\uopl{pure}(i_1+1)]\gamma_d^3\coin{\Gamma'}{d'}\gamma_d^4\mbox{,}\\ \dotfill\\{} [x\mapsto\uopl{pure}(i_1+n-1)]\gamma_d^{n+1}\coin{\Gamma'}{d'}\gamma_d^{n+2}\mbox{.} \end{array} \] We also have $\gamma_d^k\coin{\Gamma'}{d'}[x\mapsto\uopl{pure}(i_1+k-2)]\gamma_d^k$ for every $k=3,\ldots,n+1$ since monadic values of the additional variable~$x$ are coincident vacuously. Lemma~\ref{semantics:coinlemma} now implies $\left((x,\uopl{pure} i_1),\gamma_d^2\right)\coin{\Gamma'}{d'}\gamma_d^{n+2}$. Hence also $\gamma_d^2\coin{\Gamma}{d'}\uopl{tail}\gamma_d^{n+2}$. As we also have $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$, Lemma~\ref{semantics:coinlemma} gives $\gamma_d^{n+2}\coin{\Gamma}{d'}\gamma_{d'}^2$. Furthermore, as $d'\notin D_3$ implies $\mbox{\lstinline+@public+}\notin D_3$ by $D_3$ being upward closed, Theorem~\ref{semantics:outputthm} gives $\omicron_3=\ldots=\omicron_{n+2}=\epsilon$. Hence $\omicron=\omicron_1\omicron_2$ and the desired result follows. \item If $\monadic{v}_d^1=\top$ or $\monadic{v}_d^2=\top$ then \[ \monadic{v}_d=\top\mbox{,}\quad\gamma'_d=\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \] By exactness, $d_0$ is a strict superdomain of~$d$, implying that $d_0$ is also a strict superdomain of~$d'$. Hence, by exactness, $\monadic{v}_{d'}^1=\top$ or $\monadic{v}_{d'}^2=\top$, implying $\sem{\forexpr{x}{e_1}{e_2}{e_3}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$ where $\monadic{v}_{d'}=\top$, $\gamma'_{d'}=\gamma_{d'}^2$, $\omicron'=\omicron'_1\omicron'_2$. The desired claim follows. \end{itemize} \item Let $e=\wireexpr{e_1}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q'\mbox{,}\\ s_0=\mbox{\lstinline+$post+}\mbox{,}\quad q'=\qualty{t_0}{\mbox{\lstinline+$pre+}}{d_0}\mbox{,} \end{array} \] where $t_0$ is $\uintmodty{\mbox{\lstinline+N+}}$ or $\boolmodty{\mbox{\lstinline+N+}}$, and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \monadic{v}_d=\monadic{v}_d^1\mbox{,}\quad\gamma'_d=\gamma_d^1\mbox{,}\quad\omicron=\lam{d''}{\branching{(\omicron_1)_{d''}\monadic{v}_d^1&\mbox{if $d''=d_0$}\\(\omicron_1)_{d''}&\mbox{otherwise}}}\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'}^1,\gamma_{d'}^1,\omicron'_1)$ where $\monadic{v}_d^1\coin{q'}{d'}\monadic{v}_{d'}^1$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$ and $\omicron_1\coinpure{d'}\omicron'_1$. Hence \[ \begin{array}{l} \sem{\wireexpr{e_1}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')\mbox{,}\\ \monadic{v}_{d'}=\monadic{v}_{d'}^1\mbox{,}\quad\gamma'_{d'}=\gamma_{d'}^1\mbox{,}\quad\omicron'=\lam{d''}{\branching{(\omicron'_1)_{d''}\monadic{v}_{d'}^1&\mbox{if $d''=d_0$}\\(\omicron'_1)_{d''}&\mbox{otherwise}}}\mbox{.} \end{array} \] The claim $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$ follows since relations $\coin{q}{d'}$ and $\coin{q'}{d'}$ are equal. The claim $\gamma'_d\coin{\Gamma}{d'}\gamma'_{d'}$ is implied by the above. Finally, $\monadic{v}_d^1\coin{q}{d'}\monadic{v}_{d'}^1$ means that if $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$ then $\monadic{v}_d^1=\uopl{pure} v_d^1=\monadic{v}_{d'}^1$ where $v_d^1\in\mathbb{N}\cup\mathbb{B}$. Hence if $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$ then $\omicron_{d_0}=\omicron'_{d_0}$. If $d_0$~{}is a strict superdomain of~$d'$ then the lengths of $\omicron_{d_0}$ and $\omicron'_{d_0}$ are equal since both are one more than the common length of $(\omicron_1)_{d_0}$ and $(\omicron'_1)_{d_0}$. \item Let $e=\castexpr{e_1}{d_0}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q'\mbox{,}\\ q'=\qualty{t_0}{s_0}{d_1}\mbox{,}\quad d_1\mathrel{\mathchar"13C\mathchar"3A} d_0\mbox{,}\quad\gen{d_0}\supseteq\gen{t_0} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \monadic{v}_d=\branching{\monadic{v}_d^1&\mbox{if $d_0\mathrel{\mathchar"13C\mathchar"3A} d$}\\\top&\mbox{otherwise}}\mbox{,}\quad\gamma'_d=\gamma_d^1\mbox{,}\quad\omicron=\omicron_1\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'}^1,\gamma_{d'}^1,\omicron'_1)$ where $\monadic{v}_d^1\coin{q'}{d'}\monadic{v}_{d'}^1$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$, $\omicron_1\coinpure{d'}\omicron'_1$. By Lemma~\ref{semantics:castcoinlemma}, the first of these implies $\monadic{v}_d^1\coin{q}{d'}\monadic{v}_{d'}^1$. We obtain $\sem{\castexpr{e_1}{d_0}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$ where $\monadic{v}_{d'}=\branching{\monadic{v}_{d'}^1&\mbox{if $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$}\\\top&\mbox{otherwise}}$, $\gamma'_{d'}=\gamma_{d'}^1$, $\omicron'=\omicron'_1$. Consider two cases: \begin{itemize} \item If $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$ then $d_0\mathrel{\mathchar"13C\mathchar"3A} d$, implying $\monadic{v}_d=\monadic{v}_d^1$ and $\monadic{v}_{d'}=\monadic{v}_{d'}^1$. The desired claim follows. \item If $d_0$ is a strict superdomain of~$d'$ then $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$ holds vacuously. The desired claim follows. \end{itemize} \item Let $e=(\assignexpr{e_1}{e_2})$. Then $q=\qualty{\mbox{\lstinline+()+}}{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}}$. Let $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$. By Lemma~\ref{typesystem:lhslemma}, \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } y_k:q_k\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } x:q'\mbox{,}\\ q_k=\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_k}\mbox{,}\quad q'=\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q_{n+1}}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1} \end{array} \] and \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q_{n+1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q_{n+1}\mbox{,}\\ q_{n+1}=\qualty{t}{s}{d_{n+1}}\mbox{.} \end{array} \] We also have \[ \begin{array}{l} \semd{y_1}\gamma_d\phi=\uopl{pure}(\monadic{i}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{y_2}\gamma_d^1\phi=\uopl{pure}(\monadic{i}_d^2,\gamma_d^2,\omicron_2)\mbox{,}\\ \dotfill\\ \semd{y_n}\gamma_d^{n-1}\phi=\uopl{pure}(\monadic{i}_d^n,\gamma_d^n,\omicron_n)\mbox{,}\\ \semd{e_2}\gamma_d^n\phi=\uopl{pure}(\monadic{r}_d,\gamma_d^{n+1},\omicron_{n+1})\mbox{,}\\ \monadic{v}_d=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'_d=[x\mapsto\uopl{upd}(\lookup{\gamma_d}{x},\monadic{i}_d^1\ldots\monadic{i}_d^n,\monadic{r}_d)]\gamma_d^{n+1}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+1}\mbox{.} \end{array} \] Applying repeatedly the induction hypothesis, we get $\sem{y_k}_{d'}\gamma_{d'}^{k-1}\phi=\uopl{pure}(\monadic{i}_{d'}^k,\gamma_{d'}^k,\omicron'_k)$ where $\monadic{i}_d^k\coin{q_k}{d'}\monadic{i}_{d'}^k$, $\gamma_d^k\coin{\Gamma}{d'}\gamma_{d'}^k$ and $\omicron_k\coinpure{d'}\omicron'_k$ for each $k=1,\ldots,n$ (denoting $\gamma_{d'}^0=\gamma_{d'}$). In addition, $\sem{e_2}_{d'}\gamma_{d'}^n\phi=\uopl{pure}(\monadic{r}_{d'},\gamma_{d'}^{n+1},\omicron'_{k+1})$ where $\monadic{r}_d\coin{q_{n+1}}{d'}\monadic{r}_{d'}$, $\gamma_d^{n+1}\coin{\Gamma}{d'}\gamma_{d'}^{n+1}$ and $\omicron_{n+1}\coinpure{d'}\omicron'_{n+1}$. By Lemma~\ref{semantics:updexactcoinlemma}, $\uopl{upd}(\lookup{\gamma_{d'}}{x},\monadic{i}_{d'}^1\ldots\monadic{i}_{d'}^n,\monadic{r}_{d'})$ is well-defined and \[ \uopl{upd}(\lookup{\gamma_d}{x},\monadic{i}_d^1\ldots\monadic{i}_d^n,\monadic{r}_d)\coin{q'}{d'}\uopl{upd}(\lookup{\gamma_{d'}}{x},\monadic{i}_{d'}^1\ldots\monadic{i}_{d'}^n,\monadic{r}_{d'})\mbox{.} \] We conclude $[x\mapsto\uopl{upd}(\lookup{\gamma_d}{x},\monadic{i}_d^1\ldots\monadic{i}_d^n,\monadic{r}_d)]\gamma_d^{n+1}\coin{\Gamma}{d'}[x\mapsto\uopl{upd}(\lookup{\gamma_{d'}}{x},\monadic{i}_{d'}^1\ldots\monadic{i}_{d'}^n,\monadic{r}_{d'})]\gamma_{d'}^{n+1}$ and the desired claim follows. \item Let $e=\loadexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q_2\mbox{,}\\ q_1=\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_1}\mbox{,}\quad q_2=\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_1} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{a}_d,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{i}_d,\gamma_d^2,\omicron_2)\mbox{,}\\ \monadic{v}_d=\mcomp{a_d\gets\monadic{a}_d;\; i_d\gets\monadic{i}_d;\; (a_d)_{i_d}}\mbox{,}\quad\gamma'_d=\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about $e_1$, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{a}_{d'},\gamma_{d'}^1,\omicron'_1)$ where $\monadic{a}_d\coin{q_1}{d'}\monadic{a}_{d'}$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$ and $\omicron_1\coinpure{d'}\omicron'_1$. Hence by the induction hypothesis about $e_2$, $\sem{e_2}_{d'}\gamma_{d'}^1\phi=\uopl{pure}(\monadic{i}_{d'},\gamma_{d'}^2,\omicron'_2)$ where $\monadic{i}_d\coin{q_2}{d'}\monadic{i}_{d'}$, $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$ and $\omicron_2\coinpure{d'}\omicron'_2$. Thus \[ \begin{array}{l} \sem{\loadexpr{e_1}{e_2}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')\mbox{,}\\ \monadic{v}_{d'}=\mcomp{a_{d'}\gets\monadic{a}_{d'};\; i_{d'}\gets\monadic{i}_{d'};\;(a_{d'})_{i_{d'}}}\mbox{,}\quad\gamma'_{d'}=\gamma_{d'}^2\mbox{,}\quad\omicron'=\omicron'_1\omicron'_2\mbox{.} \end{array} \] Consider two cases: \begin{itemize} \item If $d_0\mathrel{\mathchar"13C\mathchar"3A} d'$ then, by $q$ being well-structured, also $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0\mathrel{\mathchar"13C\mathchar"3A} d'\mathrel{\mathchar"13C\mathchar"3A} d$. Hence we have $\monadic{a}_d=\uopl{pure}(\monadic{a}_d^1,\ldots,\monadic{a}_d^n)$, $\monadic{i}_d=\uopl{pure} i_d$, $\monadic{a}_{d'}=\uopl{pure}(\monadic{a}_{d'}^1,\ldots,\monadic{a}_{d'}^n)$, $\monadic{i}_{d'}=\uopl{pure} i_{d'}$ where $\monadic{a}_d^k\coin{q}{d'}\monadic{a}_{d'}^k$ for every $k=1,\ldots,n$ and $n\geq i_d=i_{d'}\in\mathbb{N}$. This implies $\monadic{v}_d=\monadic{a}_d^{i_d}$ and $\monadic{v}_{d'}=\monadic{a}_{d'}^{i_{d'}}$, whence $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$. \item If $d_0$ is a strict supertype of~$d'$ then $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$ holds vacuously. \end{itemize} Along with $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$ and $\omicron_1\omicron_2\coinpure{d'}\omicron'_1\omicron'_2$, this implies the desired claim. \item Let $e=\stmtcomp{\letexpr{x}{e_1}}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q_1\mbox{,}\\ (x:q_1),\Gamma\mbox{\ $\vdash$\ } e_2:q \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}((x,\monadic{v}_d^1),\gamma_d^1)\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)\mbox{,}\\ \monadic{v}_d=\monadic{v}_d^2\mbox{,}\quad\gamma'_d=\uopl{tail}\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about $e_1$, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'}^1,\gamma_{d'}^1,\omicron'_1)$ where $\monadic{v}_d^1\coin{q_1}{d'}\monadic{v}_{d'}^1$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$ and $\omicron_1\coinpure{d'}\omicron'_1$. Denoting $\Gamma'=((x:q_1),\Gamma)$, we therefore obtain $\left((x,\monadic{v}_d^1),\gamma_d^1\right)\coin{\Gamma'}{d'}\left((x,\monadic{v}_{d'}^1),\gamma_{d'}^1\right)$. By the induction hypothesis about $e_2$, $\sem{e_2}_{d'}((x,\monadic{v}_{d'}^1),\gamma_{d'}^1)\phi=\uopl{pure}(\monadic{v}_{d'}^2,\gamma_{d'}^2,\omicron'_2)$ where $\monadic{v}_d^2\coin{q}{d'}\monadic{v}_{d'}^2$, $\gamma_d^2\coin{\Gamma'}{d'}\gamma_{d'}^2$ and $\omicron_2\coinpure{d'}\omicron'_2$. Thus also $\uopl{tail}\gamma_d^2\coin{\Gamma}{d'}\uopl{tail}\gamma_{d'}^2$. As \[ \begin{array}{l} \sem{\stmtcomp{\letexpr{x}{e_1}}{e_2}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')\mbox{,}\\ \monadic{v}_{d'}=\monadic{v}_{d'}^2\mbox{,}\quad\gamma'_{d'}=\uopl{tail}\gamma_{d'}^2\mbox{,}\quad\omicron'=\omicron'_1\omicron'_2\mbox{,} \end{array} \] the desired claim follows. \item Let $e=\stmtcomp{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)\mbox{,}\\ \monadic{v}_d=\monadic{v}_d^2\mbox{,}\quad\gamma'_d=\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about $e_1$, $\sem{e_1}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'}^1,\gamma_{d'}^1,\omicron'_1)$ where $\monadic{v}_d^1\coin{q_1}{d'}\monadic{v}_{d'}^1$, $\gamma_d^1\coin{\Gamma}{d'}\gamma_{d'}^1$ and $\omicron_1\coinpure{d'}\omicron'_1$. By the induction hypothesis about $e_2$, $\sem{e_2}_{d'}\gamma_{d'}^1\phi=\uopl{pure}(\monadic{v}_{d'}^2,\gamma_{d'}^2,\omicron'_2)$ where $\monadic{v}_d^2\coin{q}{d'}\monadic{v}_{d'}^2$, $\gamma_d^2\coin{\Gamma}{d'}\gamma_{d'}^2$ and $\omicron_2\coinpure{d'}\omicron'_2$. As \[ \begin{array}{l} \sem{\stmtcomp{e_1}{e_2}}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')\mbox{,}\\ \monadic{v}_{d'}=\monadic{v}_{d'}^2\mbox{,}\quad\gamma'_{d'}=\gamma_{d'}^2\mbox{,}\quad\omicron'=\omicron'_1\omicron'_2\mbox{,} \end{array} \] the desired claim follows. \end{itemize} \end{proof} \begin{theorem}[Theorem~\ref{semantics:correctness}] Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$. Let $\gamma_d$, $\gamma\in\mathbf{Env}$ be $\Gamma$-exact in $\mbox{\lstinline+@prover+}$ and in circuit, respectively, such that $\gamma_d\coincirc{\Gamma}\gamma$. Assume that, for all subexpressions of~$e$ of the form $\ofty{\getexpr{d'}{k}}{q'}$, the value $\uopl{allpure}(\phi_{d'}(k))$ is $q'$-exact in $\mbox{\lstinline+@prover+}$. Assume that, for $d=\mbox{\lstinline+@prover+}$, there exist $\monadic{v}_d,\gamma'_d,\omicron$ such that $\semd{e}\gamma_d\phi=\uopl{pure}(\monadic{v}_d,\gamma'_d,\omicron)$. If $\rho$~{}is any pair of stream continuations (one for each of $\mbox{\lstinline+@prover+}$ and $\mbox{\lstinline+@verifier+}$) then $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$, where $\monadic{v}$ is $q$-exact and $\gamma'$ is $\Gamma$-exact in circuit. Thereby, $\monadic{v}_d\coincirc{q}\monadic{v}$ and $\gamma'_d\coincirc{\Gamma}\gamma'$. (Here, $\omicron\rho$ denotes the pointwise concatenation of $\omicron$ and $\rho$.) \end{theorem} \begin{proof} Let $q=\qualty{t_0}{s_0}{d_0}$. We proceed by induction on the structure of~$e$: \begin{itemize} \item Let $e=\epsilon$. Then $t_0=\mbox{\lstinline+()+}$, $s_0=\mbox{\lstinline+$pre+}$, $d_0=\mbox{\lstinline+@public+}$ and we have $\monadic{v}_d=\uopl{pure}\mbox{\textoneoldstyle}$, $\gamma'_d=\gamma_d$, $\omicron=\epsilon$. We also have $\sem{e}\gamma\phi\rho=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}$ and $\gamma'=\gamma$. As $d_0=\mbox{\lstinline+@public+}$ and $t_0$ is primitive, establishing that $\uopl{pure}\mbox{\textoneoldstyle}$ is $q$-exact in circuit reduces to clause~1 of Definition~\ref{semantics:exactdef}. It holds since $\mbox{\textoneoldstyle}\in\mbox{\lstinline+()+}$. Similarly, we obtain $\uopl{pure}\mbox{\textoneoldstyle}\coincirc{q}\uopl{pure}\mbox{\textoneoldstyle}$. By assumption, $\gamma'$ is $\Gamma$-exact in circuit and $\gamma'_d\coincirc{\Gamma}\gamma'$. \item Let $e=\overline{n}$ where $n\in\mathbb{N}$. Then $t_0=\uintmodty{\mbox{\lstinline+N+}}$ and $\monadic{v}_d=\uopl{pure} n$, $\gamma'_d=\gamma_d$, $\omicron=\epsilon$. We also have $\sem{e}\gamma\phi\rho=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\branching{\uopl{pure} n&\mbox{if $s_0=\mbox{\lstinline+$post+}$ or $d_0=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}}$ and $\gamma'=\gamma$. By assumption, $\gamma'$ is $\Gamma$-exact in circuit and $\gamma'_d\coincirc{\Gamma}\gamma'$. Furthermore, we have to study two cases: \begin{itemize} \item If $s_0=\mbox{\lstinline+$post+}$ or $d_0=\mbox{\lstinline+@public+}$ then $\monadic{v}=\uopl{pure} n$. As $t_0$ is primitive, establishing that $\monadic{v}$ is $q$-exact in circuit reduces to clause~1 of Definition~\ref{semantics:exactdef}. It holds since $n$ is an integer. Similarly, we obtain $\uopl{pure} n\coincirc{q}\uopl{pure} n$. \item If $s_0=\mbox{\lstinline+$pre+}$ and $d_0\ne\mbox{\lstinline+@public+}$ then $\monadic{v}=\top$ and establishing that $\monadic{v}$ is $q$-exact in circuit reduces to clause~3 of Definition~\ref{semantics:exactdef}. The former equality is exactly what clause~3 requires. The claim $\monadic{v}_d\coincirc{q}\monadic{v}$ holds vacuously. \end{itemize} \item Let $e=\overline{b}$ where $b\in\mathbb{B}$. This case is analogous to the previous one. \item Let $e=x$. Then $\lookup{\Gamma}{x}=q$ and $\monadic{v}_d=\lookup{\gamma_d}{x}$, $\gamma'_d=\gamma_d$, $\omicron=\epsilon$. We also have $\sem{e}\gamma\phi\rho=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\lookup{\gamma}{x}$, $\gamma'=\gamma$. Hence $\monadic{v}$ is $q$-exact in circuit by the assumption that $\gamma$ is $\Gamma$-exact in circuit and Lemma~\ref{semantics:lookupexactlemma}. Also $\gamma'$ being $\Gamma$-exact in circuit directly follows from assumption. Finally, $\monadic{v}_d\coincirc{q}\monadic{v}$ by $\gamma_d\coincirc{\Gamma}\gamma$, and $\gamma'_d\coincirc{\Gamma}\gamma'$ by assumption. \item Let $e=\addexpr{e_1}{e_2}$. Then $t_0=\uintmodty{\mbox{\lstinline+N+}}$ and \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,} \end{array} \] and also \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)\mbox{,}\\ \monadic{v}_d=\mcomp{v_d^1\gets\monadic{v}_d^1;\; v_d^2\gets\monadic{v}_d^2;\;\uopl{pure}(v_d^1+v_d^2)},\quad\gamma'_d=\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By $\monadic{v}_d^1,\monadic{v}_d^2$ being $q$-exact in $\mbox{\lstinline+@prover+}$, we must have $\monadic{v}_d^1=\uopl{pure} v_d^1$ and $\monadic{v}_d^2=\uopl{pure} v_d^2$, whence $\monadic{v}_d=\uopl{pure}(v_d^1+v_d^2)$. By the induction hypothesis about~$e_1$, $\sem{e_1}\gamma\phi(\omicron_1\omicron_2\rho)=\uopl{pure}(\monadic{v}^1,\gamma^1,\omicron_2\rho)$ where $\monadic{v}^1$ is $q$-exact and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{v}_d^1\coincirc{q}\monadic{v}^1$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. Now by the induction hypothesis about~$e_2$, $\sem{e_2}\gamma^1\phi(\omicron_1\rho)=\uopl{pure}(\monadic{v}^2,\gamma^2,\rho)$ where $\monadic{v}^2$ is $q$-exact and $\gamma^2$ is $\Gamma$-exact in circuit, $\monadic{v}_d^2\coincirc{q}\monadic{v}^2$ and $\gamma_d^2\coincirc{\Gamma}\gamma^2$. Hence $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where \[ \monadic{v}=\mcomp{v^1\gets\monadic{v}^1;\; v^2\gets\monadic{v}^2;\;\uopl{pure}(v^1+v^2)},\quad\gamma'=\gamma^2\mbox{.} \] Then $\gamma'$ being $\Gamma$-exact in circuit and $\gamma'_d\coincirc{\Gamma}\gamma'$ are implied by the above. Finally, we have to consider two cases: \begin{itemize} \item If $s_0=\mbox{\lstinline+$post+}$ or $d_0=\mbox{\lstinline+@public+}$ then, by $\monadic{v}^1$ and $\monadic{v}^2$ being $q$-exact in circuit, we have $\monadic{v}^1=\uopl{pure} v^1$ and $\monadic{v}^2=\uopl{pure} v^2$ for integers $v^1,v^2$. Hence $\monadic{v}=\uopl{pure}(v^1+v^2)$ which shows that $\monadic{v}$ is $q$-exact in circuit by clause~1 of Definition~\ref{semantics:exactdef}. Moreover, $\monadic{v}_d^1\coincirc{q}\monadic{v}^1$ and $\monadic{v}_d^2\coincirc{q}\monadic{v}^2$ imply $v_d^1=v^1$ and $v_d^2=v^2$. Hence $\monadic{v}_d\coincirc{q}\monadic{v}$. \item If $s_0=\mbox{\lstinline+$pre+}$ and $d_0\ne\mbox{\lstinline+@public+}$ then, by $\monadic{v}^1$ and $\monadic{v}^2$ being $q$-exact in circuit, we have $\monadic{v}^1=\monadic{v}^2=\top$ and hence also $\monadic{v}=\top$. By clause~3 of Definition~\ref{semantics:exactdef}, $\monadic{v}$ is $q$-exact in circuit. The claim $\monadic{v}_d\coincirc{q}\monadic{v}$ holds vacuously. \end{itemize} \item Let $e=\assertexpr{e_1}$. Then $t_0=\mbox{\lstinline+()+}$, $s_0=\mbox{\lstinline+$pre+}$, $d_0=\mbox{\lstinline+@public+}$ and \[ \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$post+}}{d_1}! D \] and also \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \monadic{v}_d^1\ne\uopl{pure}\mbox{\bfseries ff}\mbox{,}\quad\monadic{v}_d=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'_d=\gamma_d^1\mbox{,}\quad\omicron=\omicron_1\mbox{.} \end{array} \] Denote $q_1=(\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$post+}}{d_1})$. By $\monadic{v}_d^1$ being $q_1$-exact in $\mbox{\lstinline+@prover+}$ and $\monadic{v}_d^1\ne\uopl{pure}\mbox{\bfseries ff}$, the only possibility is $\monadic{v}_d^1=\uopl{pure}\mbox{\bfseries tt}$. By the induction hypothesis about $e_1$, $\sem{e_1}\gamma\phi(\omicron_1\rho)=\uopl{pure}(\monadic{v}^1,\gamma^1,\rho)$ where $\monadic{v}^1$ is $q_1$-exact and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{v}_d^1\coincirc{q_1}\monadic{v}^1$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. Hence $\monadic{v}^1\ne\uopl{pure}\mbox{\bfseries ff}$ since $e_1$ is in $\mbox{\lstinline+$post+}$ which implies that $\uopl{pure}\mbox{\bfseries tt}$ and $\uopl{pure}\mbox{\bfseries ff}$ cannot be $q_1$-coincident in circuit. Consequently, $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}$, $\gamma'=\gamma^1$, whence we have $\monadic{v}$ being $q$-exact in circuit and $\monadic{v}_d\coincirc{q}\monadic{v}$. By the above, we also have $\gamma'$ being $\Gamma$-exact in circuit and $\gamma'_d\coincirc{\Gamma}\gamma'$. \item Let $e=\ofty{\getexpr{d'}{k}}{q}$. Then $\uopl{allpre}_{d'}(q)$, implying $s_0=\mbox{\lstinline+$pre+}$ and $d_0=d'$. Moreover, $\monadic{v}_d=\uopl{allpure}(\phi_{d'}(k))$, $\gamma'_d=\gamma_d$ and $\omicron=\epsilon$. We also have $\sem{e}\gamma\phi\rho=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\branching{\uopl{allpure}(\phi_{d'}(k))&\mbox{if $d'=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}}$ and $\gamma'=\gamma$. Hence, by assumptions, $\gamma'$ is $\Gamma$-exact in circuit and $\gamma'_d\coincirc{\Gamma}\gamma'$. For the other desired claims, consider two cases: \begin{itemize} \item If $d'=\mbox{\lstinline+@public+}$ then $\monadic{v}_d=\uopl{allpure}(\phi_{d'}(k))=\monadic{v}$, implying $\monadic{v}_d\coincirc{q}\monadic{v}$. Moreover, $\monadic{v}$ is $q$-exact in circuit by Lemma~\ref{semantics:approxcirclemma}. \item If $d'\ne\mbox{\lstinline+@public+}$ then $\monadic{v}=\top$ which is $q$-exact since $s_0=\mbox{\lstinline+$pre+}$. Finally, $\monadic{v}_d\coincirc{q}\monadic{v}$ holds vacuously. \end{itemize} \item Let $e=\ifexpr{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_3:q! D_3\mbox{,}\\ \gen{d_1}\supseteq\gen{s_0}\cup \gen{d_0}\cup D_2\cup D_3\mbox{,} \end{array} \] and \[ \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{.} \] Denote $q_1=(\qualty{\boolmodty{\mbox{\lstinline+N+}}}{\mbox{\lstinline+$pre+}}{d_1})$. Note that $\monadic{v}_d^1$ is $q_1$-exact in $\mbox{\lstinline+@prover+}$, whence $\monadic{v}_d^1=\uopl{pure} v_d^1$ where $v_d^1\in\left\{\mbox{\bfseries tt},\mbox{\bfseries ff}\right\}$. Thus we have to consider two cases: \begin{itemize} \item If $\monadic{v}_d^1=\uopl{pure}\mbox{\bfseries tt}$ then $\semd{e_2}\gamma_d^1\phi\omicron_1=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)$, $\monadic{v}_d=\monadic{v}_d^2$, $\gamma'_d=\gamma_d^2$, $\omicron=\omicron_1\omicron_2$. By the induction hypothesis about $e_1$, $\sem{e_1}\gamma\phi(\omicron_1\omicron_2\rho)=\uopl{pure}(\monadic{v}^1,\gamma^1,\omicron_2\rho)$ where $\monadic{v}^1$ is $q_1$-exact and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{v}_d^1\coincirc{q_1}\monadic{v}^1$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. If $d_1=\mbox{\lstinline+@public+}$ then $\monadic{v}_d^1\coincirc{q_1}\monadic{v}^1$ implies $\monadic{v}^1=\uopl{pure}\mbox{\bfseries tt}$. By the induction hypothesis about $e_2$, $\sem{e_2}\gamma^1\phi(\omicron_2\rho)=\uopl{pure}(\monadic{v}^2,\gamma^2,\rho)$ where $\monadic{v}^2$ is $q$-exact and $\gamma^2$ is $\Gamma$-exact in circuit, $\monadic{v}_d^2\coincirc{q}\monadic{v}^2$ and $\gamma_d^2\coincirc{\Gamma}\gamma^2$. Hence $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\monadic{v}^2$ and $\gamma'=\gamma^2$. The desired claim follows in this case. If $d_1\ne\mbox{\lstinline+@public+}$ then $\monadic{v}^1$ being $q_1$-exact in circuit implies $\monadic{v}^1=\top$. As $\gen{d_1}\supseteq D_2$ implies $\mbox{\lstinline+@public+}\notin D_2$, Theorems~\ref{semantics:outputthm} and~\ref{semantics:effcircthm} imply $\omicron_2=\epsilon$ and $\gamma_d^1\coincirc{q}\gamma_d^2$. Hence $\sem{e}\gamma\phi(\omicron\rho)=\sem{e}\gamma\phi(\omicron_1\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\top$ and $\gamma'=\gamma^1$. As $\gen{d_1}\supseteq\gen{d_0}$ implies $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$, also $d_0\ne\mbox{\lstinline+@public+}$. As $\gen{d_1}\supseteq\gen{s_0}$ implies $s_0=\mbox{\lstinline+$pre+}$, this means that $\top$ is $q$-exact in circuit and $\monadic{v}_d\coincirc{q}\top$ vacuously. We also have $\gamma'_d\coincirc{\Gamma}\gamma'$ because of $\gamma_d^1\coincirc{q}\gamma_d^2$, $\gamma_d^1\coincirc{q}\gamma^1$ and Lemma~\ref{semantics:coinlemma}. Finally, $\gamma'$ is $\Gamma$-exact in circuit by the above. \item The case $\monadic{v}_d^1=\uopl{pure}\mbox{\bfseries ff}$ is analogous. \end{itemize} \item Let $e=\forexpr{x}{e_1}{e_2}{e_3}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}! D_2\mbox{,}\\ (x:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0}),\Gamma\mbox{\ $\vdash$\ } e_3:\qualty{t_1}{s_1}{d_1}! D_3\mbox{,}\\ \gen{d_0}\supseteq\gen{s_1}\cup\gen{d_1}\cup D_3\mbox{,}\\ t_0=\listty{\qualty{t_1}{s_1}{d_1}}\mbox{,}\quad s_0=\mbox{\lstinline+$pre+}\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)\mbox{.} \end{array} \] Denote $q'=(\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_0})$ and $q_1=(\qualty{t_1}{s_1}{d_1})$. Note that $\monadic{v}_d^1,\monadic{v}_d^2$ are $q'$-exact in $\mbox{\lstinline+@prover+}$ by Theorem~\ref{semantics:localthm}. Hence $\monadic{v}_d^1=\uopl{pure} i_1$ and $\monadic{v}_d^2=\uopl{pure} i_2$ where $i_1,i_2\in\mathbb{N}$. Denoting $n=\max(0,i_2-i_1)$, we obtain \[ \begin{array}{l} \semd{e_3}((x,\uopl{pure} i_1),\gamma_d^2)\phi=\uopl{pure}(\monadic{v}_d^3,\gamma_d^3,\omicron_3)\mbox{,}\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+1)]\gamma_d^3)\phi=\uopl{pure}(\monadic{v}_d^4,\gamma_d^4,\omicron_4)\mbox{,}\\ \dotfill\\ \semd{e_3}([x\mapsto\uopl{pure}(i_1+n-1)]\gamma_d^{n+1})\phi=\uopl{pure}(\monadic{v}_d^{n+2},\gamma_d^{n+2},\omicron_d^{n+2})\mbox{,}\\ \monadic{v}_d=\uopl{pure}(\monadic{v}_d^3,\ldots,\monadic{v}_d^{n+2})\mbox{,}\quad\gamma'_d=\uopl{tail}\gamma_d^{n+2}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+2}\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\sem{e_1}\gamma\phi(\omicron_1\ldots\omicron_{n+2}\rho)=\uopl{pure}(\monadic{v}^1,\gamma^1,\omicron_2\ldots\omicron_{n+2}\rho)$ where $\monadic{v}^1$ is $q'$-exact and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{v}_d^1\coincirc{q'}\monadic{v}^1$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. Hence by the induction hypothesis about~$e_2$, $\sem{e_2}\gamma^1\phi(\omicron_2\ldots\omicron_{n+2}\rho)=\uopl{pure}(\monadic{v}^2,\gamma^2,\omicron_3\ldots\omicron_{n+2}\rho)$ where $\monadic{v}^2$ is $q'$-exact and $\gamma^2$ is $\Gamma$-exact in circuit, $\monadic{v}_d^2\coincirc{q'}\monadic{v}^2$ and $\gamma_d^2\coincirc{\Gamma}\gamma^2$. If $d_0=\mbox{\lstinline+@public+}$ then $\monadic{v}_d^1\coincirc{q'}\monadic{v}^1$ and $\monadic{v}_d^2\coincirc{q'}\monadic{v}^2$ imply $\monadic{v}^1=\uopl{pure} i_1$ and $\monadic{v}^2=\uopl{pure} i_2$. As $\gamma^2$ is $\Gamma$-exact and $\uopl{pure} i_1$ is $q'$-exact in circuit, the updated environment $\left((x,\uopl{pure} i_1),\gamma^2\right)$ is $((x:q'),\Gamma)$-exact in circuit. Moreover, $\gamma_d^2\coincirc{\Gamma}\gamma^2$ and $\uopl{pure} i_1\coincirc{q'}\uopl{pure} i_1$ together give $\left((x,\uopl{pure} i_1),\gamma_d^2\right)\coincirc{\Gamma'}\left((x,\uopl{pure} i_1),\gamma^2\right)$ where $\Gamma'=((x:q'),\Gamma)$. Hence the induction hypothesis about~$e_3$ applies and gives $\sem{e_3}\gamma^2\phi(\omicron_3\ldots\omicron_{n+2}\rho)=\uopl{pure}(\monadic{v}^3,\gamma^3,\omicron_4\ldots\omicron_{n+2}\rho)$ where $\monadic{v}^3$ is $q_1$-exact and $\gamma_3$ is $\Gamma'$-exact in circuit, $\monadic{v}_d^3\coincirc{q_1}\monadic{v}^3$ and $\gamma_d^3\coincirc{\Gamma'}\gamma^3$. Replacing $i_1$ by $i_1+1$ does not violate the required properties, so we analogously obtain $\sem{e_3}\gamma^{k-1}\phi(\omicron_k\ldots\omicron_{n+2}\rho)=\uopl{pure}(\monadic{v}^k,\gamma^k,\omicron_{k+1}\ldots\omicron_{n+2}\rho)$ where $\monadic{v}^k$ is $q_1$-exact in circuit and $\monadic{v}_d^k\coincirc{q_1}\monadic{v}^k$ for all $k=3,4,\ldots,n+2$, $\gamma^{n+2}$ is $\Gamma'$-exact in circuit and $\gamma_d^{n+2}\coincirc{\Gamma'}\gamma^{n+2}$. Obviously the latter implies $\uopl{tail}\gamma^{n+2}$ being $\Gamma$-exact in circuit and $\uopl{tail}\gamma_d^{n+2}\coincirc{\Gamma}\uopl{tail}\gamma^{n+2}$. Thus we obtain $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\uopl{pure}(\monadic{v}^3,\ldots,\monadic{v}^{n+2})$ and $\gamma'=\gamma^{n+2}$. By clause~2 of Definitions~\ref{semantics:exactdef} and~\ref{semantics:coincidentdef}, $\uopl{pure}(\monadic{v}^3,\ldots,\monadic{v}^{n+2})$ is $q$-exact in circuit and $\uopl{pure}(\monadic{v}_d^3,\ldots,\monadic{v}_d^{n+2})\coincirc{q}\uopl{pure}(\monadic{v}^3,\ldots,\monadic{v}^{n+2})$. The desired claim follows in this case. If $d_0\ne\mbox{\lstinline+@public+}$ then $\monadic{v}^1,\monadic{v}^2$ being $q'$-exact in circuit implies $\monadic{v}^1=\monadic{v}^2=\top$. As $\gen{d_0}\supseteq D_3$ implies $\mbox{\lstinline+@public+}\notin D_3$, Theorems~\ref{semantics:outputthm} and~\ref{semantics:effcircthm} imply $\omicron_3=\epsilon$, $\left((x,\uopl{pure} i_1),\gamma_d^2\right)\coincirc{\Gamma'}\gamma_d^3$ and also $\omicron_k=\epsilon$, $[x\mapsto(i_1+k-3)]\gamma_d^{k-1}\coincirc{\Gamma'}\gamma_d^k$ for every $k=4,\ldots,n+2$. Obviously this implies $\gamma_d^2\coincirc{\Gamma}\uopl{tail}\gamma_d^3$ and $\uopl{tail}\gamma_d^{k-1}\coincirc{\Gamma}\uopl{tail}\gamma_d^k$ for every $k=4,\ldots,n+2$. By Lemma~\ref{semantics:coinlemma}, $\gamma_d^2\coincirc{\Gamma}\uopl{tail}\gamma_{n+2}$ which is the same as $\gamma_d^2\coincirc{\Gamma}\gamma'_d$. We obtain $\sem{e}\gamma\phi(\omicron\rho)=\sem{e}\gamma\phi(\omicron_1\omicron_2\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\top$ and $\gamma'=\gamma^2$. As $d_0\ne\mbox{\lstinline+@public+}$ and $s_0=\mbox{\lstinline+$pre+}$, $\top$ is $q$-exact in circuit and $\monadic{v}_d\coincirc{q}\top$ vacuously. By Lemma~\ref{semantics:coinlemma}, $\gamma_d^2\coincirc{\Gamma}\gamma'_d$ and $\gamma_d^2\coincirc{\Gamma}\gamma^2$ together imply $\gamma'_d\coincirc{\Gamma}\gamma'$. By the above, we also get $\gamma'$ being $\Gamma$-exact in circuit. The desired claim follows. \item Let $e=\wireexpr{e_1}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_0}{\mbox{\lstinline+$pre+}}{d_0}! D_1\mbox{,}\\ s_0=\mbox{\lstinline+$post+}\mbox{,}\quad\mbox{$t_0$ is $\uintmodty{\mbox{\lstinline+N+}}$ or $\boolmodty{\mbox{\lstinline+N+}}$}\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \monadic{v}_d=\monadic{v}_d^1\mbox{,}\quad\gamma'_d=\gamma_d^1\mbox{,}\quad\omicron=\lam{d'}{\branching{(\omicron_1)_{d'}\monadic{v}_d^1&\mbox{if $d'$ is the domain of~$e_1$}\\(\omicron_1)_{d'}&\mbox{otherwise}}}\mbox{.} \end{array} \] Here, $(\omicron_1)_{d'}$ denotes the member of the pair of streams $\omicron_1$ that corresponds to domain~$d'$ (for $d'\in\set{\mbox{\lstinline+@prover+},\mbox{\lstinline+@verifier+}}$). Denote $q'=(\qualty{t_0}{\mbox{\lstinline+$pre+}}{d_0})$. By the induction hypothesis about~$e_1$, \[ \sem{e_1}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v}^1,\gamma^1,\lam{d'}{\branching{\monadic{v}_d^1\rho&\mbox{if $d'$ is the domain of~$e_1$}\\\rho&\mbox{otherwise}}}) \] where $\monadic{v}^1$ is $q'$-exact and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{v}_d^1\coincirc{q'}\monadic{v}^1$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. Hence $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\branching{\monadic{v}^1&\mbox{if $d_0=\mbox{\lstinline+@public+}$}\\\monadic{v}_d^1&\mbox{otherwise}}$ and $\gamma'=\gamma^1$. Obviously we have $\gamma'$ being $\Gamma$-exact in circuit and $\gamma'_d\coincirc{\Gamma}\gamma'$. By Lemma~\ref{semantics:coinlemma}, $\monadic{v}_d\coincirc{q}\monadic{v}$. By $\monadic{v}_d^1$ being $q'$-exact in $\mbox{\lstinline+@prover+}$, we know that $\monadic{v}_d^1=\uopl{pure} v_d^1$ where $v_d^1\in t_0$. As $s_0=\mbox{\lstinline+$post+}$, $\uopl{pure} v_d^1$ is $q$-exact in circuit. Moreover, as $\monadic{v}^1$ is $q'$-exact in circuit, if $d_0=\mbox{\lstinline+@public+}$ then $\monadic{v}^1$ is $q$-exact in circuit. The desired claim follows. \item Let $e=\castexpr{e_1}{q_0}$. Let the type of $e_1$ be $q_1$, i.e., \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_0}{s_1}{d_1}! D\mbox{,}\\ s_1\mathrel{\mathchar"13C\mathchar"3A} s_0\mbox{,}\quad d_1\mathrel{\mathchar"13C\mathchar"3A} d_0\mbox{,}\quad\gen{d_0}\supseteq\gen{t_0}\mbox{.} \end{array} \] We have \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \monadic{v}_d=\monadic{v}_d^1\mbox{,}\quad\gamma'_d=\gamma_d^1\mbox{,}\quad\omicron=\omicron_1\mbox{.} \end{array} \] By the induction hypothesis, $\sem{e_1}\gamma\phi(\omicron_1\rho)=\uopl{pure}(\monadic{v}^1,\gamma^1,\rho)$ where $\monadic{v}^1$ is $q_1$-exact and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{v}_d^1\coincirc{q_1}\monadic{v}^1$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. Hence $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\branching{\monadic{v}^1&\mbox{if $s_0=\mbox{\lstinline+$post+}$ or $d_0=\mbox{\lstinline+@public+}$}\\\top&\mbox{otherwise}}$ and $\gamma'=\gamma^1$. Consider two cases: \begin{itemize} \item If $s_0=\mbox{\lstinline+$post+}$ or $d_0=\mbox{\lstinline+@public+}$ then $\monadic{v}=\monadic{v}^1$. As $s_1\mathrel{\mathchar"13C\mathchar"3A} s_0$ and $d_1\mathrel{\mathchar"13C\mathchar"3A} d_0$, we have $s_1=\mbox{\lstinline+$post+}$ or $d_1=\mbox{\lstinline+@public+}$. Hence $\monadic{v}^1$ being $q_1$-exact in circuit and $\monadic{v}_d^1\coincirc{q_1}\monadic{v}^1$ imply $\monadic{v}^1$ being $q_0$-exact in circuit and $\monadic{v}_d^1\coincirc{q_0}\monadic{v}^1$, respectively. The desired claim follows. \item If $s_0=\mbox{\lstinline+$pre+}$ and $d_0\ne\mbox{\lstinline+@public+}$ then $\monadic{v}=\top$. We have $\top$ being $q$-exact in circuit and $\monadic{v}_d\coincirc{q}\top$ vacuously. The desired claim follows. \end{itemize} \item Let $e=(\assignexpr{e_1}{e_2})$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{t_1}{s_1}{d_1}\mbox{,}\\ t_0=\mbox{\lstinline+()+}\mbox{,}\quad s_0=\mbox{\lstinline+$pre+}\mbox{,}\quad d_0=\mbox{\lstinline+@public+}\mbox{.} \end{array} \] Let $e_1=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$ and denote $\monadic{a}_d=\lookup{\gamma_d}{x}$, $\monadic{a}=\lookup{\gamma}{x}$. Then \[ \begin{array}{l} \semd{y_1}\gamma_d\phi=\uopl{pure}(\monadic{i}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{y_2}\gamma_d^1\phi=\uopl{pure}(\monadic{i}_d^2,\gamma_d^2,\omicron_2)\mbox{,}\\ \dotfill\\ \semd{y_n}\gamma_d^{n-1}\phi=\uopl{pure}(\monadic{i}_d^n,\gamma_d^n,\omicron_n)\mbox{,}\\ \semd{e_2}\gamma_d^n\phi=\uopl{pure}(\monadic{r}_d,\gamma_d^{n+1},\omicron_{n+1})\mbox{,}\\ \monadic{v}_d=\uopl{pure}\mbox{\textoneoldstyle}\mbox{,}\quad\gamma'_d=[x\mapsto\uopl{upd}(\monadic{a}_d,\monadic{i}_d^1\ldots\monadic{i}_d^n,\monadic{r}_d)]\gamma_d^{n+1}\mbox{,}\quad\omicron=\omicron_1\ldots\omicron_{n+1}\mbox{.} \end{array} \] Denote $q_1=(\qualty{t_1}{s_1}{d_1})$, $q'_i=\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d'_i}$ for every $i=1,\ldots,n$, and \[ q'=\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{\qualty{t_1}{s_1}{d_1}}}{\mbox{\lstinline+$pre+}}{d'_n}}}{\mbox{\lstinline+$pre+}}{d'_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d'_1}\mbox{.} \] By Lemma~\ref{typesystem:lhslemma}, $\Gamma\mbox{\ $\vdash$\ } y_i:q'_i$ for each $i=1,\ldots,n$ and $\Gamma\mbox{\ $\vdash$\ } x:q'$. Hence $\monadic{a}_d$ is $q'$-exact in $\mbox{\lstinline+@prover+}$ by exactness of~$\gamma$. By the induction hypothesis about all~$y_k$, $\sem{y_k}\gamma^{k-1}\phi(\omicron_k\ldots\omicron_{n+1}\rho)=\uopl{pure}(\monadic{i}^k,\gamma^k,\omicron_{k+1}\ldots\omicron_{n+1}\rho)$ where $\monadic{i}^k$ is $q'_k$-exact and $\gamma^k$ is $\Gamma$-exact in circuit, $\monadic{i}_d^k\coincirc{q'_k}\monadic{i}^k$ and $\gamma_d^k\coincirc{\Gamma}\gamma^k$. The induction hypothesis about~$e_2$ implies that $\sem{e_2}\gamma^k\phi(\omicron_{n+1}\rho)=\uopl{pure}(\monadic{r},\gamma^{n+1},\rho)$ where $\monadic{r}$ is $q_1$-exact and $\gamma^{n+1}$ is $\Gamma$-exact in circuit, $\monadic{r}_d\coincirc{q_1}\monadic{r}$ and $\gamma_d^{n+1}\coincirc{\Gamma}\gamma^{n+1}$. By Lemma~\ref{semantics:updexactcoinlemma}, $\uopl{upd}(\monadic{a},\monadic{i}^1\ldots\monadic{i}^n,\monadic{r})$ is a well-defined monadic value which is $q'$-exact in circuit, whereby $\uopl{upd}(\monadic{a}_d,\monadic{i}_d^1\ldots\monadic{i}_d^n,\monadic{r}_d)\coincirc{q'}\uopl{upd}(\monadic{a},\monadic{i}^1\ldots\monadic{i}^n,\monadic{r})$. Hence $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\uopl{pure}\mbox{\textoneoldstyle}$ and $\gamma'=[x\mapsto\uopl{upd}(\monadic{a},\monadic{i}^1\ldots\monadic{i}^n,\monadic{r})]\gamma^{n+1}$. Thereby, $[x\mapsto\uopl{upd}(\monadic{a},\monadic{i}^1\ldots\monadic{i}^n,\monadic{r})]\gamma^{n+1}$ is $\Gamma$-exact in circuit by the above and \[ [x\mapsto\uopl{upd}(\monadic{a}_d,\monadic{i}_d^1\ldots\monadic{i}_d^n,\monadic{r}_d)]\gamma_d^{n+1}\coincirc{\Gamma}[x\mapsto\uopl{upd}(\monadic{a},\monadic{i}^1\ldots\monadic{i}^n,\monadic{r})]\gamma^{n+1}\mbox{.} \] As $\uopl{pure}\mbox{\textoneoldstyle}$ is $q$-exact in circuit and $\uopl{pure}\mbox{\textoneoldstyle}\coincirc{q}\uopl{pure}\mbox{\textoneoldstyle}$, we are done. \item Let $e=\loadexpr{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:\qualty{\listty{q}}{s_1}{d_1}\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:\qualty{\mbox{\lstinline+uint+}}{s_1}{d_1}\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{a}_d,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{i}_d,\gamma_d^2,\omicron_2)\mbox{,}\\ \monadic{v}_d=\mcomp{a_d\gets\monadic{a}_d;\; i_d\gets\monadic{i}_d;\; (a_d)_{i_d}}\mbox{,}\quad\gamma'_d=\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] Denote $q'=(\qualty{\listty{q}}{s_1}{d_1})$ and $q_1=(\qualty{\mbox{\lstinline+uint+}}{s_1}{d_1})$. By $\monadic{a}_d,\monadic{i}_d$ being $q'$-exact and $q_1$-exact, respectively, in $\mbox{\lstinline+@prover+}$, we have $\monadic{a}=\uopl{pure}(\monadic{a}_d^1,\ldots,\monadic{a}_d^n)$, where all $\monadic{a}_d^k$ are $q$-exact in $\mbox{\lstinline+@prover+}$, and $\monadic{i}_d=\uopl{pure} i$ where $i\in\mathbb{N}$. Thus $\monadic{v}_d=\monadic{a}_d^i$ (whereby $i\leq n$ as the result is well-defined). By the induction hypothesis about $e_1$, $\sem{e_1}\gamma\phi(\omicron_1\omicron_2\rho)=\uopl{pure}(\monadic{a},\gamma^1,\omicron_2\rho)$ where $\monadic{a}$ is $q'$-exact and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{a}_d\coincirc{q'}\monadic{a}$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. Now by the induction hypothesis about $e_2$, $\sem{e_2}\gamma^1\phi(\omicron_2\rho)=\uopl{pure}(\monadic{i},\gamma^2,\rho)$ where $\monadic{i}$ is $q_1$-exact and $\gamma^2$ is $\Gamma$-exact in circuit, $\monadic{i}_d\coincirc{q_1}\monadic{i}$ and $\gamma_d^2\coincirc{\Gamma}\gamma^2$. Hence $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where \[ \monadic{v}=\mcomp{a\gets\monadic{a};\; i\gets\monadic{i};\; a_i}\mbox{,}\quad\gamma'=\gamma^2\mbox{.} \] Consider two cases: \begin{itemize} \item If $d_1=\mbox{\lstinline+@public+}$ then, by $\monadic{a}_d\coincirc{q'}\monadic{a}$, $\monadic{i}_d\coincirc{q_1}\monadic{i}$ and exactness in circuit, we get $\monadic{a}=\uopl{pure}(\monadic{a}^1,\ldots,\monadic{a}^n)$ where $\monadic{a}_d^k\coincirc{q}\monadic{a}^k$ for every $k=1,\ldots,n$ and $\monadic{i}=\uopl{pure} i$, whereby $\monadic{a}^1,\ldots,\monadic{a}^n$ are $q$-exact in circuit. Hence $\monadic{v}=\monadic{a}^i$ exists, is $q$-exact in circuit and satisfies $\monadic{v}_d\coincirc{q}\monadic{v}$. \item If $d_1\ne\mbox{\lstinline+@public+}$ then $\monadic{a}=\top$ and $\monadic{i}=\top$ by $s_1=\mbox{\lstinline+$pre+}$ and exactness in circuit. Hence $\monadic{v}=\top$. As $\Gamma$ is well-structured, $\qualty{\listty{q}}{s_1}{d_1}$ is well-structured by Theorem~\ref{typesystem:thm}. Thus $\gen{d_1}\supseteq\gen{d_0}\cup\gen{s_0}$, implying that $s_0=\mbox{\lstinline+$pre+}$ and $d_0\ne\mbox{\lstinline+@public+}$. Hence $\top$ is $q$-exact in circuit and $\monadic{v}_d\coincirc{q}\monadic{v}$ vacuously. \end{itemize} In both cases, we obtain $\gamma'$ being $\Gamma$-exact in circuit and $\gamma'_d\coincirc{\Gamma}\gamma'$ by the above. \item Let $e=\stmtcomp{\letexpr{x}{e_1}}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q_1! D_1\mbox{,}\\ (x:q_1),\Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}((x,\monadic{v}_d^1),\gamma_d^1)\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)\mbox{,}\\ \monadic{v}_d=\monadic{v}_d^2\mbox{,}\quad\gamma'_d=\uopl{tail}\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\sem{e_1}\gamma\phi(\omicron_1\omicron_2\rho)=\uopl{pure}(\monadic{v}^1,\gamma^1,\omicron_2\rho)$ where $\monadic{v}^1$ is \mbox{$q_1$-exact} and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{v}_d^1\coincirc{q_1}\monadic{v}^1$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. Denote $\Gamma'=((x:q_1),\Gamma)$; then $\left((x,\monadic{v}^1),\gamma^1\right)$ is $\Gamma'$-exact in circuit and $\left((x,\monadic{v}_d^1),\gamma_d^1\right)\coincirc{\Gamma'}\left((x,\monadic{v}^1),\gamma^1\right)$ by the above. Hence by the induction hypothesis about~$e_2$, $\sem{e_2}((x,\monadic{v}^1),\gamma^1)\phi(\omicron_2\rho)=\uopl{pure}(\monadic{v}^2,\gamma^2,\rho)$ where $\monadic{v}^2$ is $q$-exact and $\gamma^2$ is $\Gamma'$-exact in circuit, $\monadic{v}_d^2\coincirc{q}\monadic{v}^2$ and $\gamma_d^2\coincirc{\Gamma'}\gamma^2$. Thus $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\monadic{v}^2$ and $\gamma'=\uopl{tail}\gamma^2$. Here $\monadic{v}$ is $q$-exact in circuit and $\monadic{v}_d\coincirc{q}\monadic{v}$ by the above. Obviously $\uopl{tail}\gamma^2$ is $\Gamma$-exact in circuit and $\uopl{tail}\gamma_d^2\coincirc{\Gamma}\uopl{tail}\gamma^2$, hence the other desired claims also follow. \item Let $e=\stmtcomp{e_1}{e_2}$. Then \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ } e_1:q_1! D_1\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } e_2:q! D_2\mbox{,} \end{array} \] and \[ \begin{array}{l} \semd{e_1}\gamma_d\phi=\uopl{pure}(\monadic{v}_d^1,\gamma_d^1,\omicron_1)\mbox{,}\\ \semd{e_2}\gamma_d^1\phi=\uopl{pure}(\monadic{v}_d^2,\gamma_d^2,\omicron_2)\mbox{,}\\ \monadic{v}_d=\monadic{v}_d^2\mbox{,}\quad\gamma'_d=\gamma_d^2\mbox{,}\quad\omicron=\omicron_1\omicron_2\mbox{.} \end{array} \] By the induction hypothesis about~$e_1$, $\sem{e_1}\gamma\phi(\omicron_1\omicron_2\rho)=\uopl{pure}(\monadic{v}^1,\gamma^1,\omicron_2\rho)$ where $\monadic{v}^1$ is \mbox{$q_1$-exact} and $\gamma^1$ is $\Gamma$-exact in circuit, $\monadic{v}_d^1\coincirc{q_1}\monadic{v}^1$ and $\gamma_d^1\coincirc{\Gamma}\gamma^1$. By the induction hypothesis about~$e_2$, $\sem{e_2}\gamma^1\phi(\omicron_2\rho)=\uopl{pure}(\monadic{v}^2,\gamma^2,\rho)$ where $\monadic{v}^2$ is $q$-exact and $\gamma^2$ is $\Gamma$-exact in circuit, $\monadic{v}_d^2\coincirc{q}\monadic{v}^2$ and $\gamma_d^2\coincirc{\Gamma}\gamma^2$. Thus $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$ where $\monadic{v}=\monadic{v}^2$ and $\gamma'=\gamma^2$. The desired claims follow directly. \end{itemize} \end{proof} \section{Dynamic Semantics}\label{sec:semantics} We present dynamic semantics of our language in a denotational style. In fact, the overall setting assumes four different dynamic semantics, loosely corresponding to the views of three domains and the circuit. We call the three semantics corresponding to the domains \emph{local} since they describe what is computed by different parties locally. For example, Prover's view contains all computations that are performed as $\qual{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@prover+}}$, Verifier's view contains all computations performed as $\qual{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@verifier+}}$, etc. Values of all expressions and statements in Prover's domain are unknown from Verifier's point of view; we denote the unknown value by~$\top$. Likewise, the local semantics for the public domain evaluates all expressions and statements in the higher domains to~$\top$. Computations in the public domain are performed by the compiler. As $\mbox{\lstinline+$pre+}$ and $\mbox{\lstinline+@prover+}$ are the topmost elements of the stage and domain hierarchy, Prover's view encompasses the whole program. Basically, this view describes \emph{what should actually happen}, nevertheless ignoring the special way computation is performed in the circuit due to limited supply of operations The circuit semantics describes computations performed as $\qual{\mbox{\lstinline+$post+}}{\mbox{\lstinline{@D}}}$ for any \lstinline{@D}, and also everything in $\qual{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}}$. Although not computed by the circuit, values in $\qual{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}}$ are inevitably needed in performing branching computations as conditions of if expressions and loop bounds belong to stage $\mbox{\lstinline+$pre+}$. In reality, the compiler unrolls conditionals and loops for the circuit as the latter has no means for branching. We define all three local semantics via a common set of equations. The differences arise from domain inclusion conditions that can be either true or false depending on the party and can introduce~$\top$. The type system ensures that computing the program parts of the lower domains is not impeded by not knowing the values of the higher domains. The main notation and types are summarized in Fig.~\ref{semantics:types}. The set of values that our semantics can produce consists of non-negative integers, booleans $\mbox{\bfseries tt}$ and~$\mbox{\bfseries ff}$, the only value of the unit type, and finite sequences of (possibly unknown) values. We need two sets of values, $U$ and $V$, both defined recursively as the least fixpoint satisfying the corresponding equation. Values in the set~$U$ (which we sometimes call the ``core'' values) are built without making use of~$\top$, while the definition of~$V$ involves also $\top$. Core values are used only for representing the input of local computation; we can be sure that each party can fully read its input whence $\top$ will never occur there. By $\mathds{1}+A$, we denote the disjoint sum of a singleton set and set~$A$; in the case of~$M\, V$, we assume $\mathds{1}=\set{\top}$. We refer to the elements of the main summand (i.e., not $\mathds{1}$) as \emph{pure}. The local semantics of an expression takes a value environment and a triple of input dictionaries (one for each domain) as arguments, and normally produces a triple containing the value of the expression, an updated environment and a pair of finite sequences of values to be delivered to the circuit (one sequence for each of $\mbox{\lstinline+@prover+}$ and $\mbox{\lstinline+@verifier+}$; the circuit does not take public input). In exceptional cases, the semantics can fail, which is shown by the addend~$\mathds{1}$ in the equation for $C_d\, A$ and means a runtime error. For simplicity, we ignore runtime errors other than assertion failures in the semantics; in practice, all other runtime errors are considered semantically equivalent to a failed assertion. \begin{figure}\figsize \renewcommand{\arraycolsep}{2pt} \begin{tabular}{@{}l@{}} $\begin{array}{lcl} \mathbb{N}&=&\set{0,1,2,\ldots}\\ \mathbb{B}&=&\set{\mbox{\bfseries tt},\mbox{\bfseries ff}}\\ ()&=&\set{\mbox{\textoneoldstyle}} \end{array}$\qquad $\begin{array}{lcl} X&&\mbox{the set of variables}\\ K&&\mbox{the set of input keys}\\ U&=&\mathbb{N}\cup\mathbb{B}\cup()\cup U^*\quad\mbox{the set of core values}\\ V&=&\mathbb{N}\cup\mathbb{B}\cup()\cup(M\, V)^*\quad\mbox{the set of values} \end{array}$\\[4.5ex] $\begin{array}{lcl} M\, A&=&\mathds{1}+A\\ C_d\, A&=&\mathbf{Env}\to\mathbf{In}^3\to\mathds{1}+A\times\mathbf{Env}\times\mathbf{Out}^2\\ C\, A&=&\mathbf{Env}\to\mathbf{In}^3\to\mathbf{Out}^2\to\mathds{1}+A\times\mathbf{Env}\times\mathbf{Out}^2 \end{array}$\\[4.5ex] $\begin{array}{lcl@{\quad}l} \mathbf{Env}&=&(X\times M\, V)^+&\mbox{value environments}\\ \mathbf{In}&=&K\to U&\mbox{inputs of local computation}\\ \mathbf{Out}&=&(M\,(\mathbb{N}\cup\mathbb{B}))^*&\mbox{streams of values delivered to the circuit} \end{array}$\\[4.5ex] $\begin{array}{lcl@{\quad}l} \semd{e}&:&C_d\,(M\, V)&\mbox{the local semantics of expression~$e$ in domain~$d$}\\ \sem{e}&:&C\,(M\, V)&\mbox{the circuit semantics of expression~$e$} \end{array}$ \end{tabular} \caption{\label{semantics:types} Types of semantic objects} \end{figure} A value environment is a finite association list. It is operated as a stack. We use the following notation for lookup and update of variable~$x$ in any environment~$\gamma=((x_1,a_1),\ldots,(x_n,a_n))$, where $i$ is the least index such that $x_i=x$: \[ \lookup{\gamma}{x}=a_i\mbox{,}\quad [x\mapsto a]\gamma=((x_1,a_1),\ldots,(x_{i-1},a_{i-1}),(x_i,a),(x_{i+1},a_{i+1}),\ldots,(x_n,a_n))\mbox{.} \] Note that an update is performed in the stack element where the variable~$x$ is defined. If a new definition of~$x$ is desired, we instead write $(x,a),\gamma$ which means pushing a new association to the stack. To omit the topmost element of the stack~$\gamma$, we write $\uopl{tail}\gamma$. If $\gamma=((x_1,a_1),\ldots,(x_n,a_n))$ then we write $\uopl{vars}\gamma=(x_1,\ldots,x_n)$. The definition of local semantics is given in Fig.~\ref{semantics:exprstmt}. The notation of syntactic objects coincides with that in the type rules (e.g., $x$ stands for a variable etc.); in addition, $\gamma$, $\phi$ and $\omicron$ denote value environments, inputs and outputs, respectively. To avoid the need to study exceptional cases separately, we use the monad comprehension syntax of the functional programming language Haskell. This notation was first advocated by Wadler~\cite{DBLP:journals/mscs/Wadler92} for succinct description of computations that may involve side effects. We only use the notation for the \emph{maybe monad} $A\mapsto\mathds{1}+A$. For example, the sum of values $\monadic{v}_1,\monadic{v}_2\in M\, V$ (the static type system ensures that their types are correct, but either value can be unknown) is written as \[ \mcomp{i_1\gets\monadic{v}_1;\; i_2\gets\monadic{v}_2;\;\uopl{pure}(i_1+i_2)}\mbox{.} \] Here, the first two clauses define $i_1$ and $i_2$ as pure representatives of $\monadic{v}_1$ and $\monadic{v}_2$, respectively, and the last clause specifies the sum $i_1+i_2$ as the final outcome. The latter is wrapped into a monadic value (i.e., an element of $M\, V$) by function $\uopl{pure}$. Any of the clauses evaluating to~$\top$ turns the final result $\top$ immediately. In general, monad comprehension can contain any finite number of clauses, all of which except the last one may bind new pure values. Evaluation is strict and progresses from left to right. Note that here and below, we denote monadic values by letters with hat for clarity. Since $C_d$ also involves exceptional cases, we use monad comprehension for~$C_d$, too. So we have a two-layer monadic specification of semantics ($M$ is inside and $C_d$ outside). In the outer layer, we use function $\uopl{guard}$ that on a false condition raises an exception (and jumps out of comprehension) and has no effect otherwise. Due to the two-layer representation, the unknown value~$\top$ causes no exception in the outer layer. \begin{figure*}\figsize\renewcommand{\arraycolsep}{2pt}\renewcommand{\arraystretch}{1.2} \[\begin{array}{lcl} \semd{\epsilon}\gamma\phi&=&\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},\gamma,\epsilon)\\ \semd{\overline{n}}\gamma\phi&=&\branching{\uopl{pure}(\uopl{pure} n,\gamma,\epsilon)&\mbox{if $\overline{n}$ is in domain~$d$ or lower}\\\uopl{pure}(\top,\gamma,\epsilon)&\mbox{otherwise}}\\ \semd{\overline{b}}\gamma\phi&=&\branching{\uopl{pure}(\uopl{pure} b,\gamma,\epsilon)&\mbox{if $\overline{b}$ is in domain~$d$ or lower}\\\uopl{pure}(\top,\gamma,\epsilon)&\mbox{otherwise}}\\ \semd{x}\gamma\phi&=&\uopl{pure}(\lookup{\gamma}{x},\gamma,\epsilon)\\ \semd{\addexpr{e_1}{e_2}}\gamma_0\phi&=&\mcompv{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\semd{e_1}\gamma_0\phi;\;\\(\monadic{v}_2,\gamma_2,\omicron_2)\gets\semd{e_2}\gamma_1\phi;\;\\\uopl{pure}(\mcomp{v_1\gets\monadic{v}_1;\; v_2\gets\monadic{v}_2;\;\uopl{pure}(v_1+v_2)},\gamma_2,\omicron_1\omicron_2)}\\ \semd{\assertexpr{e}}\gamma_0\phi&=&\mcomp{(\monadic{v},\gamma_1,\omicron_1)\gets\semd{e}\gamma_0\phi;\;\uopl{guard}(\monadic{v}\ne\uopl{pure}\mbox{\bfseries ff});\;\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},\gamma_1,\omicron_1)}\\ \semd{\getexpr{d'}{k}}\gamma\phi&=&\branching{\uopl{pure}(\uopl{allpure}(\phi_{d'}(k)),\gamma,\epsilon)&\mbox{if $d'\mathrel{\mathchar"13C\mathchar"3A} d$}\\\uopl{pure}(\top,\gamma,\epsilon)&\mbox{otherwise}}\\ \semd{\ifexpr{e_1}{e_2}{e_3}}\gamma_0\phi&=&\mcompv{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\semd{e_1}\gamma_0\phi;\;\\\branching{\mcomp{(\monadic{v}_2,\gamma_2,\omicron_2)\gets\semd{e_2}\gamma_1\phi;\;\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_1\omicron_2)}&\mbox{if $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$}\\\mcomp{(\monadic{v}_3,\gamma_3,\omicron_3)\gets\semd{e_3}\gamma_1\phi;\;\uopl{pure}(\monadic{v}_3,\gamma_3,\omicron_1\omicron_3)}&\mbox{if $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$}\\\uopl{pure}(\top,\gamma_1,\omicron_1)&\mbox{otherwise}}}\\ \semd{\forexpr{x}{e_1}{e_2}{e_3}}\gamma_0\phi&=&\begin{array}[t]{@{}l@{}}\mcompv{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\semd{e_1}\gamma_0\phi;\;\\(\monadic{v}_2,\gamma_2,\omicron_2)\gets\semd{e_2}\gamma_1\phi;\;\\\branching{\uopl{main}(\max(0,i_2-i_1))&\mbox{where $\monadic{v}_j=\uopl{pure} i_j$, $j=1,2$}\\\uopl{pure}(\top,\gamma_2,\omicron_1\omicron_2)&\mbox{if $\monadic{v}_1=\top$ or $\monadic{v}_2=\top$}}}\end{array}\\ \multicolumn{2}{r}{\mbox{where}}&\uopl{main}(n)=\mcompv{(\monadic{a}_1,\gamma'_1,\omicron'_1)\gets\semd{e}((x,\uopl{pure} i_1),\gamma_2)\phi;\;\\\forall k=2,\ldots,n:(\monadic{a}_k,\gamma'_k,\omicron'_k)\gets\semd{e_3}([x\mapsto\uopl{pure}(i_1\!\!+\!\!k\!\!-\!\!1)]\gamma'_{k-1})\phi;\;\\\uopl{pure}(\uopl{pure}(\monadic{a}_1,\ldots,\monadic{a}_n),\uopl{tail}\gamma'_n,\omicron_1\omicron_2\omicron'_1\ldots\omicron'_n)}\\ \semd{\wireexpr{e}}\gamma_0\phi&=&\mcomp{(\monadic{v},\gamma_1,\omicron_1)\gets\semd{e}\gamma_0\phi;\;\uopl{pure}(\monadic{v},\gamma_1,\lam{d'}{\branching{(\omicron_1)_{d'}\monadic{v}&\mbox{if $e$ is in domain~$d'$}\\(\omicron_1)_{d'}&\mbox{otherwise}}})}\\ \semd{\castexpr{e}{d'}}\gamma_0\phi&=&\branching{\semd{e}\gamma_0\phi&\mbox{if $d'\mathrel{\mathchar"13C\mathchar"3A} d$}\\\mcomp{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\semd{e}\gamma_0\phi;\;\uopl{pure}(\top,\gamma_1,\omicron_1)}&\mbox{otherwise}}\\ \semd{\assignexpr{l}{e}}\gamma_0\phi&=&\begin{array}[t]{@{}l@{}}\mcompv{\monadic{a}\gets\uopl{pure}(\lookup{\gamma_0}{x});\;\\\forall k=1,\ldots,n:(\monadic{i}_k,\gamma_k,\omicron_k)\gets\semd{y_k}\gamma_{k-1}\phi;\;\\(\monadic{v},\gamma',\omicron')\gets\semd{e}\gamma_n\phi;\;\\\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},[x\mapsto\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})]\gamma',\omicron_1\ldots\omicron_n\omicron')}\end{array}\\ \multicolumn{2}{r}{\mbox{where}}&\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}=l\\ \semd{\loadexpr{l}{e}}\gamma_0\phi&=&\mcompv{(\monadic{a},\gamma_1,\omicron_1)\gets\semd{l}\gamma_0\phi;\;\\(\monadic{i},\gamma_2,\omicron_2)\gets\semd{e}\gamma_1\phi;\;\\\uopl{pure}(\mcomp{a\gets\monadic{a};\; i\gets\monadic{i};\; a_i},\gamma_2,\omicron_1\omicron_2)}\\ \semd{\stmtcomp{\letexpr{x}{e_1}}{e_2}}\gamma_0\phi&=&\mcompv{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\semd{e_1}\gamma_0\phi;\;\\(\monadic{v}_2,\gamma_2,\omicron_2)\gets\semd{e_2}((x,\monadic{v}_1),\gamma_1)\phi;\;\\\uopl{pure}(\monadic{v}_2,\uopl{tail}\gamma_2,\omicron_1\omicron_2)}\\ \semd{\stmtcomp{e_1}{e_2}}\gamma_0\phi&=&\mcomp{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\semd{e_1}\gamma_0\phi;\;(\monadic{v}_2,\gamma_2,\omicron_2)\gets\semd{e_2}\gamma_1\phi;\;\uopl{pure}(\monadic{v}_2,\gamma_2,\omicron_1\omicron_2)} \end{array} \] \caption{\label{semantics:exprstmt} Local dynamic semantics of expressions and statements} \end{figure*} The semantics of~$+$ is included as an example of a built-in operator. Arithmetic is implicitly performed modulo some positive integer if that is required by the type ($\uintmodty{\mbox{\lstinline{N}}}$). The only case that uses core values is that of $\mbox{\lstinline{get}}$. To transform a core value to a value in $M\, V$, we use the function $\uopl{allpure}:U\to M\, V$ defined as \[ \uopl{allpure} v=\branching{\uopl{pure} v&\mbox{if $v$ belongs to a primitive type}\\\uopl{pure}(\uopl{allpure} v_1,\ldots,\uopl{allpure} v_n)&\mbox{if $v=(v_1,\ldots,v_n)$}}\mbox{.} \] Concerning type casts, we show only the variant with domain cast as only domain matters here. The assignment case uses an auxiliary function $\uopl{upd}:M\, V\times(M\, V)^*\times M\, V\to M\, V$ that takes a value that can be a list with $0$ or more dimensions (i.e., a primitive value or a list of primitives or a matrix etc.), an index vector, and a value, and returns a new list where the cell indicated by the index vector has been updated with the given value. More formally, \[ \uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})=\branching{\monadic{v}&\mbox{if $n=0$}\\\mcomp{a\gets\monadic{a};\; i_1\gets\monadic{i}_1;\;\uopl{pure}([i_1\mapsto\uopl{upd}(a_{i_1},\monadic{i}_2\ldots\monadic{i}_n,\monadic{v})]a)}&\mbox{if $n>0$}}\mbox{.} \] The circuit semantics is defined mostly analogously; the definition is given in Fig.~\ref{semantics:circuit}. Again, we present only one case of type cast; the other cases are defined in similar lines. The most important difference from local semantics is concerning the \lstinline{wire} construct that reads non-public values from the output streams of local computations. For this reason, the circuit semantics takes a pair of streams as a supplementary argument. Execution of each wire expression in a non-public domain removes the first value from the stream corresponding to the domain of that expression; the updated pair of streams is included in the result. \begin{figure*}\figsize\renewcommand{\arraycolsep}{2pt}\renewcommand{\arraystretch}{1.2} \[ \begin{array}{lcl} \sem{\epsilon}\gamma\phi\omicron&=&\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},\gamma,\omicron)\\ \sem{\overline{n}}\gamma\phi\omicron&=&\branching{\uopl{pure}(\uopl{pure} n,\gamma,\omicron)&\mbox{if $\overline{n}$ is in \lstinline+$post+ or \lstinline+@public+}\\\uopl{pure}(\top,\gamma,\omicron)&\mbox{otherwise}}\\ \sem{\overline{b}}\gamma\phi\omicron&=&\branching{\uopl{pure}(\uopl{pure} b,\gamma,\omicron)&\mbox{if $\overline{b}$ is in \lstinline+$post+ or \lstinline+@public+}\\\uopl{pure}(\top,\gamma,\omicron)&\mbox{otherwise}}\\ \sem{x}\gamma\phi\omicron&=&\uopl{pure}(\lookup{\gamma}{x},\gamma,\omicron)\\ \sem{\addexpr{e_1}{e_2}}\gamma_0\phi\omicron_0&=&\mcompv{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\sem{e_1}\gamma_0\phi\omicron_0;\;\\(\monadic{v}_2,\gamma_2,\omicron_2)\gets\sem{e_2}\gamma_1\phi\omicron_1;\;\\\uopl{pure}(\mcomp{v_1\gets\monadic{v}_1;\; v_2\gets\monadic{v}_2;\;\uopl{pure}(v_1+v_2)},\gamma_2,\omicron_2)}\\ \sem{\assertexpr{e}}\gamma_0\phi\omicron_0&=&\mcomp{(\monadic{v},\gamma_1,\omicron_1)\gets\sem{e}\gamma_0\phi\omicron_0;\;\uopl{guard}(\monadic{v}\ne\uopl{pure}\mbox{\bfseries ff});\;\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},\gamma_1,\omicron_1)}\\ \sem{\getexpr{d}{k}}\gamma\phi\omicron&=&\branching{\uopl{pure}(\uopl{allpure}(\phi_{d}(k)),\gamma,\omicron)&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\uopl{pure}(\top,\gamma,\omicron)&\mbox{otherwise}}\\ \sem{\ifexpr{e_1}{e_2}{e_3}}\gamma_0\phi\omicron_0&=&\mcomp{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\sem{e_1}\gamma_0\phi\omicron_0;\;\branching{\sem{e_2}\gamma_1\phi\omicron_1&\mbox{if $\monadic{v}_1=\uopl{pure}\mbox{\bfseries tt}$}\\\sem{e_3}\gamma_1\phi\omicron_1&\mbox{if $\monadic{v}_1=\uopl{pure}\mbox{\bfseries ff}$}\\\uopl{pure}(\top,\gamma_1,\omicron_1)&\mbox{otherwise}}}\\ \sem{\forexpr{x}{e_1}{e_2}{e_3}}\gamma_0\phi\omicron_0&=&\begin{array}[t]{@{}l@{}}\mcompv{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\sem{e_1}\gamma_0\phi\omicron_0;\;\\(\monadic{v}_2,\gamma_2,\omicron_2)\gets\sem{e_2}\gamma_1\phi\omicron_1;\;\\\branching{\uopl{main}(\max(0,i_2-i_1))&\mbox{where $\monadic{v}_j=\uopl{pure} i_j$, $j=1,2$}\\\uopl{pure}(\top,\gamma_2,\omicron_2)&\mbox{if $\monadic{v}_1=\top$ or $\monadic{v}_2=\top$}}}\end{array}\\ \multicolumn{2}{r}{\mbox{where}}&\uopl{main}(n)=\mcompv{(\monadic{a}_1,\gamma'_1,\omicron'_1)\gets\sem{e_3}((x,\uopl{pure} i_1),\gamma_2)\phi\omicron_2;\;\\\forall k=2,...,n:(\monadic{a}_k,\!\gamma'_k,\!\omicron'_k)\gets\sem{e_3}([x\mapsto\uopl{pure}(i_1\!\!+\!\!k\!\!-\!\!1)]\gamma'_{k-1})\phi\omicron'_{k-1};\;\\\uopl{pure}(\uopl{pure}(\monadic{a}_1,\ldots,\monadic{a}_n),\uopl{tail}\gamma'_n,\omicron'_n)}\\ \sem{\wireexpr{e}}\gamma\phi\omicron&=&\mcompv{(\monadic{v},\gamma',\omicron')\gets\sem{e}\gamma\phi\omicron;\;\\\uopl{pure}(\branching{\monadic{v}&\mbox{if $d=\mbox{\lstinline+@public+}$}\\\uopl{head}\omicron'_d&\mbox{otherwise}},\gamma',\lam{d'}{\branching{\uopl{tail}\omicron'_{d'}&\mbox{if $d'=d$}\\\omicron'_{d'}&\mbox{otherwise}}})}\\ \multicolumn{2}{r}{\mbox{where}}&\mbox{$d$ is the domain of~$e$}\\ \sem{\castexpr{e}{\qualty{t}{s}{d}}}\gamma\phi\omicron&=&\branching{\sem{e}\gamma\phi\omicron&\mbox{if $s=\mbox{\lstinline+$post+}$ or $d=\mbox{\lstinline+@public+}$}\\\mcomp{(\monadic{v},\gamma',\omicron')\gets\sem{e}\gamma\phi\omicron;\;\uopl{pure}(\top,\gamma',\omicron')}&\mbox{otherwise}}\\ \sem{\assignexpr{l}{e}}\gamma_0\phi\omicron_0&=&\begin{array}[t]{@{}l@{}}\mcompv{\monadic{a}\gets\uopl{pure}(\lookup{\gamma_0}{x});\;\\\forall k=1,\ldots,n:(\monadic{i}_k,\gamma_k,\omicron_k)\gets\sem{y_k}\gamma_{k-1}\phi\omicron_{k-1};\;\\(\monadic{v},\gamma',\omicron')\gets\sem{e}\gamma_n\phi\omicron_n;\;\\\uopl{pure}(\uopl{pure}\mbox{\textoneoldstyle},[x\mapsto\uopl{upd}(\monadic{a},\monadic{i}_1\ldots\monadic{i}_n,\monadic{v})]\gamma',\omicron')}\end{array}\\ \multicolumn{2}{r}{\mbox{where}}&\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}=l\\ \sem{\loadexpr{l}{e}}\gamma_0\phi\omicron_0&=&\mcompv{(\monadic{a},\gamma_1,\omicron_1)\gets\sem{l}\gamma_0\phi\omicron_0;\;\\(\monadic{i},\gamma_2,\omicron_2)\gets\sem{e}\gamma_1\phi\omicron_1;\;\\\uopl{pure}(\mcomp{a\gets\monadic{a};\; i\gets\monadic{i};\; a_i},\gamma_2,\omicron_2)}\\ \sem{\stmtcomp{\letexpr{x}{e_1}}{e_2}}\gamma_0\phi\omicron_0&=&\begin{array}[t]{@{}l@{}}\mcompv{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\sem{e_1}\gamma_0\phi\omicron_0;\;\\(\monadic{v}_2,\gamma_2,\omicron_2)\gets\sem{e_2}((x,\monadic{v}_1),\gamma_1)\phi\omicron_1;\;\\\uopl{pure}(\monadic{v}_2,\uopl{tail}\gamma_2,\omicron_2)}\end{array}\\ \sem{\stmtcomp{e_1}{e_2}}\gamma_0\phi\omicron_0&=&\mcomp{(\monadic{v}_1,\gamma_1,\omicron_1)\gets\sem{e_1}\gamma_0\phi\omicron_0;\;\sem{e_2}\gamma_1\phi\omicron_1} \end{array} \] \caption{\label{semantics:circuit} Circuit semantics} \end{figure*} We can prove Theorems \ref{semantics:compthm}--\ref{semantics:correctness} below. Theorem~\ref{semantics:localthm} implies (via repeated application) that every party can compute all data that belong to its domain or lower domains despite not knowing values of the higher domains. Theorem~\ref{semantics:effthm} states that evaluating an expression can change only those values of the value environment that live in domains where the expression is effectful according to the type system. Theorem~\ref{semantics:outputthm} states that an expression can output values to the circuit only if the expression is effectful in $\mbox{\lstinline+@public+}$. Theorem~\ref{semantics:effcircthm} is similar to Theorem~\ref{semantics:effthm} but is concerning values in the environment that are visible to the circuit. Theorem~\ref{semantics:safety} states that inputs of higher domains do not influence computation results in the lower domains. Theorem~\ref{semantics:soundness} states that executions of the same code in different domains agree on values visible in the lower domain. Theorem~\ref{semantics:correctness} establishes that if a program succeeds in Prover's semantics then it succeeds in the circuit semantics, provided that it is given the same input and Prover's and Verifier's correct output. Proofs of the theorems use induction on the structure of the expression; the details are given in Appendix~\ref{semantics-proofs}. Before the theorems can be precisely formulated, a few notions must be introduced which the formulations rely on. The notions basically specify, for a fixed domain's or the circuit's point of view, what are good relationships between monadic values and types, and between two monadic values. \begin{definition}\label{semantics:exposeddef} Let a predicate~$P$ on qualified types be fixed. For any well-structured qualified type $q=\qualty{t}{s}{d}$ and $\monadic{v}\in M\, V$, we say that $\monadic{v}$ is \emph{$q$-exposed in~$P$} if one of the following alternatives holds: \begin{enumerate} \item $P(q)$ is true and $t$~{}is a primitive type and $\monadic{v}=\uopl{pure} v$ where $v\in t$ (e.g., if $t=\boolmodty{\mbox{\lstinline{N}}}$ then $v\in\set{\mbox{\bfseries tt},\mbox{\bfseries ff}}$); \item $P(q)$ is true and $t=\listty{q'}$ and $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$ where $n\in\mathbb{N}$ and all $\monadic{v}_1,\ldots,\monadic{v}_n\in M\, V$ are $q'$-exposed in~$P$; \item $P(q)$ is false. \end{enumerate} \end{definition} \begin{definition}\label{semantics:exactdef} Let a predicate~$P$ on qualified types be fixed. For any well-structured qualified type $q=\qualty{t}{s}{d}$ and $\monadic{v}\in M\, V$, we say that $\monadic{v}$ is \emph{$q$-exact in~$P$} if one of the following alternatives holds: \begin{enumerate} \item $P(q)$ is true and $t$~{}is a primitive type and $\monadic{v}=\uopl{pure} v$ where $v\in t$ (e.g., if $t=\boolmodty{\mbox{\lstinline{N}}}$ then $v\in\set{\mbox{\bfseries tt},\mbox{\bfseries ff}}$); \item $P(q)$ is true and $t=\listty{q'}$ and $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$ where $n\in\mathbb{N}$ and all $\monadic{v}_1,\ldots,\monadic{v}_n\in M\, V$ are $q'$-exact in~$P$; \item $P(q)$ is false and $\monadic{v}=\top$. \end{enumerate} \end{definition} \begin{definition}\label{semantics:coincidentdef} Let a predicate~$P$ on qualified types be fixed. For any well-structured qualified type $q=\qualty{t}{s}{d}$ and $\monadic{v},\monadic{v}'\in M\, V$, we say that $\monadic{v}$ and $\monadic{v}'$ are \emph{$q$-coincident in~$P$} and write $\monadic{v}\coin{q}{P}\monadic{v}'$ iff one of the following alternatives holds: \begin{enumerate} \item $P(q)$ is true and $t$~{}is a primitive type and $\monadic{v}=\monadic{v}'=\uopl{pure} v$ where $v\in t$; \item $P(q)$ is true and $t=\listty{q'}$ and $\monadic{v}=\uopl{pure}(\monadic{v}_1,\ldots,\monadic{v}_n)$, $\monadic{v}'=\uopl{pure}(\monadic{v}'_1,\ldots,\monadic{v}'_n)$ where $n\in\mathbb{N}$ and $\monadic{v}_i$, $\monadic{v}'_i$ are $q'$-coincident in~$P$ for every $i=1,\ldots,n$; \item $P(q)$ is false. \end{enumerate} \end{definition} \begin{definition} Let $\Gamma$ be a well-structured type environment and $P$ be a predicate defined on qualified types. \begin{enumerate} \item We say that $\gamma\in\mathbf{Env}$ is \emph{$\Gamma$-exposed in~$P$} iff $\uopl{vars}\Gamma=\uopl{vars}\gamma$ and, for every association $(x_i:q_i)$ occurring in~$\Gamma$, the value in the corresponding association $(x_i,\monadic{v}_i)$ in $\gamma$ is $q_i$-exposed in~$P$. \item We say that $\gamma\in\mathbf{Env}$ is \emph{$\Gamma$-exact in~$P$} iff $\uopl{vars}\Gamma=\uopl{vars}\gamma$ and, for every association $(x_i:q_i)$ occurring in $\Gamma$, the value in the corresponding association $(x_i,\monadic{v}_i)$ in $\gamma$ is $q_i$-exact in~$P$. \item We say that $\gamma,\gamma'\in\mathbf{Env}$ are \emph{$\Gamma$-coincident in~$P$} and write $\gamma\coin{\Gamma}{P}\gamma'$ iff $\uopl{vars}\Gamma=\uopl{vars}\gamma=\uopl{vars}\gamma'$ and, for every association $(x_i:q_i)$ occurring in $\Gamma$, the values in the corresponding associations $(x_i,\monadic{v}_i)$ and $(x_i,\monadic{v}'_i)$ in $\gamma$ and $\gamma'$, respectively, are $q_i$-coincident in~$P$. \end{enumerate} \end{definition} \begin{definition}\label{semantics:interpretdef} For any fixed domain~$d'$, we shall say ``-exposed in~$d'$'', ``-exact in~$d'$'' and ``\mbox{-}co\-incident in~$d'$'' instead of ``-exposed in~$P$'', ``-exact in~$P$'' and ``-coincident in~$P$'' where $P(\qualty{t}{s}{d})\rightleftharpoons(d\mathrel{\mathchar"13C\mathchar"3A} d')$. We shall say ``-exact in circuit'' and ``-coincident in circuit'' instead of ``-exact in~$P$'' and ``\mbox{-}co\-incident in~$P$'' where $P(\qualty{t}{s}{d})\rightleftharpoons(s=\mbox{\lstinline+$post+}\vee d=\mbox{\lstinline+@public+})$. We write $\coin{q}{d}$ and $\coin{\Gamma}{d}$ for coincidence in~$d$, and $\coincirc{q}$ and $\coincirc{\Gamma}$ for coincidence in circuit. \end{definition} \begin{definition} Call a predicate~$P$ defined on qualified types \emph{data insensitive} if $P(\qualty{t_1}{s}{d})=P(\qualty{t_2}{s}{d})$ for all data types $t_1,t_2$, stage~$s$ and domain~$d$. \end{definition} Note that all predicates used in Definition~\ref{semantics:interpretdef} are data insensitive. \begin{definition} Let $d$ be a fixed domain. \begin{enumerate} \item Let $\omicron\in\mathbf{Out}^2$. We say that $\omicron$ is \emph{exact in~$d$} iff, for any $d'\in\set{\mbox{\lstinline+@prover+},\mbox{\lstinline+@verifier+}}$, each component of $\omicron_{d'}$ is of the form $\uopl{pure} v$ for $v\in\mathbb{N}\cup\mathbb{B}$ if $d'\mathrel{\mathchar"13C\mathchar"3A} d$ and $\top$ if $d'$ is a strict superdomain of~$d$. \item Let $\omicron,\omicron'\in\mathbf{Out}^2$. We say that $\omicron$ and $\omicron'$ are \emph{coincident in~$d$} and write $\omicron\coinpure{d}\omicron'$ iff, for any $d'\in\set{\mbox{\lstinline+@prover+},\mbox{\lstinline+@verifier+}}$, the lengths of $\omicron_{d'}$ and $\omicron'_{d'}$ are equal and if $d'\mathrel{\mathchar"13C\mathchar"3A} d$ then $\omicron_{d'}=\omicron'_{d'}$. \end{enumerate} \end{definition} \begin{theorem}\label{semantics:compthm} Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$ and $\gamma\in\mathbf{Env}$ be $\Gamma$-exact in~$d$ for some domain~$d$. Assume that for all subexpressions of~$e$ of the form $\ofty{\getexpr{d'}{k}}{q'}$ where $d'\mathrel{\mathchar"13C\mathchar"3A} d$, the value $\uopl{allpure}(\phi_{d'}(k))$ is $q'$-exact in~$d$. Assume that $\semd{e}\gamma\phi=\uopl{pure}(\monadic{v},\gamma',\omicron)$. Then: \begin{thmlist} \item\label{semantics:localthm} $\monadic{v}$~{}is $q$-exact, $\gamma'$~{}is $\Gamma$-exact and $\omicron$~{}is exact in~$d$; \item\label{semantics:effthm} $\gamma\coin{\Gamma}{d''}\gamma'$ for any domain~$d''$ such that $d''\mathrel{\mathchar"13C\mathchar"3A} d$ and $d''\notin D$; \item\label{semantics:outputthm} If $\mbox{\lstinline+@public+}\notin D$ then $\omicron=\epsilon$; \item\label{semantics:effcircthm} If $d=\mbox{\lstinline+@prover+}$ and $\mbox{\lstinline+@public+}\notin D$ then $\gamma\coincirc{\Gamma}\gamma'$. \end{thmlist} \end{theorem} \begin{theorem}\label{semantics:safety} If $\semd{e}\gamma\phi=\uopl{pure}(\monadic{v},\gamma',\omicron)$ and $\phi'_{d'}=\phi_{d'}$ for every $d'\mathrel{\mathchar"13C\mathchar"3A} d$ then $\semd{e}\gamma\phi'=\semd{e}\gamma\phi$. \end{theorem} \begin{theorem}\label{semantics:soundness} Let $\Gamma\mbox{\ $\vdash$\ } e:q! D$ with well-structured $\Gamma$. Let $d,d'$ be domains such that $d'\mathrel{\mathchar"13C\mathchar"3A} d$. Let $\gamma_d,\gamma_{d'}\in\mathbf{Env}$ be $\Gamma$-exact in~$d$ and $d'$, respectively, and let $\gamma_d\coin{\Gamma}{d'}\gamma_{d'}$. Assume that for all subexpressions of~$e$ of the form $\ofty{\getexpr{d''}{k}}{q'}$, the value $\uopl{allpure}(\phi_{d''}(k))$ is $q'$-exact in~$d''$. Assume that there exist $\monadic{v}_d,\gamma'_d,\omicron$ such that $\semd{e}\gamma_d\phi=\uopl{pure}(\monadic{v}_d,\gamma'_d,\omicron)$. Then there exist $\monadic{v}_{d'},\gamma'_{d'},\omicron'$ such that $\sem{e}_{d'}\gamma_{d'}\phi=\uopl{pure}(\monadic{v}_{d'},\gamma'_{d'},\omicron')$, whereby $\monadic{v}_d\coin{q}{d'}\monadic{v}_{d'}$, $\gamma_d\coin{\Gamma}{d'}\gamma_{d'}$ and $\omicron\coinpure{d'}\omicron'$. \end{theorem} \begin{theorem}\label{semantics:correctness} Let $\Gamma \mbox{\ $\vdash$\ } e : q! D$ with well-structured~$\Gamma$. Let $\gamma_d$, $\gamma\in\mathbf{Env}$ be $\Gamma$-exact in $\mbox{\lstinline+@prover+}$ and in circuit, respectively, such that $\gamma_d\coincirc{\Gamma}\gamma$. Assume that, for all subexpressions of~$e$ of the form $\ofty{\getexpr{d'}{k}}{q'}$, the value $\uopl{allpure}(\phi_{d'}(k))$ is $q'$-exact in $\mbox{\lstinline+@prover+}$. Assume that, for $d=\mbox{\lstinline+@prover+}$, there exist $\monadic{v}_d,\gamma'_d,\omicron$ such that $\semd{e}\gamma_d\phi=\uopl{pure}(\monadic{v}_d,\gamma'_d,\omicron)$. If $\rho$~{}is any pair of stream continuations (one for each of $\mbox{\lstinline+@prover+}$ and $\mbox{\lstinline+@verifier+}$) then $\sem{e}\gamma\phi(\omicron\rho)=\uopl{pure}(\monadic{v},\gamma',\rho)$, where $\monadic{v}$ is $q$-exact and $\gamma'$ is $\Gamma$-exact in circuit. Thereby, $\monadic{v}_d\coincirc{q}\monadic{v}$ and $\gamma'_d\coincirc{\Gamma}\gamma'$. (Here, $\omicron\rho$ denotes the pointwise concatenation of $\omicron$ and $\rho$.) \end{theorem} \section{The Syntax of \textsc{ZK-SecreC}\xspace}\label{sec:syntax} Figure~\ref{syntax:ebnf} describes the syntax of a subset of \textsc{ZK-SecreC}\xspace that contains its most important features via the extended Backus-Naur forms (EBNF). We use the following conventions: \begin{itemize} \item The l.h.s. and r.h.s. of productions are separated by the symbol $\mathrel{::=}$; \item Non-terminals and terminals are written in italic and typewriter font, respectively; \item Zero or more repetitions of a term~$t$ is denoted by $\lizt{t\/}$; \item An optional occurrence of a term~$t$ is denoted by $\mebbe{t}$. \end{itemize} \iffalse \begin{figure}[tbp] \figsize\newcommand{\newitem}[1]{\multicolumn{3}{@{}l}{\bullet\hspace{1em}\mbox{#1}}} \[\setlength{\arraycolsep}{4pt}\begin{array}{@{}ll@{}} \begin{array}[t]{lcl} \newitem{Top-level structure of \textsc{ZK-SecreC}\xspace programs:}\\ &&\\ \nterm{prog} &\mathrel{::=}&\lizt{\nterm{fundef}}\\ \nterm{fundef} &\mathrel{::=}&\mbox{\lstinline{fn}}\ \nterm{sig}\ \nterm{expr}\ \mbox{\lstinline{;}}\\ \nterm{sig} &\mathrel{::=}&\nterm{name}\ \mnterm{typarams}\nterm{params}\ \mnterm{rettype}\ \mnterm{typreds}\\ \nterm{typarams} &\mathrel{::=}&\inbracks{\csl{\nterm{typaram}}}\\ \nterm{typaram} &\mathrel{::=}&\nterm{name} \mid\mbox{\lstinline{$}}\nterm{name} \mid\mbox{\lstinline{@}}\nterm{name}\\ \nterm{params} &\mathrel{::=}&\inpars{\csl{\nterm{param}}}\\ \nterm{param} &\mathrel{::=}&\ofty{\nterm{name}}{\nterm{type}}\\ \nterm{rettype} &\mathrel{::=}&\mbox{\lstinline{->}}\ \nterm{type}\\ \nterm{typreds} &\mathrel{::=}&\mbox{\lstinline{where}}\ \csl{\nterm{typred}}\\ \nterm{typred} &\mathrel{::=}&\nterm{domain}\ \mbox{\lstinline{<=}}\ \nterm{domain}\\ &&\\ \newitem{Types:}\\ &&\\ \nterm{type} &\mathrel{::=}&\nterm{qualtype}\ \mnterm{rettype}\\ \nterm{qualtype} &\mathrel{::=}&\nterm{datatype}\ \mnterm{stage}\ \mnterm{domain}\\ \nterm{datatype} &\mathrel{::=}&\nterm{uintty} \mid\nterm{boolty} \mid\mbox{\lstinline+()+} \mid\listty{\nterm{type}\ \mebbe{\mbox{\lstinline{,}}}}\\ \nterm{uintty} &\mathrel{::=}&\mbox{\lstinline+uint+} \mid\uintmodty{\nterm{mod}}\\ \nterm{boolty} &\mathrel{::=}&\mbox{\lstinline+bool+} \mid\boolmodty{\nterm{mod}}\\ \nterm{mod} &\mathrel{::=}&\nterm{name} \mid\nterm{uintlit}\\ \nterm{stage} &\mathrel{::=}&\mbox{\lstinline+$pre+} \mid\mbox{\lstinline+$post+} \mid\mbox{\lstinline{$}}\nterm{name}\\ \nterm{domain} &\mathrel{::=}&\mbox{\lstinline+@public+} \mid\mbox{\lstinline+@verifier+} \mid\mbox{\lstinline+@prover+} \mid\mbox{\lstinline{@}}\nterm{name}\\ &&\\ \newitem{General classification of expressions:}\\ &&\\ \nterm{expr} &\mathrel{::=}&\nterm{largeexpr} \mid\nterm{smallexpr}\\ \nterm{largeexpr} &\mathrel{::=}&\nterm{blockexpr} \mid\nterm{ifexpr} \mid\nterm{forexpr} \mid\nterm{wireexpr}\\ \nterm{smallexpr} &\mathrel{::=}&\nterm{compexpr} \mid\nterm{primexpr}\\ \nterm{compexpr} &\mathrel{::=}&\nterm{assignexpr} \mid\nterm{loadexpr} \mid\nterm{opexpr} \mid\nterm{callexpr} \mid\nterm{castexpr}\\ \nterm{primexpr} &\mathrel{::=}&\nterm{name} \mid\nterm{uintlit} \mid\nterm{boollit} \mid\inpars{\nterm{expr}} \end{array}&\hspace{-9mm}\begin{array}[t]{lcl@{}} \newitem{``Large'' expressions and statements:}\\ &&\\ \nterm{blockexpr} &\mathrel{::=}&\inbraces{\lizt{\nterm{stmt}}\ \mnterm{smallexpr}}\\ \nterm{stmt} &\mathrel{::=}&\nterm{vardef}\ \mbox{\lstinline{;}} \mid\nterm{smallexpr}\ \mbox{\lstinline{;}} \mid\nterm{largeexpr}\ \mebbe{\mbox{\lstinline{;}}}\\ \nterm{vardef} &\mathrel{::=}&\letexpr{\mebbe{\mbox{\lstinline{rec}}}\ \mebbe{\mbox{\lstinline{mut}}}\ \nterm{name}\ \mebbep{\mbox{\lstinline{:}}\ \nterm{type}}}{\nterm{expr}}\\ \nterm{ifexpr} &\mathrel{::=}&\mbox{\lstinline{if}}\ \nterm{expr}\ \nterm{blockexpr}\ \mebbep{\mbox{\lstinline{else}}\ \nterm{blockexpr}}\\ \nterm{forexpr} &\mathrel{::=}&\forexpr{\nterm{name}}{\nterm{expr}}{\nterm{expr}}{\nterm{blockexpr}}\\ \nterm{wireexpr} &\mathrel{::=}&\wireexpr{\nterm{blockexpr}}\\ &&\\ \newitem{``Small'' expressions:}\\ &&\\ \nterm{assignexpr} &\mathrel{::=}&\assignexpr{\nterm{lvalexpr}}{\nterm{expr}}\\ \nterm{lvalexpr} &\mathrel{::=}&\nterm{name} \mid\nterm{loadexpr}\\ \nterm{loadexpr} &\mathrel{::=}&\loadexpr{\nterm{lvalexpr}}{\nterm{expr}}\\ \nterm{opexpr} &\mathrel{::=}&\opexpr{\nterm{smallexpr}}{\nterm{oper}}{\nterm{smallexpr}}\\ \nterm{callexpr} &\mathrel{::=}&\nterm{name}\ \inpars{\csl{\nterm{expr}}}\\ \nterm{castexpr} &\mathrel{::=}&\castexpr{\nterm{smallexpr}}{\nterm{casttype}}\\ \nterm{casttype} &\mathrel{::=}&\nterm{type} \mid\nterm{stage} \mid\nterm{domain} \end{array} \end{array} \] \caption{\label{syntax:ebnf} The syntax of a subset of \textsc{ZK-SecreC}\xspace} \end{figure} \fi \begin{figure}[tbp] \figsize\newcommand{\newitem}[1]{\multicolumn{3}{@{}l}{\bullet\hspace{1em}\mbox{#1}}} \[\setlength{\arraycolsep}{4pt}\begin{array}{@{}ll@{}} \begin{array}[t]{lcl} \newitem{Top-level structure of \textsc{ZK-SecreC}\xspace programs:}\\ &&\\ \nterm{prog} &\mathrel{::=}&\lizt{\nterm{fundef}}\\ \nterm{fundef} &\mathrel{::=}&\nterm{sig}\ \inbraces{\nterm{ex}}\\ \nterm{sig} &\mathrel{::=}&\nterm{name}\ \inpars{\lizt{\nterm{param}}}\ \nterm{rettype}\\ \nterm{param} &\mathrel{::=}&\ofty{\nterm{name}}{\nterm{type}}\\ \nterm{rettype} &\mathrel{::=}&\mbox{\lstinline{->}}\ \nterm{type}\\ &&\\ \newitem{Types:}\\ &&\\ \nterm{type} &\mathrel{::=}&\nterm{qualtype}\ \mnterm{rettype}\\ \nterm{qualtype} &\mathrel{::=}&\nterm{datatype}\ \mnterm{stage}\ \mnterm{domain}\\ \nterm{datatype} &\mathrel{::=}&\nterm{valtype} \mid\mbox{\lstinline+()+} \mid\listty{\nterm{type}}\\ \nterm{valtype} &\mathrel{::=}&\mbox{\lstinline+uint+} \mid\uintmodty{\nterm{mod}} \mid\mbox{\lstinline+bool+} \mid\boolmodty{\nterm{mod}}\\ \nterm{mod} &\mathrel{::=}&\nterm{uintlit}\\ \nterm{stage} &\mathrel{::=}&\mbox{\lstinline+$pre+} \mid\mbox{\lstinline+$post+}\\ \nterm{domain} &\mathrel{::=}&\mbox{\lstinline+@public+} \mid\mbox{\lstinline+@verifier+} \mid\mbox{\lstinline+@prover+} \end{array}&\begin{array}[t]{lcl@{}} \newitem{Expressions and statements:}\\ &&\\ \nterm{seqex} &\mathrel{::=}&\nterm{ex}\ \mbox{\lstinline{;}}\ \nterm{ex}\\ \nterm{vdex} &\mathrel{::=}&\nterm{vardef}\ \mbox{\lstinline{;}}\ \nterm{ex}\\ \nterm{vardef} &\mathrel{::=}&\letexpr{\mebbe{\mbox{\lstinline{mut}}}\ \nterm{name}\ \mebbep{\mbox{\lstinline{:}}\ \nterm{type}}}{\nterm{ex}}\\ \nterm{ifex} &\mathrel{::=}&\mbox{\lstinline{if}}\ \nterm{ex}\ \inbraces{\nterm{ex}}\ \mbox{\lstinline{else}}\ \inbraces{\nterm{ex}}\\ \nterm{forex} &\mathrel{::=}&\forexpr{\nterm{name}}{\nterm{ex}}{\nterm{ex}}{\nterm{ex}}\\ \nterm{wireex} &\mathrel{::=}&\wireexpr{\nterm{ex}}\\ \nterm{assignex} &\mathrel{::=}&\assignexpr{\nterm{lvalex}}{\nterm{ex}}\\ \nterm{lvalex} &\mathrel{::=}&\nterm{name} \mid\nterm{loadex}\\ \nterm{loadex} &\mathrel{::=}&\loadexpr{\nterm{lvalex}}{\nterm{ex}}\\ \nterm{opex} &\mathrel{::=}&\opexpr{\nterm{ex}}{\nterm{oper}}{\nterm{ex}}\\ \nterm{callex} &\mathrel{::=}&\nterm{name}\ \inpars{\lizt{\nterm{ex}}}\\ \nterm{castex} &\mathrel{::=}&\castexpr{\nterm{ex}}{\nterm{casttype}}\\ \nterm{casttype} &\mathrel{::=}&\nterm{qualtype} \mid\nterm{stage} \mid\nterm{domain} \end{array}\\ \multicolumn{2}{c}{ \begin{array}{lcl@{}} &&\\ \nterm{ex} &\mathrel{::=}&\nterm{seqex} \mid\nterm{vdex} \mid\nterm{ifex} \mid\nterm{forex} \mid\nterm{wireex} \mid\nterm{assignex} \mid\nterm{loadex} \mid\nterm{opex} \mid\nterm{callex} \mid\nterm{castex} \mid\nterm{name} \mid\nterm{uintlit} \mid\nterm{boollit} \end{array} } \end{array} \] \caption{\label{syntax:ebnf} The syntax of a subset of \textsc{ZK-SecreC}\xspace} \end{figure} A \textsc{ZK-SecreC}\xspace \emph{program} consists of \emph{function definitions}, including the main function. Every function definition contains its \emph{signature} and \emph{body}, the latter of which is an expression. Although \textsc{ZK-SecreC}\xspace supports type inference, due to which the types of local variables can be omitted, declaring the types of parameters in function definitions is still required. The type system of \textsc{ZK-SecreC}\xspace supports both parametric and ad-hoc polymorphism. The example in Fig.~\ref{language:factor} showed the use of \emph{type parameters} and \emph{type predicates} in the signatures of functions. An example of ad-hoc polymorphism occurs in the function \lstinline{bitextract}, where the control flow depends on the value of the type parameter \lstinline{@D}. Polymorphism is important in the reuse of \textsc{ZK-SecreC}\xspace code (i.e. libraries), but since it is orthogonal to the ZKP aspects of the language, we leave it out of consideration in Sects.~\ref{sec:syntax}--\ref{sec:compilation}. The polymorphic language can be converted to an internal monomorphic form using standard monomorphization techniques (code duplication, instantiation) since we do not support polymorphic recursion. The outermost structure of a \emph{type} represents it as a (curried) function type with zero or more argument types, each of which is a \emph{qualified type}. All qualified types in \textsc{ZK-SecreC}\xspace are triples consisting of a \emph{data type}, a \emph{stage} (prefixed with \lstinline{$}) and a \emph{domain} (prefixed with \lstinline{@}); the latter two are called \emph{qualifiers}. Stage and domain are allowed to be omitted; an omitted stage is inferred, whereas an omitted domain is read as the domain \lstinline{@public}. Currently, the primitive types in \textsc{ZK-SecreC}\xspace are \emph{Booleans}, \emph{(unsigned) integers}, and the unit type~$\mbox{\lstinline+()+}$ consisting of a single value. A list is a data structure of linear shape where all elements have equal type; the element type is given to the list type as parameter. The qualifiers of a list type do not necessarily coincide with those of the element type. For example, a list of domain $\mbox{\lstinline+@public+}$ can contain elements of domain $\mbox{\lstinline+@prover+}$, meaning that the shape of the list is known to the compiler while the elements are known to Prover only. The \emph{expressions} and \emph{statements} (which are not distinguished in \textsc{ZK-SecreC}\xspace; e.g. the if-then-else construct can be used both as a statement with side effects in the branches, or as a pure expression similar to the ternary conditional operator in C-style languages) are largely self-explanatory. Each expression returns a value (which may be of type~$\mbox{\lstinline+()+}$ in particular). Sequential execution ignores the return value of the first expression. A \emph{variable definition} introduces and initializes an immutable or a mutable (if the modifier \lstinline{mut} is present) variable; its type may be omitted, in which case it will be inferred. A \emph{for loop} of the form $\forexpr{x}{e_1}{e_2}{e_3}$ introduces a new variable~$x$, executes the loop body $e_3$ for each value of~$x$ in the half-open segment between the values of $e_1$ and~$e_2$, and returns all values of the loop body as a list. A \emph{wire expression} transforms local values to circuit inputs. We have omitted definitions for names and literals as they are intuitive. Most of the given definitions of composed expressions are intuitive, too. The nonterminal $\nterm{opex}$ expands to expressions constructed via binary operator application. Standard operator precedence is assumed which allows some pairs of parentheses to be omitted (it is not made explicit in the grammar). A \emph{cast expression} enables the programmer to convert between different types. One can provide either a complete type expression or just the domain or the stage instead. \section{Proof of Theorem~\ref{typesystem:thm} and Lemma~\ref{typesystem:lhslemma}}\label{typesystem-proofs} Before proving Theorem~\ref{typesystem:thm}, we have to establish that $\uopl{allpre}_{d'}$ holds on well-structured types only. \begin{lemma}\label{typesystem:lemma} Let $q=\qualty{t}{s}{d}$ be a qualified type and $d'$ be a domain. If $\uopl{allpre}_{d'}q$ then $q$ is well-structured. \end{lemma} \begin{proof} By induction on the structure of~$t$: \begin{itemize} \item If $t$ is a primitive type then $q=\qualty{t}{\mbox{\lstinline+$pre+}}{d'}$ which is well-structured by Definition~\ref{typesystem:def}. \item Let $t=\listty{q'}$. Then $q=\qualty{\listty{q'}}{\mbox{\lstinline+$pre+}}{d'}$, i.e., $s=\mbox{\lstinline+$pre+}$ and $d=d'$, and $\uopl{allpre}_{d'}q'$. By the induction hypothesis, $q'$ is well-structured. We know by the definition of $\uopl{allpre}_{d'}$ that $q'=\qualty{t'}{\mbox{\lstinline+$pre+}}{d'}$ for some datatype $t'$. Hence $\gen{d}=\gen{d'}=\varnothing\cup\gen{d'}=\gen{\mbox{\lstinline+$pre+}}\cup\gen{d'}$ which completes the proof. \end{itemize} \end{proof} \begin{theorem}[Theorem~\ref{typesystem:thm}] If\/ $\Gamma\mbox{\ $\vdash$\ } e : q! D$ with a well-structured~$\Gamma$ then $q$ is well-structured. \end{theorem} \begin{proof} Let $q=\qualty{t}{s}{d}$. We proceed by induction of the structure of~$e$: \begin{itemize} \item If $e=\epsilon$, $e=\overline{n}$, $e=\overline{b}$, $e=\mbox{\lstinline+assert+}(e')$, $e=\mbox{\lstinline+wire+ }\inbraces{e'}$ or $e=(\mbox{$l$ \lstinline+=+ $e'$})$ then $t$ is primitive, whereby $t=()$ implies $s=\mbox{\lstinline+$pre+}$. Hence $q$ is well-structured. \item If $e=x$ then the claim follows from the assumption that $\Gamma$ is well-structured. \item If $e=\ofty{\getexpr{d}{k}}{q}$ then $\uopl{allpre}_dq$ and the claim follows from Lemma~\ref{typesystem:lemma}. \item Suppose $e=\mbox{$e_1$ \lstinline{+} $e_2$}$. Then $t=\mbox{\lstinline{uint[N]}}$, and $\Gamma\mbox{\ $\vdash$\ } e_1:t\ s\ d! D_1$ and $\Gamma\mbox{\ $\vdash$\ } e_2:t\ s\ d! D_2$. Hence by the induction hypothesis, $t\ s\ d$ is well-structured, and the desired claim follows. \item Suppose $e=\mbox{\lstinline+if+ $e_1$ \inbraces{$e_2$} \lstinline+else+ \inbraces{$e_3$}}$. Then $\Gamma\mbox{\ $\vdash$\ } e_2:t\ s\ d! D_2$ and $\Gamma\mbox{\ $\vdash$\ } e_3:t\ s\ d! D_3$. Hence by the induction hypothesis, $t\ s\ d$ is well-structured, and the desired claim follows. \item Suppose $e=\mbox{\lstinline+for+ $x$ \lstinline+in+ $e_1$ \lstinline+..+ $e_2$ }\inbraces{e_3}$. Then $t=\mbox{\lstinline+list+ }\inbracks{t'\ s'\ d'}$, $s=\mbox{\lstinline+$pre+}$ and $\Gamma\mbox{\ $\vdash$\ } e_i:\mbox{\lstinline{uint[N]} \lstinline+$pre+}\ d! D_i$ ($i=1,2$), $(x:\mbox{\lstinline+uint[N]+ \lstinline+$pre+}\ d),\Gamma\mbox{\ $\vdash$\ } e_3:t'\ s'\ d'! D_3$, whereby $\gen{d}\supseteq\gen{s'}\cup\gen{d'}\cup D_3$. By the induction hypothesis for $e_1$ and $e_2$, the qualified type $\mbox{\lstinline{uint[N]} \lstinline+$pre+}\ d$ is well-structured. Therefore, the extended type environment $(x:\mbox{\lstinline+uint[N]+ \lstinline+$pre+}\ d),\Gamma$ is well-structured. Hence the induction hypothesis for $e_3$ implies that $t'\ s'\ d'$ is well-structured. This completes checking the assumptions of $\mbox{\lstinline+list+ }\inbracks{t'\ s'\ d'}\ s\ d$ being well-structured by Definition~\ref{typesystem:def}, hence the desired claim follows. \item Suppose $e=e'\mbox{ \lstinline{as} }t\ s\ d$. Then $\Gamma\mbox{\ $\vdash$\ } e':t\ s'\ d'$, $s'\mathrel{\mathchar"13C\mathchar"3A} s$, $d'\mathrel{\mathchar"13C\mathchar"3A} d$, and $\gen{d}\supseteq\gen{t}$. By the induction hypothesis, $t\ s'\ d'$ is well-structured. If $t$ is a primitive type then $t\ s\ d$ is well-structured, too, as $s'=\mbox{\lstinline+$pre+}$ implies $s=\mbox{\lstinline+$pre+}$. Now let $t=\mbox{\lstinline+list+ }\inbracks{t''\ s''\ d''}$; by $t\ s'\ d'$ being well-structured, we have $s'=\mbox{\lstinline+$pre+}$, $\gen{d'}\supseteq\gen{s''}\cup\gen{d''}$ and $t''\ s''\ d''$ well-structured. Therefore $s=\mbox{\lstinline+$pre+}$. Moreover, using $\gen{d}\supseteq\gen{t}$ and the definition of $\gen{t}$, we obtain $\gen{d}\supseteq\gen{t''}\cup\gen{s''}\cup\gen{d''}\supseteq\gen{s''}\cup\gen{d''}$. Hence $t\ s\ d$ is well-structured by Definition~\ref{typesystem:def}. \item Suppose $e=l\inbracks{e'}$. Then $\Gamma\mbox{\ $\vdash$\ } l:t'\ s'\ d'! D'$ where $t'=\mbox{\lstinline+list+}\inbracks{t\ s\ d}$. By the induction hypothesis, $t'\ s'\ d'$ is well-structured. Definition~\ref{typesystem:def} now implies $t\ s\ d$ also being well-structured. \item Suppose $e=\mbox{\lstinline+let+ }x:t'\ s'\ d'\mbox{ \lstinline+=+ }e_1\mbox{\lstinline{;}}\ e_2$. Then $\Gamma\mbox{\ $\vdash$\ } e_1:t'\ s'\ d'! D_1$ and $(x:t'\ s'\ d'),\Gamma\mbox{\ $\vdash$\ } e_2:t\ s\ d! D_2$. By the induction hypothesis for $e_1$, qualified type $t'\ s'\ d'$ is well-structured. Therefore, the extended type environment $(x:t'\ s'\ d'),\Gamma$ is well-structured. Hence the induction hypothesis for $e_2$ implies that $t\ s\ d$ is well-structured. \item If $e=e_1\mbox{\lstinline{;}}\ e_2$ then $\Gamma\mbox{\ $\vdash$\ } e_2:t\ s\ d! D_2$, whence the induction hypothesis implies $t\ s\ d$ being well-structured. \end{itemize} \end{proof} \begin{lemma}[Lemma~\ref{typesystem:lhslemma}] Let $\Gamma\mbox{\ $\vdash$\ } e:q! D$, where $q=(\qualty{t}{s}{d})$ and $\Gamma$ is well-structured. Let $e=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$ where $x$ is a variable. Then there exist domains $d_1,\ldots,d_n$ and upward closed domain sets $D_1,\ldots,D_n$ such that $\Gamma\mbox{\ $\vdash$\ } y_i:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_i}! D_i$ for each $i=1,\ldots,n$ and \[ \Gamma\mbox{\ $\vdash$\ } x:\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1}!\varnothing\mbox{,} \] whereby $d_1\mathrel{\mathchar"13C\mathchar"3A}\ldots\mathrel{\mathchar"13C\mathchar"3A} d_{n-1}\mathrel{\mathchar"13C\mathchar"3A} d_n\mathrel{\mathchar"13C\mathchar"3A} d$ and $D=D_1\cup\ldots\cup D_n$. \end{lemma} \begin{proof} We prove the claim by induction on~$n$. If $n=0$ then $x=e$ and the claim holds trivially. Now suppose that $n>0$ and the claim holds for $n-1$. As $\Gamma\mbox{\ $\vdash$\ }\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}:q! D$, we must have a domain $d_n$ and upward closed domain sets~$D',D_n$ such that \[ \begin{array}{l} \Gamma\mbox{\ $\vdash$\ }\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_{n-1}}:\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}! D'\mbox{,}\\ \Gamma\mbox{\ $\vdash$\ } y_n:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_n}! D_n\mbox{,}\\ D=D'\cup D_n\mbox{.} \end{array} \] By the induction hypothesis, $\Gamma\mbox{\ $\vdash$\ } y_i:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_i}! D_i$ for each $i=1,\ldots,n-1$, and \[ \Gamma\mbox{\ $\vdash$\ } x:\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1}!\varnothing\mbox{,} \] whereby $d_1\mathrel{\mathchar"13C\mathchar"3A}\ldots\mathrel{\mathchar"13C\mathchar"3A} d_{n-1}\mathrel{\mathchar"13C\mathchar"3A} d_n$ and $D'=D_1\cup\ldots\cup D_{n-1}$. As $D=D'\cup D_n$, the latter implies $D=D_1\cup\ldots\cup D_n$. By $\Gamma$ being well-structured and Theorem~\ref{typesystem:thm}, the type of~$x$ is well-structured, whence also $d_n\mathrel{\mathchar"13C\mathchar"3A} d$. \end{proof} \section{Static Semantics}\label{sec:typesystem} The security guarantees of \textsc{ZK-SecreC}\xspace are established by its type system. Types are checked (and inferred in certain cases) during compile time, hence the type system is part of the static semantics of \textsc{ZK-SecreC}\xspace. In this section, we describe a static semantics that traces also effects (e.g., assertions and mutable variable updates) that expression evaluation can cause. The type system makes sure that the program can be translated into the circuit, and into Prover's and Verifier's local computations. In Sec.~\ref{sec:syntax}, we explained our non-treatment of type parameters. For analogous reasons, we skip function definitions and user-defined function calls in our treatment; a few most important or representative built-in functions are considered. Assertions in the type rules are of the form $\Gamma \mbox{\ $\vdash$\ } e : t ! D$. Here, $\Gamma$~is a type environment, $e$~is an expression, $t$~is a qualified type, and $D$~is an upward closed set of domains, assuming the ordering $\mbox{\lstinline+@public+}\mathrel{\mathchar"13C\mathchar"3A}\mbox{\lstinline+@verifier+}\mathrel{\mathchar"13C\mathchar"3A}\mbox{\lstinline+@prover+}$ of growing privacy. A type assertion states that under the constraints imposed by~$\Gamma$, the expression~$e$ has type~$t$ and running it can cause effects in domains belonging to the set~$D$. For example, an assignment to a mutable variable whose domain is $\mbox{\lstinline+@prover+}$ causes an effect in domain $\mbox{\lstinline+@prover+}$. In discussions, we will sometimes omit effects from type assertions if the effects are not important. A type environment is a finite association list consisting of the following kinds of components: \begin{itemize} \item Variable typings written in the form $x:q$, where $x$~is a variable and $q$ is a qualified type; \item Mutability statements in the form $\uopl{mut} x:b$ where $x$ is a variable and $b$~is its mutability status ($0$ or $1$). \end{itemize} We write $(z:w),\Gamma$ to denote a new type environment containing the association $(z:w)$ followed by all associations in~$\Gamma$. We also write $\lookup{\Gamma}{z}$ for lookup of~$z$ in the type environment~$\Gamma$, i.e., if $\Gamma=((z_1:w_1),\ldots,(z_n:w_n))$ then $\lookup{\Gamma}{z}=w_i$ where $i$ is the least index such that $z_i=z$. Note that $z$ is a variable possibly equipped with $\uopl{mut}$, and $w$ is either a qualified type or a mutability status, respectively. If the associations of variables to qualified types of $\Gamma$ are $(x_1:q_1),\ldots,(x_n:q_n)$, in this order, then we denote $\uopl{vars}\Gamma=(x_1,\ldots,x_n)$. \begin{figure*}\figsize\renewcommand{\arraystretch}{2.2} \begin{tabular}{@{}c@{}} \begin{prooftree} \infer0{\Gamma \mbox{\ $\vdash$\ } \epsilon : \qualty{\mbox{\lstinline+()+}}{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}} ! \varnothing} \end{prooftree}\quad \begin{prooftree} \hypo{n\in\mathbb{N}} \infer1{\Gamma \mbox{\ $\vdash$\ } \overline{n} : \qualty{\uintmodty{\mbox{\lstinline{N}}}}{s}{d} ! \gen{s}} \end{prooftree}\quad \begin{prooftree} \hypo{b\in\mathbb{B}} \infer1{\Gamma \mbox{\ $\vdash$\ } \overline{b} : \qualty{\boolmodty{\mbox{\lstinline{N}}}}{s}{d} ! \gen{s}} \end{prooftree}\quad \begin{prooftree} \hypo{\lookup{\Gamma}{x}=(\qualty{t}{s}{d})} \infer1{\Gamma \mbox{\ $\vdash$\ } x : \qualty{t}{s}{d} ! \varnothing} \end{prooftree}\\ \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e_1 : \qualty{\uintmodty{\mbox{\lstinline{N}}}}{s}{d} ! D_1} \hypo{\Gamma \mbox{\ $\vdash$\ } e_2 : \qualty{\uintmodty{\mbox{\lstinline{N}}}}{s}{d} ! D_2} \infer2{\Gamma \mbox{\ $\vdash$\ } \addexpr{e_1}{e_2} : \qualty{\uintmodty{\mbox{\lstinline+N+}}}{s}{d} ! \gen{s}\cup D_1\cup D_2} \end{prooftree}\quad \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e : \qualty{\boolmodty{\mbox{\lstinline{N}}}}{\mbox{\lstinline+$post+}}{d} ! D} \infer1{\Gamma \mbox{\ $\vdash$\ } \assertexpr{e} : \qualty{\mbox{\lstinline+()+}}{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}} ! \gen{\mbox{\lstinline+@public+}}} \end{prooftree}\\ \begin{prooftree} \hypo{\uopl{allpre}_{d'}(\qualty{t}{s}{d})} \infer1{\Gamma \mbox{\ $\vdash$\ } (\ofty{\getexpr{d'}{k}\!}{\!\qualty{t}{\!s\!}{d}})\!:\!\qualty{t}{\!s\!}{d}!\!\varnothing} \end{prooftree}\quad \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e_1 : \qualty{\boolmodty{\mbox{\lstinline{N}}}}{\mbox{\lstinline+$pre+}}{d'} ! D_1} \hypo{\Gamma \mbox{\ $\vdash$\ } e_i : \qualty{t}{s}{d} ! D_i\ (i=2,3)} \hypo{\gen{d'}\supseteq\gen{s}\cup\gen{d} \cup D_2 \cup D_3} \infer3{\Gamma \mbox{\ $\vdash$\ } \ifexpr{e_1}{e_2}{e_3} : \qualty{t}{s}{d} ! D_1 \cup D_2 \cup D_3} \end{prooftree}\\ \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e_i : \qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d'} ! D_i\ (i=1,2)} \hypo{(x : \qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d'}), \Gamma \mbox{\ $\vdash$\ } e_3 : \qualty{t}{s}{d} ! D_3} \hypo{\gen{d'} \supseteq \gen{s}\cup\gen{d}\cup D_3} \infer3{\Gamma \mbox{\ $\vdash$\ } \forexpr{x}{e_1}{e_2}{e_3} : \qualty{\listty{\qualty{t}{s}{d}}}{\mbox{\lstinline+$pre+}}{d'} ! D_1 \cup D_2 \cup D_3} \end{prooftree}\\ \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e : \qualty{t}{\mbox{\lstinline+$pre+}}{d} ! D} \hypo{t\in\set{\uintmodty{\mbox{\lstinline{N}}},\boolmodty{\mbox{\lstinline{N}}}}} \infer2{\Gamma \mbox{\ $\vdash$\ } \wireexpr{e} : \qualty{t}{\mbox{\lstinline+$post+}}{d}! \gen{\mbox{\lstinline+@public+}}} \end{prooftree}\qquad \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e : \qualty{t}{s}{d} ! D} \hypo{s \mathrel{\mathchar"13C\mathchar"3A} s'} \hypo{d \mathrel{\mathchar"13C\mathchar"3A} d'} \hypo{\gen{d'}\supseteq\gen{t}} \infer4{\Gamma \mbox{\ $\vdash$\ } \castexpr{e}{\qualty{t}{s'}{d'}} : \qualty{t}{s'}{d'} ! D} \end{prooftree}\\ \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e : \qualty{t}{s}{d} ! D} \hypo{\Gamma \mbox{\ $\vdash$\ } l : \qualty{t}{s}{d} ! D'} \hypo{\lookup{\Gamma}{\uopl{mut}(\uopl{var} l)}=1} \infer3{\Gamma \mbox{\ $\vdash$\ } \assignexpr{l}{e} : \qualty{\mbox{\lstinline+()+}}{\mbox{\lstinline+$pre+}}{\mbox{\lstinline+@public+}} ! \gen{s}\cup\gen{d} \cup D \cup D'} \end{prooftree}\quad \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } l : \qualty{\listty{\qualty{t}{s}{d}}}{s'}{d'} ! D'} \hypo{\Gamma \mbox{\ $\vdash$\ } e : \qualty{\mbox{\lstinline+uint+}}{s'}{d'} ! D} \infer2{\Gamma \mbox{\ $\vdash$\ } \loadexpr{l}{e} : \qualty{t}{s}{d} ! D \cup D'} \end{prooftree}\\ \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e_1 : \qualty{t_1}{s_1}{d_1} ! D_1} \hypo{(\uopl{mut} x : b), (x : \qualty{t_1}{s_1}{d_1}), \Gamma \mbox{\ $\vdash$\ } e_2 : \qualty{t_2}{s_2}{d_2} ! D_2} \infer2{\Gamma \mbox{\ $\vdash$\ } \stmtcomp{\letexpr{\mbox{\lstinline{mut}}^b\ x}{e_1}}{e_2} : \qualty{t_2}{s_2}{d_2} ! \gen{d_1} \cup D_1 \cup D_2} \end{prooftree}\quad \begin{prooftree} \hypo{\Gamma \mbox{\ $\vdash$\ } e_1 : \qualty{t_1}{s_1}{d_1} ! D_1} \hypo{\Gamma \mbox{\ $\vdash$\ } e_2 : \qualty{t_2}{s_2}{d_2} ! D_2} \infer2{\Gamma \mbox{\ $\vdash$\ } \stmtcomp{e_1}{e_2} : \qualty{t_2}{s_2}{d_2} ! D_1 \cup D_2} \end{prooftree} \end{tabular} \caption{\label{typesystem:exprstmt} Typing rules of expressions and statements of a subset of \textsc{ZK-SecreC}\xspace without parametric polymorphism} \end{figure*} The static semantics is presented in Fig.~\ref{typesystem:exprstmt}. The data type derivation parts of the rules are standard. Hence we mainly comment on stages, domains and effects. There exist four upward closed domain sets linearly ordered by inclusion: $\varnothing\subset\gen{\mbox{\lstinline+@prover+}}\subset\gen{\mbox{\lstinline+@verifier+}}\subset\gen{\mbox{\lstinline+@public+}}$, where $\gen{d}$ denotes the set consisting of domain~$d$ and all larger domains. Thus the union of upward closed sets always equals the largest set in the union. We also order stages as $\mbox{\lstinline+$post+}\mathrel{\mathchar"13C\mathchar"3A}\mbox{\lstinline+$pre+}$, reflecting that data computed in the circuit are also computed locally in the corresponding domain in order to be ready to provide expanded instances/witnesses to the circuit. \textsc{ZK-SecreC}\xspace requires conversion to supertype to be made explicit using the \lstinline{as} keyword. The first rule in Fig.~\ref{typesystem:exprstmt} handles missing expression~$\epsilon$; it is needed for the case where the last expression of a sequential execution is absent. Integer and Boolean literals are denoted by overlined constants. We show only rules for $\uintmodty{\mbox{\lstinline{N}}}$ and $\boolmodty{\mbox{\lstinline{N}}}$; rules for $\mbox{\lstinline+uint+}$ and $\mbox{\lstinline+bool+}$ in stage $\mbox{\lstinline+$pre+}$ are similar. Literals can be typed with any stage and domain (i.e., no type cast is required). The effect of literals depends on their actual stage: In stage $\mbox{\lstinline+$pre+}$ they do not have any effect, while in stage $\mbox{\lstinline+$post+}$, they have public effect since there they contribute to constructing of the circuit. In general, any operation in the circuit is considered a public effect. To specify the possible effects concisely in the rules, we extend the $\gen{\cdot}$ notation to stages by $\gen{\mbox{\lstinline+$pre+}}=\varnothing$, $\gen{\mbox{\lstinline+$post+}}=\gen{\mbox{\lstinline+@public+}}$, and also to data types by $\gen{t}=\varnothing$ if $t$~{}is a primitive type and $\gen{t}=\gen{t'}\cup\gen{s'}\cup\gen{d'}$ if $t=\listty{\qualty{t'}{s'}{d'}}$. (This way, the result of the $\gen{\cdot}$ operation is always an upward closed set of domains.) Types of variables are read directly from the type environment without an effect. The rule for addition allows this operation to be performed in any domain and stage, but the domain of the arguments and the result must be the same and similarly for stages. The rule for \lstinline+assert+ establishes the result data type to be the unit type. The unit type, as well as list types, is always in the stage $\mbox{\lstinline+$pre+}$ since the circuit does not deal with values of these types. In any domain, the slice of the program available to local computation of that domain can read input data. The \textsc{ZK-SecreC}\xspace functions for that are \lstinline{get_public}, \lstinline{get_instance} and \lstinline{get_witness} which read the public constants, the instance, and the witness, respectively (all non-expanded). Here we denote these functions uniformly by $\mbox{\lstinline{get}}_d$ where $d=\mbox{\lstinline+@public+}$, $d=\mbox{\lstinline+@verifier+}$ and $d=\mbox{\lstinline+@prover+}$, respectively, so the rule for $\mbox{\lstinline+get+}_d$ captures all three cases. An argument of the function $\mbox{\lstinline{get}}_d$ is a key of a dictionary and the function returns the corresponding value in the dictionary. String literals are used as keys. The type of an expression of the form $\getexpr{d'}{k}$ cannot be derived from its constituents as the dictionary need not be available for the type checker. Therefore, the type rule for such expressions requires them to be explicitly typed. The only restriction we impose on the result type is $\uopl{allpre}_{d'}(\qualty{t}{s}{d})$ which is to denote that all types occurring in $\qualty{t}{s}{d}$ must be qualified with $\qual{\mbox{\lstinline+$pre+}}{d'}$. More precisely, $\uopl{allpre}_{d'}(\qualty{t}{s}{d})$ is true iff $s=\mbox{\lstinline+$pre+}$, $d=d'$ and in the case $t=\listty{q'}$ also $\uopl{allpre}_{d'}(q')$. The rules for conditional expressions and loops restrict the stage of guards to $\mbox{\lstinline+$pre+}$, meaning that branchings happen only in local computations. For conditional expressions, the restriction $\gen{d'}\supseteq\gen{s}\cup\gen{d}\cup D_2\cup D_3$ serves the following purposes: \begin{itemize} \item $\gen{d'}\supseteq\gen{d}$ (i.e., $d'\mathrel{\mathchar"13C\mathchar"3A} d$) makes the output of the conditional expression to have at least as high privacy level as the guard (the \emph{no-read-up} property); \item $\gen{d'}\supseteq D_2\cup D_3$ disallows information flows through side effects of the branches (the \emph{no-write-down} property); \item $\gen{d'}\supseteq\gen{s}$ ensures that, if the expression is computed by the circuit, then the branch that must be taken is known at the compile-time (also an instance of \emph{no-write-down}, as all computations by the circuit have visible side-effects). \end{itemize} The restriction $\gen{d'}\supseteq\gen{s}\cup\gen{d}\cup D_3$ in the loop rule provides similar guarantees. For example, if the body of a loop performs assertions then the loop bounds must be in the domain $\mbox{\lstinline+@public+}$. A type cast can extend the type of a given expression but not reduce it. Moreover, the condition $\gen{d'}\supseteq\gen{t}$ of the cast rule guarantees a type invariant that prevents list elements from revealing information about the list structure to domains of lower privacy (via lookups). This invariant is formally established in Definition~\ref{typesystem:def} and Theorem~\ref{typesystem:thm}. The l.h.s. of an assignment can be complex, consisting of a variable followed by an index vector. Let $\uopl{var} l$ for any L-value expression~$l$ denote the variable whose mutability permits assignment to this L-value, i.e., $\uopl{var} l=l$ if $l$~is a variable, and $\uopl{var} l=\uopl{var} l'$ if $l$ is $\mbox{$l'$\inbracks{$e$}}$. The assignment rule states that the return value of an assignment expression is of the unit data type and the effect of an assignment belongs to the domain $\mbox{\lstinline+@public+}$ if the operands are in stage $\mbox{\lstinline+$post+}$, otherwise the effect belongs to the same domain~$d$ as the operands. The type structure and effects of the contents of the l.h.s. is the topic of Lemma~\ref{typesystem:lhslemma}. In the list element access rule, the index must be in the same domain as the list structure since accessing an element via its index may reveal information about the length of the list. Reading does not introduce new effects. In the rule for let statements, $\mbox{\lstinline{mut}}^1$ stands for $\mbox{\lstinline{mut}}$ keyword and $\mbox{\lstinline{mut}}^0$ means empty string, so the rule applies to both immutable and mutable variable definitions. Mutability information is reflected in the type environment when type checking the expression~$e_2$. We consider variable definition to be effectful, whence~$\gen{d_1}$ is added into the set of effects. The last rule similarly handles statement sequences but applies to the case where the first statement does not define new variables. The following definition~\ref{typesystem:def} and theorem~\ref{typesystem:thm} are essential. Proof of the theorem goes by induction on the structure of~$e$. The details are given in Appendix~\ref{typesystem-proofs}. \begin{definition}\label{typesystem:def} Let $q=\qualty{t}{s}{d}$ be a qualified type. We call $q$ \emph{well-structured} if either $t$~{}is a primitive type, whereby $s=\mbox{\lstinline+$pre+}$ in the case of $t=\mbox{\lstinline+()+}$; or $s=\mbox{\lstinline+$pre+}$ and $t=\listty{\qualty{t'}{s'}{d'}}$ such that $\gen{d}\supseteq\gen{s'}\cup\gen{d'}$ and $\qualty{t'}{s'}{d'}$ is well-structured. Call a type environment $\Gamma$ \emph{well-structured} if all qualified types occurring in it are well-structured. \end{definition} \begin{theorem}\label{typesystem:thm} If\/ $\Gamma$ is well-structured and $\Gamma\mbox{\ $\vdash$\ } e : q! D$, then $q$ is well-structured. \end{theorem} Proofs of many theorems of the following sections rely on Lemma~\ref{typesystem:lhslemma}, which is itself proved by induction on the length of index vector: \begin{lemma}\label{typesystem:lhslemma} Let $e=\loadexpr{\loadexpr{\loadexpr{x}{y_1}}{y_2}\ldots}{y_n}$ where $x$ is a variable. Let $\Gamma\mbox{\ $\vdash$\ } e:q! D$, where $q=(\qualty{t}{s}{d})$ and $\Gamma$ is well-structured. Then there exist domains $d_1,\ldots,d_n$ and upward closed domain sets $D_1,\ldots,D_n$ such that $\Gamma\mbox{\ $\vdash$\ } y_i:\qualty{\mbox{\lstinline+uint+}}{\mbox{\lstinline+$pre+}}{d_i}! D_i$ for each $i=1,\ldots,n$ and \[ \Gamma\mbox{\ $\vdash$\ } x:\qualty{\listty{\ldots\listty{\qualty{\listty{\qualty{\listty{q}}{\mbox{\lstinline+$pre+}}{d_n}}}{\mbox{\lstinline+$pre+}}{d_{n-1}}}\ldots}}{\mbox{\lstinline+$pre+}}{d_1}!\varnothing\mbox{,} \] whereby $d_1\mathrel{\mathchar"13C\mathchar"3A}\ldots\mathrel{\mathchar"13C\mathchar"3A} d_{n-1}\mathrel{\mathchar"13C\mathchar"3A} d_n\mathrel{\mathchar"13C\mathchar"3A} d$ and $D=D_1\cup\ldots\cup D_n$. \end{lemma} The details of the proof are given in Appendix~\ref{typesystem-proofs}.
0bd3830a8ee66470468f3edb80c89f9d7453347a
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Limitations \& Future Work} While our proposed pre-training method demonstrates superior performance compared with the state-of-the-art methods, there still exist several limitations. Since our approach relies on 3D geometric consistency to guide the learning of image representations, it can hardly be applied directly on the datasets such as ImageNet\cite{deng2009imagenet}, where 3D reconstructions are not applicable. Besides, in this work, we use a simple 3D clustering method for computing geometric consistency sets; one may consider using more advanced clustering techniques to further improve the performance. \section{Conclusion} We propose a method that uses 3D geometric consistency as guidance for self-supervised image representation learning. We leverage the continuities and discontinuities of 3D data and use the 3D clustering results to produce geometric consistency sets for 2D image views. Then we incorporate the geometric consistency sets into a contrastive learning framework to make the learned 2D image representations aware of 3D geometric consistency. We show that the image representations learned in this way will lead to superior performance than state-of-the-arts after fine-tuning for downstream tasks. Moreover, our approach can also improve the performance of downstream tasks when fine-tuning with limited training data. Various ablation studies further verify the effectiveness of our method. \section{Experimental Setup} In this section, we will provide a detailed description of our experimental setup, including the backbone architectures, datasets for pre-training and evaluation, and the implementation details. More experiment details are given in the supplementary materials. \subsection{Backbone Architecture} We use a UNet-style\cite{ronneberger2015u} architecture with residual connections as our network backbone since it has been widely used in various deep learning tasks. Specifically, it uses ResNet\cite{he2016deep} as encoder, and the decoder part contains standard convolution blocks together with bi-linear interpolation layers for upsampling. In most of our experiments, we use ResNet50 as our encoder for its efficiency and effectiveness. In addition, we also use ResNet18 as the encoder to see the effectiveness of our method with a more lightweight architecture. \subsection{Dataset} We conduct our experiments on two widely used datasets ScanNet\cite{dai2017scannet} and NYUv2 \cite{silberman2012indoor}, where ScanNet is used for both pre-training and downstream task fine-tuning, and NYUv2 is used for demonstrating the transferability of the representations learned with our method on ScanNet. In the following, we give more details about the two datasets. \paragraph{ScanNet} ScanNet\cite{dai2017scannet} contains large amount of RGB-D sequences together with the corresponding 3D scene reconstructions. It has 1513 scenes for training, which contains around 2.5M images in total. Following Pri3D \cite{hou2021pri3d}, we regularly sample every 25th frame from the original ScanNet sequence for pre-training. And the frame pairs with more than 30$\%$ pixel overlap will be used for contrastive training. Totally, we have around 804k frame pairs in the pre-training stage. Note that we do not use any semantic labels for pre-training. For fine-tuning on downstream tasks, we use the standard labeled training and validation set of ScanNet benchmark\cite{dai2017scannet}, and the 2D images are sampled every 100th frame from the original sequence. Thus, in the fine-tuning stage, we have around 20k images for training and 5k images for validation. \paragraph{NYUv2} NYUv2\cite{silberman2012indoor} is a dataset consisting of 2D images scanned from various indoor scenes, and in this paper, it is used for fine-tuning downstream tasks. Totally it has 1449 labeled images, in which 795 images are used for training and 654 images for testing. \subsection{Comparison Methods} \paragraph{Supervised ImageNet Pre-training \cite{deng2009imagenet}} The network is pre-trained with the supervised classification task on the ImageNet dataset. \paragraph{MoCoV2 \cite{chen2020improved}} For MoCoV2, there are various strategies for feeding the data, we only list the best performing result (i.e. MoCoV2-supIN $\rightarrow $ SN) from Pri3D \cite{hou2021pri3d}. To be specific, MoCoV2 is initialized with supervised ImageNet pre-training and then trained on ScanNet with randomly shuffled images. \paragraph{Pri3D \cite{hou2021pri3d}} Pri3D is the method most related to ours, in which 3D data and contrastive pre-training are used. Specifically, it comprises 2D to 2D and 2D to 3D point InfoNCE loss, termed View and Geo loss, respectively, and is also initialized with supervised ImageNet pre-training. \paragraph{Depth Prediction} The network is pre-trained with a single view depth prediction task, and is also initialized with supervised ImageNet pre-training. We obtain the results directly from Pri3D \cite{hou2021pri3d} where the method is implemented as a baseline. \begin{figure*} \centering \begin{overpic}[width=0.98\textwidth]{figs/vis_semseg2d.pdf}{ \put(26.5,56) {\textbf{ScanNet}} \put(73.7,56){ \textbf{NYUv2}} \put(1.7,50){\small {Input}} \put(-2.2,39){\small {ImageNet}} \put(1.2,28){\small {Pri3D}} \put(2.2,17){\small {Ours}} \put(3.2,4.5){\small {GT}} }\end{overpic} \vspace{-3mm} \caption{\textbf{Qualitative results of semantic segmentation task on ScanNet and NYUv2 datasets.} All the methods are pre-trained on ScanNet with ResNet50 as the backbone. For Pri3d we reproduce the results with their released code.} \label{fig:vis_semseg2d} \end{figure*} \subsection{Implementation Details} We use the following setting in our experiments unless explicitly specified. For pre-training with our method, Stochastic gradient descent(SGD) \cite{robbins1951stochastic} with Polynomial Learning Rate Policy (PolyLR) \cite{shamir2013stochastic} is used for optimization. The initial learning rate is 0.1 and the batch size is 64. Following Pri3D\cite{hou2021pri3d}, we initialize the network with ImageNet pre-trained weights. In the first stage of pre-training, we train the network with View and Geo loss from Pri3D for 5 epochs. And then in the second stage, the network is trained with our proposed methods for 2 epochs. We use 8 NVIDIA V100 GPUs for training our network, and all the experiments are implemented with PyTorch. \section{Introduction} \begin{figure} \centering \begin{overpic}[width=0.49\textwidth]{figs/teaser.pdf}{ \put(18,92.5){\small \textbf{Pre-training with Geometric Set Consistency}} \put(6,3){\footnotesize Object Detection} \put(34,3){\footnotesize Instance Segmentation} \put(66,2.5){\footnotesize Semantic Segmentation} }\end{overpic} \vspace{-5mm} \caption{We introduce geometric consistency set to enforce the consistency within images for self-supervised image representation learning. We show that, the image representations pre-trained in this way can improve the performance of some 2D downstream tasks including semantic segmentation, object detection and instance segmentation.} \label{fig:teaser} \vspace{-5mm} \end{figure} Self-supervised image representation learning is an important problem in the field of computer vision and has been rapidly developed in recent years. Existing works in this area mainly focus on designing various pretext tasks to learn general and intrinsic image features in self-supervised manners \cite{oord2018representation,he2020momentum,hou2021pri3d}. Those pretext tasks are usually low-level and can capture general image properties that favor many downstream tasks, like image classification, semantic segmentation, object detection, instance segmentation, etc. Due to its ability to learn from a large amount of unlabeled data, self-supervised representation learning has already become a standard training regime in many real-world applications\cite{zhao2017pspnet,he2017mask,chen2017rethinking,chen2018encoder}. Recently, researchers have started to use 3D data, usually represented by point clouds, meshes, or voxel grids, as guidance for learning image representations \cite{hou2021pri3d,liu2021contrastive}. Compared with 2D images, 3D data has complementary advantages for learning discriminative image features. Since 3D data is usually acquired by real-world scanning and reconstruction, and has the same dimension as the real-world scenes, learning geometric structures from 3D data is much easier than 2D images. Moreover, complex occlusions, as well as the texture of objects will also affect the performance of image perception methods. Meanwhile, 3D data is occlusion-free, and geometric cues like smooth regions and sharp edges can be strong priors for semantic understanding. Thus it is natural to use 3D geometric cues to favor the learning of image representations. Pioneering works, like Pri3D\cite{hou2021pri3d}, mainly rely on multi-view pixel-level consistency or 2D-3D pixel to point consistency for learning image representations in a self-supervised manner. The image representations learned in this way are proven to have significantly better performance than learning purely from 2D images for downstream tasks. Despite these great successes, the geometric consistency priors in 3D data (i.e. smooth regions or depth gaps) are not directly employed, which we demonstrate are strong cues and can significantly enhance the learning of image semantics. In this paper, we propose to use geometric consistency to promote the learning of image representations. Our intuition is that 3D points within the same smooth or even planar regions may share similar semantics, while the discontinuities or depth gaps in 3D space may imply semantic changes. Such geometric cues are directly observable in unlabeled 3D data. However, due to complex textures, these cues can be hardly learned from purely unlabeled 2D images. Based on the above intuition, we design a simple yet effective method to learn the geometric consistency priors described above. Specifically, we leverage the continuities and discontinuities of 3D data, and use the clustering method to cluster the 3D data into many local small segments, termed \textit{geometric consistency sets}, to guide the learning of image representations in a self-supervised contrastive way. Our method is simple and can be easily implemented. We show that by exploring geometric consistency in the self-supervised pre-training stage, the performance of downstream tasks can be significantly improved. In the following, we summarize our main contributions: 1) We introduce geometric consistency into a contrastive learning framework for self-supervised image representation learning. 2) We propose a simple yet effective multi-view contrastive loss with geometric consistency sets to leverage the consistency within images. 3) We demonstrate superior performance on several downstream tasks compared with SOTA methods. \section{Method} Given a large collection of unlabeled images $\{I_{i}\}$ together with the corresponding 3D scenes $\{S_{i}\}$ represented as 3D points, the goal of our method is to pre-train an image encoder $f_{\theta}$ that can extract general and representative features from the input images with the guidance of geometric consistency in a self-supervised manner. And the pre-trained encoder $f_{\theta}$ can improve the performance of various downstream tasks after fine-tuning on relatively small labeled datasets. Note that 3D data is only used for pre-training and is not available in the fine-tuning stage. Figure \ref{fig:pipeline} illustrates our overall framework. In order to learn the image representations given a set of multi-view unlabeled images together with the corresponding 3D data, our observation is that the consistency or inconsistency of the geometric features in 3D space can serve as strong prior that may imply consistent semantics or object boundaries. For example, points that lie in the same smooth or even planar region may share the same semantics, while those separated by geometry dis-continuities or depth gaps may infer semantic changes. Based on the above observation, we propose to incorporate \textit{geometric consistency sets}, for example clustering the 3D data with similar geometry features into local smooth segments, into a contrastive learning framework to leverage the geometric consistency in learning image representations, and adapt the InfoNCE loss accordingly. In the following, we will first describe the formulation of the \textit{set-InfoNCE loss} that generalizes the InfoNCE loss to enforce the consistency within image views. And then, we will provide the detailed implementation of our proposed contrastive training framework under the guidance of geometric consistency set. \subsection{Set-InfoNCE Loss} \begin{figure}[ht] \centering \begin{overpic}[width=1.0\linewidth]{figs/pseudo_label.pdf}{ \put(3,55){\footnotesize \bf{Geometric Guidance}} \put(58,55){\footnotesize \bf{2D Projection}} \put(8, 28){\footnotesize 3D Geometry} \put(1, 1.5){\footnotesize Geometric Consistency Set} \put(46,1.5){\footnotesize Image $I_n$} \put(46,28){\footnotesize Image $I_m$} \put(62,1.5){\footnotesize Projected Geo-sets $\{P_i^n\}_i$} \put(62,28){\footnotesize Projected Geo-sets $\{P_i^m\}_i$} }\end{overpic} \vspace{-5mm} \caption{\textbf{Geometric consistency set.} We visualize the geometric consistency sets (with different colors) as well as the corresponding 2D projections on two corresponding image views. } \label{fig:pseudo_label} \end{figure} 2D contrastive image representation learning mainly aims at learning consistent representations by contrasting multi-view images on either image level or pixel level. The multi-view images can be acquired via different data augmentation strategies or from real-world scanned sequences. Contrastive learning then enforces the feature consistency between different views that correspond to the same content while pushing away the others. For the pixel level contrastive representation learning, current works use pixel-level InfoNCE loss\cite{hou2021pri3d}, which is defined as: \begin{equation}\label{eq:pcontrast_loss} \mathcal{L}_{pixel} = - \sum_{(i,j) \in M_p } log \frac{\exp(\mathbf{f}_i \cdot \mathbf{f}_j / \tau)}{\sum_{(\cdot, k) \in M_p}{\exp(\mathbf{f}_i \cdot \mathbf{f}_k / \tau)}} \end{equation} \noindent where $M_p$ denotes the set of pixel-to-pixel matching pairs from one view to another, $\mathbf{f}_i$ is the normalized feature vector of the pixel at the $i$th position, and $\tau$ is the temperature parameter for controlling the concentration of the features in the representation space. Though the representations learned with pixel-level InfoNCE loss\cite{hou2021pri3d} has been proven to be beneficial for many downstream tasks, additional aggregated correspondences among the pixels like the geometric consistency prior could further improve the representation learning. In the following, we give the formulation of the set level InfoNCE loss that generalizes the pixel level InfoNCE to leverage such aggregated correspondences: \begin{equation}\label{eq:set_contrast_loss} \mathcal{L}_{set} = - \sum_{(i,j) \in M_s} log \frac{\exp(\mathcal{F}(P_i) \cdot \mathcal{F}(P_j) / \tau)}{\sum_{(\cdot,k)\in M_s}{\exp(\mathcal{F}(P_i) \cdot \mathcal{F}(P_k) / \tau)}} , \end{equation} \noindent where $P_i$ is a set of feature points that are likely to have the same semantics, $\mathcal{F}$ is a mapping from a set to a feature vector in $\mathbb{R}^c$, and $M_s$ denotes the correspondence pairs among sets. Obviously Eqn.~\ref{eq:pcontrast_loss} is a special case to Eqn.~\ref{eq:set_contrast_loss} when the sets $P_i=\{\mathbf{f_i}\}$ degenerate to one-element only. In our implementation, we set $\mathcal{F}(P_i) = \frac{1}{|P_i|}\sum_{s_j\in P_i} \mathbf{f_{s_j}}$ for aggregating the features from all the points within sets, and we will also discuss different variations of $\mathcal{F}$ in Section \ref{diff_set_choice}. Note that the set level InfoNCE loss defined in Eqn. \ref{eq:set_contrast_loss} is general, and the strategies for acquiring the set $P_i$ might be different for different scenarios \cite{xiao2021region,liu2021bootstrapping,wang2020unsupervised}. In this paper, we define our geometric consistency set under the guidance of 3D geometry, and will give the detailed description in Section \ref{sec:method_geosetconsistency}. \subsection{Learning with Geometric Set Consistency} \label{sec:method_geosetconsistency} Intuitively, the geometric consistency can be a strong prior that can guide the learning of within image consistency. The geometric cues like smooth regions and depth gaps may imply the same semantics or object boundaries respectively. In the following, we give the formal definition of the proposed set-InfoNCE loss with geometric consistency sets under projection. Formally, for a given equivalence relation $\sim$ among the points in all the scenes $\cup S_i$, we call the quotient set $\{P_j\}=\cup S_i/\sim$ as the collection of \textit{geometric consistency sets}. For example, when we have some pre-defined geometric labels among the 3D points and define the equivalence relation as \textit{points that share the same label}, then the geometric consistency set $P_i$ would contain all the points that have the $i$th label. Besides, for each image $I_m$, we call $P_j^{m}=\{proj(s) \in I_m | s \in P_j\}$ as the $projection$ of $P_j$ from 3D onto 2D image view $I_m$. By adapting Eqn. \ref{eq:set_contrast_loss}, we could define our set-InfoNCE loss with geometric consistency set as: \begin{equation}\label{eq:pseudo_loss} \mathcal{L}_{geo\_set} = - \sum_{\mathclap{~(i,m,n) \in M_s~}} log \frac{\exp(\mathcal{F}(P^m_i) \cdot \mathcal{F}(P^n_i) / \tau)}{\sum_{(k, l, \cdot)\in M_s}{\exp(\mathcal{F}(P^m_i) \cdot \mathcal{F}(P^l_k) / \tau)}} , \end{equation} \noindent where $i$ is the index of the geometric consistency set and $m,n$ are the view indices. $M_s = \{(i,m,n)\}$ maintains the matching pairs of projections $P_i^m, P_i^n$ from one view to another for each geometric consistency set $P_i$. In general, any proper notion of spatial equivalence induces its corresponding geometric consistency sets; in this work, we use a simple 3D clustering method and find it already works well in our case. We leave the exploration of more sophisticated spatial partitioning methods as future work. Specifically, for a sequence of 2D images acquired by scanning around a specific scene, we first have the corresponding 3D surface $S$ via 3D reconstruction. To obtain geometric consistency sets, we use the surface over-segmentation results produced by a normal-based graph cut method \cite{felzenszwalb2004efficient,karpathy2013object}. As shown in Figure \ref{fig:pseudo_label}, the 3D points that are likely to have the same semantics can be clustered into the same geometric consistency set. \subsection{Training Strategy} We use a two-stage training strategy to pre-train with our method. Besides our geometric guided set-InfoNCE loss that mainly considers set-level consistency and involves some high-level semantics such as smooth regions and surface discontinuities, we also include the pixel-level multi-view consistency to enforce the low-level distinction beneficial for the downstream tasks. Thus we propose to pre-train the network from low-level to high-level progressively with two stages. Specifically, in the first stage, we train the network with pixel to pixel and pixel to point multi-view contrastive loss termed as View and Geo loss in Pri3D\cite{hou2021pri3d}. And then, in the second stage, we continue to train the network with our geometric guided set-InfoNCE loss alone. In this way, we can achieve better performance on downstream tasks than training solely with our set-InfoNCE loss or with Pri3D losses. \section{Related Works} \begin{figure*}[ht] \centering \vspace{-5mm} \begin{overpic}[width=0.95\linewidth]{figs/pipeline.pdf}{ \put(9,1.5){\small RGB Image} \put(28.5,12.5){\small 2D Encoder} \put(48,1.5){\small Feature Map} \put(73,1.5){\small Geometric Consistency Set} \put(79.5,21.3){\small 3D Geometry} \put(17.5,39.6){ \textbf{Pre-training Stage for 2D Network}} \put(74.7,39.6){\textbf{Geometric Guidance}} }\end{overpic} \vspace{-2mm} \caption{\textbf{Pipeline of our pre-training method}. Given a collection of multi-view unlabeled images together with the corresponding 3D geometry, we propose to use geometric consistency sets (illustrated with different colors), acquired via 3D clustering, to guide the learning of image representations. Specifically, the multi-view feature maps extracted with a 2D encoder will be first aggregated according to the corresponding geometric consistency sets, and then set-level InfoNCE loss will be used on the aggregated features to leverage the consistency within images. } \label{fig:pipeline} \vspace{-5mm} \end{figure*} \subsection{Scene Understanding} Learning based scene understanding tasks, including semantic scene segmentation \cite{qi2017pointnet,lin2020fpconv,liu20213d,hu2021bidirectional}, object detection \cite{hu2020jsenet,qi2020imvotenet,qi2019deep} and instance segmentation \cite{yi2019gspn,hou20193d,lahoud20193d}, are fundamental tasks in computer vision and have been rapidly developed in recent years. Due to the available of large scale, real scanned 2D and 3D datasets \cite{dai2017scannet,geiger2013vision,silberman2012indoor,armeni20163d}, these tasks have been widely explored. View-based methods \cite{dai20183dmv, kundu2020virtual} mainly rely on 2D images for scene understanding tasks, and the results produced with 2D networks can be further fused to 3D space based on multi-view consistency. In recent years, with the development of 3D deep learning networks \cite{qi2017pointnet, wu2019pointconv, wang2017cnn,choy20194d, graham20183d}, the performance of scene understanding tasks has been further promoted. The architectures of 3D networks can be roughly classified into two categories including point-based \cite{qi2017pointnet,wu2019pointconv}, and sparse-voxel based \cite{wang2017cnn,choy20194d,graham20183d}. These architectures are mainly designed for extracting features from sparse and unordered 3D data and have achieved great success in 3D scene understanding. Besides, since 2D images have clearer textures while 3D data is occlusion free from which extracting structure information is much easier, it is also an important research topic to study the joint training of 2D and 3D data \cite{song2018learning,liu2020p4contrast,hou2021pri3d,liu2021contrastive} for scene understanding tasks. In this paper, we propose to use 3D geometric consistency as guidance to promote the learning of 2D image representations and improve the performance of 2D scene understanding tasks. \subsection{Self-Supervised Image Pre-training} Self-supervised image pre-training as a fundamental way for learning representations from a large amount of data has shown significant impact in the field of computer vision and has been proved to be useful for various applications. Researchers in this field mainly aim at designing pretext tasks \cite{oord2018representation,larsson2017colorization,misra2020self,noroozi2016unsupervised} to learn intrinsic and general image representations that may favor various downstream tasks. Contrastive learning \cite{oord2018representation,he2020momentum,chen2020simple,chen2021exploring}, due to it's effectiveness and simplexity, has attracted great attention in recent years. The key idea of contrastive learning is to enforce the consistency between positive pairs while pushing away negative samples. Mainstream works mainly use various data augmentation strategies to get the positive pairs, including cropping, rotating, Gaussian blurring, etc. Besides, region-wise contrastive learning methods \cite{xiao2021region,liu2021bootstrapping} performance contrasting at region level to learn the region level similarities. Recently, researchers start to involve 3D data into contrastive pre-training \cite{hou2021pri3d,liu2020p4contrast,liu2021contrastive}, and the positive samples can be directly induced via multi-view consistency. In our work, we also explore using 3D data to promote the learning of image representations. In addition to multi-view consistency, we further leverage geometric consistency to enhance the consistency within image views. \subsection{Multimodal Representation Learning} Multimodal representation learning aims at learning joint representations by interacting between the data from different modalities. By incorporating the advantages from different modalities, the representations learned in this way are usually much better than those learned with a single modality only. Vision language pre-training \cite{radford2021learning,lu2019vilbert,li2020oscar} is a successful example. The availability of a large amount of image and language pairs makes the learned representations generalizable to various downstream tasks. Recently, with the availability of large scale RGB-D datasets, learning representations jointly from 2D and 3D data has attracted great attention in the research community \cite{song2018learning,liu2020p4contrast,hou2021pri3d,liu2021contrastive}. In particular, Pri3D \cite{hou2021pri3d} proposed to use 3D data as guidance for learning 2D to 2D and 2D to 3D pixel-level consistency. P4Contrast \cite{liu2020p4contrast} proposes to use point-pixel pairs for contrastive learning, and constructs negative samples artificially based on disturbed RGB-D points. TupleInfoNCE \cite{liu2021contrastive} compose new negative tuples for contrastive learning using modalities from different scenes to ensure that the weak modalities are not being ignored. Existing works mainly use pixel-level multi-view consistency of single or multiply modalities. In our work, we use geometric consistency sets as guidance to explore intra-view consistency for 2D representation learning. \subsection{Pseudo Labeling} Pseudo labeling \cite{lee2013pseudo,shi2018transductive,rizve2021defense,liu2021one,iscen2019label}, as an effective way for learning with unlabeled data, has been widely studied in various applications. The key to the success of pseudo labeling methods is to generate high-quality pseudo labels for the unlabeled data. Researchers in this field have explored various ways for acquiring pseudo labels, including predicting directly with trained networks \cite{lee2013pseudo,liu2021one}, neighborhood graph propagation \cite{iscen2019label} or confidence based selection \cite{shi2018transductive,rizve2021defense} etc. The mainstream works mainly use pseudo labels in semi-supervised or weakly supervised learning scenarios. In our work, the geometric consistency sets we used serve as pseudo consistency labels to guide the learning of 2D image representations in a self-supervised manner. \section{Experimental Results} \subsection{Fine-tuning for 2D Downstream Tasks} In the following, we demonstrate the effectiveness of our method by fine-tuning the pre-trained network on several 2D downstream tasks, including semantic segmentation, instance segmentation, and object detection. \begin{table} \centering \begin{tabular}{lccccc} \toprule Method & 20\% & 40\% & 60\% & 80\% & 100\%\\ \midrule Pri3d(View + Geo) & 51.5 & 56.2 & 58.9 & 60.3 & 61.7\\ Ours & \textbf{54.1} & \textbf{58.3} & \textbf{60.4} & \textbf{61.5} & \textbf{63.1}\\ \bottomrule \end{tabular} \vspace{-2mm} \caption{\textbf{Data efficient learning results on ScanNet.} We fine-tune our pre-trained representations with a limited amount of training data (from $20\%$ to $100\%$). ResNet50 is used as the backbone, and mIoU is used for evaluation. } \label{tab:semseg2d_scannet_limit} \end{table} \paragraph{Semantic Segmentation on ScanNet} We demonstrate the effectiveness of our pre-trained representation by fine-tuning it with the ScanNet standard labeled training set, and mean IoU is used as the evaluation metric. ResNet50 or ResNet18 is used as the backbone encoder for all pre-training methods. In Table \ref{tab:semseg2d_scannet}, we compare our results with other state-of-the-art pre-training methods. Our method outperforms all the state-of-the-art methods for both ResNet50 and ResNet18 backbones, which confirms the effectiveness of our proposed self-supervised pre-training strategy with geometry-guided set consistency. Figure \ref{fig:vis_semseg2d} demonstrates some qualitative results, as we can see that the segmentation results of our method are less noisy and have clearer details. We further test our method with different amounts of data for fine-tuning to study the performance under limited data scenarios. ResNet50 is used as the backbone. As shown in Table \ref{tab:semseg2d_scannet_limit}, by comparing our method with the best performing SOTA method, we can achieve superior performance consistently under different ratios of training data. Moreover, we also test our pre-trained representations with more advanced 2D semantic segmentation architectures including DeepLabV3 \cite{chen2017rethinking}, DeepLabV3+ \cite{chen2018encoder} and PSPNet\cite{zhao2017pspnet}. As shown in Table \ref{tab:semseg2d_scannet_diff_arch}, our method consistently outperforms the state-of-the-art methods by a large margin. Which further validate the effectiveness of considering geometric consistency set for self-supervised image representation learning. \begin{table} \centering \begin{tabular}{lc} \toprule Method & ResNet50 \\ \midrule DeepLabV3(ImageNet) & 57.0\\ DeepLabV3(Pri3D) & 61.3\\ DeepLabV3(Ours) & \textbf{62.2}\\ \midrule DeepLabV3+(ImageNet) & 57.8\\ DeepLabV3+(Pri3D) & 61.6\\ DeepLabV3+(Ours) & \textbf{62.7}\\ \midrule PSPNet(ImageNet) & 59.7\\ PSPNet(Pri3D) & 62.8\\ PSPNet(Ours) & \textbf{63.7}\\ \bottomrule \end{tabular} \vspace{-2mm} \caption{\textbf{2D semantic segmentation results on ScanNet with different network architectures.} ResNet50 is used as the backbone for all architectures, and mIoU is used for evaluation.} \label{tab:semseg2d_scannet_diff_arch} \end{table} \paragraph{Instance Segmentation and Detection on ScanNet} We fine-tune our pre-trained representations on 2D ScanNet object detection and instance segmentation tasks to see the generalizability of the learned representations. Specifically, ResNet50 is used as the backbone encoder for all the pre-training methods. Mask-RCNN \cite{he2017mask} implemented by Detectron2 \cite{wu2019detectron2} is used for object detection and instance segmentation tasks. As shown in Table \ref{tab:insdet_scannet} and \ref{tab:insseg_scannet}, we can achieve comparable or superior performance compared with the other state-of-the-arts on different evaluation metrics. \begin{table} \centering \begin{tabular}{lccc} \toprule Method & [email protected] & [email protected] & AP \\ \midrule From Scratch & 32.7 & 17.7 & 16.9 \\ ImageNet Pre-training & 41.7 & 25.9 & 25.1\\ \midrule MoCoV2 & 43.5 & 26.8 & 25.8\\ Pri3D(View) & 43.7 & 27.0 & 26.3\\ Pri3D(Geo) & 44.2 & \textbf{27.6} & 26.6\\ Pri3D(View + Geo) & 44.5 & 27.4 & 26.6\\ \midrule Ours & \textbf{45.1} & \textbf{27.6} & \textbf{26.9}\\ \bottomrule \end{tabular} \vspace{-2mm} \caption{\textbf{2D object detection results on ScanNet.} We use ResNet50 as the backbone and average precision for evaluation.} \label{tab:insdet_scannet} \end{table} \begin{table} \centering \begin{tabular}{lccc} \toprule Method & [email protected] & [email protected] & AP \\ \midrule From Scratch & 25.8 & 13.1 & 12.2 \\ ImageNet Pre-training & 32.6 & 17.8 & 17.6\\ \midrule MoCoV2 & 33.9 & 18.1 & 18.3\\ Pri3D(View) & 34.3 & 18.7 & 18.3\\ Pri3D(Geo) & 34.4 & 18.7 & 18.3\\ Pri3D(View + Geo) & 35.8 & \textbf{19.3} & 18.7\\ \midrule Ours & \textbf{36.0} & \textbf{19.3} & \textbf{19.5}\\ \bottomrule \end{tabular} \vspace{-2mm} \caption{\textbf{2D instance segmentation results on ScanNet.} We use ResNet50 as the backbone and average precision for evaluation.} \label{tab:insseg_scannet} \end{table} \paragraph{Transfer to NYUv2} We demonstrate the transferability of our pre-trained representations to other datasets. Specifically, we use ResNet50 as the backbone encoder for all pre-training methods. The network is pre-trained on ScanNet\cite{dai2017scannet} dataset, and fine-tuned for downstream tasks on NYUv2\cite{silberman2012indoor} dataset. Following Pri3D\cite{hou2021pri3d}, we use the learning rate $0.01$ instead of $0.1$ for semantic segmentation task. As demonstrated in Table \ref{tab:semseg2d_nyuv2}, \ref{tab:insdet_nyuv2} and \ref{tab:insseg_nyuv2}, our pre-trained representations achieve superior performance compared with SOTA methods on most evaluation metrics, which further confirms that our pre-trained image representations are general and transferable across different datasets. \begin{table} \centering \begin{tabular}{lcc} \toprule Method & ResNet50 \\ \midrule From Scratch & 24.8 \\%& 22.5 \\ ImageNet Pre-training & 50.0 \\%& 44.7 \\ \midrule MoCoV2 & 47.6 \\ Pri3D(View) & 54.2 \\%& 48.2 \\ Pri3D(Geo) & 54.8 \\%& 48.6 \\ Pri3D(View + Geo) & 54.7 \\%& 48.1 \\ \midrule Ours & \textbf{55.4} \\%& \\ \bottomrule \end{tabular} \vspace{-2mm} \caption{\textbf{2D semantic segmentation results on NYUv2.} mIoU is used as the evaluation metric.} \label{tab:semseg2d_nyuv2} \end{table} \begin{table} \centering \begin{tabular}{lccc} \toprule Method & [email protected] & [email protected] & AP \\ \midrule From Scratch & 21.3 & 10.3 & 9.0 \\ ImageNet Pre-training & 29.9 & 17.3 & 16.8\\ \midrule MoCoV2 & 30.1 & 18.1 & 17.3\\ Pri3D(View) & 33.0 & 19.8 & 18.9\\ Pri3D(Geo) & 33.8 & 20.2 & 19.1\\ Pri3D(View + Geo) & 34.0 & 20.4 & 19.4\\ \midrule Ours & \textbf{34.6} & \textbf{20.5} & \textbf{19.7}\\ \bottomrule \end{tabular} \vspace{-2mm} \caption{\textbf{2D object detection results on NYUv2.} We use ResNet50 as the backbone, and average precision for evaluation.} \label{tab:insdet_nyuv2} \end{table} \begin{table} \centering \begin{tabular}{lccc} \toprule Method & [email protected] & [email protected] & AP \\ \midrule From Scratch & 17.2 & 9.2 & 8.8 \\ ImageNet Pre-training & 25.1 & 13.9 & 13.4\\ \midrule MoCoV2 & 27.2 & 14.7 & 14.8\\ Pri3D(View) & 28.1 & 15.7 & 15.7\\ Pri3D(Geo) & 29.0 & 15.9 & 15.2\\ Pri3D(View + Geo) & 29.5 & \textbf{16.3} & 15.8\\ \midrule Ours & \textbf{29.7} & \textbf{16.3} & \textbf{16.5}\\ \bottomrule \end{tabular} \vspace{-2mm} \caption{\textbf{2D instance segmentation results on NYUv2.} We use ResNet50 as the backbone, and average precision for evaluation.} \label{tab:insseg_nyuv2} \end{table} \subsection{Ablation Study} \paragraph{Different Implementation of Set Feature Aggregation }\label{diff_set_choice} We study a different choice of the set feature aggregation function $\mathcal{F}$ in Eqn. \ref{eq:pseudo_loss} to see whether it will influence the performance. Instead of using the average function to aggregate set-level features for both positive and negative pairs, here we test an asymmetric implementation. To be specific, for $\mathcal{F}(P^m_i)$ and $\mathcal{F}(P^l_k)$ in Eqn. \ref{eq:pseudo_loss} we select the feature of an arbitrary point from each set, and for $\mathcal{F}(P^n_i)$ average function is used. We pre-train the network with the newly defined loss on ScanNet and fine-tune it for ScanNet semantic segmentation. ResNet50 is used as the backbone. In this way, we get the performance of $63.1$ mIoU on the validation set, which is comparable with our result in Table \ref{tab:semseg2d_scannet}. \paragraph{Ablation of Geometric Consistency Set} We study the stability of our method by varying the parameters of the over-segmentation method \cite{felzenszwalb2004efficient,karpathy2013object} used for generating geometric consistency sets. To be specific, we generate geometric consistency sets on ScanNet under different clustering edge weight thresholds, and pre-train our network accordingly. As shown in Table ~\ref{tab:set_param_abl}, our method yields robustness to the clustering parameters. \begin{table}[ht] \centering \scalebox{1}{ \begin{tabular}{lccccc} \toprule Threshold & 0.01 & 0.02 & 0.03 & 0.04 & 0.05\\ \midrule mIoU& 63.2 & 62.9 & 62.9 &63.2 & 63.1 \\ \bottomrule \end{tabular}} \vspace{-1mm} \caption{\textbf{Ablation of geometric consistency set.} 2D semantic segmentation results on ScanNet with different over-segmentation parameters used for pre-train. ResNet50 is used as the backbone.} \label{tab:set_param_abl} \end{table} \paragraph{Pre-training with GT Semantic Label} Instead of using a geometry-guided consistency set, we also study the performance of the set-InfoNCE loss under the guidance of the ground truth semantic labels. Specifically, we use ground truth semantic labels to obtain the ground truth consistency sets and pre-train our network with ResNet50 as encoder on ScanNet\cite{dai2017scannet}. Note that ground truth category id is not used in pre-training. By fine-tuning the pre-trained representations for the ScanNet 2D semantic segmentation task, it could achieve the performance of 66.4 mIoU, which implies that a more sophisticated consistency set generation strategy may help to improve the result further. \paragraph{Ablation of Pri3D} Since in the first stage of our method we use View and Geo loss in Pri3D\cite{hou2021pri3d} to train the initial representations, one may wonder whether training Pri3D for more epochs will lead to better performance compared with the results listed in their original paper. To address this concern, we test thoroughly by continuing training from the Pri3D checkpoint with different combinations of their losses for two more epochs. And then fine-tune the network on ScanNet semantic segmentation task\cite{dai2017scannet}. Totally, in this experiment, Pri3D is pre-trained for 7 epochs. As shown in Table \ref{tab:pri3d_ablation}, continuous training of different configurations of Pri3D can not lead to better results. \begin{table} \centering \begin{tabular}{lcc} \toprule Method & ResNet50\\ \midrule Pri3D Original& 61.7 \\ \midrule Pri3D Continue(View) & 61.4\\ Pri3D Continue(Geo) & 61.6 \\ Pri3D Continue(View + Geo) & 61.5 \\ \midrule Ours & \textbf{63.1} \\ \bottomrule \end{tabular} \vspace{-2mm} \caption{\textbf{Ablation of Pri3D.} Continuous training of different configurations of Pri3D can not lead to better results. Pri3D Continue means continuous training of Pri3D.} \label{tab:pri3d_ablation} \end{table} \section{Details of Geometric Consistency Set} Here we provide more details about how to acquire the geometric consistency sets. For a 3D scene surface $S$ we can have a sequence of corresponding RGB-D scanning images. We use the surface over-segmentation results produced by a normal-based graph cut method ~\cite{felzenszwalb2004efficient, karpathy2013object} as the geometric consistency sets $\{P_j\}$. In this way, the 3D scene will be divided into many small segments. Figure \ref{fig:vis_patches} shows some examples, and Figure \ref{fig:vis_geo_sets_param} demonstrates the sets generated with different clustering edge weight thresholds. Then we project the 3D surface points together with the corresponding geometric consistency set id (here we use different ids to label the points in different geometric consistency sets) from 3D to 2D image views, and the pinhole camera model is used for 3D to 2D projection. Since the matching between the reconstructed 3D surface and the corresponding 2D image views may have a miss-match problem, we filter out invalid projections by comparing the depth difference between the projection points and the view depth maps. The projected points with the depth difference larger than a threshold, 0.05 in our experiments, will be regarded as invalid. Based on the valid projection points, we can have the corresponding projection $P_j^{m}=\{proj(s) \in I_m | s \in P_j\}$ of the geometric consistency set $P_j$ from 3D onto 2D image view $I_m$. \section{Effect of the Initial Learning Rate} We study different choices of the initial learning rate in the pre-training stage to see how it will influence the fine-tuning results. Specifically, the networks are pre-trained with different initial learning rates, including $0.1$ and $0.01$, on the ScanNet \cite{dai2017scannet} dataset and fine-tuned for the image semantic segmentation task on ScanNet and NYUv2 \cite{silberman2012indoor} datasets. Table \ref{tab:learning_rate} illustrates the performance of both our method and Pri3D \cite{hou2021pri3d}. Although the network performance varies with the initial learning rate, our method consistently outperforms Pri3D on all the settings. \begin{table}[hbt!] \centering \begin{tabular}{lcc} \toprule Method & ScanNet & NYUv2\\ \midrule Pri3D (0.01) & 59.7 & 54.8 \\ Ours (0.01) & \textbf{60.3} & \textbf{55.4} \\ \midrule Pri3D (0.1) & 61.7 & 51.4 \\ Ours (0.1) & \textbf{63.1} & \textbf{54.1}\\ \bottomrule \end{tabular} \caption{\textbf{Effect of the initial learning rate.} Effect of different initial learning rates in the pre-training stage. ResNet50 is used as the backbone encoder, the network is pre-trained on ScanNet dataset and fine-tuned for the image semantic segmentation task on ScanNet and NYUv2 datasets. mIOU is used for evaluation.} \label{tab:learning_rate} \end{table} \section{Convergence} We study the convergence of the methods by fine-tuning the pre-trained networks on ScanNet\cite{dai2017scannet} semantic segmentation dataset and reporting the performance on the validation set after different number of epochs. As shown in Figure \ref{fig:convergence}, both Pri3D\cite{hou2021pri3d} and our proposed method converge within $10$ epochs, and our method consistently outperforms Pri3D after that. \begin{figure}[ht] \centering \begin{overpic}[width=0.45\textwidth]{figs/convergence_no_text.pdf}{ \put(16,6){\footnotesize 1} \put(28,6){\footnotesize 5} \put(40,6){\footnotesize 10} \put(54,6){\footnotesize 15} \put(67.5,6){\footnotesize 20} \put(82,6){\footnotesize 25} \put(96,6){\footnotesize 30} \put(36,1){\footnotesize Number of Fine-tuning Epochs} \put(70, 26){\footnotesize Ours} \put(70, 18){\footnotesize Pri3d(View+Geo)} \put(6,12){\footnotesize 0.53} \put(6,22){\footnotesize 0.55} \put(6,31){\footnotesize 0.57} \put(6,40){\footnotesize 0.59} \put(6,50){\footnotesize 0.61} \put(6,59){\footnotesize 0.63} \put(-5, 35){\footnotesize mIoU} }\end{overpic} \caption{\textbf{Convergence of the methods.} We fine-tune the pre-trained networks on the ScanNet semantic segmentation task. The average performance of 3 runs for each method is reported.} \label{fig:convergence} \end{figure} \begin{figure*} \centering \begin{overpic}[width=1\textwidth]{figs/vis_patches.pdf}{ }\end{overpic} \caption{\textbf{Geometric consistency sets on 3D.} Different colors indicate different geometric consistency sets. } \label{fig:vis_patches} \end{figure*} \section{Representation Space Analysis} We analyze the quality of the learned representation spaces by computing the coding rate \cite{yu2020learning}, which measures the intra-category compactness, on ScanNet 2D semantic segmentation validation set. Specifically, let $\mathbf{F} \in \mathbb{R}^{d \times m}$ be the matrix containing $m$ feature vectors with dimension $d$. The coding rate of $\mathbf{F}$ can be defined as: \begin{equation}\label{eq:coding_rate} R(\mathbf{F}, \epsilon) = \frac{1}{2} \log \det (\mathbf{I} + \frac{d}{m \epsilon^2} \mathbf{F}\mathbf{F}^{\mathsf{T}}) \end{equation} \noindent where $I$ is the identity matrix, and $\epsilon$ is the distortion parameter. For each image, we extract pixel features with pre-trained networks. Since the pixel features extracted with different pre-trained networks may have different overall scales, we scale the features by dividing by average feature length. Then, we compute the coding rate for the features within each ground truth category. The coding rate of an image can be computed by averaging the coding rates of all the categories within this image. The average coding rates of Pri3D \cite{hou2021pri3d} and ours are $54.04$ and $34.05$ respectively. This means our pre-trained representations are more compact than Pri3D. Moreover, we also visualize the learned features by PCA. As shown in Figure ~\ref{fig:vis_feat}, our features are cleaner and more separable. \begin{figure*}[h] \centering \begin{overpic}[width=1\textwidth]{figs/vis_feat.pdf}{ \put(86,-2){\footnotesize Pri3D} \put(61,-2){\footnotesize Ours} \put(35,-2){\footnotesize GT Label} \put(10,-2){\footnotesize Input} }\end{overpic} \vspace{4mm} \caption{\textbf{PCA embedding of learned pixel features.} Different colors indicate different ground truth segmentation categories, and black color indicates the unlabeled regions.} \label{fig:vis_feat} \end{figure*} \begin{figure*} \centering \begin{overpic}[width=1\textwidth]{figs/vis_geo_set.pdf}{ \put(3,45){\footnotesize Threshold: 0.01} \put(52,45){\footnotesize Threshold: 0.05} }\end{overpic} \caption{\textbf{3D geometric consistency sets generated by different parameters.} Different colors indicate different geometric consistency sets, and larger clustering edge weight threshold will lead to larger sets. Black color denotes the unlabeled regions.} \label{fig:vis_geo_sets_param} \end{figure*} \section{Ablation of Two-stage Training} We test our method with different pre-training configurations, i.e. set-InfoNCE loss only, set-InfoNCE plus pixel-InfoNCE and two-stage training. As shown in Table ~\ref{tab:two_stage_abl}, the best performance is achieved with two-stage training that learns from low-level to high-level. Similar strategies can also be found in research topics like curriculum learning. \begin{table}[ht] \centering \scalebox{0.97}{ \begin{tabular}{lccccc} \toprule & set-InfoNCE & set + pixel-InfoNCE & two stage \\ \midrule mIoU& 60.6 & 61.0 & 63.1 \\ \bottomrule \end{tabular}} \caption{\textbf{Two-stage training ablation. }Performance of 2D semantic segmentation task on ScanNet with different pre-training configurations. ResNet50 is used as the backbone encoder.} \label{tab:two_stage_abl} \end{table} \section{Performance on SUN RGB-D Dataset} To further validate the transferability of our method, we fine-tune the ScanNet pre-trained representations on SUN RGB-D Dataset \cite{song2015sun} for the 2D semantic segmentation task. Specifically, the dataset contains 5k images for training and 5k images for testing, and the networks are pre-trained with initial learning rates of $0.1$ and $0.01$ respectively. As shown in Table ~\ref{tab:transfer_sunrgbd}, our method achieves better performance compared with Pri3D \cite{hou2021pri3d}. \begin{table}[ht] \centering \scalebox{1}{ \begin{tabular}{lcc} \toprule Method & ResNet50 \\ \midrule ImageNet Pre-training & 34.8\\ Pri3D (0.1) & 37.3 \\ Ours (0.1) & 38.1 \\ Pri3D (0.01) & 38.6\\ Ours (0.01) & \textbf{39.2}\\ \bottomrule \end{tabular}} \caption{\textbf{Performance on SUN RGB-D dataset.} Pre-train on ScanNet with different learning rates and fine-tune on SUN RGB-D for 2D semantic segmentation. ResNet50 is used as the backbone encoder.} \label{tab:transfer_sunrgbd} \end{table} \begin{table}[hbt!] \centering \begin{tabular}{lcc} \toprule Method & ResNet50 \\ \midrule ImageNet Pre-training & 28.5 \\ Pri3D & 33.2 \\ \midrule Ours & \textbf{33.7} \\ \bottomrule \end{tabular} \caption{\textbf{Performance on KITTI dataset.} ResNet50 is used as the backbone encoder, the network is pre-trained with unlabeled RGB-D sequence on KITTI and fine-tuned for the image semantic segmentation task. mIOU is used for evaluation.} \label{tab:kitti_semseg} \end{table} \begin{figure*} \centering \begin{overpic}[width=1\textwidth]{figs/vis_semseg2d_sup.pdf}{ \put(39,97.3) {\textbf{ScanNet}} \put(38.5,47.7){ \textbf{NYUv2}} \put(-0.5,92){\small {Input}} \put(-2.50,82){\small {ImageNet}} \put(-1,73){\small {Pri3D}} \put(0,64){\small {Ours}} \put(0.5,55){\small {GT}} \put(-0.5,42){\small {Input}} \put(-2.5,32.5){\small{ImageNet}} \put(-1,23.5){\small {Pri3D}} \put(0,14.5){\small {Ours}} \put(0.5,5){\small {GT}} }\end{overpic} \caption{\textbf{More qualitative results of semantic segmentation task on ScanNet and NYUv2 datasets.} All the methods are pre-trained on ScanNet with ResNet50 as the backbone encoder. } \label{fig:vis_semseg2d_sup} \end{figure*} \section{Performance on KITTI Dataset} We further test our method on KITTI \cite{geiger2013vision} dataset, to see the effectiveness of our method in the outdoor autonomous driving scenario. KITTI is a dataset captured by driving around a city with cars equipped with different kinds of sensors, including stereo camera, GPS, laser-scanner, etc. In our experiment, we use the unlabeled RGB-D sequences for pre-training and fine-tune the pre-trained network on the 2D image semantic segmentation task. To compute the geometric consistency sets, we use the Voxel Cloud Connectivity Segmentation (VCCS) \cite{papon2013voxel} method implemented by PCL \cite{Rusu_ICRA2011_PCL} library to extract clusters on the per-view point clouds. During training, for each view pair, we use the geometric consistency sets from one view and project them onto the other, while the geometric consistency sets from the other view are ignored. In this way, we can have the same geometric consistency sets for the corresponding views. Table \ref{tab:kitti_semseg} illustrates the results. We note that the point clouds in KITTI are partial and noisy, and the moving objects in the scenes may lead to incorrect correspondences between views, which makes the results sensitive to different clustering parameters. The experiment here is to demonstrate the possibility of adapting our method to outdoor scenes; we hope our work can motivate future research in this direction. \section{More Qualitative Results} In Figure \ref{fig:vis_semseg2d_sup}, we show more qualitative results of 2D semantic segmentation task on ScanNet\cite{dai2017scannet} and NYUv2\cite{silberman2012indoor} datasets. As is shown, the segmentation results produced with our method have less noise compared with those from other methods. \section{Details of Geometric Consistency Set} Here we provide more details about how to acquire the geometric consistency sets. For a 3D scene surface $S$ we can have a sequence of corresponding RGB-D scanning images. We use the surface over-segmentation results produced by a normal-based graph cut method ~\cite{felzenszwalb2004efficient, karpathy2013object} as the geometric consistency sets $\{P_j\}$. In this way, the 3D scene will be divided into many small segments. Figure \ref{fig:vis_patches} shows some examples, and Figure \ref{fig:vis_geo_sets_param} demonstrates the sets generated with different clustering edge weight thresholds. Then we project the 3D surface points together with the corresponding geometric consistency set id (here we use different ids to label the points in different geometric consistency sets) from 3D to 2D image views, and the pinhole camera model is used for 3D to 2D projection. Since the matching between the reconstructed 3D surface and the corresponding 2D image views may have a miss-match problem, we filter out invalid projections by comparing the depth difference between the projection points and the view depth maps. The projected points with the depth difference larger than a threshold, 0.05 in our experiments, will be regarded as invalid. Based on the valid projection points, we can have the corresponding projection $P_j^{m}=\{proj(s) \in I_m | s \in P_j\}$ of the geometric consistency set $P_j$ from 3D onto 2D image view $I_m$. \section{Effect of the Initial Learning Rate} We study different choices of the initial learning rate in the pre-training stage to see how it will influence the fine-tuning results. Specifically, the networks are pre-trained with different initial learning rates, including $0.1$ and $0.01$, on the ScanNet \cite{dai2017scannet} dataset and fine-tuned for the image semantic segmentation task on ScanNet and NYUv2 \cite{silberman2012indoor} datasets. Table \ref{tab:learning_rate} illustrates the performance of both our method and Pri3D \cite{hou2021pri3d}. Although the network performance varies with the initial learning rate, our method consistently outperforms Pri3D on all the settings. \begin{table}[hbt!] \centering \begin{tabular}{lcc} \toprule Method & ScanNet & NYUv2\\ \midrule Pri3D (0.01) & 59.7 & 54.8 \\ Ours (0.01) & \textbf{60.3} & \textbf{55.4} \\ \midrule Pri3D (0.1) & 61.7 & 51.4 \\ Ours (0.1) & \textbf{63.1} & \textbf{54.1}\\ \bottomrule \end{tabular} \caption{\textbf{Effect of the initial learning rate.} Effect of different initial learning rates in the pre-training stage. ResNet50 is used as the backbone encoder, the network is pre-trained on ScanNet dataset and fine-tuned for the image semantic segmentation task on ScanNet and NYUv2 datasets. mIOU is used for evaluation.} \label{tab:learning_rate} \end{table} \section{Convergence} We study the convergence of the methods by fine-tuning the pre-trained networks on ScanNet\cite{dai2017scannet} semantic segmentation dataset and reporting the performance on the validation set after different number of epochs. As shown in Figure \ref{fig:convergence}, both Pri3D\cite{hou2021pri3d} and our proposed method converge within $10$ epochs, and our method consistently outperforms Pri3D after that. \begin{figure}[ht] \centering \begin{overpic}[width=0.45\textwidth]{figs/convergence_no_text.pdf}{ \put(16,6){\footnotesize 1} \put(28,6){\footnotesize 5} \put(40,6){\footnotesize 10} \put(54,6){\footnotesize 15} \put(67.5,6){\footnotesize 20} \put(82,6){\footnotesize 25} \put(96,6){\footnotesize 30} \put(36,1){\footnotesize Number of Fine-tuning Epochs} \put(70, 26){\footnotesize Ours} \put(70, 18){\footnotesize Pri3d(View+Geo)} \put(6,12){\footnotesize 0.53} \put(6,22){\footnotesize 0.55} \put(6,31){\footnotesize 0.57} \put(6,40){\footnotesize 0.59} \put(6,50){\footnotesize 0.61} \put(6,59){\footnotesize 0.63} \put(-5, 35){\footnotesize mIoU} }\end{overpic} \caption{\textbf{Convergence of the methods.} We fine-tune the pre-trained networks on the ScanNet semantic segmentation task. The average performance of 3 runs for each method is reported.} \label{fig:convergence} \end{figure} \begin{figure*} \centering \begin{overpic}[width=0.95\textwidth]{figs/vis_patches.pdf}{ }\end{overpic} \caption{\textbf{Geometric consistency sets on 3D.} Different colors indicate different geometric consistency sets. } \label{fig:vis_patches} \end{figure*} \section{Representation Space Analysis} We analyze the quality of the learned representation spaces by computing the coding rate \cite{yu2020learning}, which measures the intra-category compactness, on ScanNet 2D semantic segmentation validation set. Specifically, let $\mathbf{F} \in \mathbb{R}^{d \times m}$ be the matrix containing $m$ feature vectors with dimension $d$. The coding rate of $\mathbf{F}$ can be defined as: \begin{equation}\label{eq:coding_rate} R(\mathbf{F}, \epsilon) = \frac{1}{2} \log \det (\mathbf{I} + \frac{d}{m \epsilon^2} \mathbf{F}\mathbf{F}^{\mathsf{T}}) \end{equation} \noindent where $I$ is the identity matrix, and $\epsilon$ is the distortion parameter. For each image, we extract pixel features with pre-trained networks. Since the pixel features extracted with different pre-trained networks may have different overall scales, we scale the features by dividing by average feature length. Then, we compute the coding rate for the features within each ground truth category. The coding rate of an image can be computed by averaging the coding rates of all the categories within this image. The average coding rates of Pri3D \cite{hou2021pri3d} and ours are $54.04$ and $34.05$ respectively. This means our pre-trained representations are more compact than Pri3D. Moreover, we also visualize the learned features by PCA. As shown in Figure ~\ref{fig:vis_feat}, our features are cleaner and more separable. \begin{figure*}[h] \centering \begin{overpic}[width=1\textwidth]{figs/vis_feat.pdf}{ \put(86,-2){\footnotesize Pri3D} \put(61,-2){\footnotesize Ours} \put(35,-2){\footnotesize GT Label} \put(10,-2){\footnotesize Input} }\end{overpic} \vspace{4mm} \caption{\textbf{PCA embedding of learned pixel features.} Different colors indicate different ground truth segmentation categories, and black color indicates the unlabeled regions.} \label{fig:vis_feat} \end{figure*} \begin{figure*} \centering \begin{overpic}[width=1\textwidth]{figs/vis_geo_set.pdf}{ \put(3,45){\footnotesize Threshold: 0.01} \put(52,45){\footnotesize Threshold: 0.05} }\end{overpic} \caption{\textbf{3D geometric consistency sets generated by different parameters.} Different colors indicate different geometric consistency sets, and larger clustering edge weight threshold will lead to larger sets. Black color denotes the unlabeled regions.} \label{fig:vis_geo_sets_param} \end{figure*} \section{Ablation of Two-stage Training} We test our method with different pre-training configurations, i.e. set-InfoNCE loss only, set-InfoNCE plus pixel-InfoNCE and two-stage training. As shown in Table ~\ref{tab:two_stage_abl}, the best performance is achieved with two-stage training that learns from low-level to high-level. Similar strategies can also be found in research topics like curriculum learning. \begin{table}[ht] \centering \scalebox{0.97}{ \begin{tabular}{lccccc} \toprule & set-InfoNCE & set + pixel-InfoNCE & two stage \\ \midrule mIoU& 60.6 & 61.0 & 63.1 \\ \bottomrule \end{tabular}} \caption{\textbf{Two-stage training ablation. }Performance of 2D semantic segmentation task on ScanNet with different pre-training configurations. ResNet50 is used as the backbone encoder.} \label{tab:two_stage_abl} \end{table} \section{Performance on SUN RGB-D Dataset} To further validate the transferability of our method, we fine-tune the ScanNet pre-trained representations on SUN RGB-D Dataset \cite{song2015sun} for the 2D semantic segmentation task. Specifically, the dataset contains 5k images for training and 5k images for testing, and the networks are pre-trained with initial learning rates of $0.1$ and $0.01$ respectively. As shown in Table ~\ref{tab:transfer_sunrgbd}, our method achieves better performance compared with Pri3D \cite{hou2021pri3d}. \begin{table}[ht] \centering \scalebox{1}{ \begin{tabular}{lcc} \toprule Method & ResNet50 \\ \midrule ImageNet Pre-training & 34.8\\ Pri3D (0.1) & 37.3 \\ Ours (0.1) & 38.1 \\ Pri3D (0.01) & 38.6\\ Ours (0.01) & \textbf{39.2}\\ \bottomrule \end{tabular}} \caption{\textbf{Performance on SUN RGB-D dataset.} Pre-train on ScanNet with different learning rates and fine-tune on SUN RGB-D for 2D semantic segmentation. ResNet50 is used as the backbone encoder.} \label{tab:transfer_sunrgbd} \end{table} \begin{table}[hbt!] \centering \begin{tabular}{lcc} \toprule Method & ResNet50 \\ \midrule ImageNet Pre-training & 28.5 \\ Pri3D & 33.2 \\ \midrule Ours & \textbf{33.7} \\ \bottomrule \end{tabular} \caption{\textbf{Performance on KITTI dataset.} ResNet50 is used as the backbone encoder, the network is pre-trained with unlabeled RGB-D sequence on KITTI and fine-tuned for the image semantic segmentation task. mIOU is used for evaluation.} \label{tab:kitti_semseg} \end{table} \begin{figure*} \centering \begin{overpic}[width=1\textwidth]{figs/vis_semseg2d_sup.pdf}{ \put(39,97.3) {\textbf{ScanNet}} \put(38.5,47.7){ \textbf{NYUv2}} \put(-0.5,92){\small {Input}} \put(-2.50,82){\small {ImageNet}} \put(-1,73){\small {Pri3D}} \put(0,64){\small {Ours}} \put(0.5,55){\small {GT}} \put(-0.5,42){\small {Input}} \put(-2.5,32.5){\small{ImageNet}} \put(-1,23.5){\small {Pri3D}} \put(0,14.5){\small {Ours}} \put(0.5,5){\small {GT}} }\end{overpic} \caption{\textbf{More qualitative results of semantic segmentation task on ScanNet and NYUv2 datasets.} All the methods are pre-trained on ScanNet with ResNet50 as the backbone encoder. } \label{fig:vis_semseg2d_sup} \end{figure*} \section{Performance on KITTI Dataset} We further test our method on KITTI \cite{geiger2013vision} dataset, to see the effectiveness of our method in the outdoor autonomous driving scenario. KITTI is a dataset captured by driving around a city with cars equipped with different kinds of sensors, including stereo camera, GPS, laser-scanner, etc. In our experiment, we use the unlabeled RGB-D sequences for pre-training and fine-tune the pre-trained network on the 2D image semantic segmentation task. To compute the geometric consistency sets, we use the Voxel Cloud Connectivity Segmentation (VCCS) \cite{papon2013voxel} method implemented by PCL \cite{Rusu_ICRA2011_PCL} library to extract clusters on the per-view point clouds. During training, for each view pair, we use the geometric consistency sets from one view and project them onto the other, while the geometric consistency sets from the other view are ignored. In this way, we can have the same geometric consistency sets for the corresponding views. Table \ref{tab:kitti_semseg} illustrates the results. We note that the point clouds in KITTI are partial and noisy, and the moving objects in the scenes may lead to incorrect correspondences between views, which makes the results sensitive to different clustering parameters. The experiment here is to demonstrate the possibility of adapting our method to outdoor scenes; we hope our work can motivate future research in this direction. \section{More Qualitative Results} In Figure \ref{fig:vis_semseg2d_sup}, we show more qualitative results of 2D semantic segmentation task on ScanNet\cite{dai2017scannet} and NYUv2\cite{silberman2012indoor} datasets. As is shown, the segmentation results produced with our method have less noise compared with those from other methods.
d42f6bcb438f5178354654cf1f82831a7bbc2132
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Topological data analysis (TDA) has been used in music analysis recently based on persistent homology \cite{Bigo,Bergomi,Bergomithesis}. Persistent homology is an efficient concept for music analysis as it captures the cyclic structures of data \cite{ZC2005,Cohen,EHarer}. In \cite{TPJ}, TDA was used to analyze Korean {\it Jung-Ak} music for the first time. {\it Jung-Ak} music\footnote{The literal meaning of {\it Jung Ak} is the {\it right} music.} is a type of music that was played at Royal palaces or among noble communities in old Korea. {\it Dodeuri} music is one of the most popular Jung-Ak music pieces. As its name indicates, the main characteristics of {\it Dodeuri} (repeat-and-return) music are in its frequent repetition and variation patterns. To analyze such patterns, TDA, particularly persistent homology has been utilized in \cite{TPJ}. Since the raw form of the music is not suitable, the given music is represented as a network \cite{BW,Liu,RCG,LTS10}, for which proper definitions of nodes and edges are provided in \cite{TPJ}. A node is defined as a two-dimensional vector whose first component is the pitch and the second the duration of the music note. If two nodes are placed side-by-side in the music, those two nodes are directly connected and the edge between those two nodes is defined as the connection. The weight of the edge is defined as the frequency of the side-by-side appearance of those two nodes. In such a way, the weight is non-negative integers. In order to apply TDA, the notion of the distance between two nodes is defined as the reciprocal of the edge weight of those two nodes if they are connected directly. If two nodes are only connected through more than two edges, the distance between those two nodes is defined by the sum of the reciprocals of the weights of edges involved between those two nodes. For the uniqueness, such edges between two nodes are picked in the path that has the smallest number of edges among all possible paths. Once the distance is defined, persistent homology is calculated and the corresponding one-dimensional barcodes are obtained. The one-dimensional barcode contains the one-dimensional hole information \cite{Carlsson}, that is, one-dimensional cycles in the given graph. In \cite{TPJ}, a unique set of total $8$ cycles was found for Suyeonjangjigok in Haegeum instrument -- Suyeonjangjigok (or Suyeonjang in short) is one of the most popular Dodeuri music. Figure \ref{fig:syj_original} shows first few lines of Suyeonjangjigok directly translated from Jeongganbo, the old Korean music notation. The version in the figure is a simple version of Suyeonjangjigok without ornaments. Readers can also listen Suyeonjangjigok played with Haegeum instrument in the following YouTube link {\lstinline{https://www.youtube.com/watch?v=_DKo8FjL7Mg&t=461s}} from 0:24 to 5:24. In this paper, we mainly use Suyeonjangjigok as an exemplary for the development of the proposed method. \begin{figure}[h] \begin{center} \includegraphics[width=0.9\textwidth]{syj_original.png} \caption{Suyeonjangjigok without ornaments. Credit: Myong-Ok Kim} \label{fig:syj_original} \end{center} \end{figure} In \cite{TPJ}, a new concept of {\it {\color{black}{Overlap}} matrix} of $s$-scale was introduced. The {\color{black}{Overlap}} matrix of $s$-scale, which will be explained in detail in Section \ref{cycles}, is a visualization in a matrix form that shows how those found cycles are interconnected over the music at $s$-scale. It was shown in \cite{TPJ} that the proposed {\color{black}{Overlap}} matrix is useful to understand how the given music is composed and to classify music. In fact, the {\color{black}{Overlap}} matrix explains surprisingly and quantitively well why the Dodeuri music is different from the Taryong music, a music known as a non Dodeuri music. In this way, the {\color{black}{Overlap}} matrix can be interpreted as the composition algorithm or composition principle of the considered music. The current paper is based on our assumption that the {\color{black}{Overlap}} matrix reveals the composition algorithm of the music considered. Upon such assumption, we propose a way of machine composition using the {\color{black}{Overlap}} matrix. Machine composition with Artificial Intelligence (AI) techniques based on artificial neural networks is well known even to non-experts these days \cite{Lopez}. There are various AI composition software packages available as well. AI music composition algorithms based on deep neural networks are to train a machine by feeding music pieces and create artificial neural networks that can produce music similar to the input music data. These approaches are considered as a blackbox optimization. That is, how machine composes with the constructed network is not known to users and the underlying composition algorithm of the generated music pieces is, in general, not explainable. In this paper, we present a way of machine composition that trains a machine the composition principle embedded in the given music data. Our proposed method is based on the {\color{black}{Overlap}} matrix explained in the above. As explained in details in Section \ref{cycles}, the {\color{black}{Overlap}} matrix is a kind of visualization method that shows how the key cycles of the music found via TDA are distributed and interconnected one another over the music flow. The main idea of the current paper is to train a machine the composition principle represented by the {\color{black}{Overlap}} matrix in the expectation that the music is algorithmically composed mimicking the input {\color{black}{Overlap}} matrix. One can simply create or design the {\color{black}{Overlap}} matrix and the machine generates the music with such {\color{black}{Overlap}} matrix as a seed music. In this paper, we explain how music can be generated with the {\color{black}{Overlap}} matrix. First, we will explain that the {\color{black}{Overlap}} matrix can be used directly to compose a music algorithmically. Second we will explain how we train a machine the {\color{black}{Overlap}} matrix for building artificial neural networks and generating music. The paper is composed of the following sections. In Section \ref{cycles}, we will explain the key elements of the current paper. We first explain the music network and TDA over the constructed network. Then we give detailed mathematical properties of the Overlap matrix. In Section \ref{nodepool}, we will explain the concept of node pool, which serves as the provider of nodes used for the composition. In Section \ref{algorithm}, we explain how we use the {\color{black}{Overlap}} matrix to generate music algorithmically -- Algorithm A. In Section \ref{ANN}, we explain how we use the Overlap matrix in the context of artificial neural network. First we propose three different methods that can generate the seed music using the {\color{black}{Overlap}} matrix in order to use towards the construction of the artificial neural network. Then, we provide a way to train a machine with the {\color{black}{Overlap}} matrix and construct the corresponding artificial neural networks. In Section \ref{conclusion}, we provide a brief concluding remark and future research questions. \section{Cycles and Overlap matrix} \label{cycles} In this section we first explain how to construct music network from the given music. The raw form of music is not suitable for TDA. We represent the given music as a graph so that TDA can be applied. As in \cite{TPJ}, we consider Suyeonjangjigok, a Dodeuri type monophonic music written in {\it Jeongganbo}. Jeongganbo is a unique Korean music notation similar to a matrix. Figure \ref{fig:syj_original} shows first few lines of Suyeonjangjigok translated directly from Jeongganbo. For the explanation of reading Jeongganbo, see \cite{TPJ}. Once music network is constructed, we apply TDA and obtain so-called the persistent barcode and the cycles corresponding to the one-dimensional barcode. Based on the barcode and cycles, we build the {\it {\color{black}{Overlap}} matrix} which will be used together with the cycle information and node frequency distribution for generating new music. We refer readers to \cite{TPJ,Carlsson} for more details of TDA through persistent homology. \subsection{Construction of music network} Consider a monophonic music piece composed of $d$ notes and let $\mathcal{L} = \{n_1, n_2, \ldots, n_d\}$ be the ordered sequence of notes as the music flow. Each note has the information of height (pitch) and length (duration) of the sound to be played, i.e., \[ n_i = (p_i, l_i), \] where $p_i$ is the pitch of note $n_i$ and $l_i$ is its length. Note that by the definition of $n_i$, it is possible that $(p_i,l_i) = (p_j, l_j)$ for $i\neq j$. We then construct the music network $G = (\mathcal{N}, \mathcal{E})$, where $\cal{N}$ is the set of nodes and $\cal{E}$ is the set of edges in $G$. Here, $\cal{N}$ is the set of distinct notes in $\mathcal{L}$, sorted in ascending order in terms of pitch first then length. That is, $\mathcal{N} = \{\nu_1,\nu_2,\ldots,\nu_{q}\}$, where $q\leq d$ is the number of distinct notes in $\mathcal{L}$ and $\nu_j$ has a higher pitch than $\nu_i$ or both have the same pitch but $\nu_j$ has a longer length than $\nu_i$ if $j>i$. We draw an edge between two nodes $\nu_i$ and $\nu_j$, $i\neq j$, if they occur adjacent in time. Let $e_{ij} \in \mathcal{E}$ be the edge whose end points are $\nu_i$ and $\nu_j$. The weight or the degree of the edge $e_{ij}$, $w_{ij}$, between $\nu_i$ and $\nu_j$ is the number of occurrences of those two nodes being adjacent in time. For two nodes $\nu_i$ and $\nu_j$ with $i<j$, let $p_{ij}$ be the path with the minimum number of edges between $\nu_i$ and $\nu_j$ found by Dijkstra algorithm. The distance between nodes $\nu_i$ and $\nu_j$, $i<j$ is defined to be: \begin{equation}\label{dij} \delta(\nu_i,\nu_j) = \sum \limits_{e_{kl}\in p_{ij}}w_{kl}^{-1} \end{equation} where $w_{kl}$ represents the weight of the edge $e_{kl}$ and $p_{ij} = \bigcup e_{kl} $. For those music we consider in this paper, since there is no empty Jeonggan where the music is not played, i.e., there is no isolated node, there always exists at least one path between any two distinct nodes $\nu_i$ and $ \nu_j$ even if they do not appear adjacently in the whole music. Also, it is obvious that $w_{kl}\geq 1$ for any edge $e_{kl}$. Thus, the definition of the distance by \eqref{dij} is well-defined. Then we form the distance matrix $D = \{\delta_{ij}\}$ as follows: \[ \delta_{ij} = \left\{ \begin{array}{lc} \delta(\nu_i,\nu_j), & i < j \\ 0, & i = j \\ \delta_{ji}, & i> j \end{array} \right. \] \subsection{TDA: Barcode and Cycles} We do not attempt to explain TDA here but refer readers to \cite{Carlsson} if necessary. The graph introduced above is defined with the definition of distance. Consider a point cloud composed of all nodes in $\mathcal{N}$. As all the pair-wise distances between $\nu_i$ and $\nu_j$ are defined, we first build a simplical complex out of the point {\color{black}{cloud}} as a Vietoris-Rips complex to compute persistent homology (see \cite{Carlsson,EHarer}). We note that there are other approaches rather than Vietoris-Rips complex for persistent homology on a graph. Since the main purpose of the current research is to propose a machine composition algorithm, the choice of building algorithm of complexes and filtration method is not critical. Using the distance matrix $D$, we build the corresponding Vietoris-Rips complex and barcode, for which we use the software package Javaplex \cite{AT}. Suyeonjang has total $d = 440$ notes composed of $q = 33$ distinct notes. \figref{fig:syj_barcode} shows the zero-dimensional (top) and one-dimensional (bottom) barcodes generated by Javaplex applied to $G$ of Suyeonjang. \begin{figure}[h] \begin{center} \includegraphics[width=0.7\textwidth]{syj_barcode.eps} \caption{Barcode of Suyeonjang using Vietoris-Rips method. Top: 0-D barcode. Bottom: 1-D barcode. In 1D barcode, we observe 8 non-zero persistence intervals implying 8 cycles in $G$. Credit: \cite{TPJ}} \label{fig:syj_barcode} \end{center} \end{figure} In \figref{fig:syj_barcode} the horizontal axis is the filtration value $\tau$. Vertically we have multiple intervals that correspond to generators of the homology groups. In the zeroth dimension we have $33$ generators that correspond to $33$ components when $\tau$ is zero or small, which eventually are connected into a single component when $\tau=1$. The $33$ components are actually those $33$ distinct nodes defined in Suyeonjang. All these components constitute a single component because of the fact that any node in the network connects at least one time with another node, which means that at most when distance $\tau=1$ all nodes in the network are connected. On the other hand, the fact that one component is formed exactly when $\tau = 1$ implies that there exists at least a pair of nodes $\nu_i, \nu_j$ that have distance $\delta (\nu_i, \nu_j)= 1$, i.e., $\nu_i$ and $\nu_j$ are adjacent only once. In the first dimension we see $8$ generators which topologically correspond to eight cycles. It turns out that the interconnection between these cycles is related to the repetition of music melodies known as Dodeuri \cite{TPJ}. {\color{black}{ For each persistence interval we use the persistence algorithm computing intervals to find a representative cycle. The method \textsf{computeAnnotatedIntervals} in Javaplex is used to find the nodes in the intervals of persistence. In the one dimensional case, the annotated intervals consist of the components in the loops generated in the process of filtration. }} \figref{fig:syj_cycles} shows $8$ Cycles identified by TDA corresponding to $8$ persistence intervals in the one dimensional barcode {\color{black}{of Suyeonjang. We enumerate the cycles by the order of the appearance of their corresponding persistence intervals in the barcode.}} That is, the earlier the 1D barcode dies, the lower number is assigned to the corresponding cycle. For example, the death of Cycle $i$ is earlier than the death of Cycle $j$ if $i < j$. Note that this order is different from the order of their appearance in the actual music {\color{black}{and can be done arbitrarily without affecting the proposed composition algorithms}}. In the figure, each Cycle is shown with persistence interval, node information including node number, pitch and its length, the latter two of which are encrypted in {\color{black}{the circles filled with different colors and centered by Chinese letters. In fact}}, the Chinese letter in the center of each filled circle corresponds to a specific pitch, and the color of each circle illustrates the node length (see Table \ref{tab:syj_nodeinfo}). The figure also shows edge weight (in normal size in blue), distance between nodes (in small size in blue in brackets) and the average weight (in red in center) which is the simple mean of all edge weights. As shown in the figure, the minimum number of nodes that constitute a cycle is $4$ and the maximum number is $6$. The information of corresponding music notes found {\color{black}{in}} all cycles is given in \tabref{tab:syj_nodeinfo}. {\color{black}{For the purpose of this paper, we will use only the node information of the Cycles $C_i, i=1,\ldots,8$. More precisely, we will use the information of which nodes each Cycle consists of. For example, in the case of Suyeonjang, $C_1=\{ \nu_{18}, \nu_{20}, \nu_{22}, \nu_{27}\}$, $C_2=\{ \nu_{3}, \nu_{6}, \nu_{12}, \nu_{18}\}$ and so on. It should be noted that we do not need detailed information of the names, pitches or lengths of the music notes for building the composition algorithms. Those actual music note information will be used at the finishing stage where we get the generated music for playing.}} In the next section, we explain in details how the Cycles will be used to construct so-called the Overlap matrix, one of the key ingredients in generating new music. \include{syj_cycles} \include{syj_nodeinfo} \subsection{Overlap matrices} \label{sec:om} In \cite{TPJ} the {\color{black}{Overlap}} matrix was introduced. In this section, we provide a formal definition of the {\color{black}{Overlap}} matrix and its mathematical properties. From now on, let $s$ be a positive integer. \definition{A \textit{binary matrix} is a matrix whose entries are either $0$ or $1$. } \definition{ A binary matrix $M_{k\times d}^s=\{m_{ij}^s\}$ is said to \textit{belong to $s$-scale} if for all $i = 1,\ldots,k$ we have that $m_{ij}^s = 1$ if and only if there exist nonnegative integers $t,l$ satisfying $t+l \geq s-1$ such that \begin{equation*} m_{i,j-l}^s = m_{i,j-l-1}^s = \ldots = m_{ij}^s = \ldots = m_{i,j+t-1}^s = m_{i,j+t}^s = 1. \end{equation*} } Notice that there are $t+l+1$ entries from $m_{i,j-l}^s$ to $m_{i,j+t}^s$: \begin{center} \begin{tikzpicture}[scale=1.2] \draw (0,0) -- (9,0); \node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$m_{i,j-l}^s$}] at (1,0) {}; \node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=above:{$m_{i,j-l-1}^s$}] at (2,0) {}; \node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$\ldots$}] at (3,0) {}; \node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$m_{i,j}^s$}] at (4.5,0) {}; \node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$\ldots$}] at (5.5,0) {}; \node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=above:{$m_{i,j+t-1}^s$}] at (7,0) {}; \node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$m_{i,j+t}^s$}] at (8,0) {}; \node at (4.5,-1){$\underbrace{\phantom{n + 1\text{ length of underbrace longer longer longer}}}_{t+l+1 \text{ entries }}$}; \end{tikzpicture} \end{center} Thus, a binary matrix $M_{k\times d}^s=\{m_{ij}^s\}$ belongs to $s$-scale if and only if on each row of $M_{k\times d}^s$ any entry equal to $1$ should be staying in a consecutive sequence of length at least $s$ columns that equal to $1$. Unless other mentioned, let $\mathcal{O}$ be a music piece composed of $d$ notes that flows in the following order $\mathcal{L} = \{ n_1, \ldots, n_d\}$ and assume that the barcode for it in the first dimension consists of $k$ generators which topologically correspond to $k$ Cycles, $C_1, \ldots, C_k$. We define the binary and integer Overlap matrices {\color{black}{of}} $s$-scale for $\mathcal{O}$ as follows. \definition{Matrix $M_{k\times d}^s=\{m_{ij}^s\}$ is called the \textit{binary Overlap matrix} {\color{black}{of}} $s$-scale for $\mathcal{O}$ if it satisfies the following conditions \[ m_{ij}^s = \begin{cases} 1, & \text{ if } \exists~ t,l \geq 0 \text{ satisfying } t + l \geq s-1 \text{ such that }\\ & \hspace{0.5cm} n_{j-l}, n_{j-l-1}, \ldots, n_j, \ldots, n_{j+t-1}, n_{j+t} \in C_i,\\ 0, & \text{ otherwise,} \end{cases} \] for all $i = 1,\ldots, k$; $j = 1,\ldots,d$. }\label{def:bom} \definition{ Matrix $M_{k\times d}^s=\{m_{ij}^s\}$ is called the \textit{integer Overlap matrix} {\color{black}{of}} $s$-scale for $\mathcal{O}$ if it satisfies the following conditions \[ m_{ij}^s = \begin{cases} n_j, & \text{ if } \exists~ t,l \geq 0 \text{ satisfying } t + l \geq s-1 \text{ such that }\\ & \hspace{0.5cm} n_{j-l}, n_{j-l-1}, \ldots, n_j, \ldots, n_{j+t-1}, n_{j+t} \in C_i,\\ 0, & \text{ otherwise,} \end{cases} \] for all $i = 1,\ldots, k$; $j = 1,\ldots,d$. }\label{def:iom} \remark{ Given the integer Overlap matrix {\color{black}{of}} $s$-scale for a music $\mathcal{O}$, its corresponding binary Overlap matrix is uniquely determined and easily obtained by replacing nonzero entries in the integer Overlap matrix with $1$. The converse is not true. } \label{rmk:iom_to_bom} \begin{proposition} \label{prop} If $M_{k\times d}^s=\{m_{ij}^s\}$ is the binary Overlap matrix {\color{black}{of}} $s$-scale for $\mathcal{O}$, then the followings hold \begin{enumerate}[(i)] \item $M_{k\times d}^s$ is a binary matrix belonging to $s$-scale. \item $m_{ij}^s = 1$ implies that $n_j \in C_i$. \item If $n_j \notin C_i$ then $m_{ij}^s = 0$. \end{enumerate} \end{proposition} \begin{remark} The converse of $(ii)$ and $(iii)$ is not necessarily true. \end{remark} \begin{proof}[Proof of Proposition \ref{prop}] Let $M_{k\times d}^s=\{m_{ij}^s\}$ be the binary Overlap matrix {\color{black}{of}} $s$-scale for $\mathcal{O}$. It is easy to see that $(ii)$ and $(iii)$ are straightforward from the definition \ref{def:bom}. To prove $(i)$, since $m_{ij}^s$ is either $0$ or $1$ for all $i,j$, hence $M_{k\times d}^s$ is a binary matrix, it remains to show that on each row of $M_{k\times d}^s$ any entry equal to $1$ stays in a consecutive sequence of length at least $s$ columns that equal to 1. Let $m_{ij}^s=1$. By definition \ref{def:bom}, there exist $ t,l \geq 0 $ satisfying $t + l \geq s-1$ such that $n_{j-l}$, $n_{j-l-1}, \ldots, n_j, \ldots, n_{j+t-1}$, $n_{j+t} \in C_i$. In other words, there exists a consecutive sequence of at least $s$ notes including $n_j$ in $\mathcal{O}$ that belong to $C_i$. Now, in turn, $m_{i,j-l}^s = 1$ since there exist $u=0$, $r = t+l \geq0$ satisfying $u+r = t+l \geq s-1$ such that $n_{j-l-u} (= n_{j-l}), n_{j-l-u-1} (=n_{j-l-1}) \ldots, n_{j-l+r-1} ( = n_{j+t-1}), n_{j-l+r} (= n_{j+t}) \in C_i$. Analogously, we can show that $m_{i,j-l-1}^s = \ldots = m_{i,j+t}^s = 1$. Thus, $M_{k\times d}^s=\{m_{ij}^s\}$ belongs to $s$-scale. \end{proof} \begin{remark} Given a music piece $\mathcal{O}$, the integer Overlap matrix (and thus the binary Overlap matrix as well, by Remark \ref{rmk:iom_to_bom}) {\color{black}{of $s$-scale $M_{k\times d}^s$ for $\mathcal{O}$}} is uniquely determined. \end{remark} In Algorithm \ref{algorithm1} we give an algorithm to compute the integer Overlap matrix {\color{black}{of}} $s$-scale $M_{k\times d}^s$ for a given music $\mathcal{O}$. \algdef{SE}[SUBALG]{Indent}{EndIndent}{}{\algorithmicend\ }% \algtext*{Indent} \algtext*{EndIndent} \begin{algorithm} \caption{Algorithm to compute integer Overlap matrix {\color{black}{of}} $s$-scale $M_{k\times d}^s$}\label{algorithm1} \begin{algorithmic} \State Given $\mathcal{O}$ and Cycle information $C_1, \ldots, C_k$. \State Set $M_{k\times d}^s = \mathbb{O}_{k\times d}$ (zero matrix). \State Let $j = 1$. \State For each row $i = 1,\ldots, k$, repeat the followings until $j=d$. \State {\bf Step 1: Find} \begin{equation} q = \argmin_\beta \{ j\leq \beta \leq d: n_\beta \in C_i\}. \label{inCi} \end{equation} \Indent\Indent \If {\eqref{inCi} has no solution} \State break \Else \State Go to Step 2. \EndIf \EndIndent \EndIndent \State {\bf Step 2: Find} \begin{equation} \label{not_inCi} r = \argmin_\gamma \{ q < \gamma \leq d: n_\gamma \notin C_i\}. \end{equation} \Indent\Indent \If { \eqref{not_inCi} has no solution} \If { $d-q \geq s-1$} $$m_{i,j}^s = n_j, \quad j = q,\ldots,d.$$ \EndIf \State {\bf break} \ElsIf {\eqref{not_inCi} has a solution and $r-q\geq s$} $$m_{i,j}^s = n_j, \quad j = q, \ldots r-1.$$ \EndIf \EndIndent \EndIndent \State Set $j = r$ and come back to Step 1. \end{algorithmic} \end{algorithm} In the case of Suyeonjang which is composed of $d=440$ notes and has in total eight Cycles, the binary Overlap matrix {\color{black}{of}} $4$-scale $M_{8\times440}^4$ is displayed in \figref{fig:syj_overlap4}. In \figref{fig:syj_overlap4} the horizontal axis represents the time sequence the music flows and the vertical axis represents the cycle number, from $C_1$ to $C_8$. The zero entries are left blank and the entries that equal to $1$ are colored. Notice that {\color{black}{at}} $s$-scale, each colored block is of length at least $s$ entries. \begin{figure}[!h] \begin{center} \includegraphics[scale=0.6]{syjom.png} \caption{The binary Overlap matrix {\color{black}{of $4$-scale for Suyeonjang}}. The zero entries are left blank and the entries that equal to $1$ are colored. {\color{black}{Credit: \cite{TPJ}}} } \label{fig:syj_overlap4} \end{center} \end{figure} According to the definition of the binary Overlap matrix $M_{k\times d}^s$, the entries $m_{ij}^s$ can be either $0$ or $1$ depending on whether there exists a consecutive sequence of at least $s$ notes containing the note $n_j$ of the music that belongs to the Cycle $C_i$ or not. A zero entry $m_{ij}^s=0$ does not necessarily mean that the note $n_j$ does not belong to the Cycle $C_i$. It can be the case that the note $n_j$ belongs to the Cycle $C_i$ but the consecutive sequence of notes containing note $n_j$ belonging to Cycle $C_i$ is not long enough on the scale being considered. On the other hand, if $m_{ij}^s=1$ we can say for sure that the note $n_j$ of the music belongs to the Cycle $C_i$. Thus, the $j$-th column of the matrix $M_{k\times n}^s$ provide the information of how many cycles, as well as which ones, are overlapping ``{\color{black}{at}} $s$-scale'' at this point. This is indeed the motivation why we call it the Overlap matrix. For example, let us take a close look at the binary Overlap matrix $M_{8\times 440}^4$ {\color{black}{of}} $4$-scale for Suyeonjang. The first column of $M_{8\times 440}^4$ which is \begin{equation*} \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}^T \end{equation*} can mean that the first node $n_1$ does not belong to any Cycle, or in fact it does belong to some Cycle but at least one of the notes $n_2, n_3, n_4$ does not belong to that Cycle. On the other hands, the $25$-th column of $M_{8\times 440}^4$ which is \begin{equation*} \begin{bmatrix} 0 & 1 & 0 & 0 & 1 & 1 & 1 & 0 \end{bmatrix}^T \end{equation*} implies that the $25$-th note at least belongs to 4 Cycles, that are $C_2$, $C_5$, $C_6$, $C_7$. Similar to the first note $n_1$, it is inconclusive whether or not the $25$-th note belongs to $C_1, C_3, C_4, C_8$. \vspace{0.3cm} \begin{minipage}{.5\textwidth} \begin{center} \text{first column} \\ \vspace{0.5cm} \scalebox{0.6}{ \begin{tikzpicture}[rotate=-90,every node/.style={minimum size=1cm-\pgflinewidth, outer sep=0pt}] \draw[step=1cm,color=black] (0,0) grid (8,1); \end{tikzpicture} } \end{center} \end{minipage}% \begin{minipage}{.3\textwidth} \begin{center} \text{$25$-th column} \\ \vspace{0.5cm} \scalebox{0.6}{ \begin{tikzpicture}[rotate=-90,every node/.style={minimum size=1cm-\pgflinewidth, outer sep=0pt}] \draw[step=1cm,color=black] (0,0) grid (8,1); \node[fill={rgb:cyan,0.7; green,0.2; blue,0.2}] at (1.5,0.5) {$C_2$}; \node[fill={rgb:cyan,0.7; green,0.2; blue,0.2}] at (4.5,0.5) {$C_5$}; \node[fill={rgb:cyan,0.7; green,0.2; blue,0.2}] at (5.5,0.5) {$C_6$}; \node[fill={rgb:cyan,0.7; green,0.2; blue,0.2}] at (6.5,0.5) {$C_7$}; \end{tikzpicture} } \end{center} \end{minipage} \vspace{0.5cm} \definition {A Cycle $C_i$ is said to \textit{survive} at note $n_j$ {\color{black}{at}} $s$-scale if $m_{ij}^s = 1$. } Denote by $S_j$ the set of Cycles which survive at note $n_j$ {\color{black}{at}} $s$-scale. It is obvious that \begin{equation} \label{eq:S} S_j = \begin{cases} \emptyset, & \text { if } m_{ij}^s = 0, \forall i = 1,\ldots,k, \\ \{ C_t | t \in I_j \}, & \text { if } m_{ij}^s = \chi_{I_j} (i), \end{cases} \end{equation} for $j = 1, \ldots, d$. Here, $I_j$ is an index set, $I_j \subset \{ 1, 2, \ldots, k\}$ and $\chi_{I_j}$ is the indicator function $\chi_{I_j}: \{ 1, 2, \ldots, k\} \to \{0,1\}$ such that \begin{equation*} \chi_{I_j}(x) = \begin{cases} 1, & \text{ if } x \in {I_j},\\ 0, & \text{ if } x \notin {I_j}. \end{cases} \end{equation*} Indeed, $I_j$ is the set of all the indices $i$ where $m_{ij}^s=1$ for a given $j$. In the case of Suyeonjang we have, for example, that $S_1 = \emptyset$ and $S_{25} = \{C_2, C_5, C_6, C_7\}$. \section{Node pool} \label{nodepool} First consider the algorithmic composition by following the pattern of the binary Overlap matrix {\color{black}{of}} given $s$-scale of the considered music. Notice that {\color{black}{at}} $s$-scale the Cycles obtained from the considered music by TDA tools only overlap at certain notes (see the binary Overlap matrix of Suyeonjang in \figref{fig:syj_overlap4}) or sometimes they do not overlap at all (see the binary Overlap matrix of {\color{black}{a music called Taryong \cite{TPJ}}} in \figref{fig:tr_overlap4}). Also, there are many notes along the music flow where there is no Cycle surviving {\color{black}{at}} $s$-scale. At those notes, more freedom of node choice can be given. We will build up a so-called Node pool (denoted by $\mathcal{P}$), from which we choose node for those places where there is no Cycle surviving {\color{black}{at}} the considered $s$-scale. The Node pool is a collection of nodes that satisfies the node frequency distribution. \begin{figure}[!h] \begin{center} \includegraphics[scale=0.8]{trom.png} \caption{The binary Overlap matrix {\color{black}{of $4$-scale for Taryong}}. The zero entries are left blank and the entries that equal to $1$ are colored. Credit: \cite{TPJ} } \label{fig:tr_overlap4} \end{center} \end{figure} \begin{table}[!h] \begin{center} \caption{Frequency versus node for Suyeonjang, Songkuyeo and Taryong music. Credit: \cite{TPJ}.} \label{tab:freq} {\footnotesize{ \begin{tabular}{| c | |c c|| c c|| c c|} \hline {Rank}& {Suyeonjang} & & {Songkuyeo} & & {Taryong} & \\ \hline 1 & $n_{18}$ & 76 & $n_{20}$ & 65 & $n_{16}$ & 38 \\ 2 & $n_{6}$ & 57 & $n_{31}$ & 53 & $n_{11}$ & 28 \\ 3 & $n_{11}$ & 44 & $n_{13}$ & 45 & $n_{13}$ & 23 \\ 4 & $n_{22}$ & 44 & $n_{26}$ & 44 & $n_{26}$ & 18 \\ 5 & $n_{1}$ & 30 & $n_{8}$ & 27 & $n_{29}$ & 17 \\ 6 & $n_{20}$ & 26 & $n_{18}$ & 23 & $n_{31}$ & 15 \\ 7 & $n_{27}$ & 22 & $n_{4}$ & 18 & $n_{28}$ & 15 \\ 8 & $n_{3}$ & 16 & $n_{33}$ & 18 & $n_{3}$ & 14 \\ 9 & $n_{28}$ & 14 & $n_{6}$ & 11 & $n_{18}$ & 13 \\ 10 & $n_{12}$ & 10 & $n_{16}$ & 11 & $n_{15}$ & 11 \\ 11 & $n_{16}$ & 9 & $n_{25}$ & 11 & $n_{12}$ & 10 \\ 12 & $n_{26}$ & 9 & $n_{19}$ & 10 & $n_{22}$ & 10 \\ 13 & $n_{31}$ & 9 & $n_{24}$ & 10 & $n_{6}$ & 9 \\ 14 & $n_{2}$ & 7 & $n_{27}$ & 10 & $n_{32}$ & 8 \\ 15 & $n_{4}$ & 7 & $n_{28}$ & 9 & $n_{17}$ & 7 \\ 16 & $n_{23}$ & 7 & $n_{32}$ & 8 & $n_{20}$ & 7 \\ 17 & $n_{9}$ & 6 & $n_{2}$ & 6 & $n_{4}$ & 5 \\ 18 & $n_{10}$ & 6 & $n_{15}$ & 5 & $n_{9}$ & 4 \\ 19 & $n_{5}$ & 5 & $n_{7}$ & 4 & $n_{0}$ & 3 \\ 20 & $n_{8}$ & 5 & $n_{11}$ & 3 & $n_{14}$ & 3 \\ 21 & $n_{13}$ & 5 & $n_{12}$ & 3 & $n_{2}$ & 2 \\ 22 & $n_{0}$ & 4 & $n_{14}$ & 3 & $n_{5}$ & 2 \\ 23 & $n_{7}$ & 3 & $n_{17}$ & 3 & $n_{7}$ & 2 \\ 24 & $n_{17}$ & 3 & $n_{21}$ & 3 & $n_{8}$ & 2 \\ 25 & $n_{19}$ & 3 & $n_{23}$ & 3 & $n_{19}$ & 2 \\ 26 & $n_{21}$ & 2 & $n_{35}$ & 3 & $n_{21}$ & 2 \\ 27 & $n_{25}$ & 2 & $n_{0}$ & 2 & $n_{27}$ & 2 \\ 28 & $n_{29}$ & 2 & $n_{3}$ & 2 & $n_{33}$ & 2 \\ 29 & $n_{30}$ & 2 & $n_{9}$ & 2 & $n_{34}$ & 2 \\ 30 & $n_{32}$ & 2 & $n_{10}$ & 2 & $n_{35}$ & 2 \\ 31 & $n_{14}$ & 1 & $n_{36}$ & 2 & $n_{1}$ & 1 \\ 32 & $n_{15}$ & 1 & $n_{34}$ & 2 & $n_{10}$ & 1 \\ 33 & $n_{24}$ & 1 & $n_{1}$ & 1 & $n_{23}$ & 1 \\ 34 & & & $n_{5}$ & 1 & $n_{24}$ & 1 \\ 35 & & & $n_{22}$ & 1 & $n_{25}$ & 1 \\ 36 & & & $n_{29}$ & 1 & $n_{30}$ & 1 \\ 37 & & & $n_{30}$ & 1 & $n_{38}$ & 1 \\ 38 & & & & & $n_{36}$ & 1 \\ 39 & & & & & $n_{37}$ & 1 \\ 40 & & & & & $n_{39}$ & 1 \\ \hline \end{tabular} }} \end{center} \end{table} Let us take Suyeonjang as an example again. According to our node definition, Suyeonjang is of length $440$ notes that consists of $33$ distinct nodes. The node frequency distribution of Suyeonjang is shown in Table \ref{tab:freq} where two additional music pieces, Songkuyeo and Taryong's node frequency distributions are also shown. Imagine that we have a set of $440$ nodes where, for example, the node $n_{18}$ has $76$ copies, $n_{6}$ has $57$ copies and so on. Then the chance of randomly picking up the node $n_j$ can be the same as its probability: \[ \text{ Node probability of $n_j$} = \frac{\text{ Node frequency of $n_j$}} {\text{ Total number of node frequencies}} \] In general, consider a music of length $d$ notes that flows in the following order $\mathcal{L} = \{n_1, \ldots, n_d\}$. Let $\{ \nu_1, \ldots, \nu_q\}$ be the set of its distinct nodes as before, with the node frequencies are $f_1, \ldots, f_q$, respectively. Then $\mathcal{P}$ for this music is a multiset made of all the nodes $\nu_1, \ldots, \nu_q$, where node $\nu_1$ appears in the set $f_1$ times, $\nu_2$ appears $f_2$ times and so on. \[ \mathcal{P} = \{ \underbrace{\nu_1, \ldots, \nu_1}_{f_1\text{ times}}, \underbrace{\nu_2, \ldots, \nu_2}_{f_2\text{ times}}, \ldots, \underbrace{\nu_q, \ldots, \nu_q}_{f_q\text{ times}} \} \] Notice that \[ f_1 + \ldots + f_q = d, \] thus, $\mathcal{P}$ contains exactly $d$ nodes that made up from $q$ distinct nodes from the music. In other words, $\mathcal{P}$ is a permutation of the set $\mathcal{L} = \{n_1, \ldots, n_d\}$. The chance of picking a node from $\mathcal{P}$ is equal to its probability, $p(\nu_j) = \frac{f_j}{d}$. \section{Algorithmic composition - Algorithm A} \label{algorithm} The Overlap matrix of Suyeonjang in \figref{fig:syj_overlap4} is found to be related to the unique structure of Dodeuri pattern \cite{TPJ}. The Overlap matrices show how the Cycles are distributed and interconnected along the music flow. The idea of creating new music algorithmically is shown in the flowchart in \figref{fig:flowchart}. \begin{figure}[!h] \begin{center} \begin{tikzpicture} \draw (0.5,0) rectangle (4.5,1) node[midway] {Seed music $\mathcal{O}$}; \draw[->,thick] (2.5,0) -- (7,-1); \draw (5,-1) rectangle (9,-2) node[midway] {Distance matrix $\{\delta_{ij}\}$}; \draw [->,thick] (7,-2) -- (7,-3.5); \draw (6,-4.5) rectangle (8,-3.5) node[midway] {Cycles $C_i$}; \draw [->,thick] (6,-4) -- (5,-4); \draw (0,-3.5) rectangle (5,-4.5) node[midway] {Binary Overlap matrix $M_{ij}^s$}; \draw[->,thick] (2.5,0) -- (-1.75,-1); \draw (-3.5,-1) rectangle (0,-2.5) node[midway,align=center] {Node frequency \\distribution}; \draw [->,thick] (-1.75,-2.5) -- (-1.75,-3.5); \draw (-3,-3.5) rectangle (-0.5,-4.5) node[midway] {Node pool $\mathcal{P}$}; \draw [->,thick] (-1.75, -4.5) -- (2.3,-6); \draw [->,thick] (2.5,-4.5) -- (2.5,-6); \draw [->,thick] (7,-4.5) -- (2.7,-6); \draw (0.5,-6) rectangle (4.5,-7) node[midway] {New music $\mathcal{O}'$}; \end{tikzpicture} \end{center} \caption{Flowchart of algorithmic creation of new music.} \label{fig:flowchart} \end{figure} For the preparation we need Node pool, Cycles and binary Overlap matrix. Given the music that we consider (Suyeonjang for example), it is straightforward to get the node frequency distribution and then build up the Node pool. On the other hand, from the seed music we can construct the music network and then find the distance matrix. Next, the distance matrix is plugged into Javaplex and by using TDA tools we find the barcode and corresponding Cycle information. The Cycles are then used to obtain the binary Overlap matrix. Given the music of length $d$ notes which is a music in Jeongganbo that flows in the following order $\mathcal{L} = \{ n_1, \ldots, n_d\}$, our goal is to algorithmically create new music of the same length $d$ that flows in the following order $\mathcal{L'} = \{ n_1', \ldots, n_d'\}$ such that the pattern of the binary Overlap matrix {\color{black}{of}} given $s$-scale of the seed music is strictly followed and the new music sounds similar to the seed music holding particular patterns. Below we explain how to choose each note $n_j', j = 1,\ldots,d$ of the new music. Assume that following the process described above we found $k$ Cycles $C_1, C_2,\ldots, C_k$. Let $S_j$ be the set of Cycles which survive at note $n_j$ {\color{black}{at}} $s$-scale, as defined in \eqref{eq:S}. Along the music flow, at each note $n_j$ either there are some Cycles surviving {\color{black}{at}} $s$-scale ($S_j\neq \emptyset$) or none of the Cycles survive ($S_j=\emptyset$). Denote by $\mathcal{I}_j$ the set of nodes belonging to the intersection of those Cycles surviving {\color{black}{at}} $s$-scale that overlap at note $n_j$: \[ \mathcal{I}_j = \{ n_i | n_i \in \bigcap\limits_{C_i \in S_j} C_i \}. \] If some of the Cycles survive at note $n_j$ {\color{black}{at}} $s$-scale, i.e., $S_j \neq\emptyset$, then the new note $n_j'$ is randomly chosen from the intersection of those Cycles: \begin{equation*} n_j' = \text{ random choice from } \mathcal{I}_j \iff S_j \neq \emptyset, j = 1,\ldots,d. \end{equation*} Otherwise, if none of the $k$ Cycles survive at note $n_j$ {\color{black}{at}} $s$-scale, i.e., $S_j = \emptyset$, we randomly pick up a node from the Node pool $\mathcal{P}$ with or without a constraint depending on whether or not there exist Cycles surviving at node $n_{j-1}$ and node $n_{j+1}$ {\color{black}{at}} $s$-scale as follows: \begin{equation*} \resizebox{ \textwidth}{!} {$ n_j' = \begin{cases} \text{ random choice from } \mathcal{P} & \iff S_{j-1} = S_j = S_{j+1} =\emptyset, \\ \text{ random choice from } \mathcal{P} \setminus \mathcal{I}_{j-1} & \iff S_{j-1} \neq \emptyset, S_j = S_{j+1} = \emptyset, \\ \text{ random choice from } \mathcal{P} \setminus \mathcal{I}_{j+1} & \iff S_{j-1} = S_j = \emptyset, S_{j+1} \neq \emptyset, \\ \text{ random choice from } \mathcal{P} \setminus (\mathcal{I}_{j-1} \bigcup \mathcal{I}_{j+1}) & \iff S_{j-1} \neq \emptyset, S_j = \emptyset, S_{j+1} \neq \emptyset, \end{cases}$ } \end{equation*} for $j = 1,\ldots,d$. It is easy to see that in this way, we strictly follow the pattern of the binary Overlap matrix. \begin{remark} After getting new music $\mathcal{O}'$ we can apply to it the process of constructing music network, followed by using TDA tools, to find its corresponding binary and integer Overlap matrices. It is observed that new music $\mathcal{O}'$ generated by the procedure in \figref{fig:flowchart}, although sounds nice, neither necessarily has the same number of Cycles nor necessarily reflects the overlap pattern of the original seed music $\mathcal{O}$. In other words, both the binary and integer Overlap matrices of $\mathcal{O}'$ can be very different from those of $\mathcal{O}$. This is illustrated in the following examples where we use Suyeonjang as the seed music. We provide here only the binary Overlap matrices since it is obvious that if two musics have different binary Overlap matrices then their integer Overlap matrices are also different. \end{remark} \begin{example} \label{ex:syjnew5} Figure \ref{fig:syjnew5} shows a music generated from Suyeonjang which has only four Cycles. \begin{figure}[!h] \begin{center} \includegraphics[scale=0.8]{SYJnew_5om.png} \caption{The binary Overlap matrix {\color{black}{of $4$-scale for a new music generated from Suyeonjang}}. The zero entries are left blank and the entries that equal to $1$ are colored. The new music has four Cycles. } \label{fig:syjnew5} \end{center} \end{figure} \end{example} \begin{example} \label{ex:syjnew63} Figure \ref{fig:syjnew63} shows another music generated from Suyeonjang which also has only four Cycles. The overlap pattern of this music is quite different from that of the music shown in Example \ref{ex:syjnew5}. \begin{figure}[!h] \begin{center} \includegraphics[scale=0.8]{SYJnew_63om.png} \caption{The binary Overlap matrix {\color{black}{of $4$-scale for a new music generated from Suyeonjang}}. The zero entries are left blank and the entries that equal to $1$ are colored. The new music has four Cycles. } \label{fig:syjnew63} \end{center} \end{figure} \end{example} \begin{example} Figure \ref{fig:syjnew68} shows a music generated from Suyeonjang which has six Cycles. Although this music has more Cycles than the musics shown in Examples \ref{ex:syjnew5} and \ref{ex:syjnew63}, it obviously has less Cycles than Suyeonjang. It is not exactly the same as the binary Overlap matrix of Suyeonjang but shows some similarity in the overlapping sense. \begin{figure}[!h] \begin{center} \includegraphics[scale=0.8]{SYJnew_68om.png} \caption{The binary Overlap matrix {\color{black}{of $4$-scale for a new music generated from Suyeonjang}}. The zero entries are left blank and the entries that equal to $1$ are colored. The new music has six Cycles. } \label{fig:syjnew68} \end{center} \end{figure} \end{example} \section{Creating new music with artificial neural network - Algorithm B} \label{ANN} An alternative approach of generating new music is to use the artificial neural network explained in the following. \subsection{Generating seed Overlap matrix} \label{seed} Given the integer Overlap matrix {\color{black}{of $s$-scale for Suyeonjang}} $M_{k\times d}^s$, our first goal is to generate an integer Overlap matrix $\widetilde{M}_{k\times d}^s$ that has the same size and similar pattern as $M_{k\times d}^s$, which will be used as a seed Overlap matrix towards the artificial neural network. For the given music, there could be various ways of generating seed Overlap matrix which has the same size as the Overlap matrix of the given music and also has similar patterns as the given music. Below we introduce three algorithms for generating a seed integer Overlap matrix $\widetilde{M}_{k\times d}^s$ from $M_{k\times d}^s$. {\color{black}{ The common strategy of the following three algorithms is to generate a binary Overlap matrix that has the same size and mimic the overlapping pattern of the given integer Overlap matrix first, then convert it to an integer Overlap matrix. The idea of each algorithm is as follows. {\em Row by Row Method:} Overlap Matrix Algorithm \#1 is row by row approach. That is, the first binary row is determined based on the number of blocks of consecutive nonzero entries of the first row of the given Overlap matrix. Next, using the overlapping pattern and node information, the second binary row is generated so that it overlaps or does not overlap the first row depending on whether the first and the second rows of the given Overlap matrix overlap or not. This process is continued for all rows. As a result we get a binary Overlap matrix that has the same size, same frequency of blocks of consecutive nonzero entries and preserve the overlapping pattern of the given Overlap matrix. To convert the generated binary Overlap matrix to an integer Overlap matrix, we convert column by column using the node information. {\em Element by Element {\color{black}{Method}}:} Overlap Matrix Algorithm \#2 is element by element approach. That is, nonzero entries in given Overlap matrix are first replaced with 1 to generate a binary Overlap matrix that has exactly the same overlapping pattern as the given Overlap matrix. Then, from the node information, entries equal to 1 in the generated binary Overlap matrix are converted back to integer numbers. This algorithm is the simplest one if we just want to get a new but very similar Overlap matrix. {\em Column by Column Method:} Overlap Matrix Algorithm \#3 is column by column approach. After converting given integer Overlap matrix to a binary Overlap matrix, we collect all kinds of columns in it and generate new Overlap matrix according to the frequencies of the columns. {\color{black}{In this}} way we automatically preserve the overlapping pattern of the given Overlap matrix, while still have the flexibility in the number of blocks as well as the length of each block of consecutive nonzero entries. The difficulty in this algorithm is that, a new column has to be carefully chosen so that the number of consecutive nonzero entries is not less than $s$ to satisfy the definition of an Overlap matrix {\color{black}{of}} $s$-scale. }} \vspace{0.4cm} \noindent \rule{\textwidth}{1pt} \vspace{-0.8cm} \begin{center} Overlap Matrix Algorithm \#1 \end{center} \vspace{-0.1cm} \hrule \vspace{0.3cm} \vspace{0.5cm} \begin{enumerate} \item [Step 1:] Find the frequency $f_i$ of blocks of consecutive nonzero entries in row $i$ of $M_{k\times d}^s$, $i=1,\ldots,k$. \item [Step 2:] For each cycle $C_i$, identify the set of cycles that do not overlap $C_i$. Let $S_i$ be the set of all indices $j$ of nodes $n_j$ that constitute those cycles. \item [Step 3:] Let $\widetilde{B}_{k\times d}^s$ be a $k\times d$ zero matrix. Then for each $i$ randomly pick up $f_i$ indices $j_1,\ldots, j_{f_i}$ that is not in $S_i$ and set $\widetilde{b}_{i,j_p+q} = 1$, $p = 1,\ldots, f_i$; $q = 0,1,\ldots,s-1$. Repeat this for all $i = 1,\ldots,k$. This step generates $\widetilde{B}_{k\times d}^s$ as a binary {\color{black}{Overlap}} matrix. \item [Step 4:] For each non-zero column $\bold{b_j}$ of $\widetilde{B}_{k\times d}^s$ let $U_j$ be the set of all nodes that constitute those cycles that correspond to nonzero entries in $\bold{b_j}$. Then replace all entries equal to $1$ in $\bold{b_j}$ by a random node index $n_j$ chosen from $U_j$. This step converts $\widetilde{B}_{k\times d}^s$ to an integer {\color{black}{Overlap}} matrix $\widetilde{M}_{k\times d}^s$. \end{enumerate} \vspace{1.6cm} \hrule \noindent \rule{\textwidth}{1pt} \vspace{-0.8cm} \begin{center} Overlap Matrix Algorithm \#2 \end{center} \vspace{-0.1cm} \hrule \vspace{0.3cm} \vspace{0.5cm} \begin{enumerate} \item [Step 1:] Replace nonzero entries in $M_{k\times d}^s$ with $1$ to convert $M_{k\times d}^s$ to a binary Overlap matrix $B_{k\times d}^s$. \item [Step 2:] Assume that $C_i = \{ n_1^i, n_2^i,\ldots,n_{r_i}^i\}, i = 1,\ldots,k$. Replace entries equal to $1$ in row $i$ of $B_{k\times d}^s$ by a random node $n_j^i$ belonging to $C_i$ by the method \texttt{random.choice(C\_i)}. \item [Step 3:] Repeat Step 2 for all rows in $B_{k\times d}^s$. \end{enumerate} \vspace{0.3cm} \hrule \noindent \rule{\textwidth}{1pt} \vspace{-0.8cm} \begin{center} Overlap Matrix Algorithm \#3 \end{center} \vspace{-0.1cm} \hrule \vspace{0.3cm} \vspace{0.5cm} \noindent\textbf{Procedure 1}: Generate a binary Overlap matrix $\widetilde{B}_{k\times d}^s$. \begin{enumerate} \item [Step 1:] Convert $M_{k\times d}^s$ to a binary Overlap matrix $B_{k\times d}^s$. \item [Step 2:] Choose a column for $\widetilde{B}_{k\times d}^s$ by a random selection from the set of all distinct columns in $B_{k\times d}^s$ according to the frequencies of the columns by the method \texttt{random.choices(C,F)}, where $C=[c_1,\ldots,c_i]$ denotes the list of all distinct columns in $B_{k\times d}^s$ and $F = [f_1,\ldots,f_i]$ is the list of their corresponding frequencies. \item [Step 3:] Select a number for how many times the column selected in Step 2 will be repeated in $\widetilde{B}_{k\times d}^s$. This number is chosen by \texttt{random.choices} from the set of repeated columns according to the repeating frequencies. \item [Step 4:] The next column is also chosen by the method \texttt{random.choices} but from the set of all distinct columns in $B_{k\times d}^s$ that are adjacent to the column selected in Step 2. The resulting column in Step 4 after placing in $\widetilde{B}_{k\times d}^s$ should satisfy the continuous condition, meaning that any entry equal to $1$ in $\widetilde{B}_{k\times d}^s$ should be staying in a consecutive sequence of length at least $s$ columns that equal to $1$. \item [Step 5:] Repeat Step 2-4 if necessary until the frequencies of blocks of consecutive entries equal to $1$ on each row of $B_{k\times d}^s$ and $\widetilde{B}_{k\times d}^s$ are similar. \end{enumerate} \noindent \textbf{Procedure 2}: Convert $\widetilde{B}_{k\times d}^s$ to an integer Overlap matrix $\widetilde{M}_{k\times d}^s$. \begin{enumerate} \item [Step 1:] Find all kinds of columns that $M_{k\times d}^s$ has and save them in a variable named \texttt{col\_choice}. \item [Step 2:] For each binary column $\bold{b_j}$ in $\widetilde{B}_{k\times d}^s$, find all columns in \texttt{col\_choice} that have the same indices of nonzero entries as $\bold{b_j}$, then randomly choose one of them, say $\bold{\widetilde{m_j}}$, to add to $\widetilde{M}_{k\times d}^s$. \end{enumerate} \vspace{0.3cm} \hrule \subsection{Training data set} In order to input the seed Overlap matrix into the artificial neural network for generating a new music, we need to construct an optimized artificial neural network corresponding to the given music. Such network can be obtained by training a machine with the given music. Note that the number of the given music is not large. For example, if we consider a single music, e.g. Suyeonjang, the number of the input music with which we train the machine is simply unity. That is, the number of data required for training is too small. In this section, we use a simple method of the {\it periodic extension} of the given music to generate more music for training. In our future research, however, we need to investigate more general approaches to address the issue of the number of the input music. The periodic extension is reasonable approach reflecting the Dodeuri music patterns. Let $M_{k\times d}^s$, which from now on will be denoted as $M$, be the integer Overlap matrix of the given music {\color{black}{and $\mathcal{L}$ be the ordered sequence of notes as the music flow.}} We augment seed music by shifting the original music one space at a time: \begin{equation} \begin{matrix} M^{(i)} & = & \overline{M}_{:,i:i + d - 1}, \\ \mathcal{L}^{(i)} & = & \overline{\mathcal{L}}_{i:i + d - 1}, \end{matrix} \label{eq:augmentation} \end{equation} where $\overline{M} = [{\color{black}{M \;\; M}}]$, $\overline{\mathcal{L}} = \begin{bmatrix}\mathcal{L} \\ \mathcal{L} \end{bmatrix}$, $d$ is the length of a seed music {\color{black}{and $i = 1,\ldots,d$}}. For the illustration, let us use Suyeonjang as the seed music. As explained above, for this case, we have $d = 440$ and $k = 8$ for Suyeonjang. Here, we think of a music flow $\mathcal{L}$ as a vector whose elements are indices of notes. Let $\mathcal{X}=\left\{ \overline{M}_{:,i:i+439}\right\}_{i=1}^{440}$ and $\mathcal{Y}=\left\{ \overline{\mathcal{L}}_{i:i+439}\right\}_{i=1}^{440}$. Figure \ref{fig:dataset} illustrates the construction of our dataset. \begin{figure}[!h] \centering \includegraphics[width=0.8\textwidth]{dataset_new.pdf} \caption{Dataset construction: periodic extension} \label{fig:dataset} \end{figure} We design a neural network $f_\theta$ such that $f_\theta(M') = {y}'$ where $M' \in \mathcal{X}$ and $y' \in \mathcal{Y}$ . Note that $f_\theta$ only satisfies $f_\theta(M') = {y}'$ in the optimization sense. \subsection{Construction of music generation network $f_\theta$} For the construction of $f_\theta$ introduced above, we seek a set of parameters $\theta^{*}$ that maximizes the probability of the real music flow $\mathcal{L}$ given the integer Overlap matrix $M^{s}_{k \times d}$: $$ \theta^{*} = \operatornamewithlimits{argmax}_{\theta} \sum_{(\mathcal{L}^{(i)}, M^{(i)})}\log p\left( \mathcal{L}^{(i)} \mid M^{(i)} \right), $$ where $\theta$ is a set of parameters of our model, {\color{black}{$p$ is the conditional probability distribution and}} $(\mathcal{L}^{(i)}, M^{(i)})$ is the $i$-th pair of the real music flow and its corresponding integer Overlap matrix induced by $\mathcal{L}$ and $M^{s}_{k \times d}$. We model the conditional probability distribution $p$ with a Multi-Layer Perceptron (MLP), but one can use any nonlinear function. MLPs are a sequence of affine transformations followed by element-wise nonlinearity. Let $f^{(l)}$ be the $l$-th hidden layer of a MLP and let $\mathbf{a}^{(l-1)} \in \mathbb{R}^{d^{(l-1)}}$ be an input vector of $f^{(l)}$ where $d^{(l-1)}$ is the dimensionality of $(l-1)$-th hidden layer. The output of $f^{(l)}$ is: $$ f^{(l)} \left( \mathbf{a}^{(l-1)} \right) = \sigma \left( \mathbf{W}^{(l)} \mathbf{a}^{(l-1)} + \mathbf{b}^{(l)} \right), $$ where {\color{black}{$\sigma$ is an activation function}}, $\mathbf{W}^{(l)} \in \mathbb{R}^{d^{(l)} \times d^{(l-1)}}$ and $\mathbf{b}^{(l)} \in \mathbb{R}^{d^{(l)}}$ are learnable weight matrix and bias vector, respectively. A nonlinear function $\sigma$ is applied to each element of a vector. Each hidden layer can use a different activation function. Typical choices for $\sigma$ are sigmoid function, hyperbolic tangent function and Rectified Linear Unit (ReLU). Then, a MLP $f_\theta$ is the composition of hidden layers $f^{(l)}$s: $$ \begin{matrix} f_\theta & = & f^{(L)} \circ f^{(L-1)} \circ \cdots \circ f^{(1)}, \\ \theta & = & \left\{ \mathbf{W}^{(l)}, \mathbf{b}^{(l)} :l=1, \cdots, L \right\}, \end{matrix} $$ where $L$ {\color{black}{is}} the number of hidden layers and $\mathbf{a}^{(0)}=\mathbf{x}$ is an input vector of $f_\theta$. For MLPs, the number of hidden layers, $L$ and the dimensionality of each hidden layer, $d^{(l)}$ are hyper-parameters to be determined. In general, MLPs take a vector as an input while our input is a matrix. The simplest way to feed a matrix into a MLP is to flatten it to one dimensional vector. Our model $f_\theta$ takes the flattened vector of $M^{(i)}$ and outputs the $d$ probability distributions \textcolor{black}{over $q$ distinct notes. We note that each element of $\mathcal{L}^{(i)}$ is the node index so that we apply one-hot encoding to it. Hence, we generate the corresponding $d \times q$ matrix $\mathbf{L}^{(i)}$ such that $\mathbf{L}^{(i)}_{jk}=1$ if $j$-th note is equal to $\nu_k$, and $\mathbf{L}^{(i)}_{jk}=0$ otherwise. For our network, the output of the last hidden layer $\mathbf{a}^{(L)}$ is a $dq$-dimensional vector. Then, we reshape $\mathbf{a}^{(L)}$ into the $d \times q$ matrix $\hat{\mathbf{L}}^{(i)}$, and takes the softmax function over each row. The output of our model for $M^{(i)}$ is as follows:} \begin{equation} \hat{\mathbf{L}}^{(i)}_{jk}=\frac{\exp \left( \mathbf{a}^{(L)}_{q(j-1) + k} \right)}{\sum_{l=1}^{q} \exp \left( \mathbf{a}^{(L)}_{q(j-1) + l} \right)}. \label{eq:softmax} \end{equation} $\hat{\mathbf{L}}^{(i)}_{jk}$ can be interpreted as the probability that the $j$-th note in the generated music is $\nu_k$. Then, a set of parameters of our model is updated toward minimizing the cross entropy loss between output probability distributions and the real music flow: \begin{equation} \operatorname{CrossEntropyLoss}\left(\hat{\mathbf{L}}^{(i)}, \mathbf{L}^{(i)} \right) = - \frac{1}{d} \sum\limits_{j=1}^{d} \sum\limits_{k=1}^{q} \mathbf{L}^{(i)}_{jk} \log \hat{\mathbf{L}}^{(i)}_{jk}. \label{eq:cross-entropy} \end{equation} Figure \ref{fig:network} shows the architecture of our model. \begin{figure}[htbp] \centering \includegraphics[width=\textwidth]{network_new.pdf} \caption{The architecture of our model for Suyeonjang. We use a MLP with three hidden layers each of which has 440 dimensionality. The output is the 440 probability distributions over 33 distinct notes. The learnable parameters are updated toward minimizing the cross entropy loss.} \label{fig:network} \end{figure} To evaluate our model, {\color{black}{we}} generated Suyeonjang-style musics using our model. The length $d$ of Suyeonjang is 440 and it has $q=33$ distinct notes and $k=8$ cycles. We used the binary Overlap matrix {\color{black}{of}} 4-scale. We obtained 440 data from the augmentation in Equation {\color{black}{\eqref{eq:augmentation}}} and used $70\%$ of them for training and the rest of them for evaluation. The detailed architecture of a MLP is shown in Table \ref{tab:architecture}. We optimized Equation {\color{black}{\eqref{eq:cross-entropy}}} with respect to the model's parameters using Adam optimizer with learning rate $0.001$ over 500 epochs. \begin{table}[htbp] \centering \begin{tabular}{c|c|c} \hline $l$ & $d^{(l)}$ & $\sigma$ \\ \hline $1$ & $440$ & ReLU \\ $2$ & $440$ & ReLU \\ $3$ & $440 \times 33$ & Softmax in Eq. {\color{black}{\eqref{eq:softmax} }}\\ \hline \end{tabular} \caption{The architecture of the MLP for generating Suyeonjang-style music} \label{tab:architecture} \end{table} \subsection{Examples} We generated music pieces with Algorithm A and Algorithm B.\footnote{ Some of the generated music pieces were played in June and July, 2021. Readers can listen those using the following YouTube links: {\lstinline{https://www.youtube.com/watch?v=_DKo8FjL7Mg&t=461s}} (June 5, 2021) and {\lstinline{https://www.youtube.com/watch?v=AxXKoFRlQiQ&t=751s}} (July 29, 2021). The original music with Haegeum instrument is played from 0:24 to 5:24 in the first link and 0:10 to 4:52 in the second link. } For Algorithm B, we used the Overlap Matrix Algorithm \# 1. Figure \ref{fig:example} shows the original Suyeonjang for Haegeum instrument (top), one of the generated music pieces with Algorithm {\color{black}{A}} (middle), and one of the generated music pieces with Algorithm {\color{black}{B}} (bottom). The music pieces in the middle and bottom are randomly selected from the automatically generated music pool. \begin{figure}[htbp] \centering \includegraphics[width=\textwidth]{syj1.png} \includegraphics[width=\textwidth]{syj_a1.png} \includegraphics[width=\textwidth]{syj_a2.png} \caption{Top: First few notes from the original Suyeonjang with Haegeum instrument. Middle: A music created by Algorithm A. Bottom: A music created by Algorithm B.} \label{fig:example} \end{figure} \section{Conclusion} \label{conclusion} In this paper, we used topological data analysis, {\color{black}{Overlap}} matrix and artificial neural network approaches for machine composition of trained Korean music, particularly the {\it {Dodeuri}} music. Using the concept of training the composition principle, we could generate similar music pieces to Dodeuri music. Although the proposed method provides a framework of machine composition of Korean music, there are several issues that need further rigorous investigations. First of all, we will need to analyze the overall structures of the generated music through Algorithm A and Algorithm B, compare them with the original music and study its musical implications. Second, the current research considered only limited aspects of Korean music reflected on the Overlap matrix, but for a full consideration, we will need to consider other unique characteristics of Korean music such as meter, ornamenting symbols, {\it Sikimse}\footnote{Sikimse is a unique technique of Korean music that variates the given note by vibrating, sliding, breaking, etc. }, etc. Also, the current research used a rather simple periodic extension method for generating the training data set from the given seed music. Our future work will conduct a study on how to provide training data when the number of considered music pieces is small. These should be fully considered for the construction of more generalized machine composition of Korean music. \vskip .2in \noindent {\bf{Acknowledgements:} }This work was supported by the NRF grant under grant number 2021R1A2C300964812. We thank Dr. Myong-Ok Kim for her translating Suyeonjangjigok into staff notation (\figref{fig:syj_original} and top figure of \figref{fig:example}). \newpage \bibliographystyle{plain}
efcaf07b29663840adaf7603a27f134766c29ce5
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \textit{Count-Min sketch} is a hash-based data structure to represent a dynamically changing associative array $\boldsymbol{a}$ of counters in an approximate way. The array $\boldsymbol{a}$ can be seen as a mapping from some set $K$ of keys to $\mathbb{N}$, where $K$ is drawn from a (large) universe $U$. The goal is to support {\em point queries} about the (approximate) current value of $\boldsymbol{a}(p)$ for a key $p$. Count-Min is especially suitable for the streaming framework, when counters associated to keys are updated dynamically. That is, {\em updates} are (key,value) pairs $(p,\ell)$ with the meaning that $\boldsymbol{a}(p)$ is updated to $\boldsymbol{a}(p)+\ell$. Count-Min sketch was proposed in \cite{cormode_improved_2005}, see e.g. \cite{DBLP:reference/db/Cormode18} for a survey. A similar data structure was introduced earlier in \cite{DBLP:conf/sigmod/CohenM03} named \textit{Spectral Bloom filter}, itself closely related to \textit{Counting Bloom filters} \cite{FanEtAl00}. The difference between Count-Min sketch and Spectral Bloom filter is marginal: while a Count-Min sketch requires hash functions to have disjoint codomains (rows of Count-Min matrix), a Spectral Bloom filter has all hash functions mapping to the same array, as does the regular Bloom filter. In this paper, we will deal with the Spectral Bloom filter version but will keep the term Count-Min sketch as more common in the literature. Count-Min sketch supports negative update values $\ell$ provided that at each moment, each counter $\boldsymbol{a}(p)$ remains non-negative (so-called {\em strict turnstile model} \cite{liu2011methods}). When updates are positive, the Count-Min update algorithm can be modified to a stronger version leading to smaller errors in queries. This modification, introduced in \cite{DBLP:conf/sigcomm/EstanV02} as \textit{conservative update}, is mentioned \cite{DBLP:reference/db/Cormode18}, without any formal analysis given in those papers. This variant is also discussed in \cite{DBLP:conf/sigmod/CohenM03} under the name \textit{minimal increase}, where it is claimed that it decreases the probability of a positive error by a factor of the number of hash functions, but no proof is given. We discuss this claim in the concluding part of this paper. \newcommand{\lVert \boldsymbol{a} \rVert_{1}}{\lVert \boldsymbol{a} \rVert_{1}} The case of positive updates is widespread in practice. In particular, a very common instance is \textit{counting} where all update values are $1$. This task occurs in different scenarios in network traffic monitoring, as well as other applications related to data stream mining \cite{DBLP:conf/sigcomm/EstanV02}. In bioinformatics, we may want to maintain, on the fly, multiplicities of $k$-mers (words of length $k$) occurring in a big dataset \cite{mohamadi2017ntcard,behera2018kmerestimate,shibuya_set-min_2020}. We refer to \cite{DBLP:conf/iccnc/EinzigerF15} for more examples of applications. While it is easily seen that the error in conservative update can only be smaller than in Count-Min, obtaining more precise bounds is a challenging problem. Count-Min guarantees, with high probability, that the additive error can be bounded by $\varepsilon \lVert \boldsymbol{a} \rVert_{1}$ for any $\varepsilon$, where $\lVert \boldsymbol{a} \rVert_{1}$ is the $L1$-norm of $\boldsymbol{a}$ \cite{cormode_improved_2005}. In the counting setting, $\lVert \boldsymbol{a} \rVert_{1}$ is the length of the input stream which can be very large, and therefore this bound provides a weak guarantee in practice, unless the distribution of keys is very skewed and queries are made on frequent keys (\textit{heavy hitters}) \cite{liu2011methods,charikar2004finding,cormode2008finding}. It is therefore an important practical question to analyse the improvement provided by the conservative update strategy compared to the original Count-Min sketch. Probably the first attempt towards this goal was made in \cite{DBLP:conf/teletraffic/BianchiDLS12}, under assumption that all $\binom{n}{k}$ counter combinations are equally likely at each step ($n$ size of the Count-Min array, $k$ number of hash functions) which amounts to assuming uniform distribution on $\binom{n}{k}$ input keys. For the regime when the number of distinct keys in the input considerably exceeds the sketch size, it was experimentally observed in \cite{DBLP:conf/teletraffic/BianchiDLS12} that frequent keys have essentially no error while the (over)estimate for less frequent keys tends be the same, for given input stream length and sketch size. On the other hand, it was experimentally shown that in that regime, the uniform distribution of keys presents the worst-case scenario producing the largest such estimate and a method was proposed to compute this estimate. Another method for bounding the error proposed in \cite{DBLP:conf/iccnc/EinzigerF15} } is based on a simulation of spectral Bloom filters by a hierarchy of ordinary Bloom filters. However, the bounds provided are not explicit but are expressed via a recursive relation based on false positive rates of involved Bloom filters. Recent works \cite{DBLP:journals/corr/abs-2203-14549,benmazziane:hal-03613957} propose formulas for computing error bounds depending on key probabilities assumed independent but not necessarily uniform, in particular leading to an improved precision bounds for detecting heavy hitters. In this paper, we provide a probabilistic analysis of the conservative update scheme for counting under the assumption of \textit{uniform distribution of keys} in the input. Our main result is a demonstration that the error in count estimates undergoes a phase transition when the number of distinct keys grows relative to the size of the Count-Min array. We show that the phase transition threshold corresponds to the \textit{peelability threshold} for random $k$-uniform hypergraphs. For the \textit{subcritical regime}, when the number of distinct keys is below the threshold, we show that the relative error for a randomly chosen key tends to $0$ asymptotically, with high probability. This contrasts with the regular Count-Min algorithm producing a relative error shown to be at least $1$ with constant probability. For the \textit{supercritical regime}, we show that the average relative error is lower-bounded by a constant (depending on the number of distinct keys), with high probability. We prove this result for $k=2$ and conjecture that it holds for arbitrary $k$ as well. We provide computer simulations showing that the expected relative error grows fast after the threshold, with a distribution showing a peculiar multi-modal shape. In particular, keys with small (or zero) error still occur after the threshold, but their fraction quickly decreases when the number of distinct keys grows. After defining Count-Min sketch and conservative update strategy in Section~\ref{countmin-and-CU} and introducing hash hypergraphs in Section~\ref{sec:hash}, we formulate the conservative update algorithm (or regular Count-Min, for that matter) in terms of a hypergraph augmented with counters associated to vertices. In Section~\ref{sec:main}, we state our main results and illustrate them with a series of computer simulations. All technical proofs are provided in a separate Section~\ref{sec:proofs}. In addition, in Section~\ref{sec:non-peelable}, we study a specific family of 2-regular $k$-hypergraphs that are sparse but not peelable. For such graphs we show that while the relative error of every key is $1$ with the regular Count-Min strategy, it is $1/k+o(1)$ for conservative update. While this result is mainly of theoretical interest, it illustrates that the peelability property is crucial for the error to be asymptotically vanishing. Finally, in Section~\ref{sec:zipf}, we turn to non-uniform distributions and provide experimental evidence that for Zipf's distribution, the phase transition in average error does not occur. \section{Count-Min and Conservative Update} \label{countmin-and-CU} We consider a (counting version of) Count-Min sketch to be an array $A$ of size $n$ of counters initially set to $0$, together with hash functions $h_1,\ldots,h_k$ mapping keys from a given universe to $[1..n]$. To count key occurrences in a stream of keys, regular Count-Min proceeds as follows. To process a key $p$, each of the counters $A[h_i(p)]$, $1\leq i\leq k$, is incremented by $1$. Querying the occurrence number $\boldsymbol{a}(p)$ of a key $p$ returns the estimate $\hat{\boldsymbol{a}}_{CM}(p)=\min_{1\leq i\leq k}\{A[h_i(p)]\}$. It is easily seen that $\hat{\boldsymbol{a}}_{CM}(p)\geq \boldsymbol{a}(p)$. A bound on the overestimate of $\boldsymbol{a}(p)$ is given by the following result adapted from \cite{cormode_improved_2005}. \begin{theorem}[\cite{cormode_improved_2005}] \label{countmin} For $\varepsilon>0$, $\delta>0$, consider a Count-Min sketch with $k=\lceil \ln(\frac{1}{\delta}) \rceil$ and size $n=k\frac{e}{\varepsilon}$. Then $\hat{\boldsymbol{a}}_{CM}(p)- \boldsymbol{a}(p)\leq \varepsilon N$ with probability at least $1-\delta$, where $N$ is the size of the input stream. \end{theorem} While Theorem~\ref{countmin} is useful in some situations, it has a limited utility as it bounds the error with respect to the stream size which can be very large. \textit{Conservative update} strengthens Count-Min by increasing only the smallest counters among $A[h_i(p)]$. Formally, for $1\leq i\leq k$, $A[h_i(p)]$ is incremented by $1$ only if $A[h_i(p)]=\min_{1\leq j\leq k}\{A[h_j(p)]\}$ and is left unchanged otherwise. The estimate of $\boldsymbol{a}(p)$, denoted $\hat{\boldsymbol{a}}_{CU}(p)$, is computed as before: $\hat{\boldsymbol{a}}_{CU}(p)=\min_{1\leq i\leq k}\{A[h_i(p)]\}$. It can be seen that $\hat{\boldsymbol{a}}_{CU}(p)\geq \boldsymbol{a}(p)$ still holds, and that $\hat{\boldsymbol{a}}_{CU}(p)\leq \hat{\boldsymbol{a}}_{CM}(p)$. The latter follows from the observation that on the same input, an entry of counter array $A$ under conservative update can never get larger than the same entry under Count-Min. \section{Hash hypergraphs and CU process}\label{sec:hash} With a counter array $A[1..n]$ and hash functions $h_1,...,h_k$ we associate a $k$-uniform \textit{hash hypergraph} $H=(V,E)$ with vertex-set $V=\{1..n\}$ and edge-set $E=\{\{h_1(p),...h_k(p)\}\}$ for all distinct keys $p$. Let $\mathcal{H}_{n,m}^{k}$ be the set of $k$-uniform hypergraphs with $n$ vertices and $m$ edges. We assume that the hash hypergraph is a uniformly random Erd\H{o}s-R\'enyi hypergraph in $\mathcal{H}_{n,m}^{k}$, which we denote by $H^k_{n,m}$, where $m$ is the number of distinct keys in the input (for $k=2$, we use the notation $G_{n,m}=H^2_{n,m}$). Even if this property is not granted by hash functions used in practice, it is a reasonable and commonly used hypothesis to conduct the analysis of sketch algorithms. Below we show that the behavior of a sketching scheme depends on the properties of the associated hash hypergraph. It is well-known that depending on the $m/n$ ratio, many properties of Erd\H{o}s-R\'enyi (hyper)graphs follow a phase transition phenomenon \cite{FriezeKaronski16}. For example, the emergence of a giant component, of size $O(n)$, occurs {with high probability} (hereafter, \textit{w.h.p.}) at the threshold $\frac{m}{n}=\frac{1}{k(k-1)}$ \cite{KARONSKI2002125}. Particularly relevant to us is the \textit{peelability} property. Let $H=(V,E)$ be a hypergraph. The peeling process on $H$ is as follows. We define $H_0=H$, and iteratively for $i\geq 0$, we define $V_i$ to be the set of leaves (vertices of degree 1) or isolated vertices in $H_i$, $E_i$ to be the set of edges of $H_i$ incident to vertices in $V_i$, and $H_{i+1}$ to be the hypergraph obtained from $H_i$ by deleting the vertices of $V_i$ and the edges of $E_i$. A vertex in $V_i$ is said to have \emph{peeling level}~$i$. The process stabilizes from some step $I$, and the hypergraph $H_I$ is called the \emph{core} of $H$, which is the largest induced sub-hypergraph whose vertices all have degree at least $2$. If $H_I$ is empty, then $H$ is called \emph{peelable}. It is known~\cite{molloy2005cores} that peelability undergoes a phase transition. For $k\geq 3$, there exists a positive constant $\lambda_k$ such that, for $\lambda<\lambda_k$, the random hypergraph $H^k_{n,\lambda n}$ is w.h.p. peelable as $n\to\infty$, while for $\lambda>\lambda_k$, the core of $H^k_{n,\lambda n}$ has w.h.p. a size concentrated around $\alpha n$ for some $\alpha>0$ that depends on $\lambda$. The first peelability thresholds are $\lambda_3\approx 0.818$, $\lambda_4\approx 0.772$, etc., $\lambda_3$ being the largest. For $k=2$, for $\lambda<1/2$, w.h.p. a proportion $1-o(1)$ of vertices are in trees of size $O(1)$, (and a proportion $o(1)$ of the vertices are in the core), while for $\lambda\geq 1/2$, the core size is w.h.p. concentrated around $\alpha n$ for $\alpha>0$ that depends on~$\lambda$ ~\cite{pittel2005counting}. We note that properties of hash hypergraphs determine the behavior of some other hash-based data structures, such as Cuckoo hash tables \cite{pagh2004cuckoo} and Cuckoo filters \cite{10.1145/2674005.2674994}, Minimal Perfect Hash Functions and Static Functions \cite{majewski1996family}, Invertible Bloom filters \cite{goodrich2011invertible}, and others. We refer to \cite{DBLP:phd/dnb/Walzer20} for an extended study of relationships between properties of hash hypergraphs and some of those data structures. In particular, peelability is directly relevant to certain constructions of Minimal Perfect Hash Functions as well as to good functioning of Invertible Bloom filters. The connection to hash hypergraphs allows us to reformulate the Count-Min algorithm with conservative updates as a process, which we call CU-process, on a random hypergraph $H_{n,m}^k$, where $n,m,k$ correspond to counter array length, number of distinct keys, and number of hash functions, respectively. Let $H=(V,E)$ be a hypergraph. To each vertex $v$ we associate a counter $c_v$ initially set to $0$. At each step $t\geq 1$, a \emph{CU-process} on $H$ chooses an edge $e=\{v_1,\ldots,v_k\}\in E$ in $H$, and increments by 1 those $c_{v_i}$ which verify $c_{v_i}=\min_{1\leq j\leq k}c_{v_j}$. For $t\geq 0$ and $v\in V$, $c_v(t)$ will denote the value of the counter $c_v$ after $t$ steps, and $o_e(t)$ the number of times edge $e\in E$ has been drawn in the first $t$ steps. The counter $c_e(t)$ of an edge $e=\{v_1,\ldots,v_k\}$ is defined as $c_e(t)=\min_{1\leq i\leq k} c_{v_i}(t)$. Clearly, for each $t$ and each $e$, $o_e(t)\leq c_e(t)$. The \emph{relative error} of $e$ at time $t$ is defined as $R_e(t)=\frac{c_e(t)-o_e(t)}{o_e(t)}$. The following Lemma can be easily proved by induction on $t$. \begin{lemma}\label{lem:observation} Let $H=(V,E)$ be a hypergraph on which a CU-process is run. At every step $t$, for each vertex $v$, there is at least one edge $e$ incident to $v$ such that $c_e(t)=c_v(t)$. \end{lemma} Observe that, when $H$ is a graph ($k=2$), Lemma~\ref{lem:observation} is equivalent to the property that vertex counters cannot have a strict local maximum, i.e., at every step $t$, each vertex $v$ has at least one neighbour~$u$ such that $c_u(t)\geq c_v(t)$. \section{Phase transition of the relative error} \label{sec:main} \subsection{Main results}\label{sec:main_results} Let $H=(V,E)$ be a hypergraph, $|V|=n, |E|=m$. Let $N\geq 1$. We consider two closely related models of input to perform the CU-process. In the \emph{$N$-uniform model}, the CU process is performed on a random sequence of keys (edges in $E$) of length $N\cdot m$, each key being drawn independently and uniformly in $E$. In the \emph{$N$-balanced model}, the CU-process is performed on a random sequence of length $N\cdot m$, such that each $e\in E$ occurs exactly $N$ times, and the order of keys is random. In other words, the sequence of keys on which the CU-process is performed is a random permutation of the multiset made of $N$ copies of each key of $E$. Clearly, both models are very close, since the number of occurrences of any key in the $N$-uniform model is concentrated around $N$ (with Gaussian fluctuations of order $\sqrt{N}$) as $N$ gets large. For both models, we use the notation $c_v^{(N)}=c_v(Nm)$ for the resulting counter of $v\in V$, $o_e^{(N)}=o_e(Nm)$ for the resulting number of occurrences of $e\in E$, $c_e^{(N)}=c_e(Nm)$ for the resulting counter of $e\in E$, and $R_e^{(N)}=R_e(Nm)=(c_e^{(N)}-o_e^{(N)})/o_e^{(N)}$ for the resulting relative error of $e$. In the $N$-balanced model, since each key $e\in E$ occurs $N$ times, we have $R_e^{(N)}=(c_e^{(N)}-N)/N$. Our main result is the following. \begin{theorem}[subcritical regime]\label{theo:subcriti} Let $k\geq 2$, and let $\lambda<\lambda_k$, where $\lambda_2 =1/2$, and for $k\geq 3$, $\lambda_k$ is the peelability threshold as defined in Section~\ref{sec:hash}. Consider a CU-process on a random hypergraph $H^k_{n,\lambda n}$ under either $N$-uniform or $N$-balanced model, and consider the relative error $R_e^{(N)}$ of a random edge in $H^k_{n,\lambda n}$. Then $R_e^{(N)}=o(1)$ w.h.p., as both $n$ and $N$ grow\footnote{Formally, for any $\epsilon >0$, there exists $M$ such that $\mathbb{P}(R_e^{(N)} \leq \epsilon) \geq 1-\epsilon$ if $n\geq M$ and $N\geq M$.}. \end{theorem} Note that with the regular Count-Min algorithm (see Section~\ref{countmin-and-CU}), in the $N$-balanced model, the counter value of a node $v$ is $\tilde{c}_v^{(N)} = N\cdot \mathrm{deg}(v)$, and the relative error $\tilde{R}_e^{(N)}$ of an edge $e=(v_1,\ldots,v_k)$ is always (whatever $N\geq 1$) equal to $\mathrm{min}(\mathrm{deg}(v_1),\ldots,\mathrm{deg}(v_k))-1$, and is thus always a non-negative integer. For fixed $k\geq 2$ and $\lambda>0$, and for a random edge $e$ in $H^k_{n,\lambda n}$, the probability that all $k$ vertices belonging to $e$ have at least one incident edge apart from $e$ converges to a positive constant $c(\lambda,k)=(1-e^{-k\lambda})^k$. Therefore, $\tilde{R_e}$ is a nonnegative integer whose probability to be non-zero converges to $c(\lambda,k)$. Thus, Theorem~\ref{theo:subcriti} ensures that, for $\lambda<\lambda_k$, conservative updates lead to a drastic decrease of the error, from $\Theta(1)$ to $o(1)$. For a given hypergraph $H=(V,E)$ with $m$ edges, we define $\mathrm{err}_N(H)=\frac1{m}\sum_{e\in E}R_e^{(N)}$ the \emph{average} error over the edges of $H$. Theorem~\ref{theo:subcriti} states that a randomly chosen edge has a small error, but this does not formally exclude that a small fraction of edges may have large errors, possibly yielding $\mathrm{err}_N(H)$ larger than $o(1)$. However, we believe that this is not the case. From the previous remark, it follows that the error of an edge $e=(v_1,\ldots,v_k)$ is upper-bounded by $\mathrm{min}(\mathrm{deg}(v_1),\ldots,\mathrm{deg}(v_k))-1$. Since the expected maximal degree in $H_{n,\lambda n}^k$ grows very slowly with $n$, one can expect that any set of $o(n)$ edges should have a contribution $o(1)$ w.h.p.. This is also supported by experiments given in the next section. Based on Theorem~\ref{theo:subcriti} and the above discussion, we propound that a phase transition occurs for the average error, in the sense that it is $o(1)$ in the subcritical regime $\lambda<\lambda_k$, and $\Theta(1)$ in the supercritical regime $\lambda>\lambda_k$, w.h.p.. Regarding the supercritical regime, we are able to show that this indeed holds for $k=2$ in the $N$-balanced model. \begin{theorem}[supercritical regime, case $k=2$]\label{theo:supercrit} Let $\lambda>1/2$. Then there exists a positive constant $f(\lambda)$ such that, in the $N$-balanced model, $\mathrm{err}_N(G_{n,\lambda n})\geq f(\lambda)$ w.h.p., as $n$ grows\footnote{Formally, for any $\epsilon>0$, there exists $M$ such that $\mathbb{P}(\mathrm{err}_N(G_{n,m})\geq f(\lambda))\geq 1-\epsilon$ if $N\geq 1$ and $n\geq M$.}. \end{theorem} Our proof of Theorem~\ref{theo:supercrit} can be extended to any $k\geq 2$ and $\lambda>\frac1{k(k-1)}$ such that the giant component $G'=(V',E')$ in $H_{n,\lambda n}^k$ satisfies w.h.p. $|E'|-|V'|\geq a\,n$ for some positive constant $a$. For $k=2$, any value $\lambda>1/2$ has this property~\cite{pittel2005counting}, while for $k=3$ (respectively, $k=4$), the analysis given in \cite{DBLP:journals/cpc/BehrischCK14} ensures that this property holds for values of $\lambda$ strictly above the peelability threshold, namely $\lambda>\widetilde{\lambda_3}\approx 0.94$ (respectively, $\lambda>\widetilde{\lambda_4}\approx 0.98$) . % % % % Nevertheless, based on simulations presented below, we expect that Theorem~\ref{theo:supercrit} holds for $k\geq 3$ for all $\lambda>\lambda_k$ as well, however proving this would then require a different kind of argument. \subsection{Simulations} \label{sec:simulation} Here we provide several experimental results illustrating the phase transition stated in Theorems~\ref{theo:subcriti} and \ref{theo:supercrit}. Figure~\ref{fig:av_err} shows plots for the average relative error $\mathrm{err}_N(H_{n,m}^{k})$ as a function of $\lambda=m/n$, for $k\in\{2,3,4\}$ for regular Count-Min and the conservative update strategies. Experiments were run for $n=1000$ with the $N$-independent model (each edge drawn independently with probability $1/m$) and $N=50,000$ (number of steps $N\cdot |E|$). For each $\lambda$, an average is taken over $15$ random graphs. \medskip \medskip \begin{figure}[h] \centering \begin{subfigure}[b]{0.35\textwidth} \centering \includegraphics[scale=0.22]{k2-with-countmin.png} \caption{$k=2$} \label{fig:k2} \end{subfigure} \hfill \begin{subfigure}[b]{0.33\textwidth} \centering \includegraphics[scale=0.22]{k3-with-countmin.png} \caption{$k=3$} \label{fig:k3} \end{subfigure} \hfill \begin{subfigure}[b]{0.30\textwidth} \centering \includegraphics[scale=0.22]{k4-with-countmin.png} \caption{$k=4$} \label{fig:k4} \end{subfigure} \caption{Average relative error as a function of $\lambda=m/n$ for regular Count-Min (red) and conservative update (blue), for $k\in\{2,3,4\}$.} \label{fig:av_err} \end{figure} \medskip \medskip The phase transitions are clearly seen to correspond to the critical threshold $0.5$ for $k=2$, and, for $k\in\{3,4\}$, to the peelability thresholds $\lambda_3\approx 0.818$, $\lambda_4\approx 0.772$. Observe that the transition looks sharper for $k\geq 3$, which may be explained by the fact that the core size undergoes a discontinuous phase transition for $k\geq 3$, as shown in~\cite{molloy2005cores} (e.g. for $k=3$, the fraction of vertices in the core jumps from $0$ to about $0.13$). For the supercritical regime, we analysed the concentration around the average shown in Figure~\ref{fig:av_err} by simulating CU-processes on 50 random graphs, for each $\lambda$. Figure~\ref{fig:concentration} shows the results. We observe that the concentration tends to become tighter for growing~$\lambda$. \begin{figure}[h] \centering \begin{subfigure}[b]{0.47\textwidth} \centering \includegraphics[width=\textwidth]{k2-concentration-extended.png} \caption{$k=2$} \label{fig:k2-concentration} \end{subfigure} \hfill \begin{subfigure}[b]{0.50\textwidth} \centering \includegraphics[width=\textwidth]{k3-concentration-extended.png} \caption{$k=3$} \label{fig:k3-concentration} \end{subfigure} \caption{Concentration of the average error as a function of $\lambda=m/n$, for $k\in\{2,3\}$.} \label{fig:concentration} \end{figure} Furthermore, we experimentally studied the empirical distribution of individual relative errors, which turns out to have an interesting multi-modal shape for intermediate values of~$\lambda$. Typical distributions for $k=2,3$ are illustrated in Figure~\ref{fig:distribution} where each point corresponds to an edge, and the edges are randomly ordered along the $x$-axis. Each plot corresponds to an individual random graph. When $\lambda$ grows beyond the peelability threshold, a fraction of edges with small errors still remains but vanishes quickly: these include edges incident to at least one leaf (these have error $0$) and peelable edges (these have error $o(1)$, by arguments to be given in Section~\ref{sec:proofk3}). For intermediate values of $\lambda$, the distribution presents several modes: besides the main mode (largest concentration on plots of Figure~\ref{fig:distribution}), we observe a few other concentration values which are typically integers. While this phenomenon is still to be analysed, we explain it by the presence in the graphs of certain structural motifs that involve disparities in node degrees. Note that the fraction of values concentrated around the main mode is dominant: for example, for $k=3,\lambda=3$ (Figure~\ref{fig:k3-l3}), about 90\% of values correspond to the main mode ($\approx 3.22$). Finally, when $\lambda$ becomes larger, these ``secondary modes'' disappear, and the distribution becomes concentrated around a single value. This is consistent with the tighter concentration observed earlier in Figure~\ref{fig:concentration}. \begin{figure}[ht!] \centering \begin{subfigure}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{k2-l1.png} \caption{$k=2, \lambda=1$} \label{fig:k2-l1} \end{subfigure} \hfill \begin{subfigure}[b]{0.49\textwidth} \centering \includegraphics[width=\textwidth]{k3-l1.png} \caption{$k=3, \lambda=1$} \label{fig:k3-l1} \end{subfigure} \begin{subfigure}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{k2-l3.png} \caption{$k=2, \lambda=3$} \label{fig:k2-l3} \end{subfigure} \hfill \begin{subfigure}[b]{0.49\textwidth} \centering \includegraphics[width=\textwidth]{k3-l3.png} \caption{$k=3, \lambda=3$} \label{fig:k3-l3} \end{subfigure} \begin{subfigure}[b]{0.50\textwidth} \centering \includegraphics[height=129pt]{k2-l5.png} \caption{$k=2, \lambda=5$} \label{fig:k2-l5} \end{subfigure} \hfill \begin{subfigure}[b]{0.48\textwidth} \centering \includegraphics[width=\textwidth]{k3-l5.png} \caption{$k=3, \lambda=5$} \label{fig:k3-l5} \end{subfigure} \caption{Distribution of relative errors of individual edges shown in a random order along $x$-axis.} \label{fig:distribution} \end{figure} Finally, we report on another experiment supporting the conjecture of a positive average error in the supercritical regime. We simulated the CU-process on sparse random non-peelable 3-hypergraphs (i.e. $k=3$), namely 2-regular 3-hypergraphs with $2n$ edges and $3n$ vertices ($n$ parameter). These are sparsest possible non-peelable 3-hypergraphs, with degree 2 of each vertex. We observed that the average error for such graphs is concentrated around a constant value of $\approx 0.217$. Since the core size is linear in the supercritical regime, this experiment provides an evidence of a positive error in the general case. While this remains to be proved in general, in Section~\ref{sec:non-peelable} we provide a proof for certain families of regular hypergraphs. \newpage \section{Proofs of main results} \label{sec:proofs} Theorem~\ref{theo:subcriti} relies on properties of random hypergraphs. Case $k=2$ corresponds to Erd\H{o}s-R\'enyi random graphs $G_{n,\lambda n}$ \cite{erdos1960evolution} which have been extensively studied \cite{FriezeKaronski16}. In particular, it is well known when $\lambda<1/2$ and $n$ gets large, $G_{n,\lambda n}$ is, w.h.p., a union of small connected components most of which are constant-size trees. That is, a random edge in $G_{n,\lambda n}$ is, w.h.p., in a tree of size $O(1)$. Thus, the proof amounts to showing that, for a fixed tree $T$ and a vertex $v\in T$, we have $c_v^{(N)}/N=1+o(1)$ w.h.p.. We prove this in Section~\ref{sec:error_tree} for both $N$-uniform and $N$-balanced models. The proof for $k\geq 3$, given in Section~\ref{sec:proofk3}, requires more ingredients. An additional difficulty is that, for $\lambda<\lambda_k$, a random edge $e$ in $H_{n,\lambda n}^k$ may be in the giant component (if $\lambda\in(\frac1{k(k-1)},\lambda_k)$). However, we rely on the fact that the peeling level of $e$ is $O(1)$ w.h.p., and prove that for a vertex $v$ of bounded level, we have $c_v^{(N)}/N=1+o(1)$ w.h.p. as $N\to\infty$, where the $o(1)$ term does not depend on the size of the giant component. \subsection{CU-process on a fixed tree}\label{sec:error_tree} \subsubsection{Analysis in the $N$-uniform model}\label{sec:tree_N_uniform} Consider a graph $G=(V,E)$, with $m$ edges, on which the CU-process is run, in the $N$-uniform model. Recall that $c_v(t)$ (resp. $c_e(t)$) denotes the value of the counter for $v$ (resp. for $e$) after $t$ steps, and $o_e(t)$ is the number of occurrences $e$ in the first $t$ steps. The aim of this Section is to prove the following result. \begin{lemma}\label{prop:cv} Let $T=(V,E)$ be a tree, on which the CU-process is run, in the $N$-uniform model. Let $m=|E|$. Then, for every vertex $v$ of $T$, there exist absolute positive constants $a_v,b_v$ such that, for any $N\geq 1$ and $x>0$, we have \[ \mathbb{P}\Big(\mathrm{max}_{t\in[0..Nm]}|c_v(t)-t/m| \geq x\sqrt{N}\Big)\leq a_v\exp(-b_vx^2). \] \end{lemma} Lemma~\ref{prop:cv} implies that, in the $N$-uniform model, the final counter $c_v^{(N)}$ of every vertex $v$ of $T$ is concentrated around $N$, with (sub-)Gaussian fluctuations of order $\sqrt{N}$. The same holds for the final counter $c_e^{(N)}=\mathrm{min}(c_u^{(N)},c_v^{(N)})$ of every edge $e=(u,v)$ of $T$. On the other hand, the number $o_e(Nm)$ of times $e$ is chosen follows a binomial distribution $\mathrm{Bin}(Nm,1/m)$. Then, it is also concentrated around $N$, with Gaussian fluctuations of order $\sqrt{N}$. This implies that $R_e^{(N)}=O(1/\sqrt{N})=o(1)$ w.h.p. as $N$ gets large. We say that a family of events $\mathcal{E}_M^N$ indexed by two parameters $N,M\geq 1$, is \emph{$(N,M)$-concentrated} if there are absolute constants $a,b>0$ such that, for every $N,M$, we have $\mathbb{P}(\mathcal{E}_M^N)\leq a\exp(-bx^2)$, where $x=M/\sqrt{N}$. For $f(t)$ a (possibly random) quantity depending on $t\in[0..Nm]$, we use the notation $\widehat{f}(t):=f(t)-t/m$. Thus, to prove Lemma~\ref{prop:cv}, we have to show that for a fixed tree $T$ with $m$ edges on which the $N$-independent CU-process is run, and for $v$ a vertex of $T$, the event $\{\mathrm{max}_{t\in[0..Nm]}|\widehat{c_v}(t)|\geq M\}$ is $(N,M)$-concentrated. We proceed by induction on the peeling level $i$ of vertices. A vertex $v$ at level $0$ is a leaf. Let $e$ be its incident edge. It is easy to see that the counter of $v$ increases exactly at the steps when $e$ is drawn. Hence $c_v(t)=o_e(t)$ for $t\in[0..Nm]$. Doob's martingale maximal inequality combined with Hoeffding's inequality ensure that, for every edge $e$ of $T$, we have \[ \mathbb{P}(\mathrm{max}_{t\in[0..Nm]}|\widehat{o_e}(t)|\geq M)\leq 2\exp(-2x^2/m),\ \ \mathrm{where}\ x=M/\sqrt{N}. \] Hence, for any leaf $v$ of $T$, the event $\{\mathrm{max}_{t\in[0..Nm]}|\widehat{c_v}(t)|\geq M\}$ is $(N,M)$-concentrated. Moreover, for $v$ a vertex and $e$ an arbitrary edge incident to $v$, the fact that $c_v(t)\geq o_e(t)$ ensures that the event $\{\mathrm{min}_{t\in[0..Nm]}\widehat{c_v}(t)) \leq -M\}$ is $(N,M)$-concentrated. It thus remains to show that, for vertices of positive levels, the event $\{\mathrm{max}_{t\in[0..Nm]} \widehat{c_v}(t) \geq M\}$ is $(N,M)$-concentrated. The following statement will be useful to treat the inductive step. \begin{lemma}\label{lem:dv} Let $G$ be a graph on which a CU-process is run. Let $v$ be a vertex of $G$, with $v_1,\ldots,v_{h+1}$ its neighbours one of which (say $v_{h+1}$) is distinguished, and with $e$ denoting the edge $\{v,v_{h+1}\}$. For $t\in[0..Nm]$, let $d_v(t)=\mathrm{max}(c_{v_1}(t),\ldots,c_{v_{h}}(t))$. Consider the event $\mathcal{E}_M^N$ that there exists $t\in[0..Nm]$ such that $c_v(t)\geq d_v(t)+M$, and the event $\mathcal{F}_M^N$ that there exists $t\in [0..Nm]$ such that $|\widehat{o_e}(t)|\geq M/4$ or $|\widehat{d_v}(t)|\geq M/4$. Then $\mathcal{E}_M^N$ implies $\mathcal{F}_M^N$. \end{lemma} \begin{proof} If $\mathcal{E}_M^N$ holds, let $t_0\geq 0$ be such that $c_v(t_0)\geq d_v(t_0)+M$. Let $t'=\mathrm{max}\{t\leq t_0\ |\ c_v(t)\leq d_v(t)\}$. The crucial point is that, in the interval $[t'..t_0]$, any step where $c_v$ increases occurs when $e$ is chosen (indeed, when $c_v(t)>\mathrm{max}(c_{v_1}(t),\ldots,c_{v_{h}}(t))$, choosing an edge $\{v,v_i\}$ with $i\in[1..h]$ yields no increase of $c_v$). Hence, $c_v(t_0)-c_v(t')\leq o_e(t_0)-o_e(t')$. Since $c_v(t')=d_v(t')$ and $c_v(t_0)\geq d_v(t_0)+M$ we conclude that $o_e(t_0)-o_e(t')\geq d_v(t_0)-d_v(t')+M$. Thus we also have $\widehat{o_e}(t_0)-\widehat{o_e}(t')\geq \widehat{d_v}(t_0)-\widehat{d_v}(t')+M$. Hence $\mathrm{max}(|\widehat{o_e}(t_0)|, |\widehat{o_e}(t')|,|\widehat{d_v}(t_0)|,|\widehat{d_v}(t')|)\geq M/4$, so that $\mathcal{F}_M^N$ holds. \end{proof} Let $i\geq 1$, and assume Lemma~\ref{prop:cv} holds for all vertices of level smaller than $i$. Let $v$ be a vertex of level $i$, for which we want to prove that the event $\{\mathrm{max}_{t\in[0..Nm]} \widehat{c_v}(t) \geq M\}$ is $(N,M)$-concentrated. All neighbours $v_1,\ldots,v_{h+1}$ of $v$ have level at most $i-1$, except for one, say $v_{h+1}$, with its level in $\{i-1,i,i+1\}$ (respectively corresponding to $T_i$ having one vertex, two vertices, or at least three vertices). Let $e$ be the edge between $v$ and $v_{h+1}$. Let $\mathcal{E}_M^N$ be the event that $\widehat{c_v}(t)\geq M$ for some $t\in [0..Nm]$. If this holds, then one of the two events $\{\widehat{c_v}(t)-\widehat{d_v}(t)\geq M/2\}$ or $\{\widehat{d_v}(t)\geq M/2\}$ holds. By Lemma~\ref{lem:dv}, the first event implies that $|\widehat{d_v}(t)|\geq M/8$ or $|\widehat{o_e}(t)|\geq M/8$ for some $t\in[0..Nm]$. Hence, the event $\{\mathrm{max}_{t\in[0..Nm]}\widehat{c_v}(t)\geq M\}$ implies that either the event $\{\mathrm{max}_{t\in[0..Nm]}|\widehat{d_v}(t)|\geq M/8\}$ (which is also the union of the events $\{\mathrm{max}_{t\in[0..Nm]}|\widehat{c_{v_j}}(t)|\geq M/8\}$ for $j\in[1..h]$) or the event $\{\mathrm{max}_{t\in[0..Nm]}|\widehat{o_e}(t)|\geq M/8\}$ holds. Since these events are $(N,M)$-concentrated, we conclude (using the union bound) that the event $\{\mathrm{max}_{t\in[0..Nm]}\widehat{c_v}(t)\geq M\}$ is also $(N,M)$-concentrated, which concludes the proof of Lemma~\ref{prop:cv}. \subsubsection{Analysis in the $N$-balanced model}\label{sec:tree_N_balanced} \begin{lemma}\label{prop:tree_N_uniform} Let $T$ be a tree, on which the CU-process is performed, in the $N$-balanced model. Then, for every edge $e$ of $T$, we have $R_e^{(N)}=o(1)$ w.h.p. as $N\to\infty$. \end{lemma} \begin{proof} Note that the $N$-balanced model is just the $N$-uniform model conditioned on all edges occurring exactly $N$ times, which happens with probability $\Theta(n^{-m/2})$ if $T$ has $m$ edges. Let $u$ be an extremity of $e$. By Lemma~\ref{prop:cv}, there exists a positive constant $b$ such that, in the $N$-uniform model, \[ \mathbb{P}(c_u(Nm)\geq N+N^{2/3})=O(e^{-b\, n^{1/3}}). \] Hence, in the $N$-balanced model, we have \[ \mathbb{P}(c_u^{(N)}\geq N+N^{2/3})=O(n^{m/2}e^{-b\, n^{1/3}})=o(1), \] and thus \[ \mathbb{P}(R_e^{(N)}\geq N^{-1/3})=\mathbb{P}(c_e^{(N)}\geq N+N^{2/3})\leq \mathbb{P}(c_u^{(N)}\geq N+N^{2/3})=o(1), \] which ensures that $R_e^{(N)}=o(1)$ w.h.p. as $N\to\infty$. \end{proof} \subsection{Proof of Theorem~\ref{theo:subcriti} for $k=2$}\label{sec:subcritical2} We use the well-known property~\cite{erdos1960evolution} that, for fixed $\lambda\in(0,1/2)$, a random edge $e$ in $G_{n,\lambda n}$ is w.h.p. in a tree of size $O(1)$. Precisely, if we let $\mathcal{E}^m_{n,\lambda}$ be the event that $e$ belongs to a tree of size at most $m$, then we have the property that, for every $\epsilon>0$, there exist $m$ and $n_0$ such that $\mathbb{P}(\mathcal{E}^m_{n,\lambda})\geq 1-\epsilon$ for $n\geq n_0$. By Lemma~\ref{prop:tree_N_uniform}, there exists $N_0$ (depending on $m$) such that, in the $N$-balanced or $N$-uniform model, for every tree $T$ with at most $m$ edges, and every edge $e\in T$, we have $\mathbb{P}(R_e^{(N)}\geq\epsilon)\leq \epsilon$ for $N\geq N_0$. Hence, for $n\geq n_0$ and $N\geq N_0$, if we perform the CU-process on $G_{n,\lambda n}$ in the $N$-balanced model (note that the $N$-balanced model holds separately on every connected component), and draw a random edge $e$, we have \[ \mathbb{P}(R_e^{(N)}\geq\epsilon)\leq\mathbb{P}(R_e^{(N)}\geq\epsilon\ |\ \mathcal{E}^m_{n,\lambda})+\mathbb{P}(\neg\mathcal{E}^m_{n,\lambda})\leq 2\epsilon. \] This means that $R_e^{(N)}=o(1)$ w.h.p., when $n$ and $N$ grow. In the $N$-uniform model, the same argument holds, using the fact that the total number of times edges in $T$ are drawn is concentrated around $Nm$. \subsection{Proof of Theorem~\ref{theo:subcriti} for $k\geq 3$}\label{sec:proofk3} The proof partly follows the same lines as for $k=2$, but requires additional arguments, in particular a suitably extended notion of peelability. A \emph{marked hypergraph} is a hypergraph $H=(V,E)$ where some of the vertices are marked. The subset of marked vertices is denoted $V_{\infty}$. When performing a CU-process on a marked hypergraph, the counters of unmarked vertices are (as usual) initially $0$, while the counters at marked vertices are initially (and remain) $+\infty$. When peeling, the marked vertices are not allowed to be peeled (even when they are incident to a unique edge). We define $H_0=H$, and iteratively for $i\geq 0$, we define $V_i$ as the set of non-marked vertices that are leaves or isolated vertices in $H_i$, $E_i$ as the set of edges of $H_i$ incident to vertices in $V_i$, and $H_{i+1}$ to be the hypergraph obtained from $H_i$ by deleting the vertices in $V_i$ and the edges in $E_i$. A vertex in $V_i$ is said to have \emph{level $i$}. Then $H$ is called \emph{peelable} if every unmarked vertex is peeled at some step. Following the exact same lines as in the proof of Lemma~\ref{prop:cv} (induction on the vertex-levels, and a straightforward adaptation of Lemma~\ref{lem:dv} to hypergraphs) and Lemma~\ref{prop:tree_N_uniform}, we obtain: \begin{lemma}\label{prop:cvH} Let $H=(V,E)$ be a peelable connected marked hypergraph, on which the CU-process is run, in the $N$-uniform model. Let $m=|E|$, and for $t\in[0..Nm]$, let $c_v(t)$ be the value of the counter of $v$ after $t$ steps. Then, for every unmarked vertex $v$ of $H$, there exist absolute positive constants $a_v,b_v$ such that, for any $N\geq 1$ and $x>0$, we have \[ \mathbb{P}\Big(\mathrm{max}_{t\in[0..Nm]}|c_v(t)-t/m| \geq x\sqrt{N}\Big)\leq a_v\exp(-b_vx^2). \] In the $N$-uniform or $N$-balanced model, for every unmarked vertex $v$ of $H$, we have $c_v^{(N)}/N=1+o(1)$ w.h.p. as $N\to\infty$. \end{lemma} For $H$ a hypergraph, and for $v$ a vertex of finite level in $H$, a vertex $u\in H$ is called a \emph{descendant} of $v$ if there is a sequence $v_0=u,v_1,\ldots,v_r=v$ of vertices such that, for each $j\in[1..r-1]$, $v_{j}$ and $v_{j+1}$ are incident to a same edge, and the level of $v_{j+1}$ is larger than the level of $v_j$. \begin{lemma}\label{lem:Hv} For a hypergraph $H$, and for a vertex $v$ of $H$ of finite level, let $D_v$ be the set formed by $v$ and it descendants, and let $E_v$ be the set of edges that are incident to at least one vertex from $D_v$. Let $H_v$ be the marked hypergraph formed by the edges in $E_v$ and their incident vertices, where the marked vertices are those not in $D_v$. Then $H_v$ is peelable. \end{lemma} \begin{proof} Let $u$ be a vertex in $D_v$, of level $i$. If $i=0$, then $u$ is a leaf in $H$. It is also a leaf in $H_v$, and is immediately peeled. Otherwise, except for possibly one incident edge, $u$ has at least one neighbour $v_e$ of level smaller than $i$ in every incident edge $e$ (note that $v_e$ has to be in $D_v$). By induction, $v_e$ and $e$ are peeled in the peeling process of $H_v$. Hence, $u$ is peeled as well during the peeling process on $H_v$ (by induction as well, the level of a vertex in $D_v$ is actually the same in $H$ and in $H_v$). \end{proof} \begin{remark}\label{rk:shell_ball} In a hypergraph $H=(V,E)$, the \emph{distance} between two vertices $u$ and $v$ is the minimum number of edges to traverse in order to reach $v$ from $u$. For $r\geq 1$ and $v\in V$, the ball $B_H(v,r)$ is the set of vertices at distance at most $r$ from $v$. Clearly, if $v$ is at level $i$, then every vertex in $D_v$ is in $B_H(v,i)$, and every vertex of $H_v$ is in $B(v,i+1)$. \dotfill \end{remark} \begin{lemma}[Lemma~3 in \cite{molloy2005cores}]\label{lem:I} Let $k\geq 3$, and let $\lambda\in(0,\lambda_k)$. For every $\epsilon>0$, there exist $I(\epsilon)$ and $n_0(\epsilon)$ such that, for $v$ a random vertex in $H^k_{n,\lambda n}$, the probability that $v$ has level at most $I(\epsilon)$ is at least $1-\epsilon$, for $n\geq n_0(\epsilon)$. \end{lemma} \begin{lemma}\label{lem:monoton} Let $H=(V,E)$ be a hypergraph, and let $E'$ be a subset of $E$. Let $V'$ (resp. $W$) be the subset of vertices incident to at least one edge from $E'$ (resp. incident only to edges in $E'$). Let $H'=(V',E')$ be the marked hypergraph where the unmarked vertices are those in $W$. Consider a CU-process on $H$, with $S$ the sequence of items (each item an edge of $H$), and for $v\in V$ let $c_v$ be the final value of the counter of $v$. Let $S'$ be the subsequence of $S$ composed by the items in $E'$. Consider the CU process on $H'$ where the sequence of items is $S'$. For $v\in W$, let $c_v'$ be the final value of the counter of $v$. Then $c_v'\geq c_v$. \end{lemma} \begin{proof} For an assignment $f:V\to \mathbb{N}\cup\{+\infty\}$ of initial values to the vertex counters, let $c_f:V\to\mathbb{N}\cup\{+\infty\}$ be the function giving the final vertex counters after performing the CU-process on an input sequence $S$. It is easy to check (by induction on the length of $S$) that the CU-process is monotonous: if $f(v)\leq g(v)$ for all $v\in V$, then $c_f(v)\leq c_g(v)$ for all $v\in V$. Now, if we define $f$ as the function assigning initial value $0$ to vertices in $W$, and initial value $+\infty$ to the other vertices, then $c_v'=c_f(v)$ for all $v\in W$. On the other hand, if $f_0$ denotes the function assigning initial value $0$ to all vertices, then $c_v=c_{f_0}(v)$ for all $v\in V$. Hence, the monotonicity property ensures that $c_v'\geq c_v$ for all $v\in W$. \end{proof} We can now conclude the proof of Theorem~\ref{theo:subcriti} for $k\geq 3$. Let $\epsilon>0$. Let $I(\epsilon)$ and $n_0(\epsilon)$ be as given in Lemma~\ref{lem:I}. Let $s(\epsilon)$ be such that, for a random vertex $v\in H_{n,\lambda n}^k$, we have $\mathbb{P}\big(|B(v,I(\epsilon)+1)|\leq s(\epsilon)\big)\geq 1-\epsilon$ for all $n$. The existence of $s(\epsilon)$ easily follows from the known property that $H_{n,\lambda n}$ converges to a Galton-Watson branching process for the local topology, see e.g.~\cite[Prop 2.6]{dembo2010gibbs}. Let $v$ be a random vertex in $H_{n,\lambda n}$. Let $\mathcal{E}_{n,\epsilon}$ be the event that the level of $v$ is at most $I(\epsilon)$, and the number of vertices in $H_v$ is at most $s(\epsilon)$. Then, using Remark~\ref{rk:shell_ball} and the union bound, we have $\mathbb{P}(\mathcal{E}_{n,\epsilon})\geq 1-2\epsilon$ for $n\geq n_0(\epsilon)$. From Lemma~\ref{prop:cvH}, there exists $N_0$ such that, for every marked $k$-uniform hypergraph $H$ with at most $s(\epsilon)$ vertices, and for every unmarked vertex $v$ of $H$, we have $\displaystyle\mathbb{P}\big(c_v^{(N)}/N\ -1\geq \epsilon\big)\leq \epsilon$ for $N\geq N_0$. Let $e$ be a random edge in $H^k_{n,\lambda n}$, and let $v$ be a random vertex of $e$. Note that $v$ is distributed as a random vertex in $H_{n,\lambda n}^k$. With Lemma~\ref{lem:Hv} and Lemma~\ref{lem:monoton}, this implies that, conditioned on $\mathcal{E}_{n,\epsilon}$, for $N\geq N_0$ we have $\displaystyle\mathbb{P}\big(c_v^{(N)}/N\ -1\geq \epsilon\big)\leq \epsilon$ in the $N$-balanced model, and also $\mathbb{P}(R_e^{(N)}\geq \epsilon)\leq \epsilon$ (since $c_e^{(N)} \leq c_v^{(N)}$). Since $\mathbb{P}(\neg \mathcal{E}_{n,\epsilon})\leq 2\epsilon$, we conclude that, for $n\geq n_0(\epsilon)$ and $N\geq N_0$, we have $\mathbb{P}(R_e^{(N)}\geq \epsilon)\leq 3\epsilon$. Hence, in the $N$-balanced model, $R_e^{(N)}=o(1)$ w.h.p., when $n$ and $N$ grow. In the $N$-uniform model, the same argument holds again, using the fact that the number of times an edge in $H_v$ is drawn is concentrated around $Nm$, with $m$ the number of edges of $H_v$. \subsection{Proof of Theorem~\ref{theo:supercrit}} The \emph{excess} of a graph $G$ is $\mathrm{exc}(G)=|E|-|V|$. \begin{lemma}\label{lem:excess} Let $G=(V,E)$ be a graph. Then, for the $N$-balanced model, we have $\sum_{e\in E}R_e^{(N)}\geq \frac1{2}\,\mathrm{exc}(G)$. \end{lemma} \begin{proof} During the CU process, each time an edge is drawn, the counter of at least one of its extremities is increased by $1$. Hence $\sum_{v\in V}c_v^{(N)}\geq N |E|$. Hence, with the notation $R_v^{(N)}:=c_v^{(N)}/N-1$, we have $\sum_{v\in V}R_v^{(N)}\geq \mathrm{exc}(G)$. Now, by Lemma~\ref{lem:observation}, for each $v\in V$, there exists an edge $e_v$ incident to $v$ such that $c_{e_v}^{(N)}=c_v^{(N)}$ (if several incident edges have this property, an arbitrary one is chosen). Hence, $\sum_{v\in V}R_{e_v}^{(N)}\geq \mathrm{exc}(G)$. Note that, in this sum, every edge occurs at most twice (since it has two extremities), thus $\sum_{e\in E}R_e^{(N)}\geq \frac1{2}\mathrm{exc}(G)$. \end{proof} For $\lambda>1/2$, it is known~\cite[Theorem~6]{pittel2005counting} that there is an explicit constant $\tilde{f}(\lambda)>0$ such that the excess of the giant component $G'=(V',E')$ of $G_{n,\lambda n}$ is concentrated around $\tilde{f}(\lambda)n$, with fluctuations of order $\sqrt{n}$. Thus, $\mathrm{exc}(G')\geq \frac1{2}\tilde{f}(\lambda)n$ w.h.p. as $n\to\infty$. Hence, by Lemma~\ref{lem:excess}, w.h.p. as $n\to\infty$ (and for any $N\geq 1$), we have \[ \mathrm{err}_N(G_{n,\lambda n})\geq \frac1{\lambda n}\sum_{e\in E'}R_e^{(N)}\geq \frac1{2\lambda n}\,\mathrm{exc}(G') \geq \frac1{4\lambda} \tilde{f}(\lambda)=:f(\lambda). \] \section{Analysis for some non-peelable hypergraphs} \label{sec:non-peelable} Analysing the asymptotic behaviour of the relative error of the CU-process on arbitrary hypergraphs seems to be a challenging task, even if we restrict ourselves to $N$-uniform and $N$-balanced models, as we do in this paper. Based on simulations, we expect that, for a fixed connected $k$-hypergraph $H=(V,E)$, and for $v\in V$, we have $c_v^{(N)}/N=C_v+o(1)$ w.h.p. as $N\to\infty$, for an explicit constant $C_v\in[1,\mathrm{deg}(v)]$. Since the number of increments at each step lies in $[1..k]$, constants $C_v$ must verify $1\leq \frac1{|E|}\sum_{v\in V} C_v\leq k$, where $\frac1{|E|}\sum_{v\in V} C_v$ can be seen as the average number of increments at a step. If $H$ is peelable, then Lemma~\ref{prop:cvH} implies that this concentration holds, with $C_v=1$. We expect that, if no vertex of $H$ is peelable, and if $H$ is ``sufficiently homogeneous'', then the constants $C_v$ should be all equal to the same constant $C>1$, and thus the relative error $R_e^{(N)}$ of every edge is concentrated around $C-1>0$ w.h.p. as $N\to\infty$. This, in particular, is supported by an experiment reported at the end of Section~\ref{sec:simulation}. In this Section, we show that this is the case for a family of regular hypergraphs which are very sparse ($O(\sqrt{|V|})$ edges) but have a high order (an edge contains $O(\sqrt{|V|})$ vertices). The \emph{dual} of a hypergraph $H$ is the hypergraph $H'$ where the roles of vertices and edges are interchanged: the vertices of $H'$ are the edges of $H$, and the edges of $H'$ are the vertices of $H$ so that an edge of $H'$ corresponding to a vertex $v$ of $H$ contains those vertices that correspond to edges incident to $v$ in $H$. We consider here the hypergraph $K_{n}'$ dual to the complete graph $K_{n}$. \begin{lemma}\label{lem:complete} Consider any CU-process on $K_{n}'=(V,E)$. At each step $t$, let $\mathrm{minedges}(t)$ be the set of edges of $E$ whose counter $c_e(t)$ is minimal over all edges. We have $|\mathrm{minedges}(t)|\geq 2$. Let $e$ be the edge selected at time $t$. Then, at time $t$, $e$ is the only edge whose counter increases (by $1$), except when $e\in\mathrm{minedges}(t)$ and $|\mathrm{minedges}(t)|=2$, in which case the counter of the other edge in $\mathrm{minedges}(t)$ also increases (by $1$). \end{lemma} \begin{proof} Every vertex $v\in V$ has degree~$2$. Considering a vertex $v$ of minimal counter, its two incident edges thus have to be in $\mathrm{minedges}(t)$, therefore $|\mathrm{minedges}(t)|\geq 2$. Let $e$ be the chosen edge at time~$t$. Clearly, $c_e$ increases (by $1$). Moreover, for every edge $e'$ such that $c_{e'}(t)\neq c_e(t)$, $c_{e'}$ does not increase. Let now $e'$ be such that $c_{e'}(t)=c_e(t)$, but there exists an edge $e''\notin\{e,e'\}$ with $c_{e''}(t)\leq c_{e'}(t)$. Let $v=e'\cap e''$. By Lemma~\ref{lem:observation}, we must have $c_v(t)=c_{e'}(t)$. Since $v$ is not incident to $e$, its counter does not increase, and neither does the counter of~$e'$. If there does not exist $e''\notin\{e,e'\}$ with $c_{e''}(t)\leq c_{e'}(t)$, then we must be in the situation where $e\in\mathrm{minedges}(t)$ and $|\mathrm{minedges}(t)|=2$. Let $v=e\cap e'$. Then, by Lemma~\ref{lem:observation}, we have $c_v(t)=c_e(t)=c_{e'}(t)$, and any vertex $v'\neq v$ must satisfy $c_{v'}(t)>c_v(t)$ (since $v'$ has at least one incident edge different from $e,e'$). Thus, the counter of $v$ increases, and the counter of $e'$ also increases. \end{proof} \begin{theorem}\label{theo:dual_complete} For any fixed $n\geq 2$, in the $N$-uniform model (resp. in the $N$-balanced model), {the counter of each vertex $v\in K_n'$ satisfies $c_v^{(N)}/N=n/(n-1)+o(1)$ w.h.p. as $N\to\infty$.} Hence, the relative error $R_e^{(N)}$ of each edge $e$ in $K_{n}'$ satisfies $R_e^{(N)}=1/(n-1)+o(1)$ w.h.p. as $N\to\infty$. \end{theorem} \begin{proof} Consider a CU-process performed on $K_{n}'=(V,E)$. At each step $t$, let $p(t)=\mathrm{min}(c_v(t),\ v\in V)=\mathrm{min}(c_e(t),\ e\in E)$, and let $q(t)=\mathrm{max}(c_e(t),\ e\in E)$. It easily follows from Lemma~\ref{lem:complete} that $\sum_{e\in E}c_e(t)=t+p(t)$. Therefore, $(n-1)p(t)\leq t\leq (n-1)q(t)$, so that $\frac{t}{n-1}\in[p(t),q(t)]$. We now consider the CU process on $K_{n}'$ in the $N$-uniform model. Let $e_1,e_2$ be two edges in $E$, and let $M\geq 1$. For $t\in[0..Nn]$, the event that $c_{e_1}(t)\geq c_{e_2}(t)+M$ implies the event that $o_{e_1}(t)-o_{e_1}(t')\geq o_{e_2}(t)-o_{e_1}(t')+M$ for some $t'\in[0..t]$ (indeed, letting $t'$ be the last time before $t$ where $c_{e_1}=c_{e_2}$, Lemma~\ref{lem:complete} ensures that all times in $[t'..t-1]$ where $c_{e_1}$ increases are due to chosing $e_1$), which is the same as the event that $\widehat{o_{e_1}}(t)-\widehat{o_{e_1}}(t')\geq \widehat{o_{e_2}}(t)-\widehat{o_{e_1}}(t')+M$ for some $t'\in[0..t]$, with the notation of Section~\ref{sec:tree_N_uniform}. Therefore, the event that $c_{e_2}(t)-c_{e_1}(t)\geq M$ for some $t\in[0..Nn]$ implies the event that $\mathrm{max}(|\widehat{o_{e_1}}(t)|,|\widehat{o_{e_2}}(t)|)\geq M/4$ for some $t\in[0..Nn]$. With the terminology of Section~\ref{sec:tree_N_uniform}, for every $e\in E$, the event $\mathrm{max}_{t\in [0,Nn]}|\widehat{o_e}(t)|\geq M$ is $(N,M)$-concentrated. Hence, the event $\{\mathrm{max}_{t\in [0,Nn]}(c_{e_2}(t)-c_{e_1}(t))\geq M\}$ is $(N,M)$-concentrated. This implies that $\mathbb{P}(c_{e_2}(Nn)-c_{e_1}(Nn)\geq N^{2/3})=O(e^{-bN^{1/3}})$ for some $b>0$, and (by the union bound) that $\mathbb{P}(q(Nn)-p(Nn)\geq N^{2/3})=O(e^{-\tilde{b}N^{1/3}})$ for some $\tilde{b}>0$. Note that $\frac{Nn}{n-1}\in[p(Nn),q(Nn)]$, and for every edge $e\in E$ we have $c_e(Nn)\in [p(Nn),q(Nn)]$. Therefore, $\mathbb{P}(|c_e(Nn)-\frac{Nn}{n-1}|\geq N^{2/3})=O(e^{-\tilde{b}N^{1/3}})$. Hence, in the $N$-uniform model we have $R_e^{(N)}-\frac1{n-1}=O(N^{-1/3})=o(1)$ w.h.p. as $N\to\infty$. In the $N$-balanced model, by the same argument as in Lemma~\ref{sec:tree_N_balanced}, we have $\mathbb{P}(|c_e^{(N)}-\frac{Nn}{n-1}|\geq N^{2/3})=O(N^{n/2}e^{-\tilde{b}N^{1/3}})$; hence, $R_e^{(N)}-\frac1{n-1}=O(N^{-1/3})=o(1)$ w.h.p. as $N\to\infty$. \end{proof} Note that with regular Count-Min, the relative error of every edge is $1+o(1)$ (exactly $1$ in the $N$-balanced model), since all vertices have degree 2. The statement and proof of Theorem~\ref{theo:dual_complete} easily extend to dual complete hypergraphs as follows. Let $K_{n,r}$ be the complete $r$-uniform hypergraph on $n$ vertices (for $n\geq r\geq 2$), and consider a CU-process on $K_{n,r}'$ in the $N$-uniform (resp. $N$-balanced) model. Then { the counter of each vertex $v\in K_{n,r}'$ satisfies $c_v^{(N)}/N=n/(n-r+1)+o(1)$ w.h.p as $N\to\infty$}, hence the relative error $R_e^{(N)}$ of any edge $e\in K_{n,r}'$ satisfies $R_e^{(N)}=\frac{r-1}{n-r+1}+o(1)$ w.h.p. as $N\to\infty$. For regular Count-Min, the relative error is $r-1+o(1)$ (exactly $r-1$ in the $N$-balanced model), since every vertex in $K_{n,r}'$ has degree $r$. \section{Non-uniform distributions} \label{sec:zipf} An interesting and natural question is whether the phase transition phenomenon holds for non-uniform distributions as well. This question is of practical importance, as in many practical situations keys are not distributed uniformly. In particular, Zipfian distributions often occur in various applications and are a common test case for Count-Min sketches \cite{CormodeMuthuICDM05,DBLP:conf/teletraffic/BianchiDLS12,DBLP:conf/iccnc/EinzigerF15,10.1145/3487552.3487856,DBLP:journals/corr/abs-2203-14549}. In Zipf's distributions, key probabilities in descending order are proportional to $1/i^\beta$, where $i$ is the rank of the key and $\beta\geq 0$ is the \textit{skewness} parameter. Note that for $\beta = 0$, Zipf's distribution reduces to the uniform one. It is therefore a natural question whether the phase transition occurs for Zipf's distributions with $\beta > 0$. One may hypothesize that the answer to the question should be positive, as under Zipf's distribution, frequent keys tend to have no error, as it has been observed in earlier papers \cite{DBLP:conf/teletraffic/BianchiDLS12,DBLP:journals/corr/abs-2203-14549,benmazziane:hal-03613957}. On the other hand, keys of the tail of the distribution have fairly similar frequencies, and therefore might show the same behavior as for the uniform case. However, this hypothesis does not hold. Figure~\ref{fig:zipf} shows the behavior of the average error for Zipf's distributions with $\beta \in \{0.2,0.5,0.7,0.9\}$ vs. the uniform distribution ($\beta=0$). The average error is defined here as the average error of all keys weighted by their frequencies\footnote{This definition is natural for non-uniform distributions, as the error for a frequent key should have a larger contribution. Note that it is consistent with the definition of Section~\ref{sec:main_results} in the $N$-balanced case, and in the $N$-uniform case it presents a negligible difference when $N$ gets large.}, i.e. $\mathrm{err}_N(H)=\frac{1}{mN}\sum_{e\in E}o_e^{(N)}\frac{c_e^{(N)}-o_e^{(N)}}{o_e^{(N)}}=\frac{1}{mN}\sum_{e\in E}(c_e^{(N)}-o_e^{(N)})$. In other words, $\mathrm{err}_N(H)$ is the expected error of a randomly drawn key from the entire input stream of length $mN$ (taking into account multiplicities). \begin{figure \begin{center} \includegraphics[width=0.7\textwidth]{zipf.png} \end{center} \caption{Average error as a function of $\lambda=m/n$, for Zipf's distributions with $\beta \in \{0.0,0.2,0.5,0.7,0.9\}$. Plots obtained for $n=1000$, $k=3$, $N=50,000$.} \label{fig:zipf} \end{figure} We observe that the phase transition behavior vanishes for $\beta>0$. It turns out that even in the subcritical regime, frequent elements, while having no error themselves, heavily affect the error of certain rare elements, which raises the resulting average error. In the supercritical regime ($\lambda>1$ in Figure~\ref{fig:zipf}) the opposite happens: the uniform distribution shows the largest average error. This is because an increasingly large fraction of the keys (those in the core of the associated hypergraph) contribute to the error, while for skewed distributions, frequent keys tend to have no error, and thus the larger $\beta$ (with frequent keys becoming more predominant) the smaller the average error. {Note that this is in accordance with the observation of \cite{DBLP:conf/teletraffic/BianchiDLS12} that the estimates for the uniform distribution majorate the estimates of infrequent keys for skewed distributions.} \section{Concluding remarks} We presented an analysis of conservative update strategy for Count-Min sketch under the assumption of uniform distribution of keys in the input stream. Our results show that the behaviour of the sketch heavily depends on the properties of the underlying hash hypergraph. Assuming that hash functions are $k$-wise independent, the error produced by the sketch follows two different regimes depending on the density of the underlying hypergraph, that is the number of distinct keys relative to the size of the sketch. When this ratio is below the threshold, the conservative update strategy produces a $o(1)$ relative error when the input stream and the number of distinct keys both grow, while the regular Count-Min produces a positive constant error. This gap formally demonstrates that conservative update achieves a substantial improvement over regular Count-Min. We showed that the above-mentioned threshold corresponds to the peelability threshold for $k$-uniform random hypergraphs. One practical implication of this is that the best memory usage is obtained with three hash functions, due to the fact that $\lambda_3$ is maximum among all $\lambda_k$, and therefore $k=3$ leads to the minimum number of counters needed to deal with a given number of distinct keys. In \cite{DBLP:conf/sigmod/CohenM03} it is claimed, without proof, that the rate of positive errors of conservative update is $k$ times smaller than that of regular Count-Min. This claim does not appear to be true. Note that Count-Min does not err on a key represented in the sketch if and only if the corresponding edge of the hypergraph includes a leaf (vertex of degree 1), while the conservative update can return an exact answer even for an edge without leaves. However, this latter event depends on the relative frequencies of keys and therefore on the specific distribution of keys and the input length. On the other hand, our experiments with uniformly distributed keys show that this event is relatively rare, and the rate of positive error for Count-Min and conservative update are essentially the same. One important assumption of our analysis is the uniform distribution of keys in the input. We presented an experimental evidence that for skewed distributions, in particular for Zipf's distribution, the phase transition {disappears when the skewness parameter grows. Therefore, the uniform distribution presents the smallest error in the subcritical regime. The situation is the opposite in the supercritical regime when the number of distinct keys is large compared to the number of counters: here the uniform distribution presents the largest average error. As mentioned earlier, } for Zipf's distribution, frequent keys have essentially no error, whereas in the supercritical regime, low frequency keys have all similar overestimates. This reveals another type of phase transition in error approximation for Zipf's distribution, occurring between frequent and infrequent elements. Quantifying this transition is an interesting open question directly related to the accurate detection of \textit{heavy hitters} in streams. \paragraph*{Acknowledgments} We thank Djamal Bellazougui who first pointed out to us the conservative update strategy.
b2c08792c67ad04b144db20594c503732d8460b0
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{INTRODUCTION} With the rise of autonomous systems, assuring their safety is of paramount importance. For instance, an autonomous drone should not crash during its mission, or a self-driving vehicle should not collide with other vehicles. Formulating constraints for these applications to ensure safety is a difficult task. These intelligent systems often use data-driven solutions for learning and adapting online. However, it is unclear how to principally and efficiently encode data into the paradigm of safety. A popular approach to ensuring safety of dynamical systems leverages set theoretic ideas. To be more specific, the theory of controlled set invariance is employed where a system is defined to be safe if (a subset of) its states remain within a prescribed set \cite{controls_sets_Blanchini2008}. This forms the basis of control barrier functions (CBFs) which have been successfully demonstrated on many safety-critical applications \cite{cbf_Ames2017}, \cite{cbf_safe_swarm_quadrotors_Li2017}, \cite{cbf_biped_Hsu2015}. To incorporate safety using CBFs, we need two items: a candidate function or certificate satisfying the required relative degree and a nominal model of the system dynamics. The candidate function defines a superlevel set in which the system remains forward invariant subject to certain constraints. Traditionally, these safety functions have been hand-designed. However, depending on the application, designing such a candidate CBF is not straight forward in many practical settings. To highlight the difficulty of a hand-designed solution, consider the example of a disaster recovery scenario. Designing a safety function manually for this scenario requires great effort and intuition to find an appropriate form. This can compromise system safety if designed incorrectly. We believe designing the safety candidate function based on sampled data in a principle and efficient manner will alleviate many of these concerns. To this end, we propose working with \textit{safety samples, which encode a safety metric of interest, to synthesize the safety function in a data-driven manner using Gaussian Processes (GPs) and define it as a Gaussian CBF} (see Figure \ref{fig:gcbf_vs_cbf_contours}). CBFs achieve safe control using barrier certificates \cite{cbf_barrier_certificates_prajna2007, cbf_constructive_wieland2007}. The system's safety is encoded using these safety barrier certificates (or safe sets) with the aid of a smooth function satisfying certain properties. These functions can then be combined with quadratic programs (QPs) to achieve safety constrained control \cite{cbf_Ames2017, cbf_safe_swarm_groundbots_Li2015, cbf_safe_swarm_quadrotors_Li2017, so3_conic_cbf_Tatsuya2020}. Certificates based on Lyapunov and barrier functions were combined to demonstrate stable and safe constrained control \cite{cbf_2dquad_Wu2016, cbf_3dquad_Wu2016}. These approaches incorporate deterministic CBFs defined a priori without incorporating any form of data for altering the CBF. Learning based methods for addressing safety have been investigated previously. For an uncertain nonlinear system, the region of attraction is learned by using non-parametric GPs and Bayesian optimization (BO) to estimate and expand the safe set in \cite{safe_learning_roa_felix2016} . BO was also used in safety-critical systems such as quadruped, snake, and quadrotor for improving system performance while ensuring safety \cite{bo_gait_lizotte2007}, \cite{bo_snake_matthew2011}, \cite{bo_quadrotor_berkenkamp2016}. Unfortunately, the high run-time complexity of BO limits its applicability to evolving tasks or changing environmental conditions. For systems with polynomial dynamics, an optimization routine can be set up as a convex semi-definite problem using sum-of-squares (SoS) technique to search for a valid safety certifcate \cite{opt_sos_ahmadi2016, opt_sos_ahmadi2019}. However, SoS methods also scale poorly with high dimensions, similar to BO, and are limited to polynomial system dynamics. In the context of CBFs, data-driven techniques are actively pursued. Support vector machines (SVMs) were used in \cite{cbf_supervisedml_Srinivasan2020} to parameterize CBFs with the help of sensor measurements. Carefully designed weights are required in \cite{cbf_supervisedml_Srinivasan2020} for the SVM classifier to work and the study is confined to simulation results. Data in the form of expert demonstrations was used in \cite{cbf_expertdata_Robey2020}, \cite{cbf_robust_hybrid_Robey2021} to generate CBFs. However, in many applications, having access to expert demonstrations is not always feasible. While both the papers \cite{cbf_supervisedml_Srinivasan2020, cbf_expertdata_Robey2020} empirically verify their findings, neither provide hardware experimental validation of their methods. Adaptive CBFs were formulated to handle time-varying control bounds and noise in the system dynamics \cite{cbf_adaptive_xiao2021}. CBFs have been combined with model predictive control methods for safe motion and path planning \cite{cbf_mpc_polytopes_thirugnanam2022}, \cite{cbf_mpc_racing_he2022}. For stochastic dynamical systems, stochastic CBFs are developed \cite{cbf_stochastic_clark2021}. These approaches use parametric CBFs while accounting for uncertainty in the system dynamics. The authors in \cite{cbf_robust_HJ_choi2021} use a value-function approach by combining Hamilton-Jacobi (HJ) with CBFs to maximize the safe set using viability kernels. However, the HJ based CBF is limited to low-dimensional systems. Neural certificates, which use neural networks to construct safety barrier certificates, have been demonstrated in \cite{neural_formal_abate2020}, \cite{neural_synthesis_zhao2020}, \cite{neural_convex_tsukamoto2020}, \cite{neural_lyapunov_gaby2021}. These neural certificates provide a data-driven approach to learning-based controllers and provide formal proofs of correctness. A second-order cone program was formulated in \cite{cbf_gaussian_castaneda2021}, with GPs used for modeling the control input and dynamic model uncertainty learned in an episodic manner. However, all these studies have been confined to simulation experiments and are limited to offline training which limits their applicability in many practical online settings. The work in \cite{cbf_gaussian_castaneda2021} was limited to a particular type of kernel to satisfy affineness properties. We differ from \cite{cbf_gaussian_castaneda2021} in modeling the safety candidate function with GPs instead of the underlying system dynamics and are not limited to one type of kernel parameterization. In our previous work \cite{cbf_gaussian_variance_Khan2021}, safety uncertainty was introduced in CBFs by augmenting the GP posterior variance with an existing CBF using data. We experimentally validated augmentation of safety uncertainty to a given CBF in hardware. However, this required a parametric CBF as the underlying safety function. Moreover, the safe set expansion in \cite{cbf_gaussian_variance_Khan2021} was limited only to convex safe sets. \textit{In this research, we consider a fully non-parametric formulation for synthesizing the safety function without requiring any parametric CBF candidate function. } We also provide theoretical guarantees in this study. \begin{figure}[!t] \centering \vspace{0.2cm} \includegraphics[width=1\linewidth]{images/gcbf_vs_cbf_contours.pdf} \caption{The Gaussian CBF is non-parametric and relies on data to produce the safe sets. The $0$-level contour sets are shown for a traditional CBF (left) and Gaussian CBF (right) with safe sets $\mathcal{S}_{\mathrm{cbf}}$ and $\mathcal{S}_{\mathrm{gcbf}}$ respectively. As a new observation is received (green upper triangle), the Gaussian CBF can change the safe set based on the data in a non-convex fashion.} \label{fig:gcbf_vs_cbf_contours} \end{figure} \noindent Our main \textbf{contributions} are the following. \begin{enumerate} \item We present a novel approach for synthesizing CBFs in a data-driven non-parametric manner using GPs. This is achieved using safety samples as opposed to the prevailing use of CBFs which requires a function. \item We construct Gaussian CBFs to design safe sets based on the data. These sets are not confined to convex safe sets. GPs provide favorable properties such as analytical tractability and uncertainty estimation which are key enablers in finding closed-form safety function and associated Lie derivatives with high guarantees. \item We formulate Gaussian CBFs for safe control in the presence of noise for both the safety samples (observations to GPs) and the system states (inputs to the GPs). \item We validate Gaussian CBFs in hardware using a quadrotor for three case studies: (i) safe control for fixed but arbitrary safe sets, (ii) online obstacle avoidance with an evolving safe set, and (iii) juxtaposing Gaussian CBFs with regular CBFs for safe control in the presence of noisy system states. \end{enumerate} To the best of our knowledge, we believe this is the first work that fully synthesizes a CBF in a non-parametric data-driven manner online using GPs and validate all findings in hardware. The outline of the paper is as follows. Mathematical preliminaries are covered in Section \ref{sec:background} with the problem statement discussed in Section \ref{sec:problem}. We present our proposed methodology in \ref{sec:methodology}. The quadrotor application testcase is explained in Section \ref{sec:application}. We discuss experimental results in Section \ref{sec:experiments} followed by conclusion in Section \ref{sec:conclusion}. \section{BACKGROUND PRELIMINARIES}\label{sec:background} We tackle the problem of encoding safety for a dynamical system using a data-driven approach. We leverage theoretical properties of CBFs and GPs to encode safety in a probabilistic manner. We first review key results on CBFs and GPs and refer the reader to \cite{cbf_Ames2017, cbf_exponential_Nguyen2016, gp_textbook_Rasmussen2003} for more details. \subsection{Control Barrier Function}\label{subsec:cbf} Consider a general control affine dynamical system, \begin{align}\label{eq:nonlinear_affine_system} \dot{\mathbf{x}} &= f(\mathbf{x}) + g(\mathbf{x}) \mathbf{u}, \end{align} where $\mathbf{x}(t) \in \mathbb{R}^n$ is the state and $\mathbf{u}(t) \in \mathbb{R}^m$ is the control input. The drift vector field, $f : \mathbb{R}^n \rightarrow \mathbb{R}^n$, and control matrix field, $g : \mathbb{R}^n \rightarrow \mathbb{R}^{n \times m}$, are assumed to be locally Lipschitz continuous. For reasons of brevity, we omit the implicit dependence on time for the state and control input unless otherwise stated. Let safety for (\ref{eq:nonlinear_affine_system}) be encoded as the superlevel set $\mathcal{S}$ of a smooth function $h : \mathbb{R}^n \rightarrow \mathbb{R} $ as follows, \begin{align}\label{eq:safeset} \mathcal{S} = \{ \mathbf{x} \in \mathbb{R}^n \ | \ h(\mathbf{x}) \geq 0 \}. \end{align} \begin{definition}[Control Barrier Function \cite{cbf_Ames2017}]\label{def:cbf} \textit{The function $h(\mathbf{x}) : \mathbb{R}^n \rightarrow \mathbb{R}$ is defined as a control barrier function (CBF), if there exists an extended class-$\kappa$ function $\alpha$ ($\alpha(0) = 0$ and strictly increasing) such that for any $\mathbf{x} \in \mathcal{S}$, \begin{align}\label{eq:cbf_inequality} \sup\limits_{\mathbf{u} \in \mathbb{R}^m } L_f h (\mathbf{x}) + L_g h (\mathbf{x}) \mathbf{u} + \alpha( h (\mathbf{x})) \geq 0, \end{align} } \end{definition} \noindent where $L_f h (\mathbf{x}) = \frac{\partial h }{\partial \mathbf{x}}f(\mathbf{x})$ and $L_g h (\mathbf{x}) = \frac{\partial h }{\partial \mathbf{x}}g(\mathbf{x})$ are the Lie derivatives of $h(\mathbf{x})$ along $f(\mathbf{x})$ and $g(\mathbf{x})$ respectively. \begin{theorem}[Safety Condition \cite{cbf_Ames2017}]\label{thm:cbf} \textit{Given a system (\ref{eq:nonlinear_affine_system}), with safe set $\mathcal{S} \subset \mathbb{R}^n$ (\ref{eq:safeset}), and a smooth CBF $h(\mathbf{x}) : \mathbb{R}^n \rightarrow \mathbb{R}$ (\ref{eq:cbf_inequality}), any Lipschitz continuous controller $\mathbf{u} \in \mathbb{R}^m$, chosen from $\mathrm{K}_{\mathrm{cbf}} = \{ \mathbf{u} \in \mathbb{R}^m \ | \ L_fh(\mathbf{x}) + L_gh(\mathbf{x}) \mathbf{u} + \alpha(h(\mathbf{x})) \geq 0 \}$ for any $\mathbf{x} \in \mathbb{R}^n$, renders the set $\mathcal{S}$ forward invariant for (\ref{eq:nonlinear_affine_system}). } \end{theorem} As seen from Theorem \ref{thm:cbf}, CBFs are limited to systems with relative degree one, $\rho = 1$. For systems with $\rho > 1$, we look at an extension of CBFs called Exponential CBFs \cite{cbf_exponential_Nguyen2016, cbf_highorder_xiao2019}. \begin{definition}[Exponential Control Barrier Function \cite{cbf_exponential_Nguyen2016}]\label{def:ecbf} \textit{The smooth function $h(\mathbf{x}) : \mathbb{R}^n \rightarrow \mathbb{R}$, with relative degree $\rho$, is defined as an exponential control barrier function (ECBF), if there exists $\mathcal{K} \in \mathbb{R}^{\rho}$ such that for any $\mathbf{x} \in \mathbb{R}^n$,} \begin{align*} \sup\limits_{\mathbf{u} \in \mathbb{R}^m } L_f^{\rho} h(\mathbf{x}) + L_gL_f^{\rho-1}h(\mathbf{x})\mathbf{u} + \mathcal{K}^{\top} \mathcal{H} \geq 0, \end{align*} \end{definition} \noindent where $\mathcal{H} = [h(\mathbf{x}), L_fh(\mathbf{x}), ... , L_f^{(\rho-1)} h(\mathbf{x})]^{\top} \in \mathbb{R}^\rho$ is the Lie derivative vector for $h(\mathbf{x})$, and $\mathcal{K} = [k_0, k_1, ..., k_{\rho-1}]^{\top} \in \mathbb{R}^\rho$ is the coefficient gain vector for $\mathcal{H}$. $\mathcal{K}$ can be determined using linear control methods such as pole placement. We refer the reader to \cite{cbf_exponential_Nguyen2016} for proofs of ECBF forward invariance. \subsection{Gaussian Process Regression}\label{subsec:gp} GPs are a popular choice in machine learning for nonparametric regression which rely on kernels. Kernels furnish a notion of similarity between pairs of input points, $\mathbf{x}_i, \mathbf{x}_j \in \mathbb{R}^n$. However, any arbitrary function of input pairs will not constitute a valid kernel. To be a valid kernel, it should satisfy positive semidefiniteness, see \cite{gp_textbook_Rasmussen2003}. A popular choice of the kernel function is the squared exponential (SE) kernel, \begin{align}\label{eq:gaussian_kernel} k(\mathbf{x}_i,\mathbf{x}_j) = \sigma_f^2 \exp \bigg( \hspace{-0.15cm} - \frac{ ( \mathbf{x}_i - \mathbf{x}_j )^{\top} \mathbf{L}^{-2} ( \mathbf{x}_i - \mathbf{x}_j) } {2} \bigg) \hspace{-0.1cm} + \hspace{-0.05cm} \delta_{ij} \sigma_y^2 , \end{align} where $\delta_{ij} = 1$ if $i=j$ and $0$ otherwise, $\mathbf{l} \in \mathbb{R}^n$ is the characteristic length scale, with $\mathbf{L} = \mathrm{diag}(\mathbf{l}) \in \mathbb{R}^{n \times n}$. The signal scale and observation noise are given by $\sigma_f^2 \in \mathbb{R}$ and $\sigma_y^2 \in \mathbb{R}$ respectively. Together, these free parameters constitute the SE kernel's hyperparameters, $\Theta = \{ \mathbf{L}, \sigma_f^2, \sigma_y^2 \}$. We are interested in constructing a safety function for which we assume to have noisy scalar observations. Given a set of $N$ data points, with input vectors $\mathbf{x} \in \mathbb{R}^n$, and scalar targets $y \in \mathbb{R}$, we compose the dataset $\mathcal{D}_N = \{ \mathbf{X}_N, \mathbf{y}_N \}$, where $\mathbf{X}_N = \{\mathbf{x}_i\}_{i=1}^{N}$ and $\mathbf{y}_N = \{y_i\}_{i=1}^N$. GPs can compute the posterior mean and variance for an arbitrary deterministic query point $ \x_q \in \mathbb{R}^n$, by conditioning on previous measurements. We will later investigate how to handle the case when the query point $\mathbf{x}_q$ is noisy. The posterior mean $\mu \in \mathbb{R}$ and variance $\sigma^2 \in \mathbb{R}$ are given by \cite{gp_textbook_Rasmussen2003}, \begin{align} \mu( \x_q) &= \mathbf{k}( \x_q)^{\top} \ \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \mathbf{y}_N, \label{eq:gp_mean} \\ \sigma^2( \x_q) &= k ( \x_q, \x_q) - \mathbf{k}( \x_q)^{\top} \ \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \mathbf{k}( \x_q) \label{eq:gp_var}, \end{align} where $\mathbf{k}(\x_q) = \big[k(\mathbf{x}_1, \x_q), \ldots , k(\mathbf{x}_N, \x_q) \big]^{\top} \in \mathbb{R}^{N}$ is the covariance vector between $\mathbf{X}_N$ and $ \x_q$, $\mathbf{\overline{K}} \in \mathbb{R}^{N \times N}$, with entries $[ \bar{k} ]_{(i,j)} = k(\mathbf{x}_i, \mathbf{x}_j), \ i, j \in \{1, \ldots, N\}$, is the covariance matrix between pairs of input points in $\mathbf{X}_N$, and $k( \x_q, \x_q) \in \mathbb{R}$ is the prior covariance. The SE kernel is infinitely differentiable, and hence, it is infinitely mean-square (MS) differentiable. This allows for a flexible parameterization of the safety function and its Lie derivatives. We use the SE kernel to develop Gaussian CBFs while noting that any valid kernel can be used. \section{PROBLEM STATEMENT}\label{sec:problem} Consider a control affine system (\ref{eq:nonlinear_affine_system}) is given, with access to its states $\mathbf{x}$, and scalar noisy observations $y$, that represents a metric for safety. The metric for safety cannot be generalized and therefore is very problem dependent. A distance sensor's readings for obstacle avoidance can be used as a metric for safety or a temperature sensor's readings for determining thermally acceptable regions to traverse. In a similar vein, a LIDAR scan creating $\mathrm{3D}$ point cloud information can be used to detect environmental hazards or a computer vision algorithm providing the decision boundary for safe regions of interest. In all these examples, we can easily sample from the data based on domain knowledge to construct a target metric for safety. \textit{This provides us with the means to construct a valid safety certificate using the data as opposed to hand-designing a safety function which could be limited and requires manual effort along with good domain knowledge intuition.} \begin{remark} We assume there is a high-level planner or observer, e.g., sensors or computer vision algorithms, providing the necessary data observations. We acknowledge some feature engineering or data sampling may be involved which is very common in practice. These observations represent the \textit{safety sample} candidates in our problem setting. \end{remark} Our objective is to \textit{synthesize a safety function $ h_{\mathrm{gp}} (\mathbf{x})$ in a non-parametric manner from measurements of the system states and safety samples or observations online and ensure that (\ref{eq:nonlinear_affine_system}) remains safe.} Data-based methods are ultimately approximations and hence, it is desirable to account for any uncertainty in the estimation of the safety function. This leads to the following candidate function, \begin{align}\label{eq:problem_general_gcbf} \underbrace{{ h_{\mathrm{gp}} (\mathbf{x}(t))}}_{\text{overall safety}} := \underbrace{{ h_{\mathrm{b}} (\mathbf{x}(t) ; \Theta )}}_{\text{safety belief}} \ - \underbrace{ h_{\mathrm{u}} (\mathbf{x}(t) ; \Theta )}_{\text{safety uncertainty}}. \end{align} The system's overall safety is given by $ h_{\mathrm{gp}} (\mathbf{x})$ which has two components; a belief in safety given by $ h_{\mathrm{b}} (\mathbf{x})$ and an associated uncertainty given by $ h_{\mathrm{u}} (\mathbf{x})$. Intuitively, the safety belief represents our best estimation of system safety and safety uncertainty represents the uncertainty in the estimation. Ideally, if there is no uncertainty, then the safety belief will perfectly match the overall final safety. Additionally, there are hyperparameters $\Theta$ that can alter the relative notion of safety belief and uncertainty. \begin{problem} Given system \eqref{eq:nonlinear_affine_system} and online (noisy) measurements of the state $\x_q$, synthesize $ h_{\mathrm{gp}} (\mathbf{x})$ with a safety belief and associated uncertainty, conditioned on past states and observations in the dataset given by: $\mathcal{D}_N = \{ \mathbf{X}_N, \mathbf{y}_N \}$, where $\mathbf{X}_N = \{\mathbf{x}_i\}_{i=1}^{N}$ and $\mathbf{y}_N = \{y_i\}_{i=1}^N$, such that system (\ref{eq:nonlinear_affine_system}) is safe. \end{problem} To ensure the system remains safe, we need to rectify a given nominal control input $\mathbf{u}_{\mathrm{nom}}$ to its rectified form $\mathbf{u}_{\mathrm{rec}}$ which is then applied to (\ref{eq:nonlinear_affine_system}). This is done by making sure the Lie derivatives of the corresponding candidate safety function satisfies the inequality (\ref{eq:cbf_inequality}). \begin{problem} Given system \eqref{eq:nonlinear_affine_system}, synthesized $ h_{\mathrm{gp}} (\mathbf{x})$ with safe set $\mathcal{S}$, and a nominal control input $\mathbf{u}_{\mathrm{nom}}$, design the rectified control input $\mathbf{u}_{\mathrm{rect}}$ such that system (\ref{eq:nonlinear_affine_system}) is safe. \end{problem} Note that designing the control objective for a data-driven based CBF construction is particularly challenging. A non-parametric approach is adopted where the data is fully exploited to construct the safe sets and safety function hypothesis. This compounds the problem of computing the Lie derivatives since time derivatives are computed on $ h_{\mathrm{gp}} (\mathbf{x})$ in order to satisfy the forward invariance properties for CBFs. It is an ill-posed problem to compute the time derivative of an unknown entity i.e., the system's safety belief and uncertainty, without making prior assumptions. For addressing these challenges, a kernel representation is used for constructing the safety belief and uncertainty. \section{PROPOSED METHODOLOGY}\label{sec:methodology} In this section, we present our proposed approach, where GPs are used for synthesizing the safety function. A key advantage of GPs over other models such as neural networks, radial basis functions or polynominal chaos, lies in its bayesian non-parametric design. \textit{By allowing a flexible prior over functions, GPs give a probabilistic workflow that gives robust posterior estimates in analytical form. This enables a flexible realization for our safety function as well as computing the associated Lie derivatives.} The resulting architecture for our framework is shown in Figure \ref{fig:gcbf_architecture}. \subsection{Gaussian Control Barrier Function}\label{subsec:gcbf} A GP prior is placed on the desired candidate safety function, $ h_{\mathrm{gp}} (\mathbf{x}) \sim \mathcal{GP}(0, k(\mathbf{x},\mathbf{x}'))$. By using the GP prior, we fully specify the candidate safety function unlike our previous work in \cite{cbf_gaussian_variance_Khan2021}. Only the GP posterior variance was used in \cite{cbf_gaussian_variance_Khan2021} to handle safety uncertainty for a given deterministic CBF. Note that the new formulation is a far more flexible realization \textit{since the data is used for informing both the safety belief and associated uncertainty}. We operate under the following standard assumptions for GPs. \begin{assumption}\label{assump:noisy_observations} Each observation $y_i$ is corrupted with Gaussian noise, $y_i \sim \mathcal{N}(p_i, \sigma_y)$, where $p_i$ is the noise-free safety sample and $\sigma_y$ is the observation noise variance. \end{assumption} \begin{assumption}\label{assump:noise_free_training_inputs} Training input states $\mathbf{X}_N$ in the dataset $\mathcal{D}_N$ are noise-free. \end{assumption} We consider the case of getting noisy measurements for the safety samples. This is a realistic assumption, since in practice these safety samples are captured from noisy sensory measurements. The input training data is considered to be noise-free, however, which is a common practice in machine learning. We first consider the case where the query point $\mathbf{x}_q$ is deterministic, i.e., noise-free. Later, we look at the case when the input query point is also noisy, see Section \ref{subsec:gcbf_noisy_input}. \begin{assumption}\label{assump:initialize_safeset} The safe set is nonempty with at least one datapoint, the initial state $\mathbf{x}(0)$ and associated safety value $ h_{\mathrm{gp}} (\mathbf{x}(0)) \in \mathbb{R}_{\geq 0}$, to synthesize $ h_{\mathrm{gp}} $. \end{assumption} We assume that the system begins in an initial compact safe set. Safety for $ h_{\mathrm{gp}} $ is encoded as, \begin{align} \mathcal{S} = \{ \mathbf{x} \in \mathbb{R}^n \ | \ h_{\mathrm{gp}} (\mathbf{x}) \geq 0 \}, \label{eq:gcbf_safeset} \\ \partial \mathcal{S} = \{ \mathbf{x} \in \mathbb{R}^n \ | \ h_{\mathrm{gp}} (\mathbf{x}) = 0 \}. \label{eq:gcbf_safeset_boundary} \end{align} A noise-free query state $\x_q \in \mathbb{R}^n$ with a noisy safety sample $y \in \mathbb{R}$ is sampled if, \begin{align}\label{eq:sample_xq} \norm { \mathbf{x}_{(i)} - \x_q } \geq \tau, \qquad i = \{1, \cdots, N \}, \end{align} where $\tau \in \mathbb{R}$ is the sampling distance between any two input states. This avoids dense sampling of the states, resulting in computational tractability. Moreover, if the samples collected are too close together, this may give rise to an ill-conditioned covariance matrix \cite{gp_textbook_Rasmussen2003}. \begin{definition}[Gaussian Control Barrier Function]\label{def:gcbf} \textit{A function $ h_{\mathrm{gp}} (\mathbf{x}) : \mathbb{R}^n \rightarrow \mathbb{R}$ is defined as a Gaussian CBF for \eqref{eq:nonlinear_affine_system}, if $ h_{\mathrm{gp}} (\mathbf{x}) \sim \mathcal{GP}(0, k(\mathbf{x}_i, \mathbf{x}_j))$ is a Gaussian process, with an infinitely mean-square differentiable positive definite kernel, $k(\mathbf{x}_i, \mathbf{x}_j): \mathbb{R}^n \times \mathbb{R}^n \rightarrow \mathbb{R}$, and if $\exists$ an extended class-$\kappa$ function $\alpha$ such that for any $\mathbf{x} \in \mathbb{R}^n$,} \begin{align}\label{eq:gcbf_def} \sup\limits_{\mathbf{u} \in \mathbb{R}^m } L_f h_{\mathrm{gp}} (\mathbf{x} ) + L_g h_{\mathrm{gp}} ( \mathbf{x} ) \mathbf{u} + \alpha( h_{\mathrm{gp}} (\mathbf{x} )) \geq 0. \end{align} \end{definition} \begin{remark} The Gaussian CBF above has attractive properties. A GP prior is placed on the safety candidate function, giving rise to a non-parametric functionality. Thus, the data is used to fully realize the safety function a posteriori. As more data is collected, the overall safety encoded by $ h_{\mathrm{gp}} (\mathbf{x})$ changes. Moreover, it has an analytical form for both the safety belief and uncertainty. This enables computing Lie derivatives of $ h_{\mathrm{gp}} (\mathbf{x})$ in closed-form. \end{remark} The Lie derivatives in (\ref{eq:gcbf_def}) require taking partial derivatives of $ h_{\mathrm{gp}} $ with respect to $\mathbf{x}$ which we will discuss later in Section \ref{subsec:lie_gcbf}. We propose the Gaussian CBF $ h_{\mathrm{gp}} (\mathbf{x})$ that incorporates safety belief and uncertainty \textit{online} using the GP posterior mean \eqref{eq:gp_mean} and variance \eqref{eq:gp_var} as follows\footnote{We can employ weights, $w_{\mu}$ and $w_{\sigma^2}$, to the posterior mean and variance respectively in order to adjust safety based on the application. For the sake of simplicity, we consider the weights to be unity in the problem statement.}, \begin{align} h_{\mathrm{gp}} (\mathbf{x} ) := \mu(\mathbf{x} ) - \sigma^2(\mathbf{x} ) \notag \hspace{4cm}\\ = \underbrace{\mathbf{k}(\mathbf{x} )^{\top} \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \mathbf{y}_N}_{\text{safety belief}} - \underbrace{\Big( k (\mathbf{x} , \mathbf{x} ) - \mathbf{k}(\mathbf{x} )^{\top} \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \mathbf{k}(\mathbf{x} ) \Big)}_{\text{safety uncertainty}}. \label{eq:gcbf} \end{align} The GP posterior mean represents the belief we have regarding safety whereas the GP posterior variance accounts for safety uncertainty. We require the following theorem to discuss forward invariance properties for the set $\mathcal{S}$ in \eqref{eq:gcbf_safeset}-\eqref{eq:gcbf_safeset_boundary}. \begin{theorem}[Sample Path Differentiability \cite{gp_nonstationary_proofs_Paciorek2003}]\label{thm:gp_differentiability} \textit{ A Gaussian process with an isotropic correlation function that can be expressed in the Schoenberg representation \cite{math_metricspace_schoenberg1938}, has $M^{\text{th}}$-order mean-square partial derivatives if $M$ moments of the length-scale parameter, $l$, are finite. } \end{theorem} We first consider an unforced dynamical system given by $\dot{\mathbf{x}} = f(\mathbf{x})$, where $\mathbf{u}(t) = 0, \forall t \geq 0$. In this case, the Gaussian CBF will simply be considered as a Gaussian barrier function, since the control input does not appear. \begin{proposition}\label{prop:gcbf} \textit{Given a system $\dot{\mathbf{x}} = f(\mathbf{x})$ with a nonempty safe set $\mathcal{S}$ as defined by (\ref{eq:gcbf_safeset}-\ref{eq:gcbf_safeset_boundary}) for a Gaussian process $ h_{\mathrm{gp}} $, if $ h_{\mathrm{gp}} $ is a Gaussian barrier function defined on the set $\mathcal{S}$, then $\mathcal{S}$ is forward invariant. } \end{proposition} \begin{proof} First, we observe that $ h_{\mathrm{gp}} $ uses an infinitely MS differentiable kernel. Hence, $ h_{\mathrm{gp}} $ is also infinitely MS differentiable with respect to $\mathbf{x}$ due to Theorem \ref{thm:gp_differentiability} since the length-scale has infinitely many moments. Since $ h_{\mathrm{gp}} $ is a Gaussian CBF and infinitely MS differentiable, then the inequality $L_f h_{\mathrm{gp}} (\mathbf{x}) \geq -\alpha( h_{\mathrm{gp}} (\mathbf{x}))$, is satisfied. Given Assumption \eqref{assump:initialize_safeset}, the set $\mathcal{S}$ is nonempty, for any $\mathbf{x} \in \partial \mathcal{S}$, $ h_{\mathrm{gp}} (\mathbf{x}) = 0$ holds. As a result, $\alpha( h_{\mathrm{gp}} (\mathbf{x})) = 0$ which gives $L_f h_{\mathrm{gp}} (\mathbf{x}) \geq 0 \implies \dot{h}_{\mathrm{gp}} \geq 0$. By applying Nagumo's theorem \cite{controls_sets_Blanchini2008}, which states that for any $C^1$ function $ h_{\mathrm{gp}} $, the condition $\dot{h}_{\mathrm{gp}} \geq 0$ on $\partial \mathcal{S}$ is necessary and sufficient for the set $\mathcal{S}$ to be forward invariant, completes the proof. \end{proof} \begin{remark} For the case when the kernel is only $M$ times differentiable, and not infinitely MS differentiable, we require that $M > 2\rho$, where $\rho \in \mathbb{N}$ is the relative degree of the system. The proof above holds trivially for an $M$ times differentiable kernel using Theorem \ref{thm:gp_differentiability}. \end{remark} We are interested in ensuring forward invariance of $\mathcal{S}$ characterized by $ h_{\mathrm{gp}} $ for the system defined by ($\ref{eq:nonlinear_affine_system}$). The admissible control space for the Gaussian CBF is given by, \begin{align}\label{eq:gcbf_inequality} \mathrm{K}_{\mathrm{gcbf}} \hspace{-0.05cm} = \hspace{-0.1cm} \{ \mathbf{u} \in \mathbb{R}^m \big| L_f h_{\mathrm{gp}} (\mathbf{x}) \hspace{-0.07cm} + \hspace{-0.07cm} L_g h_{\mathrm{gp}} (\mathbf{x}) \mathbf{u} + \hspace{-0.06cm} \alpha( h_{\mathrm{gp}} (\mathbf{x})) \hspace{-0.06cm} \geq \hspace{-0.06cm} 0 \}. \end{align} \begin{proposition}\label{prop:gcbf_control} \textit{Given a Gaussian CBF $ h_{\mathrm{gp}} (\mathbf{x}) : \mathcal{S} \rightarrow \mathbb{R}$ defined by (\ref{eq:gcbf_def}), where $\mathcal{S}$ is nonempty (\ref{eq:gcbf_safeset}), any Lipschitz continuous controller $\mathbf{u} \in \mathbb{R}^m$, that satisfies (\ref{eq:gcbf_inequality}) for any $\mathbf{x} \in \mathbb{R}^n$, renders $\mathcal{S}$ forward invariant for the system (\ref{eq:nonlinear_affine_system}). } \end{proposition} \begin{proof} $ h_{\mathrm{gp}} $ is a Gaussian process with an infinitely MS differentiable kernel. Using Theorem \ref{thm:gp_differentiability}, $ h_{\mathrm{gp}} $ is also infinitely MS differentiable and is, therefore, smooth. Since $ h_{\mathrm{gp}} $ satisfies (\ref{eq:gcbf_inequality}), we have $L_f h_{\mathrm{gp}} (\mathbf{x}) + L_g h_{\mathrm{gp}} (\mathbf{x}) \mathbf{u} \geq -\alpha( h_{\mathrm{gp}} (\mathbf{x}))$. Using Theorem \ref{thm:cbf}, the proof is complete. \end{proof} \begin{figure}[!t] \centering \vspace{0.2cm} \includegraphics[width=1\linewidth]{images/gcbf_architecture_nonparametric.pdf} \caption{Gaussian CBF incorporates safety belief and uncertainty based on past measurement data.} \vspace{-0.2cm} \label{fig:gcbf_architecture} \end{figure} \subsection{Lie Derivatives of Gaussian CBF}\label{subsec:lie_gcbf} The Gaussian CBF uses kernels for determining safety belief and uncertainty in the state space. As stated earlier, we use the SE kernel (\ref{eq:gaussian_kernel}) which is an infinitely mean-square differentiable function. Computing its Lie derivatives is necessary for rectifying the control input and ensuring forward invariance for the system in the safe set. First, we take the partial derivative of (\ref{eq:gcbf}) with respect to $\mathbf{x}$ at a query point $\x_q$, \begin{align} &\frac{\partial \hgp (\x) }{\partial \x} \bigg|_{ \xquery} \hspace{-.3cm} = \frac{\partial \mu (\x) }{\partial \x} \bigg|_{ \xquery} - \frac{\partial \sigma^2 (\x) }{\partial \x} \bigg|_{ \xquery} \notag \\ & \hspace{1cm} = \mathbf{y}_N^{\top} \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \frac{\partial \mathbf{k} (\x) }{\partial \x} \bigg|_{ \xquery} \hspace{-0.3cm} + 2 \mathbf{k}( \x_q)^{\top} \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \frac{\partial \mathbf{k} (\x) }{\partial \x} \bigg|_{ \xquery} \hspace{-0.3cm} . \hspace{-0.1cm} \label{eq:dhgpdx} \end{align} The kernel derivative in (\ref{eq:dhgpdx}) is given by, \begin{align}\label{eq:kernel_deriv} \frac{\partial \mathbf{k}_{(i)} (\x) }{\partial \x} \bigg|_{ \xquery} &= (\mathbf{x}_{(i)} - \x_q)^{\top} \ k(\mathbf{x}_{(i)} , \x_q) \mathbf{L}^{-2} , \end{align} where $\mathbf{k}_{(i)}$ is the $i^{\mathrm{th}}$ element of $\mathbf{k}(\mathbf{x})$, and (\ref{eq:kernel_deriv}) is the $i^{\text{th}}$ row of $\frac{\partial \mathbf{k} (\x) }{\partial \x} \in \mathbb{R}^{N \times n}$. Now, we can compute the Lie derivatives of $ h_{\mathrm{gp}} (\mathbf{x})$ by taking its time derivative as follows, \begin{align} \dot{h}_{\mathrm{gp}}(\mathbf{x}) &= \frac{\partial \hgp (\x) }{\partial \x} f(\mathbf{x}) + \frac{\partial \hgp (\x) }{\partial \x} g(\mathbf{x}) \mathbf{u} \notag \\ &= L_f h_{\mathrm{gp}} (\mathbf{x}) + L_g h_{\mathrm{gp}} (\mathbf{x}) \mathbf{u}, \label{eq:gcbf_lie} \end{align} \noindent where (\ref{eq:dhgpdx}) is used in the Lie derivatives, $L_f h_{\mathrm{gp}} (\mathbf{x})$ and $L_g h_{\mathrm{gp}} (\mathbf{x})$. In prior literature, the derivative predictions of GP posterior mean and variance are exploited \cite{gp_derivatives_observations_Solak2003, gp_derivatives_scaling_Eriksson2018}. Here, we take the partial derivatives of $\mu$ and $\sigma^2(\mathbf{x})$ with respect to the state $\mathbf{x}$ which are different from the derivative predictions of GP posterior mean and variance. \subsection{Online Safety Control}\label{subsec:online_qp} Consider a nominal control input $\mathbf{u}_{\mathrm{nom}} \in \mathbb{R}^m$ that is designed as the feedback policy for system \eqref{eq:nonlinear_affine_system}. This control policy may not restrict the solution of system \eqref{eq:nonlinear_affine_system} inside the safe set. An online quadratic program (QP) rectifies $\mathbf{u}_{\mathrm{nom}}$ whose constraints are given by the Lie derivatives in (\ref{eq:gcbf_lie}) \cite{cbf_Ames2017}. The QP optimization routine is set up as follows: \begin{algorithm} Gaussian CBF-QP: \textit{Input modification} \begin{align}\label{eq:gcbf-qp_degree1} \mathbf{u}_\mathrm{rect} &= \argmin_{ \mathbf{u} \in \mathbb{R}^m} \frac{1}{2} \norm{ \mathbf{u} - \mathbf{u}_{\mathrm{nom}} }^2 \ \ \text{s.t.} \\ & \ \ L_f h_{\mathrm{gp}} (\mathbf{x}) + L_g h_{\mathrm{gp}} (\mathbf{x}) \mathbf{u} + \alpha( h_{\mathrm{gp}} (\mathbf{x})) \geq 0, \notag \end{align} \end{algorithm} \noindent where $\uu_{\mathrm{rect}}$ is the rectified control input. The QP constraint above ensures that the nominal control is followed as long as the safety condition is not violated, i.e., $ h_{\mathrm{gp}} (\mathbf{x}) \geq 0$. When approaching the boundary of the safe set, i.e., $ h_{\mathrm{gp}} \rightarrow 0$, the QP rectifies $\uu_{\mathrm{nom}}$ minimally to $\uu_{\mathrm{rect}}$. By rectifying the control policy, the system is guaranteed to remain forward invariant for the safe set $\mathcal{S}$ due to Proposition \ref{prop:gcbf_control}. When solving for the QP, every term in the constraint is simply a numerical value except for the decision variable, the control input, which is rectified. Therefore, $ h_{\mathrm{gp}} (\mathbf{x})$ being highly non-linear and non-convex does not affect finding the rectified control input. The algorithm for computing safe control input from the Gaussian CBF is shown in Algorithm \ref{algo:gcbf_algorithm}. \begin{algorithm} \caption{Gaussian CBF Synthesis \& Safe Control}\label{algo:gcbf_algorithm} \hspace*{\algorithmicindent} \textbf{Input:} \textsc{GP Prior} $ h_{\mathrm{gp}} (\mathbf{x}) \sim \mathcal{GP}(0, k(\mathbf{x},\mathbf{x}'))$ \\ \hspace*{\algorithmicindent} \hspace{1cm} \textsc{System} (\ref{eq:nonlinear_affine_system}) \\ \hspace*{\algorithmicindent} \hspace{1cm} \textsc{Nominal Input} $\mathbf{u}_{\mathrm{nom}}$ \hspace*{\algorithmicindent} \textbf{Output:} \textsc{Rectified input} $\mathbf{u}_{\mathrm{rect}}$ \begin{algorithmic}[1] \Procedure{SafeControl}{} \State \textsc{Sample} $\mathbf{X}_N \gets \x_q \ \& \ \mathbf{y}_N \gets y$ using (\ref{eq:sample_xq}) \State \textsc{Synthesize} $ h_{\mathrm{gp}} (\mathbf{X}_N, \mathbf{y}_N)$ using (\ref{eq:gcbf}) \State \textsc{Compute} $\frac{\partial \hgp (\x) }{\partial \x}$ using (\ref{eq:dhgpdx}-\ref{eq:kernel_deriv}) \State \textsc{Setup QP} constraint using (\ref{eq:gcbf_lie}) \State \textsc{Rectify} $\mathbf{u}_{\mathrm{nom}}$ using (\ref{eq:gcbf-qp_degree1}) \\ \textbf{return} $\mathbf{u}_\mathrm{rect}$ \EndProcedure \end{algorithmic} \end{algorithm} \vspace{-.25cm} \begin{remark} Note that due to the non-parametric nature of the Gaussian CBF, the algorithm above can be treated as a blackbox routine. This is a beneficial property since, if a traditional CBF is altered, then the corresponding Lie derivatives also change explicitly in their form. However, in the Gaussian CBF, the structure of the Lie derivatives remains the same, i.e, the partial derivatives are explicitly agnostic to the underlying CBF. It is characterized only by the data and the dynamical system. \end{remark} \subsection{Gaussian CBF with Noisy Query State}\label{subsec:gcbf_noisy_input} We extend Gaussian CBFs to handle the case when the query state, $\underline{\x}_q$, is stochastic and therefore a random variable. \begin{assumption}\label{assump:noisy_test_inputs} The query state $\mathbf{x}_q$ is Gaussian distributed, $\underline{\mathbf{x}}_q \sim \mathcal{N}(\bm{\mu}, \bm{\Sigma})$, where $\bm{\mu}$ is the mean and $\bm{\Sigma}$ is its noise covariance matrix. \end{assumption} This has practical significance because accurate estimates of these states are required to generate safe control actions. In practice, however, measurement uncertainty is pervasive leading to error in the state estimates, thus degrading the safety behavior. As a result, we need to modify the posterior predictions of the GP in order to account for this noise. The predictive equations for a Gaussian test input have been looked at before \cite{gp_multistep_girard2002, gp_deisenroth2011}. Generally, if a Gaussian input is multiplied with the nonlinear GP predictive distribution, the resulting distribution is non-Gaussian, \begin{align}\label{eq:noisy_input_nongp} \hspace{-0.15cm} p( h_{\mathrm{gp}} (\underline{\x}_q) | \ \bm{\mu}, \bm{\Sigma}) = \int p( h_{\mathrm{gp}} (\underline{\x}_q) | \underline{\x}_q ) p( \underline{\x}_q | \bm{\mu}, \bm{\Sigma} ) \mathrm{d} \underline{\x}_q. \end{align} As a result, moment matching is used to derive the posterior predictions. To determine the moments of the predictive function value, both the query distribution and the distribution of the function given by the GP are averaged over. For the SE kernel, the posterior mean and variance can be computed for the predictive distribution in \eqref{eq:noisy_input_nongp} in closed-form\footnote{This statement holds true for all kernels, in particular the SE, polynomial, and trigonometric kernels, if the integral of the kernel multiplied with a Gaussian distribution can be solved analytically.} \cite{gp_thesis_deisenroth2010}. By using the law of iterated expectations, the posterior mean with a noisy query point $\underline{\x}_q$ is given as follows \cite{gp_thesis_deisenroth2010}, \begin{align}\label{eq:noisy_gp_mean} \mu(\underline{\x}_q) &= \mathbf{q}(\underline{\x}_q)^{\top} \ \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \mathbf{y}_N, \end{align} where $\mathbf{q} = [q_i, \dots, q_N ]^{\top} \in \mathbb{R}^N$ with each $q_i$ representing the expected covariance between $ h_{\mathrm{gp}} (\underline{\x}_q)$ and $ h_{\mathrm{gp}} (\mathbf{x}_i)$, \begin{align*} q_i(\mathbf{x}_i, \underline{\x}_q) &:= \int k(\mathbf{x}_i, \underline{\x}_q) \mathcal{N} (\underline{\x}_q | \bm{\mu}, \bm{\Sigma} ) \mathrm{d} \underline{\x}_q \\ &\hspace{-1.2cm}= \sigma_f^2 | \ \bm{\Sigma} \mathbf{L}^{-2} + \mathbf{I}_n \ |^{\frac{1}{2}} \exp \bigg( \hspace{-0.15cm} - \frac{1}{2} ( \mathbf{x}_i - \bm{\mu} )^{\top} \mathbf{R}^{-1} ( \mathbf{x}_i - \bm{\mu}) \bigg), \end{align*} where $\mathbf{R} = \bm{\Sigma} + \mathbf{L}^{2} \in \mathbb{R}^{n \times n}$. It is interesting to note the case for a deterministic query point $\x_q$, where $\bm{\Sigma = 0}$ and $\bm{\mu} = \x_q$. On comparing \eqref{eq:noisy_gp_mean} with \eqref{eq:gp_mean}, the posterior mean for the noisy input results in the same posterior mean for the noise-free input, since $q_i(\mathbf{x}_i, \x_q)$ collapses to $k_i(\mathbf{x}_i, \x_q)$ in \eqref{eq:gaussian_kernel}. Effectively, the noise-free input point is a special case of the noisy posterior prediction with $\mathbf{\Sigma} = \bm{0}$ and $\bm{\mu} = \x_q$. For details on the derivation of the preditive variance for the noisy test point, see \cite{gp_thesis_deisenroth2010}. Here, we simply state the posterior predictive variance which is as follows, \begin{align}\label{eq:noisy_gp_var} \hspace{-0.2cm} \sigma^2(\underline{\x}_q) = \sigma_f^2 - \mathrm{tr}\big( \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \mathbf{V} \big) + \bm{\beta}^{\top} \big( \mathbf{V}\bm{\beta} - \mathbf{q} \big), \end{align} with $\bm{\beta} = \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \mathbf{y}_N \in \mathbb{R}^N$, and the entries of $\mathbf{V} \in \mathbb{R}^{N \times N}$ are given by, \begin{align*} v_{ij} = \frac{k(\mathbf{x}_i, \bm{\mu}) k(\mathbf{x}_j, \bm{\mu})}{ | 2\bm{\Sigma}\mathbf{L}^{-2} + \mathbf{I}_n |^{\frac{1}{2}} } \exp \big( (\mathbf{z}_{ij} - \bm{\mu})^{\top} \mathbf{T} (\mathbf{z}_{ij} - \bm{\mu}) \big), \end{align*} where $\mathbf{T} := (\bm{\Sigma} + \frac{1}{2}\mathbf{L}^2)^{-1} \bm{\Sigma} \mathbf{L}^{-2} \in \mathbb{R}^{n \times n}$ and each entry in $\mathbf{z}_{ij} := \frac{1}{2}(\mathbf{x}_i + \mathbf{x}_j) \in \mathbb{R}^n$. As seen in \eqref{eq:noisy_gp_mean} and \eqref{eq:noisy_gp_var}, both the predictive mean and variance explicitly depend on the mean $\bm{\mu}$ and the covariance matrix $\bm{\Sigma}$ of the Gaussian distributed query state $\underline{\x}_q$. The Gaussian CBF for a noisy query point $\underline{\x}_q$ is given by, \begin{align}\label{eq:gcbf_noisy} h_{\mathrm{gp}} (\underline{\x}_q) := \mu(\underline{\x}_q) - \sigma^2(\underline{\x}_q). \end{align} To compute the Lie derivatives, the partial derivative of \eqref{eq:gcbf_noisy} with respect to $\bm{\mu}$ is given by, \begin{align} \frac{\partial \mu(\underline{\x}_q)}{\partial \underline{\x}_q} \bigg|_{ \bm{\mu}} &= \mathbf{y}_N^{\top} \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \frac{\partial \mathbf{q} (\x) }{\partial \x} \bigg|_{ \bm{\mu}} \label{eq:gcbf_noisy_mean_derivative} \\ \Bigg[ \frac{\partial \sigma^2(\underline{\x}_q)}{\partial \underline{\x}_q} \bigg|_{ \mu_k} \Bigg] &= \hspace{-0.2cm} \sum_{i,j = 1}^{N} \hspace{-0.1cm} \Big( \frac{-1}{\bar{k}_{ij}} + \beta_i \beta_j \Big) \frac{\partial v_{ij}}{\partial x_k} \bigg|_{ \mu_k} \hspace{-0.4cm} - \sum_{i = 1}^N \beta_i \frac{\partial q_i}{\partial x_k} \bigg|_{ \mu_k} \hspace{-0.1cm}, \label{eq:gcbf_noisy_variance_derivative} \end{align} where $k = \{ 1, \dots, n \}$, $x_k$ and $\mu_k$ are the $k^{\mathrm{th}}$ entries of $\underline{\x}_q$ and $\bm{\mu}$ respectively, and $\bar{k}_{ij} = k(\mathbf{x}_i, \mathbf{x}_j) \in \mathbb{R}$. We emphasize that $\mathbf{V}$ is a symmetric matrix which allows combining the summation with the choice of indices in \eqref{eq:gcbf_noisy_variance_derivative}. The Lie derivatives can then be computed using the equations above, similar to \eqref{eq:gcbf_lie}, to achieve safe constrained control by setting up a QP as constructed in \eqref{eq:gcbf-qp}. \section{APPLICATION TEST CASE: QUADROTOR}\label{sec:application} To demonstrate the efficacy of our method, we implement our proposed technique on a quadrotor system. Quadrotors pose an interesting and challenging problem due to their inherently unstable nature. We run $3$ separate experiments using Gaussian CBF on a quadrotor: (a) safe constrained control for arbitrary safe sets (b) explore the state space safely and synthesize the safe set online, and (c) safe constrained control in presence of noisy states and compare the performance with regular CBFs. First, we review quadrotor dynamics followed by safety rectification using the Gaussian CBF for a quadrotor platform. \subsection{Quadrotor Dynamics}\label{subsec:quadrotor_dynamics} We consider the position dynamics and attitude dynamics of a quadrotor model evolving in a coordinate-free framework. This framework uses a geometric representation for its attitude given by a rotation matrix $\mathbf{R}$ on $SO(3) := \{ \mathbf{R} \in \mathbb{R}^{3 \times 3} \ | \ \mathbf{R}^{\top}\mathbf{R} = \mathbf{I}_3, \ \det(\mathbf{R}) = 1 \}$. $\mathbf{R}$ represents the rotation from the body-frame to the inertial-frame. The origin of the body-frame is given by the quadrotor's center of mass, denoted by $\mathbf{r} \in \mathbb{R}^3$. A quadrotor is an underactuated system since it has $6$ DOF, due to its configuration space being $SE(3) := \mathbb{R}^3 \times SO(3)$, but $4$ control inputs; thrust $F \in \mathbb{R}$ and moments $\mathbf{M} \in \mathbb{R}^3$. The equations of motion are: \begin{align} \dot{\mathbf{r}} &= \mathbf{v} , \notag \\ m\dot{\mathbf{v}} &= -m g \mathbf{e}_3 + F \mathbf{R} \mathbf{e}_3 , \label{eq:dyn2}\\ \dot{\mathbf{R}} &= \mathbf{R} \mathbf{\Omega}^{\times}, \notag \\ \mathbf{J} \dot{\mathbf{\Omega}} &= \mathbf{M} - (\mathbf{\Omega}^{\times} \mathbf{J} \mathbf{\Omega}) , \label{eq:dyn4} \end{align} where $\mathbf{v} \in \mathbb{R}^3$ is the velocity in the inertial frame, $m \in \mathbb{R}$ is the quadrotor mass, $g \in \mathbb{R}$ is gravity, $\mathbf{e}_3 = [0 \ 0 \ 1]^{\top} \in \mathbb{R}^3$, $\mathbf{\Omega} \in \mathbb{R}^3$ is the body-frame angular velocity, $\mathbf{J} \in \mathbb{R}^{3 \times 3}$ is the inertia matrix, and $(\cdot)^{\times}: \mathbb{R}^3 \rightarrow so(3)$ is the skew-symmetric operator, such that $\forall \ \mathbf{x}, \mathbf{y} \in \mathbb{R}^3, \ \mathbf{x}^{\times}\mathbf{y} = \mathbf{x} \times \mathbf{y}$. \subsection{Setpoint Generation for Quadrotor}\label{subsec:setpoint_quadrotor} For achieving safety constrained control of the quadrotor, we first compute setpoints. These setpoints are sent to a Crazyflie 2.1 \cite{crazyflie}, in the form of desired thrust, $F_{\mathrm{des}}$, and desired roll, pitch, yaw angles, $\eta = [\phi_\mathrm{des}, \ \theta_\mathrm{des}, \ \psi_\mathrm{des}]^{\top} \in \mathbb{R}^3$. The Crazyflie is equipped with a fast response low-level onboard controller that can directly track these setpoint commands. More details regarding the hardware experimental setup are covered in Section \ref{subsec:experiment_setup}. Given a desired trajectory, $\mathbf{r}_\mathrm{des} \in \mathbb{R}^3$, that is twice differentiable, a second-order integrator model is set up, \begin{align}\label{eq:second_order_integrator} \underbrace{ \begin{bmatrix} \dot{\mathbf{r}} \\ \ddot{\mathbf{r}} \end{bmatrix} }_{\dot{\mathbf{x}}} &= \underbrace{ \begin{bmatrix} \mathbf{0} & \mathbf{I} \\ \mathbf{0} & \mathbf{0} \end{bmatrix} \begin{bmatrix} \mathbf{r} \\ \dot{\mathbf{r}} \end{bmatrix} }_{f(\mathbf{x})} + \underbrace{ \begin{bmatrix} \mathbf{0} \\ \mathbf{I} \end{bmatrix} }_{g(\mathbf{x})} \mathbf{u}, \end{align} where $\mathbf{x} = [\mathbf{r} \ \mathbf{\dot{r}} ]^{\top} \in \mathbb{R}^6$ and $\mathbf{u} = \ddot{\mathbf{r}}_\mathrm{des} \in \mathbb{R}^3$. The input $\mathbf{u}$ in (\ref{eq:second_order_integrator}) is rectified using the synthesized Gaussian CBF generating the following rectified setpoints, \begin{align} \phi_\mathrm{rect} &= \frac{ (u_{1, \mathrm{rect}} \sin \psi - u_{2, \mathrm{rect}} \cos \psi) } {g}, \label{eq:rectified_roll}\\ \theta_\mathrm{rect} &= \frac{ (u_{1, \mathrm{rect}} \cos\psi + u_{2, \mathrm{rect}} \sin \psi)} {g}, \label{eq:rectified_pitch}\\ F_\mathrm{rect} &= m(u_{3, \mathrm{rect}} + g), \label{eq:rectified_thrust} \end{align} where the desired yaw is assumed to be zero and small angle approximations are made to invert the dynamics in (\ref{eq:dyn2}) for simplicity \cite{cbf_teleoperation_Xu2018, quadrotor_trajectory_generation_control_Mellinger2012}. Next, we discuss the safety rectification of $\mathbf{u}$ to compute $\mathbf{u}_\mathrm{rect}$ using the Gaussian CBF. \subsection{Online Control Rectification}\label{subsec:quadrotor_safety_rectification} Given a Gaussian CBF expressed in the position space, the relative degree for system (\ref{eq:second_order_integrator}) is $\rho = 2$. The associated Lie derivatives for the Gaussian CBF in (\ref{eq:gcbf}) are, \begin{align*} L_f h_{\mathrm{gp}} (\mathbf{x}) &= \Big( \nabla \mu(\mathbf{x}) - \nabla \sigma^2(\mathbf{x}) \Big) ^{\top} f(\mathbf{x}), \hspace{3cm} \\[3pt] L_f^2 h_{\mathrm{gp}} (\mathbf{x}) &= f(\mathbf{x})^{\top} \Big( \mathbf{H}_{\mu} (\mathbf{x}) - \mathbf{H}_{\sigma^2} \Big) f(\mathbf{x}) \\[-2pt] & \hspace{0.25cm} + \Big( \nabla \mu(\mathbf{x}) - \nabla \sigma^2(\mathbf{x}) \Big) ^{\top} \cdot \nabla f(\mathbf{x}) \cdot f(\mathbf{x}), \\[5pt] L_gL_f h_{\mathrm{gp}} (\mathbf{x}) &= f(\mathbf{x})^{\top} \Big( \mathbf{H}_{\mu} (\mathbf{x}) - \mathbf{H}_{\sigma^2} (\mathbf{x}) \Big) g(\mathbf{x}) \\ & \hspace{0.25cm} + \Big( \nabla \mu(\mathbf{x}) - \nabla \sigma^2(\mathbf{x}) \Big)^{\top} \cdot \nabla f (\mathbf{x}) \cdot g(\mathbf{x}), \end{align*} where $\nabla \mu(\mathbf{x}) = \frac{\partial \mu (\x) }{\partial \x}^{\top}$ and $\nabla \sigma^2(\mathbf{x}) = \frac{\partial \sigma^2 (\x) }{\partial \x}^{\top}$ are the gradients of GP mean and variance in (\ref{eq:dhgpdx}) and $\nabla f(\mathbf{x}) = \frac{\partial f (\mathbf{x}) }{\partial \mathbf{x}}$ is the Jacobian of $f(\mathbf{x})$. $\mathbf{H}_{\mu}(\mathbf{x})$ and $\mathbf{H}_{\sigma^2}(\mathbf{x})$ are the Hessians of GP mean and variance given by, \begin{align*} \mathbf{H}_{\mu}(\mathbf{x}) &= \bigg( \hspace{-0.1cm} \sum_i^N a_i \frac{\partial^2 \mathbf{k}_{(i)} (\x) }{\partial \x^2} \bigg), \\[-8pt] \mathbf{H}_{\sigma^2}(\mathbf{x}) &= - 2 \nabla \mathbf{k}(\mathbf{x}) \mathbf{ \overline{K} \hspace{0.1cm} }^{-1} \nabla \mathbf{k}(\mathbf{x})^{\hspace{-0.05cm}\top} \hspace{-0.1cm} - 2 \bigg( \hspace{-0.1cm} \sum_i^N b_i \frac{\partial^2 \mathbf{k}_{(i)} (\x) }{\partial \x^2} \bigg), \end{align*} where $a_i$ is the $i^{\mathrm{th}}$ entry of $\mathbf{y}_N^{\top} \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \in \mathbb{R}^{1 \times N}$, $b_i$ is the $i^{\mathrm{th}}$ entry of $\mathbf{k}(\x_q)^{\top} \mathbf{ \overline{K} \hspace{0.05cm} }^{-1} \in \mathbb{R}^{1 \times N}$, $\nabla \mathbf{k}(\mathbf{x}) = \frac{\partial \mathbf{k} (\x) }{\partial \x}^{\top} \in \mathbb{R}^{n \times N}$, and $\frac{\partial^2 \mathbf{k}_{(i)} (\x) }{\partial \x^2}$ is the partial derivative of (\ref{eq:kernel_deriv}) with respect to $\mathbf{x}$. For the case when the query state is noisy, $\underline{\x}_q$, we use the predictive mean and variance \eqref{eq:gcbf_noisy} as described in Section \ref{subsec:gcbf_noisy_input}. Similarly, the corresponding partial derivatives are used to compute the Jacobians and Hessians from \eqref{eq:gcbf_noisy_mean_derivative}-\eqref{eq:gcbf_noisy_variance_derivative} to compute the Lie derivatives for the noisy query state. Given the nominal control input $\mathbf{u}_\mathrm{nom} \in \mathbb{R}^3$ in (\ref{eq:second_order_integrator}), the QP below rectifies $\mathbf{u}_\mathrm{nom}$ into $\mathbf{u}_\mathrm{rect} \in \mathbb{R}^3$, \vspace{-.1cm} \begin{algorithm} Gaussian CBF-QP: \textit{Input modification} \begin{align}\label{eq:gcbf-qp} \mathbf{u}_\mathrm{rect} &= \argmin_{ \mathbf{u} \in \mathbb{R}^3} \frac{1}{2} \norm{ \mathbf{u} - \mathbf{u}_{\mathrm{nom}} }^2 \ \ \text{s.t.} \\ & \ \ L_f^2 h_{\mathrm{gp}} (\mathbf{x}) + L_g L_f h_{\mathrm{gp}} (\mathbf{x}) \mathbf{u} + \mathcal{K}^{\top} \mathcal{H} \geq 0, \notag \end{align} \end{algorithm} \noindent where $\mathcal{K} = [k_1 \ k_2]^{\top} \hspace{-0.1cm} \in \mathbb{R}^2$ is the coefficient gain vector, and $\mathcal{H} = [L_f h_{\mathrm{gp}} (\mathbf{x}) \ h_{\mathrm{gp}} (\mathbf{x}) ]^{\top} \hspace{-0.1cm} \in \mathbb{R}^2$ is the Gaussian Lie derivative vector. The rectified input $\mathbf{u}_{\mathrm{rect}}$ is used to compute the rectified setpoints using \eqref{eq:rectified_roll}, \eqref{eq:rectified_pitch}, \eqref{eq:rectified_thrust} which are then ultimately sent to the quadrotor. \section{EXPERIMENTAL VERIFICATION}\label{sec:experiments} In this section, we discuss the implementation of our method on a hardware quadrotor. We test our proposed formulation in three different scenarios. In the first setting, we demonstrate safe constrained control, where the Gaussian CBF is used to formulate the candidate function. These safe sets are arbitrarily designed and are not limited to taking any convex shape. For the second demonstration, we synthesize the safety function online by exploring the state space while avoiding static collisions. The quadrotor performs safe control within the constructed Gaussian CBF. And for the final scenario, we revisit the constrained control problem for a given candidate function, but in the presence of noisy position states. We compare the safe controlled behavior with a regular CBF. All experiments can be seen here: \small{\url{https://youtu.be/HX6uokvCiGk}}\normalsize. \subsection{Experiment Setup}\label{subsec:experiment_setup} We use the Crazyflie 2.1 as the hardware quadrotor. State estimation is performed onboard with the help of an external low-cost lighthouse positioning system \cite{crazyflie}. All computations are done remotely on a ground station equipped with an Intel i7-9800X at $4.4 \si{\giga\hertz}$ processor and 16 GB RAM. The $\texttt{crazyflie\_ros}$ API is used to communicate for interprocess communication, subscribing to pose information, and publishing setpoints over the Crazyradio PA USB dongle \cite{crazyflie_ros_hoenig2017}. Positions and velocities are collected at $20 \si{\hertz}$ with a data capacity set to $300$ samples. Gaussian CBF synthesis and rectification routine (\ref{eq:gcbf-qp}) are run on a parallel thread at $50 \si{\hertz}$ where solving the QP takes under $5 \si{\ms}$. Nominal setpoint commands are sent to the Crazyflie at $100 \si{\hertz}$ with the help of a Logitech joystick controller, which acts as the nominal controller in the QP formulation. \subsection{Scenario A : Safe Control for Arbitrary Safe Sets} The objective in this scenario is to demonstrate safe constrained control for any given arbitrary safe set using the Gaussian CBF formulation. We assume a high-level observer or planner provides a map from which we can sample (un)safe locations. For instance, take the example of a satellite view for a street or the indoor map of a warehouse unit, where the goal is to navigate an autonomous agent safely and provide safety specifications at the planning phase. The configuration space for position safety in such settings cannot be designed by hand effectively. By using the data driven design of Gaussian CBFs, we can construct safe sets based on the dataset allowing flexible realizations of safe sets based on information from a high-level planner or observer. In this scenario, we construct a safety map in $2\mathrm{D}$, where the domain is chosen to be $[-0.35, 0.35]$ along each lateral axis, $\mathrm{x}$ and $\mathrm{y}$. We uniformly sample, $N = 200$, $(\mathrm{x},\mathrm{y})$ input points. The safety sample for each input coordinate is drawn from a uniform distribution, $y \sim \mathcal{U}(a,b)$, where $a = -1.0$ and $b = 2.0$ are the lowest and highest values respectively of the distribution. This gives a discrete $2\mathrm{D}$ safety map, where for each of the $200$ $(\mathrm{x},\mathrm{y})$ coordinates, we have an associated target safety sample. The safety maps are synthesized once and do not change during the experiment, so the sampling distance is set to $\tau = 0$. The hyperparameters are arbitrarily chosen to generate arbitrary safety maps: $\mathbf{L} = \mathrm{diag}(0.1, 0.1), \sigma_f = 1, \sigma_y = 0.01$. The Gaussian CBF characterizes the posterior safety map as follows, \begin{align}\label{eq:gcbf_experiment} h_{\mathrm{gp}} (\mathbf{x}) := \mu(\mathbf{x}) - 4\sigma^2(\mathbf{x}). \end{align} We generate $3$ arbitrary safe sets and run $3$ separate experiments with the quadrotor always starting in the safe set as shown in Figure \ref{fig:hardware_noisefree_exp3}. For each experiment, we plot the flight trajectory of the quadrotor, its initial and final positions, and the $0$-level set of $ h_{\mathrm{gp}} $. The plot of $ h_{\mathrm{gp}} (t)$ is also shown for each experimental run. First, we point out that the data generates arbitrary non-convex safe sets. The posterior mean represents the safety belief in $ h_{\mathrm{gp}} $, whereas the posterior variance quantifies the notion of safety for regions in the state space where we have few or no samples. We can thus generate very safe realizations of candidate CBFs with high probabilistic bounds. The flight trajectory of the quadrotor always remains inside the safe set based on the QP formulation in \eqref{eq:gcbf-qp}. This can be verified by looking at the $ h_{\mathrm{gp}} (t)$ for each experiment, which is always non-negative. \begin{figure}[!t] \centering \vspace{-0.3cm} \includegraphics[width=0.9\linewidth]{images/hardware_noisefree_exp1.pdf} \includegraphics[width=0.9\linewidth]{images/hardware_noisefree_exp2.pdf} \includegraphics[width=0.9\linewidth]{images/hardware_noisefree_exp3.pdf} \vspace{-0.3cm} \caption{Experiments are run for arbitrary safe sets generated using the Gaussian CBF $ h_{\mathrm{gp}} $. The initial ({\color{green}$\blacksquare$}), mid-flight ({\color{lightblue}$\circ$}), and final ({\color{red}$\bullet$}) quadrotor positions are shown. The $0$-level contour line is marked (bold gray). The temporal plot of $ h_{\mathrm{gp}} $ for each experiment shows that the quadrotor always remains inside the safe set.} \label{fig:hardware_noisefree_exp3} \vspace{-0.3cm} \end{figure} \subsection{Scenario B : Online Synthesis of Safe set with obstacle avoidance} The objective is to synthesize the safety function online by exploring the state space and avoiding collisions. This has great practical significance in safe navigation since onboard sensors are limited in collecting data only within their local proximity. Therefore, we cannot know a priori the complete safety map. Moreover, the sensed data will also need to alter the safety decision boundary online. With the help of Gaussian CBFs, we can incrementally change the safe set as more data is collected. This allows expansion of the safe set in a non-convex manner, which is required in many practical scenarios involving unstructured environments. In this scenario, $ h_{\mathrm{gp}} (\mathbf{x})$ denotes the distance between the quadrotor and the obstacle. Here, we use two obstacles and therefore have two separate distance measurements, \begin{align*} d_a &= (\mathbf{r}_{xy} - \mathbf{p}_a)^{\top} (\mathbf{r}_{xy} - \mathbf{p}_a) - R^2_a, \\ d_b &= (\mathbf{r}_{xy} - \mathbf{p}_b)^{\top} (\mathbf{r}_{xy} - \mathbf{p}_b) - R^2_b , \end{align*} where $\mathbf{r}_{xy}$ is the quadrotor's lateral position, similarly $\mathbf{p}_{(\cdot)} \in \mathbb{R}^2$ is the obstacle's lateral position and $R_{(\cdot)} \in \mathbb{R}$ is the obstacle radius. The overall safety sample is taken as the noisy estimate by combining the two distance measurements, \begin{align*} y := d_a \cdot d_b + w, \ \ w \sim \mathcal{N}(0, \sigma_y^2), \end{align*} where $\sigma^2_y \in \mathbb{R}$ is the noise variance. We take noisy sample observations to make the experiment more realistic. Moreover, we also wanted to highlight experimentally that, despite using noisy safety samples, our approach is robust enough to design non-convex safe sets online and ensure the system remains safe. If the quadrotor is closer to one of the obstacles, the product decreases, as a result reducing the safety metric. Note that, even though the obstacles are assumed to be convex, the final safe set constructed need not be convex. This is due to the noisy distance measurements observed and the posteriors being constructed online. The sampling distance is set to $\tau = 0.1$ and the hyperparameters are optimized by maximizing the log marginal likelihood using gradient methods \mbox{\cite{gp_textbook_Rasmussen2003}}. We use the same Gaussian CBF as \mbox{\eqref{eq:gcbf_experiment}} in scenario A to generate the posterior safe set online. The quadrotor starts in an initial safe set containing only the initial position, see Figure \ref{fig:gcbf_safeset_expansion}. The quadrotor collects safety samples $y$ with the corresponding state $\mathbf{x}$ along its trajectory. With the data being collected, the safety function $ h_{\mathrm{gp}} (\mathbf{x})$ and its associated safe set is constructed online using (\ref{eq:gcbf_experiment}). In regions where we have data, the safety belief is high and safety uncertainty is low. As more data is collected, the associated safe set expands. For unexplored regions in the state space, the safety uncertainty is high due to the high posterior variance. This aligns with the intuition that safety is not known with high confidence in unexplored spaces. \begin{figure}[!t] \centering \vspace{0.1cm} \includegraphics[width=0.85\linewidth]{images/gcbf_safeset_expansion.pdf} \vspace{-0.1cm} \caption{As more samples are collected, the safe set can expand arbitrarily and is not confined to a convex expansion. The contour plots are shown for the two data sample sets. The $0$-level set for $15$ samples is shown with bold white line and for $31$ samples with black dashed line.} \label{fig:gcbf_safeset_expansion} \end{figure} \begin{figure}[!t] \centering \includegraphics[width=0.85\linewidth]{images/gcbf_safeset_expansion_200_samples.pdf} \vspace{-0.2cm} \caption{The contour plot for the Gaussian CBF with over $300$ samples collected is shown. After exploring the state space, we see that the obstacles are located in the $0$-sublevel sets. For the collected data set, the $0$-level set is depicted with black dashed line.} \label{fig:gcbf_safeset_expansion_200_samples} \vspace{-0.3cm} \end{figure} \begin{figure}[!t] \centering \includegraphics[width=0.9\linewidth]{images/gcbf_complete_safety_map.pdf} \caption{Final safe set of $ h_{\mathrm{gp}} (\mathbf{x})$ for the hardware experiment with over $300$ samples collected during the exploration process.} \label{fig:gcbf_complete_safety_map} \vspace{-0.4cm} \end{figure} \begin{figure}[!b] \centering \vspace{-0.3cm} \includegraphics[width=1\linewidth]{images/cbf_safety_map_noisy_experiment.pdf} \includegraphics[width=1\linewidth]{images/gcbf_safety_map_noisy_experiment.pdf} \caption{Safe sets of CBF $h_{\mathrm{cbf}}(\mathbf{x})$ (top) and Gaussian CBF $ h_{\mathrm{gp}} (\mathbf{x})$ (bottom) computed by taking $100$ samples ($\bullet$) from $h_{\mathrm{cbf}}$.} \label{fig:gcbf_safety_map_noisy_experiment} \vspace{-0.2cm} \end{figure} \begin{figure}[!t] \centering \vspace{-0.2cm} \includegraphics[width=0.9\linewidth]{images/hardware_noisy015_cbf_exp1.pdf} \includegraphics[width=0.9\linewidth]{images/hardware_noisy025_cbf_exp1.pdf} \includegraphics[width=0.9\linewidth]{images/hardware_noisy04_cbf_exp1.pdf} \vspace{-0.1cm} \caption{The quadrotor goes outside the boundary of the safe set $R = 0.35$ in presence of noise for CBF. The quadrotor trajectory is shown using ground truth position. The plot of $h_{\mathrm{cbf}}(t)$ using ground truth position data shows that the safety constraint is violated in the presence of noise.} \label{fig:hardware_noisy04_cbf_exp1} \end{figure} \begin{figure}[!t] \centering \vspace{-0.2cm} \includegraphics[width=0.9\linewidth]{images/hardware_noisy015_gcbf_exp1.pdf} \includegraphics[width=0.9\linewidth]{images/hardware_noisy025_gcbf_exp1.pdf} \includegraphics[width=0.9\linewidth]{images/hardware_noisy04_gcbf_exp1.pdf} \vspace{-0.1cm} \caption{The quadrotor does not go outside the circular boundary of $R = 0.35$ for Gaussian CBF because a more conservative safe set is modeled by $ h_{\mathrm{gp}} $. When looking at $ h_{\mathrm{gp}} (t)$ and $h_{\mathrm{cbf}}(t)$ on the ground truth position, the quadrotor is further away from the boundary of the safe set using $h_{\mathrm{cbf}}$. }\label{fig:hardware_noisy04_gcbf_exp1} \end{figure} As seen in Figure \ref{fig:gcbf_safeset_expansion}, we see two sets of data samples during the quadrotor's flight. Initially, the quadrotor explored a small region in the state space containing $15$ samples. The $0$-level set is shown in bold white. Then the quadrotor continues exploring the state space further, thus expanding the safe set. Notice that the expansion of the safe set is not limited to any convex expansion. The $0$-level set for the larger safe set of all $31$ samples collected thus far is marked with dashed black line in Figure \ref{fig:gcbf_safeset_expansion}. The exploration process continues, and the quadrotor is able to detect regions in the state space which are unsafe, particularly, when it gets closer to the obstacles. The safe set constructed after collecting more than $200$ samples is shown in Figure \ref{fig:gcbf_safeset_expansion_200_samples}. As seen in the figure, the obstacles are located in the $0$-sublevel sets which are also the unsafe regions. The final safety map for the Gaussian CBF using (\ref{eq:gcbf}) is shown in Figure \ref{fig:gcbf_complete_safety_map}. \subsection{Scenario C : Safe Control in presence of noisy state} For the final experiment, we consider the problem of safe constrained control in the presence of noisy position states. In many practical applications, measurement noise is a common occurrence which can degrade system performance and lead to unsafe consequences. This is a particularly hard problem because we consider noise for both the input and observations to the GPs. In our current scenario, this would be noise for the safety samples and the system query state, in particular, the position state of the quadrotor. The query state is given by $\underline{\x}_q := [ \mathbf{\underline{r}}^{\top} \ \mathbf{\dot{r}}^{\top} ]^{\top}$, where $\mathbf{\underline{r}} \sim \mathcal{N}(\mathbf{r}, \bm{\Sigma})$ is the Gaussian distributed noisy position state. We have observability of the noisy query state $\underline{\x}_q$ and assume knowledge of the noise covariance matrix $\bm{\Sigma}$ for the position states. The safety objective is to keep the quadrotor inside a circle of radius $D$. We first construct a standard CBF using the following candidate function, \begin{align*} h_{\mathrm{cbf}} := D^2 - x^2 - y^2, \end{align*} where $D = 0.35$ is the safety boundary radius. Next, $100$ samples are sampled randomly with Gaussian noise from this candidate CBF, $y = \mathcal{N}(h_\mathrm{cbf}, 0.03)$. The posterior GP is then computed, along with hyperparameter optimization, using \eqref{eq:gcbf_experiment} from this dataset which forms the Gaussian CBF. Both the CBFs as well as safety samples are shown in Figure \ref{fig:gcbf_safety_map_noisy_experiment}. In this scenario we choose $\tau = 0$, since the safe sets are fixed and require no online sampling. We perform $3$ separate experiments on the quadrotor for the standard CBF using different values for the noisy position states. The different noise covariance values in the experiments are $\bm{\Sigma} = [ 0.015, \ 0.025 ,\ 0.04] \mathbf{I}_3 \in \mathbb{R}^{3 \times 3}$. For each experiment in Figure \ref{fig:hardware_noisy04_cbf_exp1}, the quadrotor starts inside the safe set and then violates safety at the boundary when subjected to noisy position states. As the value of the noise increases, the quadrotor exhibits more violation of the safety constraint by going outside the safety boundary radius. Since CBFs rectify the control input pointwise and do not account for any measurement noise in its formulation, measurement noise in the position states degrades the safety performance. For each experiment, the temporal behavior of $h_{\mathrm{cbf}}(t)$ verifies that the safety constraint is violated due to the negative values. We next look at the experiments using Gaussian CBFs for the same values of noise covariance used above. In Figure \ref{fig:hardware_noisy04_gcbf_exp1}, we see that for every experiment, the quadrotor remains confined within a more conservative safe set, which is inside the primary safety boundary radius. This occurs because in the presence of noisy input (query) to the GPs, the posterior mean uses a more conservative weighted kernel $\mathbf{q}$ in \eqref{eq:gcbf_noisy}, whose entries $q_i$ have coefficients lesser than the coefficients of the SE kernel. The coefficient of an entry $q_i$ given by $\sigma_f^2 | \ \bm{\Sigma} \mathbf{L}^{-2} + \mathbf{I}_n \ |^{\frac{1}{2}}$ is always lesser than $\sigma_f^2$ since the eigenvalues of $\bm{\Sigma} \mathbf{L}^{-2} + \mathbf{I}_n$ are always greater than $1$ ($ \bm{\Sigma} \mathbf{L}^{-2} $ is a positive definite matrix added to the identity matrix). Therefore, the determinant is always positive and greater than unity. Intuitively, this makes sense since the GP posterior distribution is not overfitting to the noisy input query states, thus leading to a more conservative posterior estimation. We also plot $h_{\mathrm{cbf}}$ as a function of time using the trajectory of the quadrotor rectified under $ h_{\mathrm{gp}} $. The quadrotor does not get close to the circular boundary, since it is constrained conservatively by $ h_{\mathrm{gp}} $, thus ensuring that the original safety requirement is met. Indeed, if the noise becomes very large, then the safe set may not exist under $ h_{\mathrm{gp}} $. Determining the bounds on the measurement noise is currently outside the scope of this study and is left for future investigation. Here, we are primarily interested in achieving safe control in the presence of noisy query states with nonempty compact safe sets. \subsection{Note on Complexity} GPs are known to scale cubically with data i.e., $\mathcal{O}(N^3)$, where $N$ is the number of datapoints. This complexity arises due to the inverse operation in (\ref{eq:gcbf}) for the covariance matrix $\mathbf{ \overline{K} }$. As the number of data points increases, this could potentially cause a computational bottleneck. We address this with the help of rank-$1$ inverse method. For example, given $500$ samples, it only takes $25 \si{\ms}$ to synthesize the Gaussian CBF. Thereafter, we handle more datapoints by performing rank-$1$ inverse approximations giving tremendous boost in computational speed. For every new data point included, it only takes $4 \si{\ms}$ to compute the inverse covariance matrix. \section{CONCLUSION}\label{sec:conclusion} In this study, we proposed a framework for the synthesis of a safety function in a data-driven manner using GPs. The formulation requires safety samples as opposed to the traditional requirement of a smooth function. The newly formulated CBF called the Gaussian CBF was constructed by using a flexible GP prior. GPs provide the posterior mean and variance which serve as analogues for safety belief and uncertainty in our methodology. By exploiting the kernel properties in the posterior mean and variance, we were able to analytically compute the associated Lie derivatives. The Lie derivatives served as constraints in formulating a QP for rectifying the given nominal control input. We empirically verified our framework on a hardware quadrotor platform without risking any expensive system failures. We verify our approach on three different scenarios. The objective in each experiment was to synthesize a candidate safety function using GPs. We successfully show safe control for arbitrary safe sets synthesized using Gaussian CBFs, online synthesis of a Gaussian CBF as more data is collected in a collision avoidance problem, and juxtapose a Gaussian CBF with a regular CBF for constrained control in the presence of noisy position states. The quadrotor always remained inside the safe sets associated with the synthesized Gaussian CBFs. As part of future work, we would like to delve deeper and develop Gaussian CBFs for stochastic settings as well, and compare against other CBF techniques. \section{ACKNOWLEDGEMENTS} This research was supported by the US National Science Foundation under Grant S\&AS:1723997. \bibliographystyle{ieeetr}
219d5975ab4c6e1c1685b80782cfc96e33f849de
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} In the last few years, multi-speaker text-to-speech (TTS) models have been proposed that can create entirely new high-quality voices \cite{jia2018transfer, stanton2021speaker}. While these approaches can generate unique voices that are distinct from voices seen during training, it is unclear how to create a personalized voice that fits one's own mental representation. The existence of such a tool would open the door to numerous creative and practical applications, such as developing customized voices for robots, personalized speech assistants, bringing fictional characters or paintings to life, or developing individualized voices for speech-impaired people. A large body of psychological research has shown that people actively make inferences about faces, including the personality, age, or background of the person \cite{jack2015review, sofer2014trustworthiness, ekman1992emotions, angulu2018age, walker2016personality}. Since the relation between face and voice is complex, we use humans-in-the-loop to find voices in the speaker latent space of a trained TTS model that match their perception of faces in photographs, art portraits, and cartoons. Despite the fact that this approach is not automated and relies on expensive human judgments, subjective evaluations from an independent group of human raters confirm that the created voices accurately match the faces. \section{Background} Previous human-in-the-loop approaches have shown that humans can iteratively build feature representations for personalizing sound and speech. For example, Ritschel et al. \cite{ritschel2019personalized} used an interactive evolutionary algorithm to allow users to create sounds that express intentions and emotions for a social robot. Van Rijn et al. \cite{vanrijn2021exploring} used an adaptive method to sample from latent semantic human representations \cite{harrison2020gsp} to find prototypes of emotional speech by adapting the latent representation of a GST Tacotron model \cite{wang2018style}. In the past years, various approaches have been proposed to create novel voices. Jia et al. \cite{jia2018transfer} demonstrated that an independently trained speaker encoder network trained on a speaker verification task can produce useful conditioning for a multi-speaker text-to-speech model. By sampling random points from the obtained speaker embedding space, the authors generated fictitious voices that were not seen during the training. Another approach was proposed by Stanton et al. \cite{stanton2021speaker} that does not rely on transfer learning from the speaker verification task, but jointly learns a distribution over speaker embeddings, also allowing for sampling a novel voice. However, all of these papers focus on speaker generation, but not on speaker personalization. To our knowledge, this is the first paper using speaker generation models for voice personalization. In the present paper, we adopt the method proposed by Jia et al. \cite{jia2018transfer} and used embeddings from a speaker verification network as speaker representation: because they can be trained on noisy speech of thousands of speakers, do not require transcripts, can extract speaker embeddings for unseen voices, and the obtained voice prototypes can be reused in future models if trained on the same pretrained speaker verification network. While this work use this particular state-of-the-art architecture for voice synthesis (Figure \ref{fig1}A), our human-sampling approach (Figure \ref{fig1}B) can be extended to work with a large class of speaker generation models so that they can be used for voice personalization. \begin{figure*}[ht!] \centering \includegraphics{figures/figure_1.pdf} \caption{Overview. (A) The architecture used in this paper is a modified version of the VITS model using SpeakerNet ($\theta_\mathrm{spk}$) and GST embeddings ($\theta_\mathrm{gst}$). $z_q$ is the posterior latent sequence for a speech sample. (B) Participants move a slider adjusting a single dimension of the voice. The same slider is presented to three participants. The mean answer is passed to the next iteration. This allows us to gradually optimize the voice which fits to a face over the course of iterations. (C) Image materials. Images are extracted for all speakers in the RAVDESS corpus. We use deep-learning style transfer to convert the images to cartoons and paintings.} \label{fig1} \end{figure*} \section{Methods} \subsection{TTS Architecture} Here, we use the state-of-the-art TTS model VITS \cite{kim2021conditional}, consisting of the following components: (i) text frontend composed of text normalization followed by a grapheme-to-phoneme model utilizing IPA characters (International Phonetic Alphabet) \cite{bernard2021phonemizer}, (ii) transformer-based Text Encoder with a projection layer used to construct prior distribution, (iii) Normalizing Flow greatly improving the flexibility of prior latent space, (iv) convolutional Posterior Encoder producing $z_q$, (v) Monotonic Alignment Search (MAS) and Stochastic Duration Predictor (SDP) modules learning to align input characters to encoded spectrogram frames, (vi) high-fidelity GAN vocoder based on the HiFi-GAN \cite{jungil2020hifigan} architecture. We extend VITS by two additional components described below: SpeakerNet and GST. We use the pretrained speaker verification network SpeakerNet-M \cite{koluguri2020speakernet} as speaker embeddings. The model was trained on 7,205 speakers and has a satisfactory trade-off between the quality on a speaker recognition task and a small computational footprint. We furthermore found that SpeakerNet mainly encoded voice pitch and timbre information and not prosody. In order to learn prosodic variation, we extend our model with a bank of Global Style Tokens (GST) \cite{wang2018style}, which extracts style embeddings from encoded spectrogram frames. We initialized 16 Global Style Tokens with 8 attention heads and the resulting embedding size was set to 256. For the GST encoder, an 8-layer convolutional network was used with the same architecture as the Posterior Encoder. During training, the speaker and style embedding were separately L2-normalized and concatenated. During the experiments, we use the same zero embedding to keep prosody approximately constant across samples. To prevent the GSTs from learning speaker-dependent features in presence of SpeakerNet embeddings, an additional adversarial loss is proposed as follows. Alongside discriminators, a separate shallow feed-forward neural network is trained to reconstruct the speaker embeddings from extracted style embeddings. During the discriminator step, this network minimizes a cosine distance between real and reconstructed speaker embeddings using cosine embedding loss: $(1-\mathrm{cos}(x,\hat{x}))$. Conversely, during the generator step, the style extractor is penalized if this network succeeded in reconstructing speaker embeddings -- the loss function is then: $(\mathrm{max}(0,\mathrm{cos}(x,\hat{x})))$. The overview of the architecture is depicted in Figure \ref{fig1}A. We applied transfer learning from the publicly available VCTK checkpoint \cite{vits} and the training was continued using two NVIDIA V100 GPUs. For the first 400k iterations only the discriminators were allowed to train due to the lack of a published discriminator checkpoint, then normal training continued for additional 2M iterations with learning rate lowered to 1e-4. \begin{figure*}[ht!] \centering \includegraphics{figures/figure_2_comp.pdf} \caption{Results. (A) Final speaker profiles on mean values for F0 and MFCC1--4. The shaded areas in all plots refer to 95\% confidence intervals. (B) Example profiles for speaker 8 at different iterations. (C) The Euclidean distance between consecutive iterations is larger for earlier iterations compared to later iterations. (D) The Euclidean distance to the original reference drops over the first ten dimensions and slightly increases and decreases. (E) The mean opinion score increases over the course of iterations. } \label{fig2} \end{figure*} \subsection{Gibbs Sampling with People} `Gibbs Sampling with People' (GSP) is an adaptive technique \cite{harrison2020gsp}, where many participants collaborate to navigate a stimulus space and identify regions associated with a given semantic concept, in our case optimize voice parameters so that they match a target face animation. The participants' responses are organized into sequences of iterations called ``chains''. In each trial, the participant is presented with a stimulus (a synthesized voice) and a slider, where the slider is coupled to a particular dimension of the stimulus space that changes from trial to trial. The participant is instructed to move the slider to find the stimulus most associated with the target face. In our implementation, three different participants contribute trials for a given iteration in a given chain, and their responses are averaged. The resulting stimulus (based on the average response) is then passed along the chain of participants, with each successive generation of participants optimizing a different dimension of the stimulus (Figure 1B). This procedure is repeated multiple times, cycling through each of the dimensions of the sample space. Harrison et al. (\cite{harrison2020gsp}) demonstrated that the emergent process corresponds to a Gibbs sampler that maps the relationship between the target face and the participants' internalized representations of the corresponding voice parameters In the current experiment, participants change the first ten principal components of the SpeakerNet embeddings. Initial piloting suggested that these principal components had the desired property of intuitive interpretability (e.g., PC2 has a strong gender effect), and prior research with related models suggested that 10 principal components should be enough to achieve meaningful control over the stimuli \cite{harrison2020gsp}. The principal components were computed on SpeakerNet embeddings extracted on a single utterance of the 45,825 speakers present in the train, dev, and test partitions of the English CommonVoice dataset \cite{commonvoice} and account for 25.4 \% of the variance. The participants are prompted to adjust a slider that corresponds to one principal component to make the voice maximally similar to a face (see Figure \ref{fig1}C for some of the faces). For practical reasons, every slider contains a finite resolution of 31 equally-spaced slider positions. As opposed to using static images, we use Wav2Lip \cite{prajwal2020wav2lip} to synchronize the lips to the voice so that the resulting stimulus looks more natural (see supplementary materials). \section{Materials} \subsection{Stimuli} In order to compare the personalized voice with ground truth, we extracted stills and speaker embeddings from recordings of real speakers. It was important to use speakers who are unknown to the participants because this might constrain possible voices attributed to the face. We used the same neutral utterance of all 24 speakers in the RAVDESS corpus \cite{livingstone2018ravdess}. To demonstrate our approach does not only work for real faces, but also for fictional characters, we created for each original image four fictional characters based on style transfer. We used toonify \cite{pinkey2020toonify} and three additional art portrait styles from Ai Gahaku\cite{ai_gahaku}: OR, EX3, and ROO or P00 (see example in figure 1C). We selected the images in the following way. We start by creating 12 art portraits and one toonified version and then select four styles with the highest perceptual similarity to the real photo \cite{zhang2018perceptual} (see Figure \ref{fig1}C). Thus, we select toonify, OR, and EX3 styles, but in 22 of 24 cases we select R00 and in all other cases we select P00. For all 24 speakers, we use the extracted images and four styles with the highest perceptual similarity totaling 120 chains. To each chain, we randomly assign one of the 720 phonetically balanced and semantically neutral Harvard sentences \cite{harvardsentences}. \subsection{Participants} All participants were recruited from Amazon Mechanical Turk (AMT) and provided informed consent in accordance with the Max Planck Society Ethics Council approved protocol (application 2021\_42). Participants were paid \$9/hour. Requirements for participation include a minimum age of 18 years, 99\% or higher approval rate on at least 5,000 previous tasks on AMT, residency in the US, and wearing headphones \cite{woods2017headphone}. Participant recruitment was managed by PsyNet \cite{harrison2020gsp}, an under-development framework for implementing complex experimental paradigms. This framework builds on the Dallinger platform \cite{dallinger} for experiment hosting and deployment. \begin{figure*}[ht!] \centering \includegraphics{figures/figure_3.pdf} \caption{Gender difference. (A) Generated speaker embeddings in MDS space in which voices for male and female pictures occupy increasingly distinct areas in the voice latent space. Each row represents two iterations, read from left to right, top to bottom. (B) The pitch strongly increases for female faces and is lowered for male faces in the first ten iterations. The solid background reflects common pitch ranges for the sexes. Extracted F0 is expressed in Hz. (C) In the final iterations, the difference in the generated voice is smaller within the different styles of the same face (purple), compared to a random same-sex (green) or different-sex face (yellow).} \label{fig3} \end{figure*} \section{Results and discussion} \subsection{Main experiment} 180 US participants (69 female, 3 prefer not to say, 68 male) engaged in the main experiment. The age ranged from 19 to 78 years old (\textit{M} = 41, \textit{SD} = 12). We terminated the experiment after 48 hours, after which 99 out of the 120 chains were full (22 iterations). In the last iteration, we obtain unique profiles for all 24 speakers (Figure \ref{fig2}A) and while each voice is randomly initialized, the profiles rapidly develop towards the final prototypes (Figure \ref{fig2}B). Quantitatively, we show that the Euclidean distance between consecutive iterations within a chain decreases over the course of iterations (Figure \ref{fig2}C), stabilizing toward the final 15 iterations. This means that participants move the sliders to a lesser extent at later iterations, suggesting convergence. We also compared the created speaker embedding at each iteration with the original speaker embedding of the real speaker. As we can see in Figure \ref{fig2}D, the difference to the reference is dropping for the first 10 iterations and then mildly increases and decreases again. \subsection{Validation} In a separate validation experiment, participants (\textit{N} = 110, 50 female, 1 prefer not to say, 59 male; age \textit{M} = 35, \textit{SD} = 10) rated how well the voice matches the moving face on a 5-point Mean Opinion Score (MOS): `Excellent', `Good', `Fair', `Poor', and `Bad match'. The validation included all stimuli generated in the first experiment, (overall 2,409 stimuli). Participants performed 200 ratings per experiment and consequently on average every stimulus was rated 9.1 times. As depicted in Figure \ref{fig2}E, the average MOS increases over the course of iterations for all styles. However, the increase is largest for the original faces moving from a 2.7 MOS at iteration 0 to a MOS of 4.0 (`Good match') in the later iterations (Wilcoxon rank sum test, \textit{Z} = .42, \textit{p} $<$ 0.001, Bonferroni-adjusted). The trend is followed by the cartoons (Wilcoxon rank sum test, \textit{Z} = .18, \textit{p} $<$ 0.001, Bonferroni-adjusted). For art portraits the improvement over iterations is smallest (Wilcoxon rank sum test, \textit{Z} = .16, \textit{p} $<$ 0.001, Bonferroni-adjusted). \subsection{Toward personalized voice characteristics} To further understand what kind of voice features were selected by the personalization process, we visualize the speaker latent space using Multi Dimensional Scaling on all voices created in the experiment. As shown in Figure \ref{fig3}A, over the course of iterations, male and female faces occupy increasingly distinct areas in the voice latent space. Furthermore, the average pitch starts at roughly the same point due to the random initialization of the voices and over the course of iterations is lowered for male and increased for female voices (Figure \ref{fig3}B). Voices for males and females converge in a pitch range common for the sex (85-155 and 165-255 Hz respectively) as indicated by the shaded areas \cite{fitch1970fundamental}. Based on these results, we can state that the speaker gender apparent from the face is well-recovered in the voice. However, do people only focus on gender or also on other characteristics of the face? In order to address this question, we run another analysis. Here, we compute the Euclidean difference between the voices created for different styles of the same speaker versus a random speaker of the same sex. Using bootstrapping (\textit{n} = 1,000) we show that the voice differences within the same speaker are significantly smaller compared to a voice of a random speaker of the same sex (Figure \ref{fig3}C). The results show that the voice prototypes can capture face-specific image features in addition to gender. \subsection{Limitations and outlook} Since the ratings plateau at a MOS of 4 (``good match'') there is still room for improving the match. A simple way to improve the model is to increase the dimension of the latent space and apply GSP to the style embeddings instead of fixing the prosody in all chains. Furthermore, applying neutral prosody to all stimuli can have a negative impact on intelligibility, amplified by the fact that participants should focus on the match between voice and face rather than intelligibility. For future work, we may also explore running iterations within the same participants and without aggregating multiple responses per iteration (see \cite{harrison2020gsp, vanrijn2021exploring} for an exploration of these options). Another possible modification is changing the interface so that there are more sliders per interaction. Another approach to disentangle prosody could be to initially obtain the speaker embeddings from a speaker verification network and at a later stage to learn them with the other components of the model. This initialization with speaker verification embeddings can be a reasonable starting point. In the present study, we used the first ten principal components computed on the SpeakerNet Embeddings, but future research can explore alternative parametrizations of the speaker latent space that potentially better align with human perception and might explain more variance. \section{Conclusion} In this paper, we presented a human-in-the-loop approach for generating speech personalized to a specific face. To this end, we used an embedding space of a speaker verification network as input to a state-of-the-art TTS model. The embeddings were modified collaboratively by the use of a GSP experiment in order to find a voice that is consistent with shown images of realistic faces, portraits, and cartoon-style faces. Our evaluation showed that over the course of our experiment, the MOS of the generated speech, representing the consistency between the speech and the shown faces, increased from 2.7 to 4.0. This indicates that our approach is promising for synthesizing highly personalized speech for a specific speaker's visual appearance. Taken together our results open up a vast range of creative and practical applications including personalized voices in audiobooks and games, personalized speech assistants, and individualized voices for people with speech-impairments. \section{Acknowledgments} This work has partially been funded by the European Union Horizon 2020 research and innovation programme, grant agreement 856879 (PRESENT). \clearpage \bibliographystyle{IEEEtran}
7c9d4652452102c817a247418ca3b6a644e93084
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction}\label{Sec:Introduction} Implementing time evolution operators under a large-scale Hamiltonian is one of the most important tasks in noisy intermediate-scale quantum (NISQ) devices \cite{Preskill2018-uo} and larger fault-tolerant quantum computers to exploit their computational power. The task is computationally hard for classical computers; despite the enormous effort toward its efficient computation, it generally takes resources that are exponential to the system size. On the other hand, quantum computers are capable of executing it in polynomial time \cite{Lloyd1996-ko}. It is also important for computing eigenvalues and eigenstates of a system on a quantum computer; the quantum phase estimation algorithm \cite{Yu_Kitaev1995-oi,Cleve1998-ou,nielsen2002quantum} uses controlled time evolution operators to generate them. Recent hardware with tens of qubits has realized its proof-of-principle demonstrations for systems such as Fermi-Hubbard models \cite{Arute2020-qr}, discrete time crystals \cite{Mi2021-dtc,Randall2021-ke}, and various equilibrium and nonequilibrium phenomena \cite{Smith2019-zz,Neill2021-jv,Zhu2021-ws}. \begin{figure}[t] \includegraphics[height=7.25cm, width=8.5cm]{Fig_LVQC.pdf} \caption{Overview of the local variational quantum compilation (LVQC) protocol. We optimize the cost functions for the compilation size $\tilde{L}$, determined by the Lieb-Robinson (LR) bound. For finite-ranged and short-ranged interacting cases, it typically gives $\tilde{L} \lesssim O(L^0)$ or $\tilde{L} \lesssim O(\log L)$. We can directly implement a large-scale time evolution operator with the optimal parameter $\theta_\mr{opt}$. LVQC can be completed by classical simulation with some approximation or NISQ devices, without implementing the target $\exp (-i H^{(L)} \tau)$ itself.} \label{fig:summary} \end{figure} Trotterization is one of the simplest implementations, which has been extensively investigated theoretically \cite{Lloyd1996-ko,Abrams1997-jb,Sornborger1999-oq,Campbell2019-prl,Childs2019fasterquantum,Childs2021-trotter,Ouyang2020compilation} and employed in various experiments such as Refs. \cite{Arute2020-qr,Smith2019-zz,Zhu2021-ws,OMalley2016-dh,Lanyon2011-qo}. Despite recent developments, it may involve a huge number of gates when applied to a large scale problem with over 50 qubits. For example, Ref. \cite{Ouyang2020compilation} estimated that we need $10^{15}$-$10^{18}$ gates to perform time evolution of simple molecules. Even for the simpler Heisenberg model, it is estimated that $10^{6}$-$10^{7}$ elementary rotation gates are needed \cite{Childs2019fasterquantum}. These estimates are well beyond the reach of current quantum devices whose gate infildelities are on the order of $1$\%. Moreover, it is problematic even for an ideal fault-tolerant quantum computer because execution of $10^{15}$ gates would require years even if it can perform $10^8$ gates per second. It is therefore vital to develop methods that can compress the circuits for time evolution. The so-called qubitization technique \cite{Low2019-lf} has achieved an optimal scaling in the number of gates needed, but requires many ancilla qubits for its implementation (see e.g. Ref. \cite{Babbush2018-prx}). When focusing on algorithms that requires no or few ancilla qubits, Refs. \cite{Kokcu2021-on,Gulania2021-eu}, for example, have presented depth-compression methods for Trotter expansion based on some algebraic structures. Another promising approach is to use the framework of variational quantum algorithms \cite{cerezo2021variational}. They are exemplified by variational quantum simulation \cite{Li2017-ht,Yuan2019-kq,Heya2019-xp,Endo2020-mp,Benedetti2021-lt,Lin2021-vp,Berthusen2021-qv}, and quantum compilations employing variational quantum diagonalization \cite{Cirstoiu2020-kk,Commeau2020-tf,Gibbs2021-mu}. Among other methods, quantum-assisted quantum compiling (QAQC) \cite{Khatri2019-gj,Sharma2020-re} and its variant \cite{bilek2022recursive} are one of the promising ways to obtain approximate time evolution operators with compressed circuit depth. It uses a variational quantum circuit $V$ to approximate a target unitary $U$. Importantly, they employed a local cost function instead of the naive global fidelity measure $\Tr(U^\dagger V)$ to avoid the barren plateau problem. While QAQC is available for generic target unitary gate $U$ on $L$ qubits, it seems to be problematic for depth compression that the target $U$ itself should be accurately implemented on quantum circuits. In this paper, we develop a local variational quantum compilation (LVQC) protocol to search an accurate and efficient quantum circuit for constructing a large-scale local Hamiltonian dynamics with limited-size quantum devices or possibly with classical simulation of such limited-size quantum circuits. To formulate the protocol, we focus on Lieb-Robinson (LR) bound \cite{Lieb1972-uo}, which dictates that the dynamics under a local Hamiltonian has approximate causal cones. We compose of subsystem cost functions for every subsystem which measure the local difference between the target unitary gate and the ansatz. Exploiting the LR bound, we rigorously derive their scaling, which is validated when the subsystem size is as large as the approximate causal cone. These results lead to our LVQC protocol as described in Fig. \ref{fig:summary}; we optimize a local-compilation cost function, corresponding to the average of the subsystem cost functions over subsystems. This cost function can be computed with a at-most $2\tilde{L}$-qubit quantum device or a corresponding classical simulator, where $\tilde{L}$ ($<L$: system size) denotes the scale of the causal cone size. Finally, we construct a quantum circuit that approximates the target time evolution operator for the system size $L$ based on the resulting optimal parameters. We also conduct classical numerical demonstration of LVQC to compress the depth of the ideal time evolution operators. We adopt a one-dimensional Heisenberg model, and optimize the cost function for subsystems by approximately computing it with time-evolving block decimation (TEBD) \cite{Vidal2003-eb,Vidal2004-oa}. We successfully compose of a $5$-depth time evolution operator for $40$ qubits by the local compilation for $20$-qubit systems. This achieves the average gate fidelity $0.9977$, which is much better than that of the same-depth Trotter decomposition, $0.8580$. In addition, by computing the stroboscopic dynamics of ferromagnetic states with local excitations or domain walls, the optimal ansatz obtained by LVQC reproduces the dynamics with size- and time-scales twice and ten times as large as those used in the compilation, respectively. We emphasize some advantages of LVQC. First, it requires at-most $2 \tilde{L}$-qubit quantum devices as large as the causal cone size, which is comparably smaller than the whole-system size $L$. There is no need for preparing the ideal target unitary gate for the size $L$ during our protocol. Second, our formulation relies only on the existence of the LR bounds. LVQC is available for broad systems involving finite-ranged, short-ranged, and long-ranged interactions in generic dimension, with the help of the recent developments in the LR bound \cite{Robinson1976-wd,Nachtergaele2006-ok,Nachtergaele2006-il,Hastings2006-ob,Foss-Feig2015-ca,Matsuta2017-mf,Else2020-tr,Kuwahara2020-se,Tran2021-pv}. We expect that LVQC can be applied for executing large-scale time evolution operators in the following ways; \begin{enumerate} \item Classical local compilation with approximations \\ \& Quantum execution in NISQ or larger systems \item Quantum local compilation by NISQ devices \\ \& Quantum execution in larger quantum devices \end{enumerate} The first case is exemplified by our numerical results based on TEBD. LVQC ensures the small-size compilation sometimes accessible with classical simulators employing some approximations. In that case, we can classically compile time evolution operators without suffering noises and statistical errors, and can simulate large-scale quantum systems that are inaccessible only with classical simulators; long-time behaviors beyond the coherence time will be observed in recent programmable quantum simulators by the optimized time evolution operators. The second one is rather a long-term perspective. To simulate quantum materials with generic dimensions or interactions by NISQ devices or larger fault-tolerant quantum computers, the local-system size for the compilation will become at-least hundreds or thousands of qubits. This is just suitable for NISQ devices in the near future, and hence our results will contribute to bridging the gap between NISQ devices and larger-scale quantum computers. The rest of this paper is organized as follows. In Sec. \ref{Sec:Preliminaries}, we introduce QAQC and the LR bound as the preliminaries for our results. We devote Sec. \ref{Sec:Scalablity_of_cost}, Sec. \ref{Sec:Local_compilation} and Sec. \ref{Sec:Numerical} to provide the main results. In Sec. \ref{Sec:Scalablity_of_cost}, we introduce the subsystem cost function from the local cost functions of QAQC, and rigorously prove its scaling property by the LR bounds. In Sec. \ref{Sec:Local_compilation}, we formulate the LVQC protocols respectively for translationally-invariant systems and other generic systems. The above scaling yields the local compilation of a large-scale Hamiltonian dynamics for both cases, while the protocol is simplified in the former case. Finally, we show its numerical verification in Sec. \ref{Sec:Numerical} and conclude this paper in Sec. \ref{Sec:Discussion}. \section{Preliminaries}\label{Sec:Preliminaries} \begin{figure}[t] \includegraphics[height=5.5cm, width=8.5cm]{Fig_Preli.pdf} \caption{Schematic picture of the way to compute the global and the local cost functions. In each figure, applying a Bell pair $\ket{\Phi_+}_{A_j B_j}$ indicates taking contractions on the $j$-th pair $A_j$ and $B_j$, which we represent by the red solid lines. (a) Schematic picture of $\mr{Tr}[\Pi_1 \hdots \Pi_L \rho_{AB}(U,V)]$, which gives the global cost function $C_\mr{HST}$ via Eq. (\ref{Eq:Cost_HST}). (b) Schematic picture of $\mr{Tr}[\Pi_j \rho_{AB}(U,V)]$, which gives the local cost function $C_\mr{LHST}$ via Eq. (\ref{Eq:Cost_LHST_j}).} \label{fig:preliminary} \end{figure} In this section, we review some preliminary studies in order to derive our results on LVQC for a large-scale Hamiltonian dynamics. \subsection{Quantum-assisted quantum compiling (QAQC)}\label{Subsec:QAQC} Quantum-assisted quantum compiling (QAQC) \cite{Khatri2019-gj} is a quantum-classical hybrid algorithm to obtain a variational quantum circuit $V(\theta)$ with parameters $\theta$, which approximates a target unitary operator $U$. They have introduced several cost functions $C(U,V)$, that should be minimized, to to obtain an optimal parameter $\theta_{\mathrm{opt}}$ such that $U \simeq V(\theta_\mr{opt})$. The cost functions $C(U,V)$ should satisfy the following properties; \begin{enumerate} \item (Computability) We can efficiently compute $C(U,V)$ with a quantum computer. \item (Faithfulness) $C(U,V)$ is always non-negative, and it becomes $0$ if and only if $U$ and $V$ are equivalent. \item (Operational meaning) $C(U,V)$ provides constraints on some operationally meaningful value. \end{enumerate} The first cost function is a global one defined by \begin{equation}\label{Eq:Cost_HST_Def} C_\mr{HST}(U,V) = 1 - \frac{1}{4^L} | \mr{Tr} [U^\dagger V] | ^2, \end{equation} when $U$ and $V$ are defined on an $L$-qubit lattice $\Lambda$. This can be measured by Hilbert-Schmidt Test (HST). In HST, we use an $2L$-qubit lattice $\Lambda_A \cup \Lambda_B$ (each of $\Lambda_A$ and $\Lambda_B$ is a copy of $\Lambda$), and initialize the state by the Bell state $\ket{\Phi_+}_{AB}$, defined by \begin{eqnarray} \ket{\Phi_+}_{AB} &=& \bigotimes_{j \in \Lambda} \ket{\Phi_+}_{A_j B_j}, \\ \ket{\Phi_+}_{A_j B_j} &=& \frac{1}{\sqrt{2}} (\ket{00}+\ket{11})_{A_j B_j}. \end{eqnarray} The state $\ket{\Phi_+}_{A_j B_j}$ represents the Bell pair of the $j$-th sites $A_j$ and $B_j$ respectively in $\Lambda_A$ and $\Lambda_B$. Then, we apply $U$ and $V^\ast$ respectively to the subsystems $A$ and $B$, resulting in the state \begin{equation} \rho_{AB}(U,V) = (U_A \otimes V^\ast_B) \ket{\Phi_+}_{AB}\bra{\Phi_+}_{AB} (U_A \otimes V^\ast_B)^\dagger, \end{equation} and perform the Bell measurements for every $j$-th pair $A_j$ and $B_j$. It is equivalent to measure $\Pi_1 \Pi_2 \hdots \Pi_L$, where $\Pi_j$ is defined by \begin{equation} \Pi_j = \ket{\Phi_+}_{A_j B_j} \bra{\Phi_+}_{A_j B_j}. \end{equation} Finally, since Eq. (\ref{Eq:Cost_HST_Def}) can be rewritten as \begin{equation}\label{Eq:Cost_HST} C_\mr{HST}(U,V) = 1 - \mr{Tr} [\Pi_1 \Pi_2 \hdots \Pi_L \rho_{AB}(U,V)], \end{equation} we can efficiently compute $C_\mr{HST}(U,V)$ with a $2L$-qubit quantum device. The term $\mr{Tr} [\Pi_1 \Pi_2 \hdots \Pi_L \rho_{AB}(U,V)]$ is schematically depicted by Fig. \ref{fig:preliminary} (a). The cost function $C_\mr{HST}(U,V)$ is faithful in that it satisfies $0 \leq C_\mr{HST}(U,V) \leq 1$ and that it becomes $0$ if and only if there exists $\varphi \in \mathbb{R}$ such that $U=e^{i \varphi} V$. The second one is a local cost function defined by \begin{equation}\label{Eq:Cost_LHST} C_\mr{LHST}(U,V) = \frac{1}{L} \sum_{j=1}^L C_\mr{LHST}^{(j)}(U,V), \end{equation} where each term is given by \begin{equation}\label{Eq:Cost_LHST_j} C_\mr{LHST}^{(j)}(U,V) = 1 - \mr{Tr} [\Pi_j \rho_\mr{AB}(U,V)], \end{equation} for $j=1,2,\hdots,L$. They satisfy $0 \leq C_\mr{LHST}(U,V) \leq 1$ and $0 \leq C_\mr{LHST}^{(j)}(U,V) \leq 1$ by their definitions. We can compute them on a $2L$-qubit quantum device by Local Hilbert-Schmidt Test (LHST), in which we perform Bell measurement of the $j$-th pair $A_j$ and $B_j$ on the state $\rho_{AB}(U,V)$ for $C_\mr{LHST}^{(j)}(U,V)$ and take its average for $ C_\mr{LHST}(U,V)$. The term $\mr{Tr} [\Pi_j \rho_\mr{AB}(U,V)]$ is described by Fig. \ref{fig:preliminary} (b). In terms of faithfulness, $ C_\mr{LHST}^{(j)}(U,V)$ satisfies the following property, \begin{eqnarray} && C_\mr{LHST}^{(j)}(U,V) = 0 \quad \text{if and only if} \nonumber \\ && \quad \text{$\,^\exists \varphi \in \mathbb{R}$, $\,^\exists W$: unitary, s.t. $UV^\dagger = e^{i \varphi} I_{\{j\} } \otimes W$}, \label{Eq:LHST_zero_condition} \end{eqnarray} where $I_{\{j\}}$ denotes the identity operator acting on $j$-th qubit. This indicates that the action of $U$ corresponds to that of $V$ on the $j$-th site. Thus, the cost function $ C_\mr{LHST}(U,V)$ becomes $0$ if and only if there exists $\varphi \in \mathbb{R}$ such that $U=e^{i \varphi} V$. In QAQC in Ref. \cite{Khatri2019-gj}, the authors employ either or the combined cost function \begin{equation} C_\alpha(U,V) = \alpha C_\mr{HST}(U,V) + (1-\alpha) C_\mr{LHST}(U,V), \end{equation} with $0 \leq \alpha \leq 1$. It is faithful, and possesses an operational meaning in terms of the average gate fidelity, defined by \begin{equation} \bar{F}(U,V) = \int_\psi |\braket{\psi | U^\dagger V | \psi}|^2 d \psi, \quad \text{$\psi$: Haar random state}. \end{equation} This indicates the expected fidelity between $U \ket{\psi}$ and $V\ket{\psi}$ averaged over a Haar random state $\ket{\psi}$, and it is bounded from below by the resulting cost functions as follows \cite{Horodecki1999-ws,Nielsen2002-ia,Khatri2019-gj}, \begin{eqnarray} \bar{F}(U,V) &=& 1 - \frac{2^{|\Lambda|}}{2^{|\Lambda|}+1} C_\mr{HST}(U,V), \label{Eq:operational_meaning_HST} \\ \bar{F}(U,V) &\geq& 1 - \frac{2^{|\Lambda|}}{2^{|\Lambda|}+1} \cdot |\Lambda| C_\mr{LHST} (U,V), \label{Eq:operational_meaning_LHST} \end{eqnarray} where $|\Lambda|$ denotes the number of sites in the lattice $\Lambda$. The cost functions of QAQC can be efficiently computed on a $2L$-qubit quantum device based on Eqs. (\ref{Eq:Cost_HST}) and (\ref{Eq:Cost_LHST_j}). Alternatively, we can nontrivially reduce the resource for cost evaluation to $L$ qubits by the following lemma, which we prove in Appendix \ref{Asec:LqubitLHST}. \begin{lemma}\label{Thm:LqubitLHST} $C_{\mathrm{HST}}(U,V)$ and $C_{\mathrm{LHST}}(U,V)$ for $L$-qubit unitaries $U$ and $V$ can be evaluated effciently within an additive error $\epsilon$ with $\mathcal{O}(1/\epsilon^2)$ runs of an $L$-qubit device. \end{lemma} \noindent It should be noted that the algorithm to achieve Lemma \ref{Thm:LqubitLHST} involves a Monte-Carlo sampling and induces increased (however constant) overhead compared to the case where we use $2L$ qubits. In any cases, the bottleneck of QAQC for compressing time evolution operators is to implement the target $U$ itself on at-least $L$-qubit quantum systems for cost evaluation. Our protocol can avoid this problem by compiling with smaller quantum systems with the size $\tilde{L}$, as large as the approximate causal cone by the LR bound, as discussed in Sec. \ref{Sec:Local_compilation}, \subsection{Lieb-Robinson bound}\label{Subsec:LiebRobinsonBound} Lieb-Robinson (LR) bound dictates that any local observable cannot spread out faster than a certain finite velocity (called Lieb-Robinson velocity) under a local Hamiltonian \cite{Lieb1972-uo}. This can be interpreted as the emergence of approximate causal cones in quantum mechanics. Let us describe it more precisely. We focus on a local Hamiltonian on a lattice $\Lambda$, given by \begin{equation}\label{Eq:Local_Hamiltonian} H = \sum_{X \subseteq \Lambda} h_X, \end{equation} where $h_X$ denotes a term nontrivially acting on a domain $X \subseteq \Lambda$. Let $\|\cdot\|$ denote the operator norm. Here, we assume \begin{enumerate} \item (Extensiveness) Local energy scale at every site is bounded by a finite value $g$; \begin{equation}\label{Eq:Extensiveness} \sum_{X; X \ni j} \| h_X \| \leq g, \quad \text{for any $j \in \Lambda$}. \end{equation} \item (Locality of interactions) At-most $k$-body interactions are involved with $k=O(1)$; \begin{equation}\label{Eq:Locality} h_X = 0, \quad \text{if} \quad |X| > k. \end{equation} \item (Range of interactions) Interactions are finite-ranged with distance $d_H = O(1)$; \begin{equation}\label{Eq:Finite_range} h_X = 0, \quad \text{if $\,^\exists j, j^\prime \in X$ s.t. $\mr{dist}(j,j^\prime) > d_H$}. \end{equation} \end{enumerate} Let us consider local observables $O_j$ and $O_{j^\prime}$ acting on $j$ and $j^\prime$ respectively, and assume that they are normalized as $\|O_j\|=\|O_{j^\prime}\|=1$. Then, the inequality, \begin{eqnarray} \| [U(\tau)^\dagger O_j U(\tau), O_{j^\prime}] \| &\leq& C e^{ - (\mr{dist}(j,j^\prime) - v \tau)/\xi }, \label{Eq:Lieb_Robinson_Bound} \\ U(\tau) &=& e^{-i H \tau}, \end{eqnarray} holds for a fixed time $\tau$. Here, the constant velocity $v$ and the constant length $\xi$ are determined only by the extensiveness $g$, the locality $k$, and the range $d_H$, while the constant $C$ depends on $\tau$ in addition ($C$ typically increases linearly in $\tau$ \cite{Lieb1972-uo}). This suggests that $U(\tau)^\dagger O_j U(\tau)$ approximately acts on the domain inside the approximate causal cone $\{ j^\prime \in \Lambda \, | \, \mr{dist}(j,j^\prime) \leq v\tau \}$, and that the components outside of it are exponentially suppressed in the distance from $j$. As a result, it can be expected that $U(\tau)^\dagger O_j U(\tau)$ is well reproduced by the local Hamiltonian inside the approximate causal cone. Let $H^{(L^\prime,j)}$ denote the local Hamiltonian composed of $h_X$ whose support $X$ has distance from $j$ smaller than $L^\prime/2$ [See Eqs. (\ref{Eq:Restricted_lattice}) and (\ref{Eq:Restricted_Hamiltonian}) for the exact definition]. In fact, we can derive the following inequality from the LR bound (See Ref. \cite{Else2020-tr} and Appendix \ref{Asec:Extension}); \begin{equation}\label{Eq:Def_epsilon_LR1} \| U(\tau)^\dagger O_j U(\tau) - e^{i H^{(L^\prime,j)} \tau} O_j e^{-i H^{(L^\prime,j)} \tau}\| \leq \varepsilon_\mr{LR}, \end{equation} \begin{equation}\label{Eq:Def_epsilon_LR2} \varepsilon_\mr{LR} = C^\prime \int_{L^\prime/2-d_H}^\infty e^{-(x-v\tau)/\xi} dx = e^{-O(l_0/\xi)}, \end{equation} where $l_0$ is defined by $L^\prime = 2(l_0+d_H+v\tau)$. The integration comes from the summation all over the lattice out of the approximate causal cone. This relation enables us to approximate the local cost function (\ref{Eq:Cost_LHST}) for a large size $L$ by that for the smaller size $L^\prime$ with an arbitrarily small error $e^{-O(l_0/\xi)}$ when $L^\prime$ is sufficiently large compared to $v\tau$. \section{Approximation of local cost functions by Lieb-Robinson bound}\label{Sec:Scalablity_of_cost} \begin{figure}[t] \includegraphics[height=4.2cm, width=8.5cm]{Fig_ansatz.pdf} \caption{The brickwork-structured ansatz $V^{(L)}(\theta)$, defined by Eq. (\ref{Eq:Ansatz}). For translationally-invariant systems, we choose the variational parameter set $\theta = \{ \theta_{i,k}, \theta_{i,k}^\prime \}_{i,k}$ so that $\theta_{i,k}$ and $\theta_{i,k}^\prime$ respectively become independent of the position $k$. The yellow region represents the $j$-centered $\tilde{L}$-size domain $\Lambda^{(\tilde{L},j)}$, which is utilized for composing of the restricted ansatz $V^{(\tilde{L},j)}(\theta)$ based on Eq. (\ref{Eq:restricted_ansatz}).} \label{fig:ansatz} \end{figure} In this section, we provide the first main result, where we compose of the subsystem cost functions and show their scaling property by the LR bound. The subsystem cost functions are obtained by the restriction of systems to smaller subsystems for the local cost function $C_\mr{LHST}$. We clarify the approximate causal cone from the LR bound and the exact causal cone from the ansatz in the local cost functions. They lead to two formulas, which are respectively raised as Propositions \ref{Prop:Result1} and \ref{Prop:Result2} below. As a result, we obtain how the error between the subsystem cost functions and $C_\mr{LHST}$ scales in the subsystem size $\tilde{L}$, and validate the approximation of $C_\mr{LHST}$ by the subsystem cost functions with proper $\tilde{L}$. As we will see in Sec. \ref{Sec:Local_compilation}, these results enables the LVQC protocol for the whole-system Hamiltonian dynamics. First of all, we specify the setup and the notation. We consider a local and extensive Hamiltonian with finite-ranged interactions, $H$, on a lattice $\Lambda$ [See Eqs. (\ref{Eq:Extensiveness})-(\ref{Eq:Finite_range})]. Throughout the main text, we focus on an $L$-qubit one-dimensional system, as $\Lambda=\{1,2,\hdots, L \}$, but the extension to other cases is straightforward (See Appendix \ref{Asec:Extension}). We explicitly write the system size $L$ like $H^{(L)}$, and consider the target time evolution operator $U^{(L)}=\exp (-i H^{(L)} \tau)$. For simplicity, we employ a brickwork-structured ansatz with the depth $d$ in the form of \begin{equation}\label{Eq:Ansatz} V^{(L)} (\theta) = \prod_{i=1}^d \left[ \left(\prod_k V^{(2)}_{2k,2k+1}(\theta_{i,k})\right)\left(\prod_k V^{(2)}_{2k-1,2k}(\theta_{i,k}^\prime)\right)\right], \end{equation} as described in Fig. \ref{fig:ansatz}. Here, $V^{(2)}_{j,j^\prime}$ represents an arbitrary parametrized two-qubit gate on the neighboring sites $j$ and $j^\prime$, and the parameter set $\theta$ is composed of $\{ \theta_{i,k} \}_{i,k}$ and $\{ \theta_{i,k}^\prime \}_{i,k}$. Now, we derive two rigorous relations on the local cost function for each $j$-th site, $C_\mr{LHST}^{(j)}(U^{(L)}, V^{(L)})$, using the approximate causal cone from the LR bound and the exact causal cone from the locality of ansatz. The first one, coming from the LR bound, validates the evaluation of the cost function with a local Hamiltonian acting only on qubits around $j$-th cite. To be precise, when we define the $j$-centered $L^\prime$-size domain $\Lambda^{(L^\prime,j)}$ and the restricted Hamiltonian $H^{(L^\prime,j)}$ by \begin{eqnarray} \Lambda^{(L^\prime,j)} &=& \{ j^\prime \in \Lambda \, | \, |j-j^\prime| \leq L^\prime/2 \}, \label{Eq:Restricted_lattice} \\ H^{(L^\prime,j)} &=& \sum_{X; X \subseteq \Lambda^{(L^\prime,j)}} h_X, \label{Eq:Restricted_Hamiltonian} \end{eqnarray} for the $L$-qubit Hamiltonian $H^{(L)}=\sum_{X; X \subseteq \Lambda} h_X$, they are related to the local cost functions $C_\mr{LHST}^{(j)}(U^{(L)}, V^{(L)})$ by the following proposition. \begin{figure*} \begin{center} \includegraphics[height=4cm, width=18cm]{Fig_proof.pdf} \caption{(a) Diagrammatic description of $\mr{Tr}(\Pi_j \rho_{AB}(U^{(L^\prime,j)},V^{(L)}))$. This gives an approximate upper bound of the local cost function $C_\mr{LHST}^{(j)}(U^{(L)},V^{(L)})$ via Proposition \ref{Prop:Result1}. (b) A part of gates composing $\mr{Tr}(\Pi_j \rho_{AB}(U^{(L^\prime,j)},V^{(L)}))$, designated by the green region in (a). Only the orange two-qubit gates in $V^{(L)\dagger}$ are active while the other gray and white two-qubit gates vanish due to their positions out of the causal cones. (c) Schematic picture of the active region in the ansatz $V^{(L)}$. All the active two-qubit gates are included in the yellow domain. Its height determines the proper compilation size $\tilde{L}$. } \label{fig:proof} \end{center} \end{figure*} \begin{proposition}\label{Prop:Result1} Let the restriction size $L^\prime$ be chosen by \begin{equation} L^\prime = 2(l_0+d_H+v\tau), \end{equation} with a tunable parameter $l_0$, the range of the Hamiltonian $d_H$, and the LR velocity $v$. Then, the time evolution operator under the restricted Hamiltonian, defined by \begin{equation}\label{Eq:restricted_U} U^{(L^\prime,j)}=e^{-i H^{(L^\prime,j)} \tau} \otimes I_{\Lambda \backslash \Lambda_{L^\prime,j}}, \end{equation} provides the following inequality, \begin{equation}\label{Eq:Result1} C_{\mr{LHST}}^{(j)} (U^{(L)}, V^{(L)}) \leq C_{\mr{LHST}}^{(j)} (U^{(L^\prime,j)}, V^{(L)}) + \frac{3}{4} \varepsilon_{\mr{LR}}. \end{equation} Here, the term $\varepsilon_\mr{LR}$ is defined by Eqs. (\ref{Eq:Def_epsilon_LR1}) and (\ref{Eq:Def_epsilon_LR2}), and it is exponentially small in the tunable parameter $l_0$ as $\varepsilon_\mr{LR}=e^{-O(l_0/\xi)}$. \end{proposition} \textit{Proof.}--- From the definition Eq. (\ref{Eq:Cost_LHST_j}), we obtain \begin{eqnarray} && |C_{\mr{LHST}}^{(j)} (U^{(L)}, V^{(L)})- C_{\mr{LHST}}^{(j)} (U^{(L^\prime,j)}, V^{(L)})| \nonumber \\ &\quad& = |\mr{Tr}[\Pi_j \{ \rho_{AB}(U^{(L)},V^{(L)}) - \rho_{AB}(U^{(L^\prime,j)},V^{(L)}) \}]| \nonumber \\ &\quad& = |\braket{\Phi_+ |(U_A^{(L)}\otimes V^{(L)\ast}_B)^\dagger \Pi_j (U_A^{(L)}\otimes V^{(L)\ast}_B) |\Phi_+}_{AB} \nonumber \\ &\quad& \quad - \braket{\Phi_+ |(U_A^{(L^\prime,j)}\otimes V^{(L)\ast}_B)^\dagger \Pi_j (U_A^{(L^\prime,j)}\otimes V^{(L)\ast}_B) |\Phi_+}_{AB} |. \nonumber \\ && \label{Eq:Proof1_A} \end{eqnarray} Considering that the projection to the Bell state is expanded by \begin{eqnarray} \Pi_j &=& (\ket{\Phi_+}\bra{\Phi_+})_{A_j B_j} \nonumber \\ &=& \frac{1}{4} (I_{A_j B_j}+X_{A_j}X_{B_j}-Y_{A_j}Y_{B_j}+Z_{A_j}Z_{B_j}), \label{Eq:Pi_j_decompose} \end{eqnarray} the right hand side of Eq. (\ref{Eq:Proof1_A}) is bounded by \begin{eqnarray} && \frac{1}{4} \sum_{O=X,Y,Z} \| U^{(L)\dagger}_A O_{A_j} U^{(L)}_A - U^{(L^\prime,j)\dagger}_A O_{A_j}U^{(L^\prime,j)}_A \| \nonumber \\ &\qquad& \qquad \qquad \qquad \times \| V^{(L) \mr{T}}_B O_{B_j} V^{(L)\ast}_B \| \braket{\Phi_+|\Phi_+}_{AB} \nonumber \\ &&\leq \frac{3}{4} \varepsilon_\mr{LR}. \end{eqnarray} The above inequality comes from Eq. (\ref{Eq:Def_epsilon_LR1}), the LR bound for the local observable. Finally, we obtain the relation \begin{equation} |C_{\mr{LHST}}^{(j)} (U^{(L)}, V^{(L)})- C_{\mr{LHST}}^{(j)} (U^{(L^\prime,j)}, V^{(L)})| \leq \frac{3}{4} \varepsilon_\mr{LR}, \end{equation} which implies the inequality Eq. (\ref{Eq:Result1}). \hfill $\quad \square$ This proposition says that the restriction of the Hamiltonian to a smaller region hardly alters the local cost functions. The difference is bounded by the LR bound error $\varepsilon_{\mathrm{LR}}$. Equivalently, the diagram of Fig. \ref{fig:preliminary} (b), which gives $C_\mr{LHST}$, can be approximated by that of Fig. \ref{fig:proof} (a), which gives the restricted version. We note that this proof relies only on the existence of the LR bound, and hence Proposition \ref{Prop:Result1} is valid also for generic locally-interacting systems in any dimension. For one-dimensional systems with finite-ranged interactions, we have $\varepsilon_\mr{LR}=\exp(-O(l_0/\xi))$ with $L^\prime=2(l_0+d_H+v\tau)$ from Eq. (\ref{Eq:Def_epsilon_LR2}). Based on this proposition, we can accurately determine the upper bound of the local cost function $C_{\mr{LHST}}^{(j)} (U^{(L)}, V^{(L)})$ by evaluating $C_{\mr{LHST}}^{(j)} (U^{(L^\prime,j)}, V^{(L)})$. At this stage, however, measurement of the cost functions require $2L$-qubit quantum devices or $L$-qubit quantum devices with sampling due to the existence of $V^{(L)}$. To overcome this obstacle, we employ causal cones of the ansatz $V^{(L)}$ and show that $C_{\mr{LHST}}^{(j)} (U^{(L^\prime,j)}, V^{(L)})$ can be evaluated with smaller-size quantum devices without any approximation. For the $j$-centered $\tilde{L}$-site domain $\Lambda_{\tilde{L},j}$, let us define a restricted ansatz $ V^{(\tilde{L},j)}(\theta)$ by \begin{eqnarray} && V^{(\tilde{L},j)}(\theta) = \nonumber \\ && \prod_{i=1}^d \left[ \left(\prod_k \!^{(\tilde{L},j)} V^{(2)}_{2k,2k+1}(\theta_{i,k})\right)\left(\prod_k \!^{(\tilde{L},j)} V^{(2)}_{2k-1,2k}(\theta_{i,k}^\prime)\right)\right], \nonumber \\ && \label{Eq:restricted_ansatz} \end{eqnarray} from the $d$-depth ansatz $V^{(L)}(\theta)$ of Eq. (\ref{Eq:Ansatz}). Here, the symbols $\Pi_k^{(\tilde{L},j)}$ represent the product over $k$ such that the support of $V^{(2)}_{2k,2k+1}(\theta_{i,k})$ (for the first one) or $V^{(2)}_{2k-1,2k}(\theta_{i,k})$ (for the second one) is included in the domain $\Lambda_{\tilde{L},j}$ (See Fig. \ref{fig:ansatz}). Then, we obtain the following proposition. \begin{proposition}\label{Prop:Result2} We consider the same situation as that of Proposition \ref{Prop:Result1}. We assume $4d \geq L'$ for the $d$-depth $L$-site ansatz $V^{(L)}(\theta)$, and rewrite the depth as $d=L^\prime/4 + d^\prime$ ($d^\prime \geq 0$ is chosen so that $d$ becomes an integer). For $\tilde{L}$ satisfying $\tilde{L} \geq L^\prime + 2d^\prime + 1$, where the right hand side represents the size of the approximate causal cones, the $d$-depth $\tilde{L}$-site ansatz $V^{(\tilde{L},j)}(\theta)$ satisfies the following equality; \begin{equation}\label{Eq:Result2} C_{\mr{LHST}}^{(j)} (U^{(L^\prime,j)}, V^{(L)}) = C_{\mr{LHST}}^{(j)} (\tilde{U}^{(L^\prime,j)}, V^{(\tilde{L},j)}). \end{equation} Here, $\tilde{U}^{(L^\prime,j)}$ represents the restriction of $U^{(L^\prime,j)}$ to the domain $\Lambda_{\tilde{L},j}$, which is given by \begin{equation}\label{Eq:restricted_U_tilde} \tilde{U}^{(L^\prime,j)} = e^{-i H^{(L^\prime,j)} \tau} \otimes I_{\Lambda_{\tilde{L},j} \backslash \Lambda_{L^\prime,j}}. \end{equation} \end{proposition} \textit{Remark.}--- The assumption $4d\geq L^\prime$ is not essentially required for proving this proposition. It rather serves as a guideline to construct the ansatz $V^{(L)}$. When we employ the brickwork-structured ansatz given by Eq. (\ref{Eq:Ansatz}), a local observable acting on a single qubit generally spreads to $4d$-qubit operators. Hence, we should use $d$ such that $4d\geq L^\prime$ to capture the correlation within the LR bound and thereby accurately approximate the time evolution. It is straight-forward to generalize the above proposition to smaller $d$ with a slight modification of $\tilde{L}$. \textit{Proof.}--- We employ the causal cones of quantum circuits here. Let us focus on $\mr{Tr} [\Pi_j \rho_{AB}(U^{L^\prime,j}, V^{(L)})]$, which can be schematically depicted by Fig. \ref{fig:proof} (a). To visualize the causal cone, we pick up a part of the circuit belonging to the right half in the figure (the light-green region), which results in Fig. \ref{fig:proof} (b). The light-blue squares in Fig. \ref{fig:proof} (b) represent local operators on $j$-th sites composing $\Pi_j$, given by Eq. (\ref{Eq:Pi_j_decompose}). We also note that $V_B^{(L)\ast}$ in Fig. \ref{fig:proof} (a) is translated into $V^{(L) \dagger}$ since its input and output are exchanged. Each local two-qubit gates in the ansatz $V^{(L) \dagger}$ can be classified into three groups by its effect on the local cost function. The first group is depicted by the white (non-painted) two-qubit gates in Fig. \ref{fig:proof} (b). Since these local gates and the corresponding ones in $V^{(L) \mr{T}}_B$ cancel each other by the contraction in the lower layer of Fig. \ref{fig:proof} (a), they do not affect $\mr{Tr} [\Pi_j \rho_{AB}(U^{(L^\prime,j)}, V^{(L)})]$. This cancellation is due to the locality of $\Pi_j$ and independent of $U_A^{(L^\prime,j)}$ appearing in the upper layer. The second group, composed of the gray two-qubit gates, are also inactive, because they can be contracted to identity in the upper layer. In contrast to the first group, its cancellation originates from the size restriction of the Hamiltonian $H^{(L)}$ to $H^{(L^\prime)}$, validated by the LR bound. The last one is composed of the yellow gates residing within the causal cones. Only these two-qubit gates are relevant for $\mr{Tr} [\Pi_j \rho_{AB}(U^{(L^\prime,j)}, V^{(L)})]$, which can be schematically depicted as Fig. \ref{fig:proof} (c). Finally, we determine the proper compilation size $\tilde{L}$. The active region, composed of the two causal cones spreading from the left- and the right-side [See (i) and (ii) in Fig. \ref{fig:proof} (c)], is designated by \begin{equation} |y| \leq \min \{ 2 (d-x) + L^\prime/2 +1, 2x \}, \quad 0 \leq x \leq d. \end{equation} When the compilation size $\tilde{L}$ surpasses its height, that is, when \begin{equation} \tilde{L} \geq \frac{L^\prime}{2} + 2d +1 = L^\prime + 2d^\prime +1, \end{equation} the restricted ansatz $V^{(\tilde{L},j)}(\theta)$ includes all the two-qubit gates in the active region. Therefore, we have \begin{eqnarray} && \mr{Tr} [\Pi_j \rho_{AB}(U^{(L^\prime,j)}, V^{(L)})] \nonumber \\ && = \mr{Tr} [\Pi_j \rho_{AB}(e^{-iH^{(L^\prime,j)}\tau} \otimes I_{\Lambda \backslash \Lambda_{L^\prime,j}}, V^{(\tilde{L},j)} \otimes I_{\Lambda \backslash \Lambda_{\tilde{L},j}})] \nonumber \\ && = \mr{Tr} [\Pi_j \rho_{AB}(e^{-iH^{(L^\prime,j)}\tau} \otimes I_{\Lambda_{\tilde{L},j} \backslash \Lambda_{L^\prime,j}}, V^{(\tilde{L},j)}) ], \end{eqnarray} where we use the fact that the contraction over $\Lambda \backslash \Lambda_{\tilde{L},j}$ gives identity for the last equality. By using the definitions of the local cost function $C_\mr{LHST}^{(j)}$ and the restricted time evolution $\tilde{U}^{(L^\prime,j)}$ [See Eqs. (\ref{Eq:Cost_LHST_j}) and (\ref{Eq:restricted_U_tilde}) respectively], we complete the proof of Proposition \ref{Prop:Result2}. \hfill $\quad \square$ Let us define the subsystem cost function by $C_{\mr{LHST}}^{(j)} (\tilde{U}^{(L^\prime,j)}, V^{(\tilde{L},j)})$, which can be measured by a $2\tilde{L}$-qubit quantum device or a $\tilde{L}$-qubit quantum device with a Monte-Carlo sampling based on Lemma \ref{Thm:LqubitLHST}. Propositions \ref{Prop:Result1} and \ref{Prop:Result2} yield that the local cost function $C_\mr{LHST}^{(j)}(U^{(L)},V^{(L)})$ can be approximated by the subsystem cost function, and they also dictate the scaling property of the subsystem cost function in the subsystem size $\tilde{L}$. Importantly, $\tilde{L} \geq L^\prime + 2d^\prime +1 = 2 (l_0 + d_H + v\tau ) + 2d^\prime + 1$ can be independent of the whole-system size $L$ and significantly smaller than $L$. We note that the coefficient of the depth $d$ in $\tilde{L}$ comes from the brickwork structure of the ansatz $V^{(L)}$. We can obtain the same result for any other ansatz with changing the coefficient in $\tilde{L}$ as long as it is local. \section{Local variational quantum compilation of a large-scale Hamiltonian dynamics}\label{Sec:Local_compilation} In this section, we formulate the local variational quantum compilation (LVQC) of a large-scale Hamiltonian dynamics as the second main result. In our protocol, we construct an approximate time evolution operator for the large size $L$ by optimizing the cost functions defined on the smaller size $\tilde{L}$. Based on Propositions \ref{Prop:Result1} and \ref{Prop:Result2}, we provide two different formulations for translationally-invariant cases (Sec. \ref{Subsec:Local_compilation_PBC}) and generic cases (Sec. \ref{Subsec:local_compilation_generic}). \subsection{Local compilation for translationally-invariant systems}\label{Subsec:Local_compilation_PBC} We first deal with translationally-invariant cases under periodic boundary conditions (PBC). Throughout this section, we denote such a translationally invariant Hamiltonian and its time evolution operator for the size $L$ as $H^{(L)}_\mr{PBC}$ and $U^{(L)}_\mr{PBC}$. Then, it is reasonable to impose translation invariance and PBC also on the ansatz, denoted by $V^{(L)}_\mr{PBC}$. To be precise, we assume that the variational parameter set $\theta = \{ \theta_{i,k}, \theta^\prime_{i,k} \}_{i,k}$ is independent of the position $k$. The number of parameters in $V^{(L)}_\mr{PBC}(\theta)$ depends only on the depth $d$. Based on Propositions \ref{Prop:Result1} and \ref{Prop:Result2}, we can derive the following theorem which also shows the protocol of LVQC. \begin{theorem}\label{Thm:local_compilation_PBC} We define the local-compilation cost function by, \begin{eqnarray} &&C_\alpha^{(\tilde{L})} (\theta) = \nonumber \\ && \alpha C_\mr{HST}(U^{(\tilde{L})}_\mr{PBC}, V^{(\tilde{L})}_\mr{PBC}(\theta)) + (1-\alpha) C_\mr{LHST}(U^{(\tilde{L})}_\mr{PBC}, V^{(\tilde{L})}_\mr{PBC}(\theta)), \nonumber \\ && \end{eqnarray} for a certain $\alpha \in [0,1]$, which is defined on an $\tilde{L}$-size translationally-invariant systems under PBC. Assume that, after the minimization of $C_\alpha^{(\tilde{L})} (\theta)$, the optimal parameter set $\theta_\mr{opt}$ gives the upper bound of the local and global cost functions as \begin{eqnarray} && C_\mr{LHST}(U_\mr{PBC}^{(\tilde{L})}, V_\mr{PBC}^{(\tilde{L})}(\theta_\mr{opt})) < \varepsilon_\mr{LHST}, \label{Eq:thm_PBC_assume_LHST} \\ && C_\mr{HST}(U_\mr{PBC}^{(\tilde{L})}, V_\mr{PBC}^{(\tilde{L})}(\theta_\mr{opt})) < \varepsilon_\mr{HST}. \label{Eq:thm_PBC_assume_HST} \end{eqnarray} When we choose the smallest even number larger than $2(l_0+d_H+v\tau) +2d^\prime+1$ as the compilation size $\tilde{L}$, the time evolution operator for an $L$-qubit system ($L \geq \tilde{L}$) is approximated as \begin{eqnarray} && C_\mr{LHST} (U_\mr{PBC}^{(L)}, V_\mr{PBC}^{(L)} (\theta_\mr{opt})) \leq \varepsilon_\mr{LHST} + \frac{3}{2} \varepsilon_\mr{LR}, \label{Eq:thm_PBC_result_LHST} \\ && C_\mr{HST} (U_\mr{PBC}^{(L)}, V_\mr{PBC}^{(L)} (\theta_\mr{opt})) \leq L \left( \varepsilon_\mr{HST} + \frac{3}{2} \varepsilon_\mr{LR} \right), \label{Eq:thm_PBC_result_HST} \end{eqnarray} with the usage of the same parameter set $\theta_\mr{opt}$. \end{theorem} \begin{figure}[t] \includegraphics[height=3.9cm, width=8.5cm]{Fig_PBC_circuit.pdf} \caption{Schematic picture of Fig. \ref{fig:proof} (b) for translationally-invariant systems under PBC. The blue and red solid lines respectively represent identical sites.} \label{fig:pbc_circuit} \end{figure} \textit{Proof.}--- We first derive Eq. (\ref{Eq:thm_PBC_result_LHST}) from Eq. (\ref{Eq:thm_PBC_assume_LHST}). We combine translation symmetry with the scaling property of the subsystem cost functions, represented by Propositions \ref{Prop:Result1} and \ref{Prop:Result2}. As a result, we obtain the relation for any $j$, \begin{eqnarray} C_\mr{LHST} (U_\mr{PBC}^{(L)}, V_\mr{PBC}^{(L)}) &=& C_\mr{LHST}^{(j)} (U_\mr{PBC}^{(L)}, V_\mr{PBC}^{(L)}) \nonumber \\ &\leq& C_\mr{LHST}^{(j)} (\tilde{U}^{(L^\prime,j)}, V^{(\tilde{L},j)}) + \frac{3}{4} \varepsilon_\mr{LR}. \nonumber \\ && \label{Eq:proof_PBC_1} \end{eqnarray} Here, $\tilde{U}^{(L^\prime,j)}$ and $V^{(\tilde{L},j)}$ are constructed from $U_\mr{PBC}^{(L)}$ and $V_\mr{PBC}^{(L)}$ by the restriction to $L^\prime$- and $\tilde{L}$-size systems respectively [See Eqs. (\ref{Eq:restricted_U_tilde}) and (\ref{Eq:restricted_ansatz})]. They have open boundary condition (OBC) as illustrated in Fig. \ref{fig:pbc_circuit}, and therefore do not straight-forwardly relate to $U_\mr{PBC}^{(\tilde{L})}$ and $V_\mr{PBC}^{(\tilde{L})}$. To recover the PBC, we take the following strategy. Figure \ref{fig:pbc_circuit} gives a schematic picture of a part of gates composing $\mr{Tr}[\Pi_j \rho_{AB}(\tilde{U}^{L^\prime,j},V^{(\tilde{L},j)})]$, similar to Fig. \ref{fig:proof} (b). First, we add two-qubit gates $V^{(2)}_{\tilde{L},1}$ to each layer of the restricted ansatz $V^{(\tilde{L},j)}$, represented by the light-blue squares at the boundaries in Fig. \ref{fig:pbc_circuit}. When the parameter set of each $V^{(2)}_{\tilde{L},1}$ is same as that of the two-qubit gate in the same layer, it reproduces the translationally-invariant ansatz under PBC, $V^{(\tilde{L})}_\mr{PBC}$. Since local gates outside of the causal cones does not alter the local cost function at all, we obtain the following relation; \begin{equation}\label{Eq:proof_PBC_2} C_\mr{LHST} (U_\mr{PBC}^{(L)}, V_\mr{PBC}^{(L)}) \leq C_\mr{LHST}^{(j)} (\tilde{U}^{(L^\prime,j)}, V^{(\tilde{L})}_\mr{PBC}) + \frac{3}{4} \varepsilon_\mr{LR}. \end{equation} We also recover the PBC of the target unitary $\tilde{U}^{(L^\prime,j)}$. Let us consider the two Hamiltonians $H^{(\tilde{L})}_\mr{PBC}$ and $H^{(L^\prime,j)}$, which respectively provide the time evolution operators $U^{(\tilde{L})}_\mr{PBC}$ and $\tilde{U}^{(L^\prime,j)}$. Since the Hamiltonian $H^{(L^\prime,j)}$ becomes the restriction of $H^{(\tilde{L})}_\mr{PBC}$ from the domain $\Lambda_{\tilde{L},j}$ to the one $\Lambda_{L^\prime,j}$, we can again employ the inequality Eq. (\ref{Eq:Def_epsilon_LR1}) brought by the LR bound, \begin{equation} \| U^{(\tilde{L}) \dagger}_\mr{PBC} O_j U^{(\tilde{L})}_\mr{PBC} - \tilde{U}^{(L^\prime,j) \dagger} O_j \tilde{U}^{(L^\prime,j)} \| \leq \varepsilon_\mr{LR}, \end{equation} for any local normalized observable at a $j$-th site, $O_j$. This implies that we can apply Propositions \ref{Prop:Result1} and \ref{Prop:Result2} with substituting $U^{(\tilde{L})}_\mr{PBC}$ for $U^{(L)}$, which results in \begin{eqnarray} C_\mr{LHST}^{(j)} (\tilde{U}^{(L^\prime,j)}, V^{(\tilde{L})}_\mr{PBC}) &\leq& C_\mr{LHST}^{(j)} (U^{(\tilde{L})}_\mr{PBC}, V^{(\tilde{L})}_\mr{PBC}) + \frac{3}{4} \varepsilon_\mr{LR} \nonumber \\ &<& \varepsilon_\mr{LHST} + \frac{3}{4} \varepsilon_\mr{LR}. \end{eqnarray} Combining this inequality with Eq. (\ref{Eq:proof_PBC_2}), we arrive at the relation of $C_\mr{LHST}$, given by Eq. (\ref{Eq:thm_PBC_result_LHST}). Next, we derive Eq. (\ref{Eq:thm_PBC_result_HST}), which gives an upper bound of the global cost function $C_\mr{HST}$. We employ the following inequality \cite{Khatri2019-gj}, \begin{equation}\label{Eq:relation_HST_LHST} C_\mr{LHST} (U,V) \leq C_\mr{HST} (U, V) \leq |\Lambda| C_\mr{LHST} (U,V), \end{equation} when two unitary gates $U$ and $V$ are defined on a lattice $\Lambda$. Under the assumption of Eq. (\ref{Eq:thm_PBC_assume_HST}), we have $C_\mr{LHST}(U_\mr{PBC}^{(\tilde{L})}, V_\mr{PBC}^{(\tilde{L})}(\theta_\mr{opt})) < \varepsilon_\mr{HST}$ from the first inequality in Eq. (\ref{Eq:relation_HST_LHST}). Using the above result for the local cost function $C_\mr{LHST}$, Eq. (\ref{Eq:thm_PBC_result_LHST}), we obtain $C_\mr{LHST} (U_\mr{PBC}^{(L)}, V_\mr{PBC}^{(L)} (\theta_\mr{opt})) \leq \varepsilon_\mr{HST} + \frac{3}{2} \varepsilon_\mr{LR}$. Finally, considering $|\Lambda| = L$ for a one-dimensional system, the second inequality in Eq. (\ref{Eq:relation_HST_LHST}) implies Eq. (\ref{Eq:thm_PBC_result_HST}). \hfill $\quad \square$ This theorem tells us that the optimal parameter set $\theta_\mr{opt}$ for the $\tilde{L}$-size local-compilation cost function can be directly employed to construct the approximate larger-scale time evolution by $U^{(L)}_\mr{PBC} \simeq V^{(L)}_\mr{PBC}(\theta_\mr{opt})$. Its accuracy can be guaranteed by Eq. (\ref{Eq:thm_PBC_result_LHST}) or Eq. (\ref{Eq:thm_PBC_result_HST}). The error consists of two parts: the first terms, $\varepsilon_\mr{LHST}$ and $\varepsilon_\mr{HST}$, are due to a limited expressive power of the ansatz $V^{(\tilde{L})}_\mr{PBC}$; the second term, $\varepsilon_\mr{LR}$ is the intrinsic error induced by this LVQC protocol. They can be improved by using more expresive ansatz and using larger compilation size $\tilde{L}$, respectively. Now, we discuss what compilation size should be used to achieve an accuracy of $O(\varepsilon)$ for a quantity of interest. When we focus on some local observables under the approximate time evolution $V^{(L)}_\mr{PBC}(\theta_\mr{opt})$, the local cost function $C_\mr{LHST}$ plays a significant role since it guarantees the local equivalence with $U^{(L)}_\mr{PBC}$ by Eq. (\ref{Eq:LHST_zero_condition}). To be more precise, $C_\mr{LHST}=O(\varepsilon)$ implies additive error $O(\varepsilon)$ in the expectation values of local observables. We wish to choose the compilation size $\tilde{L}= 2 \lceil l_0+d_H+v\tau+d^\prime + 1/2 \rceil$ so that $\varepsilon_\mr{LR} = e^{-O(l_0/\xi)}$ can be neglected. Therefore, in this case, $\tilde{L}$ can be taken as $ O(\xi\log(1/\epsilon))+2d_H+2v\tau+2d^\prime$, which is independent of the whole-system size $L$. On the other hand, in the cases where we require the accuracy in terms of global observables, the average gate fidelity $\bar{F}$ has the operational meaning. $1-\bar{F}=O(\varepsilon)$ implies an accuracy of $O(\varepsilon)$ in the expectation values of any observables. When the $\tilde{L}$-size optimization is achieved as Eqs. (\ref{Eq:thm_PBC_assume_LHST}) and (\ref{Eq:thm_PBC_assume_HST}), the combination with Eqs. (\ref{Eq:operational_meaning_HST}) or (\ref{Eq:operational_meaning_LHST}) ensures its lower bound as \begin{eqnarray} \bar{F} (U_\mr{PBC}^{(L)}, V_\mr{PBC}^{(L)} (\theta_\mr{opt})) &\geq& 1 - \frac{2^{|\Lambda|}}{2^{|\Lambda|}+1} \cdot L \left( \varepsilon_\mr{LHST} + \frac{3}{2} \varepsilon_\mr{LR} \right) \nonumber \\ &\geq& 1 - \frac{2^{|\Lambda|}}{2^{|\Lambda|}+1} \cdot L \left( \varepsilon_\mr{HST} + \frac{3}{2} \varepsilon_\mr{LR} \right). \nonumber \\ && \label{Eq:average_gate_fidelity_pbc} \end{eqnarray} Therefore, to achieve $1-\bar{F}=O(\varepsilon)$, we should choose the compilation size $\tilde{L}$ satisfying $L \varepsilon_\mr{LR} = e^{-O(l_0/\xi) + \log L} =O(\varepsilon)$, which results in $\tilde{L} = O(\xi\log{(1/\varepsilon)}+\xi\log{L}) + 2 d_H + 2 v\tau + 2d^\prime$. Upon this choice of the compilation size, we should continue the optimization of $C_\alpha^{(\tilde{L})} (\theta)$ until $\varepsilon_\mr{LHST}$ or $\varepsilon_\mr{HST}$ becomes much smaller than $O(L^{-1})$, and then we can obtain preferable accuracy. To summarize, our protocol starts with choosing a proper compilation size $\tilde{L}$. $\tilde{L}$ should taken to be comparable to the approximate causal cone size by the LR bound, $2 (\xi+ d_H+v\tau+d^\prime)$, or a bit larger than it, depending on the desired error. After minimizing the local-compilation cost function $C_\alpha^{(\tilde{L})} (\theta)$ which can be evaluated using classical simulator or quantum device with at least $\tilde{L}$ qubits, we can directly apply the optimal parameter set $\theta_\mr{opt}$ to obtain the approximate time evolution $U^{(L)}_\mr{PBC} \simeq V^{(L)}_\mr{PBC}(\theta_\mr{opt})$. This reduction in the size makes NISQ devices or classical simulators employing some approximation (See Sec. \ref{Sec:Numerical}) suitable for the compilation. LVQC can be employed for various purposes such as depth compression and calibration of $U^{(L)}$, without implementing the target $U^{(L)}$ itself but only with the one for smaller systems $U^{(\tilde{L})}$. This is clearly one of the largest advantages in our protocol. In addition, by repeating the application of $ V(\theta_\mr{opt})$, we can approximately simulate the stroboscopic dynamics at $t=n\tau$ ($n \in \mathbb{N}$). Thus, LVQC with the size-scale $\tilde{L}$ and the time-scale $\tau$ can be applied to reproduce the dynamics of larger scales both in space and time. We summarize the results in Fig. \ref{fig:summary}. \subsection{Local compilation for generic systems without translation-invariance}\label{Subsec:local_compilation_generic} Here, we develop the LVQC protocol for one-dimensional finite-ranged systems without translation-invariance. The result does not essentially alter from translationally-invariant cases, but they have different cost functions. We directly use Propositions \ref{Prop:Result1} and \ref{Prop:Result2} to derive the protocol. For the brickwork-structured ansatz $V^{(L)}(\theta)$ (not necessarily translationally-invariant), we define the local-compilation cost function for generic cases by \begin{equation}\label{Eq:Local_cost_generic_case} C^{(\tilde{L})}(\theta) = \frac{1}{L} \sum_{j=1}^L C_\mr{LHST}^{(j)} (\tilde{U}^{(L^\prime,j)}, V^{(\tilde{L},j)}(\theta)), \end{equation} where we directly use the subsystem cost functions $C_\mr{LHST}^{(j)} (\tilde{U}^{(L^\prime,j)}, V^{(\tilde{L},j)}(\theta))$. With the help of Propositions \ref{Prop:Result1} and \ref{Prop:Result2}, we immediately obtain \begin{eqnarray} && |C_\mr{LHST}(U^{(L)},V^{(L)}) - C^{(\tilde{L})}(\theta) | \nonumber \\ &\quad& \leq \frac{1}{L} \sum_{j=1}^L |C_\mr{LHST}^{(j)}(U^{(L)},V^{(L)}) - C_\mr{LHST}^{(j)}(\tilde{U}^{(L^\prime,j)},V^{(\tilde{L},j)})| \nonumber \\ &\quad& \leq \frac{3}{4} \varepsilon_\mr{LR}. \end{eqnarray} We also use the relation Eq. (\ref{Eq:relation_HST_LHST}), which results in \begin{equation} C_\mr{HST}(U^{(L)},V^{(L)}) \leq L \left( C^{(\tilde{L})}(\theta) + \frac{3}{4} \varepsilon_\mr{LR} \right). \end{equation} Therefore, we obtain the following theorem, which designates the protocol for generic cases. \begin{theorem}\label{Thm:Local_compilation_generic} We variationally minimize the local-compilation cost function $C^{(\tilde{L})}(\theta)$. When the optimal parameter set $\theta_\mr{opt}$ gives $C^{\tilde{L}}(\theta_\mr{opt}) \leq \varepsilon_\mr{LHST}$, the cost functions for the size $L$ is bounded by \begin{eqnarray} && C_\mr{LHST}(U^{(L)}, V^{(L)}(\theta_\mr{opt})) \leq \varepsilon_\mr{LHST} + \frac{3}{4} \varepsilon_\mr{LR}, \label{Eq:thm_generic_result_LHST} \\ && C_\mr{HST}(U^{(L)}, V^{(L)}(\theta_\mr{opt})) \leq L \left( \varepsilon_\mr{LHST} + \frac{3}{4} \varepsilon_\mr{LR} \right). \label{Eq:thm_generic_result_HST} \end{eqnarray} The average gate fidelity is bounded from below as follows: \begin{equation}\label{Eq:average_gate_fidelity_generic} \bar{F}(U^{(L)}, V^{(L)}(\theta_\mr{opt})) \geq 1- \frac{2^{|\Lambda|}}{2^{|\Lambda|+1}} \cdot L \left( \varepsilon_\mr{LHST} + \frac{3}{4} \varepsilon_\mr{LR} \right). \end{equation} \end{theorem} \begin{figure*} \begin{center} \includegraphics[height=5cm, width=18cm]{Fig_Numerical_A.pdf} \caption{(a) The history of the cost function $C_\mr{LHST}^{(\tilde{L}/2)}(U^{(\tilde{L})}, V^{(\tilde{L})}(\theta))$ in the intermediate size $\tilde{L}=20$. The yellow, blue, and the red solid lines respectively represent the results for the depth of the ansatz $d=3,4,5$. The dashed lines represent the corresponding cost functions for the Trotter decomposition with various depth $d$. (b) Cost functions $C(U^{(L)},V^{(L)}(\theta))$ for increasing $L$. The ansatz $V^{(L)}(\theta_\mr{opt})$, where $\theta_\mr{opt}$ is obtained by the optimization using only $\tilde{L}=20$ qubits, well approximates $U^{(L)}$ compared to the Trotter decomposition with the same depth, $V^{(L)}(\theta_\mr{trot}^{d=5})$.} \label{fig:numerical} \end{center} \end{figure*} Based upon this theorem, we can perform the local compilation in a similar way to translationally-invariant systems, while the cost function is replaced by Eq. (\ref{Eq:Local_cost_generic_case}). We have the same compilation size $\tilde{L} = 2 \lceil l_0+d_H+v\tau+d^\prime+1/2 \rceil$ with $l_0$ such that $\varepsilon_\mr{LR}$ or $L \varepsilon_\mr{LR}$ becomes sufficiently small. After the local optimization that achieves $\varepsilon_\mr{LHST} \ll 1$ or $L \varepsilon_\mr{LHST} \ll 1$, we use the optimal parameter set $\theta_\mr{opt}$ for the $L$-size time evolution operator as schematically shown in Fig. \ref{fig:summary}. We also remark extension of our protocol to other generic cases. Our protocol relies only on the existence of the LR bound, given by Eq. (\ref{Eq:Def_epsilon_LR1}), and the locality of the ansatz. Thus, the extension to higher-dimensional systems is straightforward, in which we change the form of $\varepsilon_\mr{LR}$ and replace the coefficient $L$ in Eqs. (\ref{Eq:thm_PBC_result_HST}) or (\ref{Eq:thm_generic_result_HST}) by $|\Lambda| \sim L^D$. We can also consider short-ranged, or long-ranged interactions since they respectively show an exponential or polynomial decay of the error $\varepsilon_\mr{LR}$ (Note that we require additional conditions when considering long-ranged interactions for the existence of the LR bound, as discussed in Appendix \ref{Asubsec:Extension_Long_range}). The compilation size $\tilde{L}$ increases at-most in $O(\log L)$ (for finite-ranged, short-ranged interactions in generic dimension) or in $O(L^\sigma)$ with $\sigma<1$ (long-ranged interactions in generic dimension). We can expect significant reduction in the compilation size for a broad class of locally-interacting systems to compile large-scale time evolution operators. See Appendix \ref{Asec:Extension} for the detailed discussion. \section{Numerical demonstration of depth compression}\label{Sec:Numerical} Here, we numerically demonstrate LVQC, and in particular, we try to compress the depth of a large-scale time evolution operator by the compilation. For simplicity, we concentrate on one-dimensional systems and rely on classical simulation by time-evolving block decimation (TEBD), based on matrix product states (MPS) \cite{Vidal2003-eb,Vidal2004-oa,Hastings2009-hd,Schollwock2011-zj}. We first introduce the model and the ansatz. We adopt an anti-ferromagnetic (AFM) Heisenberg model on a one-dimensional lattice, defined by \begin{equation} H_\mr{AFM}^{(L)} = \sum_{j=1}^{L-1} (X_j X_{j+1} + Y_j Y_{j+1} + Z_j Z_{j+1}). \end{equation} We employ OBC to make it easier to simulate by MPS. The target of the depth compression is the time evolution operator $U^{(L)} = \exp (- i H_\mr{AFM}^{(L)} \tau)$ with a fixed time $\tau$. On the other hand, we give the ansatz $V^{(L)}(\theta)$ by the brickwork-structured circuit under OBC, designated by Eq. (\ref{Eq:Ansatz}). We parameterize each of two-qubit gates in it by \begin{eqnarray} && V_{j,j+1}^{(2)} (\eta, \zeta, \chi, \gamma, \phi) = \nonumber \\ && \quad \left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & e^{-i(\gamma+\zeta)}\cos \eta & -i e^{-i(\gamma-\chi)} \sin \eta & 0 \\ 0 & -i e^{-i(\gamma+\chi)}\sin \eta & e^{-i (\gamma - \zeta)} \cos \eta & 0 \\ 0 & 0 & 0 & e^{-i (2\gamma+\phi)} \end{array} \right),\nonumber \\ && \end{eqnarray} in the basis of $\{ \ket{00}, \ket{01}, \ket{10}, \ket{11} \}$, where $\eta$, $\zeta$, $\chi$, $\gamma$, and $\phi$ denote the variational parameters. This form is chosen so that $V_{j,j+1}^{(2)}$ can represent any two-qubit gate preserving the total $Z$-spin which is a symmetry of $H_\mr{AFM}$ \cite{Arute2020-qr,Neill2021-jv}. Here, we expect that, when the system has more than tens of qubits, its boundaries hardly affect the results. Reflecting this approximate translation symmetry, we employ a single parameter set $(\eta, \zeta, \chi, \gamma, \phi)$ within each layer. Upon this setup, the number of the independent variational parameters becomes $10d$ for the $d$-depth ansatz. We examine whether we can approximate $U^{(L)}$ by the shallow-depth circuit $V^{(L)}$ as $U^{(L)} \simeq V^{(L)}(\theta_\mr{opt})$, with the optimal parameter set obtained in the smaller size $\tilde{L}$. Based on the approximate translation symmetry, we apply the protocol for translationally-invariant systems under PBC. To be precise, based on Theorem \ref{Thm:local_compilation_PBC}, we minimize the local cost function $C_\mr{LHST}^{(\tilde{L}/2)}(U^{(\tilde{L})}, V^{(\tilde{L})}(\theta))$, which is expected to approximate the local-compilation cost function $C^{(\tilde{L})}_{\alpha=0}(\theta)$. Then, with the optimal parameters $\theta_\mr{opt}$, we compute the cost functions $C_\mr{LHST}(U^{(L)}, V^{(L)}(\theta_\mr{opt}))$ and $C_\mr{LHST}(U^{(L)}, V^{(L)}(\theta_\mr{opt}))$ to evaluate how well the ansatz $V^{(L)}(\theta_\mr{opt})$ reproduces $U^{(L)}$. We deal with the size $L=40$, the time $\tau = 0.5$, and the ansatz depth $d$ up to $5$. First, we show the numerical results for the depth compression in the intermediate size $\tilde{L}$. The compilation size $\tilde{L} = 2 \lceil l_0 + d_H + v \tau + d^\prime +1/ 2 \rceil$ should be at-least larger than $d_H +v \tau + 2d$ with considering $d=L^\prime/4 + d^\prime$. The AFM Heisenberg Hamiltonian $H_\mr{AFM}^{(L)}$ has the range of interactions, $d_H=1$, and now we are assuming $d=5$. Since $v \tau$ is expected to be not so large under $\tau=0.5$, we choose $\tilde{L}=20$. We compute the cost function $C_\mr{LHST}^{(\tilde{L}/2)}(U^{(\tilde{L})},V^{(\tilde{L})})$ based on Eq. (\ref{Eq:Cost_LHST_j}) with a $2\tilde{L}$-qubit MPS having the bond dimension $30$. For implementing $U^{(\tilde{L})}$, we employ the Trotter decomposition with sufficiently large depth $d=100$, \begin{equation} U^{(\tilde{L})} \simeq U_{\mr{trot},d}^{(\tilde{L})} \equiv \left( e^{-i H_\mr{even}^{(\tilde{L})} \tau/d} e^{-i H_\mr{odd}^{(\tilde{L})} \tau/d} \right)^d, \end{equation} where $H_\mr{odd}$ [$H_\mr{even}$] represents terms composed of interactions between $(2k-1)$-th and $2k$-th sites [$2k$-th and $(2k+1)$-th sites] in $H_\mr{AFM}$. We variationally minimize the cost function by the Broyden-Fletcher–Goldfarb–Shanno (BFGS) method implemented in SciPy \cite{2020SciPy-NMeth} with maximum iteration set to $128$. The initial parameter set $\theta$ is chosen as $\theta_\mr{trot}^d$ so that the ansatz $V(\theta_\mr{trot}^d)$ becomes equivalent to the Trotter decomposition with the same depth, $U_{\mr{trot},d}$, except for the global phase. Figure \ref{fig:numerical} (a) shows the history of the cost function during the optimization in $\tilde{L}=20$, represented by the yellow ($d=3$), blue ($d=4$), red ($d=5$) solid lines in the panel. For the comparison, we also compute the cost functions for shallow-depth Trotter decomposition $C_\mr{LHST}^{(\tilde{L}/2)}(U^{(\tilde{L})}, V^{(\tilde{L})}(\theta_\mr{trot}^d))$ with various $d$, as described by the dashed lines. For each depth $d=3,4,5$, the ansatz with the resulting optimal parameter set $\theta_\mr{opt}$ overwhelms the same-depth Trotter decomposition. For instance, the $5$-depth ansatz $V^{(\tilde{L})}(\theta_\mr{opt})$ provides the cost value $7.80 \times 10^{-5}$, which is as large as that for the $40$-depth Trotter decomposition, $8.48 \times 10^{-5}$. In other words, we successfully compress the time evolution operator from depth $40$ to depth $5$ under the compilation size $\tilde{L}=20$. Next, we examine how the larger-scale time evolution operator $U^{(L)}$ is approximated by our protocol. Hereafter, we concentrate on the $5$-depth ansatz, and employ the corresponding optimal parameter set as $\theta_\mr{opt}$. Considering the approximate translation invariance, the size-extended ansatz $V^{(L)}(\theta_\mr{opt})$ is constructed by copying the two-qubit gate of $V^{(\tilde{L})}(\theta_\mr{opt})$ in the spatial directions. We again approximate $U^{(L)}$ by the large-depth Trotter decomposition $U^{(L)}_{\mr{trot},d=100}$, and compute the cost functions as described in Fig. \ref{fig:numerical} (b). As Theorem \ref{Thm:local_compilation_PBC} says, the local cost functions $C_\mr{LHST}$ and $C_\mr{LHST}^{(L/2)}$ (the purple and brown solid lines) hardly increase when we employ $\theta_\mr{opt}$ in $\tilde{L}=20$ for the larger-scale ansatz with $L \geq 20$. Reflecting the fact that Theorem \ref{Thm:local_compilation_PBC} yields the loose bound proportional to $L$, the global cost function $C_\mr{HST}$ (the red solid line) experiences a gradual increase in $L$, but remains sufficiently small compared to $1$. Any cost function for the ansatz with $\theta_\mr{opt}$ is comparably smaller than that with $\theta_\mr{trot}^{d=5}$, the parameter set for reproducing the Trotter decomposition with the same depth $d=5$ (See the blue, orange, and light-green solid lines). We also assess the average gate fidelity. Based on Eqs. (\ref{Eq:operational_meaning_HST}) and (\ref{Eq:operational_meaning_LHST}), the ansatz extended to $L=40$ qubits is ensured to have $\bar{F}(U^{(L)},V^{(L)}(\theta_\mr{opt})) \geq 0.9977$, while the same-depth Trotter decomposition provides $\bar{F}(U^{(L)},V^{(L)}(\theta_\mr{trot}^{d=5})) \geq 0.8580$. Therefore, our protocol succeeds in implementing the time evolution operator for the larger-scale $20 \leq L \leq 40$ with the limited depth by exploiting the local compilation on the size $\tilde{L}=20$. \begin{figure}[t] \includegraphics[height=6.43cm, width=8.5cm]{Fig_Numerical_ex_dw_dynamics.pdf} \caption{Real-time dynamics of $Z_{L/2}$ (a) from the ferromagnetic initial state with two local excitations $\ket{\psi_\mr{LE}^{(L)}(0)}$ and (b) from the one with two domain walls $\ket{\psi_\mr{DW}^{(L)}(0)}$. The orange dots represents the stroboscopic dynamics at $t \in \tau \mathbb{Z}$ under $V^{(L)}(\theta_\mr{opt})$, implemented with the depth $50$ up to $t=5$. This well corresponds to the blue line, which shows an accurate dynamics under the Trotter decomposition with sufficiently large depth $100$ per $\tau=0.5$.} \label{fig:numerical_dynamics} \end{figure} Finally, we demonstrate how well the compressed time evolution operator $V^{(L)}(\theta_\mr{opt})$ reproduces the dynamics of larger-scale systems under the accurate one $U^{(L)}$. By applying $V^{(L)}(\theta_\mr{opt})$ or its inverse repeatedly, we can approximately simulate the stroboscopic dynamics at the time $t \in \tau \mathbb{Z}$, which is larger than the original time scale $\tau$, with a smaller-depth circuit. Furthermore, it should be noted that our protocol can capture larger-scale phenomena in the size $L$ despite the compilation in $\tilde{L} < L$. To confirm this numerically, we simulate the stroboscopic dynamics which involves the time scale and the size scale respectively larger than $\tau=0.5$ and $\tilde{L}=20$. As the simplest cases, we prepare the following two initial states, \begin{eqnarray} \ket{\psi^{(L)}_\mr{LE}(0)} &=& X_{(L-\tilde{L})/2} X_{(L+\tilde{L})/2} \ket{0}^{\otimes L}, \\ \ket{\psi^{(L)}_\mr{DW}(0)} &=& \left( \prod_{j = (L-\tilde{L})/2}^{(L+\tilde{L})/2} X_j \right) \ket{0}^{\otimes L}, \end{eqnarray} for the size $L=40$. They respectively represent ferromagnetic states having two local excitations (for $\ket{\psi_\mr{LE}(0)}$) and two domain walls (for $\ket{\psi_\mr{DW}(0)}$) with distance $\tilde{L}=20$. Then, we evaluate the expectation value of $Z_{L/2}$ evolving under the Hamiltonian $H_\mr{AFM}^{(L)}$. Intuitively, it is expected that two distant local excitations or domain walls at the $(L-\tilde{L})/2$-th and $(L+\tilde{L})/2$-th sites respectively propagate in both left and right directions under the Hamiltonian $H_\mr{AFM}^{(L)}$, and the central site $j=L/2$ observes their collisions. Thus, the change in the expected value of $Z_{L/2}$ can be employed as a diagnosis for the larger-scale dynamics involving at-least $\tilde{L}+1$ sites, which is larger than the compilation size. Figure \ref{fig:numerical_dynamics} shows the numerical results for the approximate stroboscopic dynamics obtained by the compilation. With the $5$-depth ansatz $V^{(L)}(\theta_\mr{opt})$ obtained by the optimization in the size $\tilde{L}=20$, we compute the state and its local observable, given by \begin{eqnarray} \ket{\psi^{(L)}(n \tau)} &=& V^{(L)}(\theta_\mr{opt})^n \ket{\psi^{(L)}(0)}, \quad n \in \mathbb{N}, \\ Z_{L/2}(n \tau) &=& \braket{\psi^{(L)}(n \tau) | Z_{L/2} | \psi^{(L)}(n \tau)}. \end{eqnarray} We employ MPS with the bond dimension $60$ for simulating the dynamics from the initial states $\ket{\psi_\mr{LE}(0)}$ or $\ket{\psi_\mr{DW}(0)}$, which are depicted as the orange dots respectively in Fig. \ref{fig:numerical_dynamics} (a) and (b). We also compute the dynamics under the large-depth Trotter decomposition $U^{(L)}_{\mr{trot},d=100}$ as the accurate dynamics for the comparison (See the blue solid lines). In both cases, the compilation results well reproduce the accurate dynamics up to $t \leq 10 \tau = 5$ with the mean square errors $5.27 \times 10^{-6}$ and $1.29 \times 10^{-6}$ \cite{remark:numerical_dynamics}. We conclude that our prescription exploiting the intermediate-size $\tilde{L}$ and the fixed time $\tau$ provides an appropriate shallow-depth time evolution operator useful for larger-scale quantum systems both in space and time. We also remark that the optimal parameter obtained here is expected to be useful for even larger-scale quantum simulations beyond the size considered in this work from the size-dependence in Fig. \ref{fig:numerical} (b). Our numerical results suggest the feasibility of the classical local compilation to design large-scale quantum circuits, in addition to the possible quantum local compilation by NISQ devices. \section{Discussion and Conclusion}\label{Sec:Discussion} In this paper, we develop the local variational quantum compilation (LVQC), in which we conduct local optimization for intermediate-scale quantum systems designated by the Lieb-Robinson bound, and obtain an approximate time evolution operator of larger-scale quantum systems. Since the approximation error of the local cost function supporting our protocol relies only on the Lieb-Robinson bound, it has broad applicability to finite-ranged, short-ranged, and long-ranged interacting large-scale systems in generic dimension. LVQC begins with the local compilation by intermediate-scale quantum devices or corresponding classical simulators, and ends up with the quantum execution of the compiled larger-scale dynamics. Therefore, not only it unveils a classical approach to design large-scale quantum circuits, but also it will play a significant role in bridging NISQ device technique to the practical use of larger quantum devices as the long-term goal. We finish this article with providing some future directions. The first one is to seek for the possibility of the local compilation in classical ways. While we refer to our protocol as ``quantum" compilation, Theorems \ref{Thm:local_compilation_PBC} and \ref{Thm:Local_compilation_generic} are not limited to the context of variational quantum algorithms where we optimize parametrized quantum circuit in a quantum-classical hybrid manner. Our numerical demonstration based on TEBD involving up to $40$ qubits is indeed a good example for using classical simulator for LVQC. Other sophisticated techniques (e.g. tensor-network-based methods for 2D systems) will also be important for executing our protocol on classical computers. We might also be able to use exact brute-force classical simulators for LVQC in future. This is because, for finite-ranged or short-ranged systems with $v\tau = O(L^0)$, LVQC ensures the classical efficient evaluaion of the cost function in time $e^{O(\tilde{L})} = \mr{poly} (L)$ given that it is sufficient to take $\tilde{L} = O(\log L)$ in this case. Although current classical devices are still not capable of simulating quantum systems with size $\tilde{L}$, which typically becomes more than tens of qubits, LVQC without resorting to approximate simulators may be available in future. Note that this does not contradict with the existing result that states the evaluation of the cost functions $C_\mr{LHST}$ and $C_\mr{HST}$ in polynomial accuracy with respect to the system size $L$ for general unitaries is a DQC1-hard problem \cite{Khatri2019-gj} (DQC1; efficiently solvable problems by one clean qubit and other noisy qubits \cite{Knill1998-xs}), since we restrict ourselves to certain short-time local Hamiltonian dynamics and shallow depth ansatzes (See Appendix \ref{Asec:dqc1} for detail). The second significant task for future is to accumulate benchmark results by both classical and quantum simulation, including higher-dimensional cases, short-ranged interacting cases, and long-ranged interacting cases. Several programmable quantum simulators, such as superconducting qubits \cite{chow2021ibm} and Rydberg atoms \cite{Ebadi2022-uj}, have recently achieved a few hundred qubits with high-controllability and two-dimensionality, and they will be available for both the local compilation and the quantum execution of the compressed time evolution. For instance, as an immediate task to be tackled, it may be possible to observe long-time dynamics beyond the current coherence time on such compiled quantum simulators by the classical local compilation for tens of qubits. One of the ultimate goals is to compile time evolution operators for huge quantum chemistry materials such as molecules and crystals. Although long-ranged Hamiltonians of electrons from the first principles are out of scope with the current knowledge of the LR bound, our protocol is expected to be valid for various materials under the reorganization of approximate models based on their structures. As for including the improvement for long-ranged cases, we leave it as future work. \section*{Acknowledgment} Kaoru Mizuta is supported by WISE Program, MEXT, and a Research Fellowship for Young Scientists from JSPS (Grants No. JP20J12930). Kosuke Mitarai is supported by JST PRESTO Grant No. JPMJPR2019 and JSPS KAKENHI Grant No. 20K22330. K.F. is supported by JST ERATO Grant No. JPMJER1601 and JST CREST Grant No. JPMJCR1673. This work is supported by MEXT Quantum Leap Flagship Program (MEXTQLEAP) Grant No. JPMXS0118067394 and JPMXS0120319794. We also acknowledge support from JST COI-NEXT program Grant No. JPMJPF2014. A part of this work was performed for Council for Science, Technology and Innovation (CSTI), Cross-ministerial Strategic Innovation Promotion Program (SIP), “Photonics and Quantum Technology for Society 5.0” (Funding agency: QST).
5452190712d3059cb939adf273b23e2380d7e1df
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:intro} Event cameras are bio-inspired vision sensors developed in recent years \cite{brandli2014240}. Different from traditional frame-based cameras which capture a scene as a synchronous sequence of 2D images, event cameras asynchronously measure brightness changes on each pixel and output \emph{event} streams. An event encodes the timestamp, pixel coordinates and polarity of brightness changes. Compared with traditional cameras, event cameras have numerous advantages: extremely high event rate ($>10^6$ events per second, events/s) and dynamic range (up to $130$ dB) while traditional cameras usually obtain $\sim 30$ FPS and $65$ dB, respectively \cite{son20174}. Additionally, event cameras only require a very low data rate (KB vs. MB) by removing an amount of the inherent redundancy of standard cameras, thus making it quite efficient. The unique properties of event cameras make them as ideal sensors for running visual SLAM systems on low-power embedded platforms, such as robots and drones, for real-time applications. The event-based monocular visual SLAM systems involve event-based 3D reconstruction which aims to estimate the depth information and the structure of the scene from event cameras. Unlike the multi-view stereo methods, the monocular methods only require a single event camera which do not pursue instantaneous depth estimation, but rather depth estimation for SLAM \cite{cadena2016past}. Recently, the event-based monocular multi-view stereo (EMVS) technique has received particular attention, since its performance will greatly affect the overall performance of visual SLAM systems \cite{zhou2021event}\cite{zhou2018semi}. However, it is very challenging to unlock the benefits of event cameras for monocular multi-view stereo applications on embedded platforms for real-time purpose. This is due to the fact that event cameras represent a paradigm shift in acquisition of visual information, thus requiring novel algorithms and specified hardware design \cite{gallego2020event}. Previous accelerators designed for traditional intensity-frame-based multi-view stereo algorithms cannot be directly applied for the event-based algorithms. Several previous algorithms have been proposed for EMVS implementations \cite{rebecq2018emvs}\cite{kim2016real}\cite{gallego2018unifying} but all of them could only run on relatively powerful CPU or GPU platforms. Aiming to improve the computational efficiency of EMVS, an event-based space-sweep method \cite{rebecq2018emvs} is proposed by back-projecting events to create a ray density volume \cite{collins1996space}, and then find local maxima of ray density to estimate the scene structure. Such an efficient EMVS implementation integrated with an event-based visual odometry (EVO) system \cite{rebecq2016evo} could process $1.2$ million events/s when running with a single core of Intel x86 CPU, and $4.7$ million events/s with $4$ cores \cite{rebecq2018emvs}. However, running the EMVS algorithms on multi-core x86 CPUs is not practical for embedded EVO applications. Another event processing pipeline is proposed in \cite{kim2016real} by utilizing three filters running in parallel to jointly estimate the motion of the event camera and 3D map. Such an approach only runs on GPUs for real-time performance and cannot process high event rate input (up to $1$M events/s). A unified event processing framework is proposed in \cite{gallego2018unifying} focusing on motion estimation, depth estimation and optical flow estimation. However, such a framework is only evaluated on a desktop CPU and no quantitative results are provided. Overall, all of these implementations are insufficient to fully unlock the potential advantages of event cameras for EMVS systems. This motivates us to explore more efficient EMVS algorithm-hardware co-design approach for real-time target on low-power embedded platforms. From comparative analysis, we observed that the event-based space-sweep procedures in EMVS have significant advantages including relatively high parallelism, low data dependency and low computational redundancy. These advantages make it very suitable for customized hardware acceleration, which is adopted as the basic framework for our algorithm-hardware co-design and optimizations. In this paper, \texttt{Eventor} is proposed as an FPGA/ARM heterogeneous accelerator for EMVS systems. The most time-consuming tasks of event back-projection and volumetric ray-counting are performed on FPGA. The main contributions are listed below: \begin{itemize}[topsep=4pt,leftmargin=12pt] \item[$\checkmark$] A novel efficient EMVS accelerator, \texttt{Eventor}, is proposed for real-time applications on embedded FPGA platform via algorithm-architecture co-design approaches. \item[$\checkmark$] The involved EMVS algorithm is redesigned and customized in a hardware-friendly manner, which makes the accelerator much more efficient. \item[$\checkmark$] Highly paralleled and fully pipelined architecture is designed and integrated with the heterogeneous execution model to improve the throughput and reduce the memory footprint. \end{itemize} The remainder of the paper is organized as follows. Section \ref{sec:system} demonstrates some comprehensive analysis of EMVS algorithm for potential optimization. Section \ref{sec:arch} illustrates the detailed architecture of the proposed \texttt{Eventor}. Evaluation results are provided in Section \ref{sec:exp}. Finally the conclusions are given in Section \ref{sec:con}. \section{EMVS System} \label{sec:system} In this section, typical EMVS algorithm is analyzed for computational patterns evaluation and reformulated for hardware-friendly targeting. Meanwhile, data quantization and compression strategies are further exploited to improve the computational efficiency. \begin{figure}[t] \includegraphics[width=\linewidth]{figure/emvs-workflow.pdf} \caption{A typical EMVS workflow. This paper focuses on building the semi-dense depth information from the event streams.} \label{fig:emvs-workflow} \end{figure} \subsection{Algorithm Analysis} EMVS algorithm aims to address the problem of estimating 3D structure from the event stream acquired by a moving event camera with a known trajectory \cite{rebecq2018emvs}. A typical EMVS system is depicted in Fig.~\ref{fig:emvs-workflow}. It mainly consists of four procedures: event \emph{aggregation} ($\mathcal{A}$), event back-\emph{projection} ($\mathcal{P}$), volumetric \emph{ray}-counting ($\mathcal{R}$) and scene structure \emph{detection} ($\mathcal{D}$). The system receives the input event stream and corresponding camera trajectory, and reconstructs the semi-dense depth information of the viewing scene by event-based space-sweep method. The complete workflow of EMVS algorithm is illustrated in Fig.~\ref{fig:emvs-framework}, and each stage is described as follows. \emph{\textbf{Event Aggregation}}. Specifically, when the logarithmic brightness at a certain pixel $\left(x_{k},y_{k}\right)$ reaches a threshold, event camera generates an event $e_{k}\doteq \left \langle x_{k},y_{k},t_{k},p_{k}\right \rangle$, where $x_{k}$ and $y_{k}$ is the corresponding pixel's coordinates of $k$-th event, $t_{k}$ is the timestamp of the triggered event and $p_{k}$ is the polarity of the brightness change. \emph{Aggregation} (denoted as $\mathcal{A}$) divides the generated event stream to event frames (i.e. event packets) which will be processed together. \emph{\textbf{Event Back-Projection}}. Event back-\emph{projection} (denoted as $\mathcal{P}$) is the first stage of event-based space-sweep method. Each event in an event frame is back-projected to the viewing space according to the camera pose of the frame. Usually a ray density volume is created to record the distribution of back-projected rays. A disparity space image (DSI) is interchangeably used to describe the discretized space volume and the scores stored in each voxel (i.e., the number of back-projected viewing rays passing through each voxel) \cite{rebecq2018emvs}. The DSI is defined by dividing the viewing space to $N_{z}$ slices along the depth and discretizing each slice to $w \times h$ cuboid voxels, where $w$ and $h$ are the horizontal and vertical resolution of the event camera. So the DSI size is $w \times h \times N_{z}$. Assuming the center of a voxel is $\mathcal{X}=\left(X,Y,Z\right)^{T}$, then back projecting events to the DSI can be discretized to the execution of mapping events to all the depth planes $\left \{ \mathbb{Z}_{i} \right \}_{i=1}^{N_{z}}$ located in the middle of the slices. By creating a virtual camera located at a reference viewpoint, a DSI could be defined for its view recording. The event back-projection is performed by two steps: \ding{182} Each event is firstly mapped from the current camera to the virtual camera via a canonical plane $\mathbb{Z}_{0}$ using homography matrix $\mathcal{H}_{\mathbb{Z}_{0}}$, which are denoted as $\mathcal{P}\left(\mathbb{Z}_{0}\right)$. The coordinates of events back-projected to $\mathbb{Z}_{0}$ are denoted as $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$. \ding{183} The other depth planes $\mathbb{Z}_{i}$ could be obtained by mapping the points from $\mathbb{Z}_{0}$, which are denoted as $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$. The coordinates of events back-projected to $\mathbb{Z}_{i}$ are denoted as $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right)\right \}$. \emph{\textbf{Volumetric Ray-Counting}}. After back-projecting events to DSI volume, the second stage of event-based space-sweep method is counting the number of back-projection rays that pass through each voxel (denoted as $\mathcal{R}$). In the previous stage, the ray-voxel intersections are discretized to back projecting events to depth planes $\left \{ \mathbb{Z}_{i} \right \}_{i=1}^{N_{z}}$. Then accumulating votes in the DSI can be done by voting DSI voxels at positions of $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right), \mathbb{Z}_{i}\right \}$. \begin{figure}[t] \includegraphics[width=0.85\linewidth]{figure/emvs-framework.pdf} \caption{EMVS algorithm framework.} \label{fig:emvs-framework} \end{figure} \emph{\textbf{Key Frame Selection}}. The EMVS algorithm selects several key reference views along the trajectory of the event camera and constructs local DSI. After setting the original reference viewpoint, a new event frame could be only selected as a new key frame ($\mathcal{K}$) if the distance between the current event camera pose and the previous key reference view exceeds a threshold. All of the events between two key frames will be utilized to estimate the local depth information. \emph{\textbf{Scene Structure Detection}}. Scene structure detection ($\mathcal{D}$) is the last stage of event-based space-sweep method. A semi-dense depth map at the reference viewpoint is extracted from the DSI by determining whether a 3D point is present in each DSI voxel. Based on the theory that the regions where multiple back-projection rays nearly intersect are likely to possess scene points, the algorithm determine 3D points by finding DSI voxels whose ray density scores are at local maximum of the ray density function. \emph{\textbf{Merging Depth Information}}. After getting the semi-dense depth map of the previous reference view at the scene structure detection procedure, the old local DSI is abandoned and a new local DSI is set in the viewing space of the new reference viewpoint. Then the depth map is converted to a local point cloud and merged into the global point cloud ($\mathcal{M}$). Hence, it includes three steps: reset DSI, point cloud conversion, and map updating. \emph{\textbf{Computational Evaluation}}. According to our observations, the most computational intensive and time-consuming tasks in the whole algorithm is \emph{event back-projection} ($\mathcal{P}$) and \emph{volumetric ray-counting} ($\mathcal{R}$). When evaluating the EMVS algorithm on the DAVIS event camera dataset \cite{mueggler2017event}, the runtime of these two tasks accounts for over $80\%$ of total runtime. To execute EMVS efficiently in real-time on a low-power embedded system, optimizations for these two tasks are obviously required, from both algorithm and hardware perspectives. Hence, the procedures of $\mathcal{P}$ and $\mathcal{R}$ are accelerated by FPGA in our proposed \texttt{Eventor}. \subsection{Hardware-Friendly Reformulation} \label{subsec:reform} Aiming to relieve the computational bottleneck ($\mathcal{P}$ and $\mathcal{R}$) of EMVS algorithm, an algorithm-hardware co-optimization approach is proposed where the original algorithm is rescheduled in a hardware-friendly manner as shown in Fig.~\ref{fig:emvs-reschedule}. The event back-projection ($\mathcal{P}$) is divided into four sub-tasks: \ding{202} \emph{Compute Homography Matrix} aims to compute the homography matrix $\mathcal{H}_{\mathbb{Z}_{0}}$, \ding{203} \emph{Canonical Event Back-Projection} corresponds to $\mathcal{P}\left(\mathbb{Z}_{0}\right)$, \ding{204} \emph{Compute Proportional Back-Projection Parameters} determines the parameters $\phi$ required in $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$, \ding{205} \emph{Proportional Event Back-Projection} conducts the actual $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$. And the volumetric ray-counting ($\mathcal{R}$) is divided into two sub-tasks: \emph{Generate DSI Votes} ($\mathcal{G}$) and \emph{Vote DSI Voxels} ($\mathcal{V}$). \begin{figure}[t] \includegraphics[width=\linewidth]{figure/emvs-reschedule.pdf} \caption{Details of original EMVS framework (left) and rescheduled for hardware-friendly optimization in our \texttt{Eventor} (right).} \label{fig:emvs-reschedule} \end{figure} \emph{\textbf{Workload Evaluation}}. We further evaluate the computational workload of each sub-task for the above $\mathcal{P}$ and $\mathcal{R}$ procedures. Among all the sub-tasks, \emph{Canonical Event Back-Projection} ($\mathcal{P}\left(\mathbb{Z}_{0}\right)$), \emph{Proportional Event Back-Projection} ($\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$), \emph{Generate DSI Votes} ($\mathcal{G}$) and \emph{Vote DSI Voxels} ($\mathcal{V}$) will take up most of the runtime, because the required executions are proportional to the number of input events, while the \emph{Homography Matrix} ($\mathcal{H}_{\mathbb{Z}_{0}}$) and \emph{Proportional Back-Projection Parameters} ($\phi$) are only updated once when a new event frame is received. Validation results on the DAVIS dataset show that the four sub-tasks above are responsible for over $90\%$ execution time of $\mathcal{P}$ and $\mathcal{R}$ procedures. \emph{\textbf{Computation Parallelism Analysis}}. The above $\mathcal{P}$ and $\mathcal{R}$ procedures could be found with high parallel availability. According to the mechanism of event-based space-sweep method, there are mainly three types of parallelism in workloads: \begin{itemize}[topsep=3pt,leftmargin=12pt] \item[$\medtriangleright$] \emph{Operator-Level Parallelism}. For the involved matrix and vector calculations in the procedure of $\mathcal{P}$, multiple arithmetic logic units (ALUs) could be deployed for fine-grained parallelism. \item[$\medtriangleright$] \emph{Event-Level Parallelism}. The procedure $\mathcal{P}$ requires to back-project each input event to the viewing space separately and extract scene structure from the ray density volume, which does not require simultaneous event observations or event matching. Hence, different events can be processed in parallel and the computation stages involved can be fully pipelined. \item[$\medtriangleright$] \emph{DSI-Level Parallelism}. Due to the discretized structure of DSI and depth planes $\left \{ \mathbb{Z}_{i} \right \}_{i=1}^{N_{z}}$, the procedure $\mathcal{P}$ for different depth planes can be executed in parallel, so can voting for different DSI voxels. \end{itemize} \begin{figure}[t] \centering \begin{subfigure}{0.495\linewidth} \centering \includegraphics[width=\linewidth]{figure/vote-error.pdf} \caption{Different voting approaches.} \label{fig:error-compare:vote-error} \end{subfigure} \begin{subfigure}{0.495\linewidth} \centering \includegraphics[width=\linewidth]{figure/quant-error.pdf} \caption{w/ or w/o quantization.} \label{fig:error-compare:quant-error} \end{subfigure} \caption{Depth estimation error (AbsRel) comparison between different approaches evaluated on different datasets. The maximum AbsRel difference between Nearest Voting and original Bilinear Voting is about $1.18\%$. The maximum AbsRel difference before and after quantization is about $1.01\%$.} \label{fig:error-compare} \end{figure} \emph{\textbf{Dataflow Reformulation}}. According to the evaluation and analysis above, there are four tasks accelerated on FPGA: $\mathcal{P}\left(\mathbb{Z}_{0}\right)$, $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$, $\mathcal{G}$ and $\mathcal{V}$. The high parallelism makes accelerating these tasks on FPGA rewarding. However, the dataflow of the original EMVS framework shown in Fig.~\ref{fig:emvs-reschedule} (left) is not hardware-friendly enough. Rescheduling the original algorithm to a streaming and hardware-friendly manner is proven to be an effective strategy in previous software-hardware co-optimization designs for traditional visual SLAM, such as the ORB-SLAM accelerator in \cite{liu2019eslam}. Therefore, we perform reformulation to the EMVS algorithm for sufficient acceleration on heterogeneous systems. As illustrated in Fig.~\ref{fig:emvs-reschedule} (right), the reformulation is mainly performed in the aspects of \emph{Rescheduling} and \emph{Approximate Computing}: $\RHD$ \emph{\underline{Rescheduling}} includes the stages of \emph{Event Distortion Correction} and \emph{Compute Proportional Back-Projection Coefficients}. \ding{182} \emph{Event Distortion Correction} execution is originally performed after the events aggregated to a whole frame. We set this stage before \emph{Event Aggregation} so that the correction is executed for each event in a streaming manner. Streaming corrections could improve memory access efficiency during the aggregation stage. \ding{183} \emph{Proportional Back-Projection Coefficients} $\phi$ is pre-computed before performing $\mathcal{P}\left(\mathbb{Z}_{0}\right)$. With the pre-computed $\phi$, the subsequent stages $\mathcal{P}\left(\mathbb{Z}_{0}\right)$, $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$, $\mathcal{G}$ and $\mathcal{V}$ could be efficiently accelerated on FPGA in parallel and fully pipelined. Meanwhile, the originally required data transfer of $\phi$ could be significantly reduced. $\RHD$ \emph{\underline{Approximate Computing}} is adopted to improve the execution efficiency of procedure $\mathcal{R}$. \ding{182} A standard DSI voting approach is named \emph{bilinear voting}, which is similar to bilinear interpolation. Bilinear voting adopts a point $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right), \mathbb{Z}_{i}\right \}$ to vote for the corresponding four nearest voxels on depth plane $\mathbb{Z}_{i}$ by splitting its contribution according to the distance between this point to each voxel. \ding{183} Another approximate approach is called \emph{nearest voting}, which simply adopts each point to vote for its nearest neighboring voxels. Nearest voting approach is less accurate than bilinear voting. However, the computation complexity and memory access characteristics of nearest voting are much more hardware-friendly than bilinear voting. The depth estimation accuracy comparison between Bilinear Voting and Nearest Voting is illustrated in Fig.~\ref{fig:error-compare:vote-error} by absolute relative error (AbsRel) across different datasets. Fig.~\ref{fig:error-compare:vote-error} shows that the accuracy loss is acceptable when adopting nearest voting. Considering the requirement of hardware-friendly manner, nearest voting is exploited in our dataflow. \subsection{Hybrid Data Quantization} Since most data involved in EMVS dataflow are represented by long floating-point format, we consider converting them as short fixed-point representations to reduce the memory footprint and data transferring bandwidth requirements. Linear quantization method is utilized both for event coordinates and related parameters during the procedure of $\mathcal{P}$ and $\mathcal{R}$. Detailed quantization strategies are illustrated in Table~\ref{tab:quantization}. \begin{table}[t] \caption{Detailed quantization strategies for procedure $\mathcal{P}$ and $\mathcal{R}$. Original floating-point data are quantized by fix-point data.} \label{tab:quantization} \small \begin{tabular}{|c|c|c|c|} \hline Quantized Data Type & Total \#bit & \#bit of Integer & \#bit of Decimal \\ \hline ($x_k$, $y_k$) & $16$ & $9$ & $7$ \\ \hline $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ & $16$ & $9$ & $7$ \\ \hline $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right)\right \}$ & $8$ & $8$ & $0$ \\ \hline $\mathcal{H}_{\mathbb{Z}_{0}}$ & $32$ & $11$ & $21$ \\ \hline $\phi$ & $32$ & $11$ & $21$ \\ \hline DSI Scores & $16$ & $16$ & $0$ \\ \hline \end{tabular} \end{table} \emph{\textbf{Event Coordinates Quantization}}. For event coordinates, we adopt a hybrid quantization strategy. Considering the byte-aligned bit width limitation and the $32$-bit data bus width between DRAM and FPGA, we utilize $16$-bit data to store the coordinates of the original input events ($x_k$, $y_k$). In this way, the coordinates of an event are quantized as a pair of $16$-bit data and concatenated to a $32$-bit data to be saved in memory. For events generated by DAVIS event camera with resolution of $240 \times 180$, $9$-bit is enough for integer part of fixed-point coordinates, and remaining $7$-bit is exploited for decimal part. Coordinates of $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ are quantized by using the same strategy. As for coordinates of $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right)\right \}$, due to the mechanism of nearest voting method adopted in procedure $\mathcal{R}$, finding the nearest voxel to the projected point could be done by rounding the precise floating coordinates to integers. Therefore, their coordinates can be quantized as $8$-bit integers. \emph{\textbf{Parameters Quantization}}. Since the homography matrix $\mathcal{H}_{\mathbb{Z}_{0}}$ and pre-computed parameters $\phi$ are usually invoked repeatedly during the procedures, their precision settings will have larger impact on the whole algorithm. On the other hand, the required memory of these parameters are essentially much less than event coordinates and DSI scores. As an appropriate strategy, they are quantized as $32$-bit data with $11$-bit integer part and $21$-bit decimal part. As our observations, the sufficient integer bit width avoids data overflow, and continuing to increase the decimal bit width will not bring significant improvement to the depth estimation accuracy. \emph{\textbf{DSI Scores Quantization}}. For the scores stored in DSI voxels, they are quantized from $32$-bit float to $16$-bit integer. Benefiting from nearest voting method, the increments (i.e. votes) of the scores are integer so that no decimal part is required. Since the entire DSI structure are usually required to be stored in memory, such a quantization strategy can significantly reduce the memory footprint. In summary, our hybrid data quantization strategy can save up to $50\%$ of the memory requirement and data transferring bandwidth. Meanwhile, the depth estimation errors resulted from quantization are also evaluated across different datasets and illustrated in Fig.~\ref{fig:error-compare:quant-error}. Evaluation results indicate that the accuracy of our quantized framework is comparable to the original full-precision framework. \section{\texttt{Eventor} Architecture} \label{sec:arch} \begin{figure}[t] \includegraphics[width=\linewidth]{figure/eventor-architecture.pdf} \caption{Overall hardware architecture of our proposed \texttt{Eventor}.} \label{fig:eventor-architecture} \end{figure} Base on the reformulated dataflow, overall hardware architecture of \texttt{Eventor} is designed on Zynq FPGA platform as shown in Fig.~\ref{fig:eventor-architecture}. \texttt{Eventor} is partially implemented with programmable logic (PL) of FPGA and hosted by an ARM CPU as the processing system (PS). \emph{Canonical Projection Module} and \emph{Proportional Projection Module} are exploited to compute $\mathcal{P}\left(\mathbb{Z}_{0}\right)$, $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$. For processing each input event frame, ARM configures DMA to transfer input event coordinates $\left(x_{k},y_{k}\right)$ and parameters to input buffers. Then ARM sends instructions to start the computational modules. Overall, \texttt{Eventor} receives the input event frames streaming and updates the DSI data stored in DRAM. \subsection{Canonical Projection Module} Canonical Projection Module aims to compute $\mathcal{P}\left(\mathbb{Z}_{0}\right)$. It receives the input event frames, $\mathcal{H}_{\mathbb{Z}_{0}}$, and outputs $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$. It also temporarily stores the proportional back-projection parameters and provides them together with intermediate event coordinates. \textbf{AXI Interface} supports DMA to transfer input data and parameters via AXI bus. Quantized $16$-bit coordinates $\left(x_{k},y_{k}\right)$ are concatenated as 32-bit data which are transferred via AXI bus and stored in buffer. \textbf{Buffers} in Canonical Projection Module include: \ding{182} \texttt{Buf\_H} for storing $\mathcal{H}_{\mathbb{Z}_{0}}$, \ding{183} Event Buffer \texttt{Buf\_E} for storing input event coordinates $\left(x_{k},y_{k}\right)$, \ding{184} Proportional Back-Projection Parameter Buffer \texttt{Buf\_P} for storing parameters $\phi$ required in $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$, \ding{185} Intermediate Buffer \texttt{Buf\_I} for storing $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$. Among them, \texttt{Buf\_H} is composed of registers since only one $3\times3$ homography matrix is required for each input event frame. And the others are built with on-chip BRAM. All of these buffers (including the Vote Buffer \texttt{Buf\_V} illustrated in Subsection \ref{sebsec:ppm} are realized by the manner of \emph{double-buffering}. Many dataflow-driven accelerator designs have adopted this strategy to guarantee continuous loading and output streaming \cite{fu2018scalable}. In this way, the transferring and processing of streaming data can be executed simultaneously, thus avoiding pipeline halt due to waiting for input data. \textbf{PE\_Z0} is the processing element (PE) deployed in Canonical Projection Module for computing $\mathcal{P}\left(\mathbb{Z}_{0}\right)$. It is equipped with a set of matrix-vector multiply-accumulate (MV MAC) units and a normalization function unit. $\mathcal{P}\left(\mathbb{Z}_{0}\right)$ is accelerated by multiple ALUs deployed in \texttt{PE\_Z0}, which are fully pipelined. \texttt{PE\_Z0} loads $\mathcal{H}_{\mathbb{Z}_{0}}$ from \texttt{Buf\_H}, then receives streaming $\left(x_{k},y_{k}\right)$ from \texttt{Buf\_E} and outputs $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ to \texttt{Buf\_I}. Since the workload of $\mathcal{P}\left(\mathbb{Z}_{0}\right)$ is less than $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$, only one \texttt{PE\_Z0} is deployed. Besides, the latency of computing $\mathcal{P}\left(\mathbb{Z}_{0}\right)$ is not the critical path for normal frames in the pipelined workflow which will be demonstrated in Subsection \ref{sebsec:workflow}. \textbf{Controller} in Canonical Projection Module mainly receives the starting instructions and configurations, then initializes \texttt{PE\_Z0} and buffers. The Canonical Projection Controller is built as a finite-state machine (FSM), which has a specially designed synchronization state to synchronize the double-buffering state of \texttt{Buf\_E} together with the Proportional Projection Controller. This synchronization mechanism ensures two modules to work in a pipelined mode. \subsection{Proportional Projection Module} \label{sebsec:ppm} Proportional Projection Module is responsible for $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$. It receives $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ and $\phi$ from Canonical Projection Module, and updates the DSI voxels scores. \textbf{PE\_Zi:} Canonical Projection Module has multiple \texttt{PE\_Zi} to execute $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{G}$. \texttt{PE\_Zi} receives $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ and $\phi$ from Data Allocator, and generates the addresses of DSI voxels which are required for \texttt{Buf\_V}. \texttt{PE\_Zi} includes: Scalar MAC Units, Nearest Voxel Finder and Vote Address Generator. Scalar MAC Units execute $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$. Nearest Voxel Finder computes the nearest DSI voxel to $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right), \mathbb{Z}_{i}\right \}$ and conducts projection missing judgement. Vote Address Generator generates the vote addresses, which are directly utilized for updating DSI scores. Usually different PEs (multiple \texttt{PE\_Zi}) could share a same event input and operate simultaneously in parallel for different depth planes. \textbf{Data Allocator} fetches input data and parameters required by \texttt{PE\_Zi} and allocates them to PEs. Different PEs need different parameters while sharing a same event input. The dataflow between \texttt{Buf\_I} and \texttt{PE\_Zi} is managed by this allocator. \textbf{Vote Execute Unit} exploits the DSI vote addresses stored in \texttt{Buf\_V} to vote the corresponding voxels. It is equipped with two AXI-HP ports and data transfer logic to directly access the DRAM via the DRAM controller, no need for ARM intervention. The old scores stored in DSI voxels are fetched from DRAM, added by a vote value (typically $1$) and wrote back to DRAM. \begin{figure}[t] \includegraphics[width=\linewidth]{figure/pipeline.pdf} \caption{The pipelined workflow of normal event frame (upper) and key event frame (lower).} \label{fig:pipeline} \end{figure} \subsection{Accelerator Workflow} \label{sebsec:workflow} The overall execution model of \texttt{Eventor} is shown in Figure \ref{fig:pipeline}. Canonical Projection Module and the Proportional Projection Module work in a pipelined order while \texttt{Eventor} receives the streaming input event frames. For normal event frames, the two modules work simultaneously. Canonical Projection Module starts working as soon as \texttt{Buf\_I} is ready for new input so that Proportional Projection Module can operate continuously. In this way, the actual execution time for each frame is equal to the sum of the execution time of $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$, and the execution time of $\mathcal{P}\left(\mathbb{Z}_{0} \right)$ is overlapped. Things are different when a new key event frame is selected. Because a new key frame means a new reference view, the DSI will be reset and the following events will be back projected and vote for the new DSI. So the Canonical Projection Module will wait until the Proportional Projection Module finishes processing the previous event frame, then start processing the key event frame if it is fired up. The Proportional Projection Module then starts to work once receiving $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$. Therefore, the execution time for a key frame is equal to the sum of the execution time of $\mathcal{P}\left(\mathbb{Z}_{0} \right)$, $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$. \subsection{Parallelization Mechanism} According to the computation parallelism analysis carried out in Section \ref{subsec:reform}, three levels of parallelism are involved: operator-level, event-level and DSI-level. \texttt{Eventor} aims to fully utilize these parallelism. For operator-level parallelism, we deploy multiple ALUs in \texttt{PE\_Z0} to accelerate matrix and vector calculation. For event-level parallelism, the workflow and datapath of \texttt{Eventor} is designed as a fully-pipelined scheme to process events without data dependency. For DSI-level parallelism, multiple \texttt{PE\_Zi} are implemented inside the Proportional Projection Module to back-project an event to multiple depth planes and generate vote addresses simultaneously. Benefiting from the exploration of parallelism, our \texttt{Eventor} is able to achieve a relatively high event processing rate. \section{Experimental Results} \label{sec:exp} This section first introduces our experimental setup. Then, we evaluate the effectiveness of our hardware-friendly dataflow reformulation and the proposed \texttt{Eventor} accelerator. \subsection{Experimental Setup} \textbf{Hardware Implementation:} The \texttt{Eventor} is implemented and evaluated on Xilinx Zynq XC7Z020 SoC \cite{zynq}. Its PL is with $4.9$ Mb BRAM as on-chip memory and 1 GB, 32-bit DDR3 DRAM as external memory. The clock frequency of \texttt{Eventor} is 130 MHz, and the DDR clock is $533$ MHz. The prototype of \texttt{Eventor} is equipped with two \texttt{PE\_Zi} and corresponding \texttt{Buf\_I} in Proportional Projection Module. The computation modules on PL are implemented by hand-optimised RTL. The resources utilization of \texttt{Eventor} are shown in Table~\ref{tab:utilization}. It can be seen that \texttt{Eventor} uses quite few resources. \begin{table}[t] \caption{The FPGA resources utilization of \texttt{Eventor}.} \label{tab:utilization} \small \begin{tabular}{|c|c|c|c|} \hline & \# LUT & \# FF & BRAM \\ \hline Utilization & $ 17538$ ($32.97\%$) & $22830$ ($21.46\%$) & $64$ KB ($11.43\%$) \\ \hline \end{tabular} \end{table} \textbf{Dataset:} The reformulated EMVS framework and \texttt{Eventor} are evaluated on DAVIS event camera dataset and simulator \cite{mueggler2017event}. It contains event streams captured with a DAVIS event camera in a variety of simulated and real environments, along with ground-truth camera trajectories. The resolution of a DAVIS event camera is $240\times180$. Four different sequences are used for evaluation: \emph{simulation\_3planes} and \emph{simulation\_3walls} are simulated sequences, \emph{slider\_close} and \emph{slider\_far} are captured in real scene. \begin{figure}[t] \centering \begin{subfigure}{0.495\linewidth} \centering \includegraphics[width=\linewidth]{figure/total-error.pdf} \caption{The depth estimation error (AbsREL) of our reformulated hardware-friendly EMVS when compared with original EMVS.} \label{fig:total-error:error} \end{subfigure} \hfill \begin{subfigure}{0.43\linewidth} \centering \includegraphics[width=\linewidth]{figure/depth_colored.pdf} \caption{A sample demonstration of reconstructed scene structure from the sequence of \emph{simulation\_3planes}.} \label{fig:total-error:scene} \end{subfigure} \caption{Accuracy of depth estimation comparison and reconstructed scene structure demonstration.} \label{fig:total-error} \end{figure} \subsection{Accuracy Analysis} The accuracy of EMVS is measured by depth estimation error (absolute relative error, AbsREL), which means the difference between the depth of reconstructed scene structure and the groundtruth. Fig.~\ref{fig:total-error:error} shows the comparison of average depth estimation error between original EMVS and our reformulated framework. For \emph{simulation\_3planes} and \emph{simulation\_3walls}, the original EMVS has a better accuracy than our reformulated framework, but the maximum difference is less than $1.78\%$. For \emph{slider\_close} and \emph{slider\_far}, our framework even has a better accuracy than the original EMVS. Overall, the results indicate that the accuracy of our reformulated framework is comparable to original EMVS. A sample reconstructed scene structure from the sequence of \emph{simulation\_3planes} is also demonstrated in Fig.~\ref{fig:total-error:scene} for 3D view. \subsection{Performance Evaluation} The performance of \texttt{Eventor} is compared with the EMVS run on Intel i5-7300HQ CPU \cite{intel}. Comparison results of computation speed and power consumption are illustrated in Table~\ref{tab:performance}, including detailed runtime breakdown, average runtime per event frame and the event processing rate. Each event frame consists of $1024$ events, which is determined according to the sensor's event rate and storage. Compared with the Intel i5 CPU, the event processing rate of \texttt{Eventor} is slightly higher, without obvious advantage. However, in terms of power consumption, \texttt{Eventor} shows great advantage over the Intel CPU. As shown in Table \ref{tab:performance}, the power consumption can be reduced by $24\times$. \texttt{Eventor} is able to achieve significant energy reduction with no loss of performance. \begin{table}[t] \caption{Performance comparison between \texttt{Eventor} and original EMVS run on Intel i5 CPU.} \label{tab:performance} \small \begin{tabular}{|cc|c|c|} \hline \multicolumn{2}{|c|}{} & Intel CPU & \texttt{Eventor} \\ \hline \multicolumn{1}{|c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Runtime per Event Frame\\ ( $\mu$s / task )\end{tabular}}} & $\mathcal{P}\left(\mathbb{Z}_{0}\right)$ & 22.40 & 8.24 \\ \cline{2-4} \multicolumn{1}{|c|}{} & $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ \& $\mathcal{R}$ & 559.55 & 551.58 \\ \hline \multicolumn{1}{|c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Runtime per Event Frame\\ ( $\mu$s / frame )\end{tabular}}} & Normal frame & 581.95 & 551.58 \\ \cline{2-4} \multicolumn{1}{|c|}{} & Key frame & 581.95 & 559.82 \\ \hline \multicolumn{1}{|c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Event Processing Rate\\ ( $10^6$ events / second)\end{tabular}}} & Normal frame & 1.76 & 1.86 \\ \cline{2-4} \multicolumn{1}{|c|}{} & Keyframe & 1.76 & 1.83 \\ \hline \multicolumn{2}{|c|}{Power (W)} & 45 & 1.86 \\ \hline \end{tabular} \end{table} \section{Conclusions} \label{sec:con} In this paper, an efficient EMVS accelerator, \texttt{Eventor}, is proposed for real-time applications and evaluated on Zynq FPGA platform. The EMVS algorithm is partly reformulated to a more hardware-friendly manner, and hybrid data quantization strategies are adopted to improve the computational efficiency. Meanwhile, the most time-consuming stages, i.e., event back-projection and volumetric ray-counting are accelerated on FPGA with different parallelism. Evaluation results show that \texttt{Eventor} could achieve $24\times$ improvement in energy efficiency compared with Intel i5 CPU. The overall performance of \texttt{Eventor} could satisfy the requirements of real-time reconstruction on power-limited embedded platforms. \section{0pt}{3pt plus 1pt minus 1pt}{0pt plus 1pt minus 1pt} \titlespacing\subsection{0pt}{3pt plus 1pt minus 1pt}{0pt plus 1pt minus 1pt} \titlespacing\subsubsection{0pt}{3pt plus 1pt minus 1pt}{2pt plus 1pt minus 1pt} \setlength{\textfloatsep}{8pt plus 1pt minus 1pt} \setlength{\floatsep}{10pt plus 1pt minus 1pt} \setlength{\intextsep}{4pt plus 1pt minus 1pt} \setlength{\columnsep}{21pt} \setlength{\belowdisplayskip}{5pt} \setlength{\belowdisplayshortskip}{5pt} \setlength{\abovedisplayskip}{5pt} \setlength{\abovedisplayshortskip}{5pt} \fi \settopmatter{printacmref=false} \setcopyright{acmcopyright} \copyrightyear{2022} \acmYear{2022} \setcopyright{acmcopyright}\acmConference[DAC '22]{Proceedings of the 59th ACM/IEEE Design Automation Conference (DAC)}{July 10--14, 2022}{San Francisco, CA, USA} \acmBooktitle{Proceedings of the 59th ACM/IEEE Design Automation Conference (DAC) (DAC '22), July 10--14, 2022, San Francisco, CA, USA} \acmPrice{15.00} \acmDOI{10.1145/3489517.3530452} \acmISBN{978-1-4503-9142-9/22/07} \begin{document} \title{ \texttt{Eventor}: An Efficient \underline{Event}-Based Monocular Multi-View Stereo Accelera\underline{tor} on FPGA Platform } \titlenote{This work was supported by the National Natural Science Foundation of China (Grant No. 62072019). \\ Corresponding author: \textit{Jianlei Yang}, Email: \url{[email protected]}} \author{Mingjun Li$^1$, \quad Jianlei Yang$^1$, \quad Yingjie Qi$^1$, \quad Meng Dong$^2$, \quad Yuhao Yang$^1$,} \author{Runze Liu$^3$, \quad Weitao Pan$^2$, \quad Bei Yu$^4$, \quad Weisheng Zhao$^1$} \affiliation{ \institution{ $^1$Beihang University, Beijing, China \hspace{3em} $^2$Xidian University, Xi'an, Shaanxi, China \\ $^3$Beijing Real Imaging Medical Technology Co., Ltd. \hspace{3em} $^4$The Chinese University of Hong Kong, Hong Kong } } \input{0-abstract.tex} \keywords{Event-based Vision, Multi-View Stereo, FPGA, Acceleration} \setcopyright{none} \maketitle \pagestyle{plain} \pagenumbering{gobble} \input{1-introduction.tex} \input{2-system.tex} \input{3-architecture.tex} \input{4-experiment.tex} \input{5-conclusions.tex} \bibliographystyle{unsrt}
71c66ad01187f44812e3e7415d579047932b8a2b
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{Sec:1} Agarwal and Andrews \cite{RRIN} gave some identities for Rogers-Ramanujan type partitions with n copies of n, which correspond to colored partitions. Sandon and Zanello \cite{WCPI} proved identities on the colored case of some partition types. This gave us the idea of combining colored partitions and Roger-Ramanujan type partitions and apply a constructive method to find identities on those partitions. Rogers-Ramanujan identities can be interpreted using partitions in which the difference between every two consecutive parts is at least 2. We combined these types of partitions and colored ones to have the following partition type, \begin{definition} A 2-colored Rogers-Ramanujan partition of $n$ consists of two separated parts, each of the same color, and the difference between every two consecutive parts of the same color is at least two, moreover, parts in different colors do not intersect. \end{definition} As an example, all 2-colored Rogers-Ramanujan partitions of 6 are $$6, \color{red}6 \color{black}, 5 + 1, \color{red}5\color{black}+1, 5 + \color{red}1\color{black}, \color{red}5\color{black}+\color{red}1\color{black}, 4 + 2, \color{red}4\color{black}+2, 4 + \color{red}2\color{black}, \color{red}4\color{black}+\color{red}2\color{black}, 3 + \color{red}2\color{black}+1, \color{red}3\color{black}+2 + \color{red}1$$ A constructive way from Kur\c{s}ung\"{o}z's papers \cite{AndSty} and \cite{BreSty} applied on the generating functions for these types of partitions to find identities on 2-colored Rogers-Ramanujan partitions. For this purpose, functional equations relating to generating functions for given partition types have been found. By these functional equations, in two main steps, we can find the generating function as an infinite sum. Finally, by some transformation such as Jacobi's triple products \cite{tToP}, we can find the divisibility part of identities. \begin{theorem}[Jacobi's triple product]\label{JTP} For $z \neq 0$, $|q|<1$, $$\sum_{n=-\infty}^{\infty}z^nq^{n^2}=\prod_{n=0}^{\infty}(1-q^{2n+2})(1+zq^{2n+1})(1+z^{-1}q^{2n+1}).$$ \end{theorem} By the method and the transformation mentioned above we reached the following identity \begin{theorem} Let $R(n)$ denote the number of 2-colored Rogers-Ramanujan partitions of $n$, then $$R(n)=\frac{(-q)_\infty(q^2,q^2,q^4;q^4)_\infty}{(q)_\infty}.$$ \end{theorem} We observed that our results are identical to identities for special cases of overpartitions in \cite{RRGO}, that identity is \begin{theorem} For $k \geq a \geq 1$, let $D_{k,a}(n)$ denote the number of overpartitions of $n$ of the form $d_1 + d_2 + \cdots + d_s$, such that $1$ can occur as a non-overlined part at most $a-1$ times, and $d_j - d_{j+k-1} \geq 1$ if $d_j$ is overlined and $d_j - d_{j+k-1} \geq 2$ otherwise. For $k > i \geq 1$, let $C_{k,i}(n)$ denote the number of overpartitions of $n$ whose non-overlined parts are not congruent to $0,\pm i$ modulo $2k$ and let $C_{k,k}(n)$ denote the number of overpartitions of $n$ with parts not divisible by $k$. Then $C_{k,i}(n) = D_{k,i}(n)$. \end{theorem} In the first section, we will go over the 2-colored Rogers-Ramanujan partition type, accordingly, we will find two functional equations, and then constructively, mentioned above, we will find a partition identity. In the third section, a correspondence between our identities and one for overpartitions is given. Finally, possible future works are introduced in the last section. \section{Colored Rogers-Ramanujan Partitions} \label{Sec:2} Throughout this paper, for $|q| < 1$, $$(a;q)_n=\prod_{i=0}{n-1}(1-aq^i),$$ $$(a;q)_\infty=\lim_{n\rightarrow \infty}(a;q)_n,$$ $$(a_1, a_2,\cdots,a_k; q)_n := (a_1; q)_n(a_2; q)_n \cdots (a_k; q)_n.$$ According to 2-colored Rogers-Ramanujan partitions, the following definition is given. \begin{definition}\label{R12} For $1 \leq j \leq 2$, let $R_j(x)$ be the generating function of 2-colored Rogers-Ramanujan partitions with smallest part greater than or equal to $j$. \end{definition} With respect to these definitions, one can find the following functional equations relating $R_1(x)$ and $R_2(x)$, \begin{equation}\label{con.eq1} R_1(x) - R_2(x) = xq R_1(xq) + xq R_2(xq) \end{equation} and \begin{equation}\label{ck.eq1} R_2(x) = R_1(xq) \end{equation} Equation \eqref{ck.eq1} is clear, as shifting every part of $R_1$ by 1 unit it will change to $R_2$. The proof of equation \eqref{con.eq1} is as follows. Let $$R_i(x)=\sum_{m\geq 0}\sum_{n\geq 0}r_i(m,n)x^mq^n \;\; ;\;\; i = 1, 2$$ be the generating function for the types that have been mentioned above, where m is referring to the number of parts in partitions. Let $\pi$ be a 2-Colored Rogers-Ramanujan partition of $n$ with $m$ parts, all possible ways such that the smallest part $\geq 1$ will be counted by $r_1(m,n)$, if all partitions that the smallest part is $\geq 2$ ($r_2(m, n)$) have been removed, then all remaining partitions are of 2-Colored Rogers-Ramanujan type with the smallest part exactly be 1 ($r_1(m, n) - r_2(m, n)$). Now, let's count all partitions with the smallest part 1 in another way, if 1 is removed from all partitions, then there will be two cases \begin{itemize} \item[(i)] The smallest part is $\geq 2$ with different color than 1, so one can subtract 1 from each part, the enumeration of these partitions is by $r_1(m - 1, n - m)$. \item[(ii)] The smallest part is $\geq 3$ with the same color as 1, if 1 is subtracted from each part, the enumeration of these partitions is $r_2(m-1, m-n)$, note that a part 2 is not possible here. \end{itemize} So $$r_1(m, n) - r_2(m, n) = r_1(m - 1, n - m) + r_2(m - 1, n - m)$$ Multiplying all terms by $x^m q^n$ and taking the summation over $m$ and $n$ for all terms, $m,n \geq 0$ and both integers, we will have \begin{equation*} \begin{split} \sum_{m\geq 0}\sum_{n\geq 0}r_1(m, n)x^mq^n - \sum_{m\geq 0}\sum_{n\geq 0}r_2(m, n)x^mq^n =\\ \sum_{m\geq 0}\sum_{n\geq 0}r_1(m - 1, n - m)x^mq^n+\sum_{m\geq 0}\sum_{n\geq 0}r_2(m - 1, n - m)x^mq^n \end{split} \end{equation*} By changing $m - 1$ to $m$ and $n - m$ to $n - m + 1$ on the right hand side of this equation, we will have \begin{equation*} \begin{split} \sum_{m\geq 0}\sum_{n\geq 0}r1_(m, n)x^mq^n -\sum_{m\geq 0}\sum_{n\geq 0}r_2(m, n)x^mq^n = \\ \sum_{m\geq 0}\sum_{n\geq 0}r_1(m, n)x^{m+1}q^{n+m+1}+\sum_{m\geq 0}\sum_{n\geq 0}r_2(m, n)x^{m+1}q^{n+m+1} \end{split} \end{equation*} so, one will get the functional equation as follows $$R_1(x) - R_2(x) = xqR_1(xq) + xqR_2(xq)$$ Using steps described on \cite{AndSty} and \cite{BreSty}, with straightforward but long computations which we skipped here, by $$R_i(x)=\sum_{n\geq 0} \alpha_n(x)q^{nA_i}+\beta_n(x)x^{B_i}q^{C_i}q^{nD_i}, \;\; i=1,2$$ we can find $\alpha_n$ and $\beta_n$ in terms of $\alpha_0$, $$\alpha_n(x) = \tilde{\alpha}_0(xq^{2n}) \frac{x^{2n} q^{n(2n+1)} q^{-nA_2} (-1; q^E)_{n}(-x^F q^G q^{F-H} q^{nH}; q^{2F -H})_\infty}{(q^E; q^E)_n(x^F q^G q^{F-H} q^{nH}; q^{2F-H})_\infty}$$ and $$\beta_n(x) = -\tilde{\alpha}_0(xq^{2n+1})\frac{x^{2n+1}q^{(n+1)(2n+1)}x^{-B_2} q^{-C_2} q^{-nD_2} (-1; q^E)_{n+1}(-x^Fq^Gq^{2F-H}q^{nH}; q^{2F -H})_\infty}{(q^E; q^E)_n(x^F q^G q^{nH}; q^{2F-H})_\infty}$$ where $$\tilde{\alpha}_0(xq^{2n}) = \alpha_0(xq^{2n})\frac{((xq^{2n})^F q^G q^{F -H}; q^{2F-H})_\infty}{(-(xq^{2n})^F q^G q^{F-H}; q^{2F -H})_\infty}.$$ Then, by equation \eqref{ck.eq1} and considering some assumptions for equations to be consistent, we can find $E$, $F$, $G$ and $H$, in this case $F = G = H = 1$ and $E = -1$. Putting them in the generating functions for $R_i(x)$, being constant of $\tilde{\alpha}_0$ with respect to $x$, and applying $x=1$, we will have $$R_1(1)=\sum_{n\geq 0}\frac{(-1)^nq^{n(2n+1)}(-1;q)_n(-q^{n+1};q)_\infty}{(q)_n(q^{n+1};q)_\infty}-\frac{(-1)^nq^{(n+1)(2n+2)}(-1;q)_{n+1}(-q^{n+2};q)_\infty}{(q)_n(q^{n+1};q)_\infty}$$ and $$R_2(1)=\sum_{n\geq 0}\frac{(-1)^nq^{n(2n+2)}(-1;q)_n(-q^{n+1};q)_\infty}{(q)_n(q^{n+1};q)_\infty}-\frac{(-1)^nq^{(n+1)(2n+1)}(-1;q)_{n+1}(-q^{n+2};q)_\infty}{(q)_n(q^{n+1};q)_\infty}.$$ they can be rewritten as follows, $$R_1(1)=2\frac{(-q)_\infty}{(q)_\infty}\sum_{n\geq 0}(-1)^nq^{n(2n+1)}(\frac{1}{1+q^n}-\frac{q^{3n+2}}{1+q^{n+1}})$$ and $$R_2(1)=2\frac{(-q)_\infty}{(q)_\infty}\sum_{n\geq 0}(-1)^nq^{n(2n+2)}(\frac{1}{1+q^n}-\frac{q^{n+1}}{1+q^{n+1}}).$$ So, \begin{equation*} \begin{split} R_1(1)=2\frac{(-q)_\infty}{(q)_\infty}(\sum_{n\geq 0}\frac{(-1)^nq^{n(2n+1)}}{1+q^n}-\sum_{n\geq 0}\frac{(-1)^nq^{n(2n+1)}q^{3n+2}}{1+q^{n+1}})\\ =\frac{(-q)_\infty}{(q)_\infty}(1+2(\sum_{n\geq 1}\frac{(-1)^nq^{n(2n+1)}}{1+q^n}-\sum_{n\geq 1}\frac{(-1)^{n-1}q^{2n^2}}{1+q^{n}}))\\ =\frac{(-q)_\infty}{(q)_\infty}(1+2\sum_{n\geq 1}(-1)^nq^{2n^2})=\frac{(-q)_\infty}{(q)_\infty}\sum_{n=-\infty}^{\infty}(-1)^nq^{2n^2} \end{split} \end{equation*} By theorem \ref{JTP} for $z=-1$ and $q^2$, for 2-colored Rogers-Ramanujan defined in \ref{R12} the following identity holds $$R_1(1)=\frac{(-q)_\infty(q^2,q^2,q^4;q^4)_\infty}{(q)_\infty}$$ Moreover, the coefficients in the Taylor series of $R_2(1)$ coincides with the number of partitions for 2-colored Rogers-Ramanujan partitions with parts more than $1$, $$1+2q^2+2q^3+2q^4+4q^5+6q^6+8q^7+10q^8+14q^9+18q^{10}+\cdots .$$ \section{Correspondence with Overpartitions} \label{Sec:3} There is a one-to-one correspondence between 2-colored Rogers-Ramanujan type partitions and previously defined overpartitions $D_{k,a}(n)$ for k=a=2. Let $\pi=(y_1,\cdots,y_i,y_{i+1},\cdots,y_m)$ be an arbitrary partition of $n$, first of all, for both cases all parts are distinct. Secondly, for the case that there are $t$ number of consecutive parts, for the colored case, there are only two possibilities, they should be alternatively red and black, e.g. for three consecutive parts $i$, $i+1$ and $i+2$ cases are $$\cdots,i,\color{red}{i+1} \color{black},i+2, \cdots \;\; \text{and} \;\; \cdots, \color{red}i \color{black}, {i+1},\color{red}{i+2} \color{black},\cdots$$ which means two consecutive parts can not be of the same color, and for overpartition case, the first $t-1$ parts should be overlined and there are two possibilities for the last one, e.g. for three consecutive parts we will have $$\cdots,\overline{i},\overline{i+1},i+2,\cdots \;\; \text{and} \;\; \cdots,\overline{i},\overline{i+1},\overline{i+2},\cdots$$ implies the first one should be overlined and the second one can be overlined or non-overlined. If $y_{i+1}-y_i > 1$, then there are four cases for both colored cases and overpartition one, $$\cdots,y_i,y_{i+1}, \cdots \;\; \text{and} \;\; \cdots, y_i,\color{red} y_{i+1} \color{black},\cdots \;\; \text{and} \;\; \cdots, \color{red}y_i \color{black}, y_{i+1},\cdots \;\; \text{and} \;\; \cdots, \color{red}y_i \color{black}, \color{red}y_{i+1}\color{black},\cdots$$ and $$\cdots,y_i,y_{i+1},\cdots \;\; \text{and} \;\; \cdots,y_i,\bar{y}_{i+1},\cdots \;\; \text{and} \;\; \cdots,\bar{y}_i,y_{i+1},\cdots \;\; \text{and} \;\; \cdots,\bar{y}_i,\bar{y}_{i+1},\cdots$$ so, there exists a one-to-one correspondence between them. It is not hard to see another correspondence between $D_{2,1}(n)$ and the following partition type, \begin{definition}\label{R3} Let $R_3(n)$ denote the number of 2-colored Rogers-Ramanujan partitions which do not allow to have a red $1$ in the partition. \end{definition} Then \begin{theorem} For definition \ref{R3} the following identity holds $$R_3(n)=D_{2,1}(n)=\frac{(-q)_\infty(q^1,q^3,q^4;q^4)_\infty}{(q)_\infty}$$ \end{theorem} \section{Future Works} \label{Sec:4} There are two options for further work on this topic, first one is to extend the number of colors to more than two, ideally for arbitrary number of colors. Our second suggestion is two extend it to 2-colored Gordon-Rogers-Ramanujan type partitions, i.e. for 2-colored partition $y_1+ \cdots + y_m$, and for $k \geq 1$, $y_j - y_{j+k-1} \geq 1$ if $y_j$ is black and $y_j - y_{j+k-1} \geq 2$ otherwise.
b902889fecc6782af19ab472b99cfff85a4199b6
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction and main results} Let $\theta$ be an inner function in the sense of Beurling, $\Lambda = \{\lambda_k\}_{k \ge 0}$ be a sequence of distinct points in the open unit disc ${\mathbb D}$ satisfying the Blaschke condition, \begin{equation} \sum_{\lambda\in\Lambda}(1-|\lambda|)<\infty, \tag{B} \end{equation} (from now on we write $\Lambda \in (B)$ if a set $\Lambda$ satisfies the Blaschke condition $(B)$), and let $B_\Lambda$ be the corresponding Blaschke product. We are interested in geometric properties ((uniform) minimality, being a Riesz sequen\-ce/basis, being an asymptotically orthonormal basis) of the reproducing kernel family $$ \mathcal K_{\Lambda, \theta}=\Bigl\{k_\theta(\lambda, z) =P_\theta k(\lambda, z) = \frac {1-\overline {\theta(\lambda)} \theta(z)} {1-\overline {\lambda} z}\Bigr\}_{\lambda \in \Lambda} $$ in the model space $K_\theta=H^2 \ominus \theta H^2$. Here $P_\theta$ is the operator of orthogonal projection onto $K_\theta$, and $k(\lambda, z) = \frac {1} {1-\overline {\lambda} z}$ is the reproducing kernel in the Hardy space $H^2$. B.Pavlov noticed (see \cite[Vol.2, Part D, Section 4.4]{11}, \cite{2}, \cite{7}) that if $\sup_{\lambda \in \Lambda} |\theta(\lambda)| <1$ and $P_\theta\vert K_{B_\Lambda}$ is an isomorphism onto its image, then the family $\mathcal K_{\Lambda, \theta}$ inherits some geometric properties of the family $\mathcal K_{\Lambda}=\{k(\lambda, \cdot) : \lambda \in \Lambda\} $. Furthermore, $P_\theta\vert K_{B_\Lambda}$ is an isomorphism onto its image if and only if \begin{equation} \mathop{\rm dist\,}_{L^\infty}(\theta, B_{\Lambda}H^\infty)<1. \label{distless1} \end{equation} Notice that under condition \eqref{distless1}, we have $\sup_{\lambda \in \Lambda} |\theta(\lambda)| <1$. In \cite{4} and \cite{5} we studied relationships between condition \eqref{distless1} and the so called Schur--Nevanlinna coefficients and functions. Given $\mu \in {\mathbb D}$, denote by $\tau_\mu$ the corresponding M\"obius transformation, $\tau_\mu(z)=\frac{z-\mu}{1-\overline \mu z}$. Fix a function $\theta$ in the closed unit ball $\mathcal B$ of $H^\infty$ and a sequence $\Lambda=\{\lambda_n\}_{n\ge 0}$ of points in the unit disc. We define the Schur--Nevanlinna functions $\{\theta_n\}_{n \ge 0}$ and the Schur--Nevanlinna coefficients $\{\gamma_n\}_{n \ge 0}$ as follows: $\theta_0 =\theta$, $\gamma_0 =\theta_0(\lambda _0)$ and \begin{equation} \theta_n = \frac{\tau_{\gamma_{n-1}}(\theta_{n-1})}{\tau_{\lambda_{n-1}}},\qquad \gamma_{n} =\theta_{n}(\lambda _{n}),\qquad n\ge 1. \label{Schur} \end{equation} The Schwarz lemma gives immediately that $\theta_n\in\mathcal B$, $n\ge 1$. In \cite{4} we established that if \begin{equation} \sum_{n \ge 0} |\gamma_n| < \infty, \label{sumConverges} \end{equation} then condition \eqref{distless1} is fulfilled. Given $\mu \in {\mathbb D} \setminus \Lambda$, we set $l_\mu = \frac {\sqrt{1-|\mu|^2}} {1-\overline \mu z} B_\Lambda \in K_{B_{\Lambda \bigcup \{\mu\}}}$. In \cite[Corolary 3.5]{5} we showed that $$ \mathop{\rm dist\,}_{H^2}^2(P_\theta l_{\mu}, \spanmat\mathcal K_{\Lambda , \theta}) = (1-|\theta(\mu)|^2) \prod_{k=1}^{{\infty}} \frac {1-|\theta_k(\mu)|^2}{1-|\theta_k(\lambda_{n})|^2|b_{\lambda_{k-1}}(\mu)|^2}, $$ where $\spanmat X$ denotes the closed linear hull of a family $X$. Using \eqref{usefulidentity} below, we get \begin{equation} \mathop{\rm dist\,}_{H^2}^2(P_\theta l_{\mu}, \spanmat\mathcal K_{\Lambda , \theta}) = \lim_{n\to\infty} (1-|\theta_n(\mu)|^2) \prod_{k=0}^{n-1} \frac {|1-\overline \gamma_k \theta_k(\mu)|^2}{1- | \gamma_k|^2}. \label{distlmu} \end{equation} Since $l_\mu$ are unit vectors orthogonal to $K_{B_\Lambda}$, we have $\mathop{\rm dist\,}( l_{\mu}, K_{B_\Lambda})=1$. If $P_\theta\vert K_{B_{\Lambda \bigcup \{\mu\}}}$ is an isomorphism into $K_\theta$, then the distance between the corresponding images is separated from $0$, that is $$ \mathop{\rm dist\,}_{H^2} (P_\theta l_{\mu}, \spanmat\mathcal K_{\Lambda , \theta}) >0 $$ Under condition \eqref{sumConverges} the latter means that $ \lim_{n \to \infty} |\theta_n(\mu)| <1$. In Section 3 of this paper, we consider first the case when condition \eqref{sumConverges} is not necessarily fulfilled. \begin{proposition} \label{Pr1} Let $\Lambda=\{\lambda _n\}_{n \ge 0} \in (B)$ and let $\theta$ be an inner function. Suppose that $\mathcal K_{\Lambda, \theta}$ is complete in $K_\theta$. Then $\sum_{n \ge 1} |\theta_n(\mu)|^2=\infty$ for every $ \mu \in {\mathbb D} \setminus \Lambda$. \end{proposition} If condition \eqref{sumConverges} is fulfilled, we can say much more. In \eqref{distNRKmuinfty2} below, we obtain that \begin{multline*} \mathop{\rm dist\,}_{H^2}^2(\widetilde k_\theta(\mu, \cdot), \spanmat \mathcal K_{\Lambda, \theta}) \\ = \frac { |B_\Lambda(\mu)| ^2} {1-|\theta(\mu)|^2} \lim_{n\to\infty} (1-|\theta_n(\mu)|^2) \prod_{k=0}^{n-1} \frac {|1-\overline \gamma_k \theta_k(\mu)|^2}{1- | \gamma_k|^2}, \end{multline*} where $\widetilde k_\theta(\mu, \cdot)=\frac {k_\theta(\mu, \cdot)}{\|k_\theta(\mu, \cdot)\|_2}$ is the normalized reproducing kernel in $K_\theta$. Since $\spanmat \mathcal K_{\Lambda, \theta} \neq K_{\theta}$ if and only if for every $ \mu \in {\mathbb D} \setminus \{\Lambda\} $ we have $ k_{\theta}(\cdot,\mu) \notin \spanmat \mathcal K_{\Lambda, \theta}$ (see Lemma B below), we obtain that under condition \eqref{sumConverges}, $\mathcal K_{\Lambda , \theta}$ is complete in $K_\theta$ if and only if $ \lim_{n \to \infty} |\theta_n(\mu)| =1$ for some/every $ \mu \in {\mathbb D} \setminus \{\Lambda\} $. \subsection{Functions with given Schur--Nevanlinna coefficients} Given a sequence $\Lambda$ and a sequence $\Gamma=\{\gamma_n\}_{n \ge 0} $ satisfying \eqref{sumConverges} we are going to construct two functions: an inner function $\theta$ and a function $h\in \mathcal B$, whose Schur--Nevanlinna coefficients with respect to $\Lambda$ coincide with $\Gamma$ and which satisfy some additional conditions on the corresponding Schur--Nevanlinna functions. \begin{lemma} \label{L2} Let $\Lambda=\{\lambda_n\}_{n \ge 0}\in (B)$, $\Gamma=\{\gamma_n\}_{n \ge 0}$ be a sequence of points in ${\mathbb D}$ satisfying condition \eqref{sumConverges}, $\mu \in {\mathbb D} \setminus \Lambda$. Then \newline\noindent {\rm (i)} there exists a function $h\in \mathcal B$ such that its sequence of Schur--Nevanlinna coefficients with respect to $\Lambda$ coincides with $\Gamma$ and \newline\noindent $\sup_{n \ge 0} \|h_n\|_\infty<1$, where $h_n$ is the $ n$-th Schur--Nevanlinna function for $(\Lambda,h)$; \newline\noindent {\rm (ii)} there exists an inner function $\theta$ such that its sequence of Schur--Nevanlinna coefficients with respect to $\Lambda$ coincides with $\Gamma$ and for every $\mu \in {\mathbb D} \setminus \Lambda$ we have $\sup_n | \theta_n(\mu)|=1$, where $\theta_n$ is the $ n$-th Schur--Nevanlinna function for $(\Lambda, \theta)$. \end{lemma} It should be mentioned that, by the Schwarz lemma, $\sup_n | \theta_n(\mu)|=1$ for some $\mu \in {\mathbb D} $ if and only if $\sup_n | \theta_n(\mu)|=1$ for every $\mu \in {\mathbb D}$. Using Lemma~\ref{L2} we obtain the following result on the distances between $P_\theta l_\mu $ and $ \spanmat\mathcal K_{\Lambda , \theta}$. \begin{proposition} \label{Th3} Let $\Lambda=\{\lambda_n\}_{n \ge 0}\in (B)$, $\Gamma=\{\gamma_n\}_{n \ge 0}$ be a sequence of points in ${\mathbb D}$ satisfying condition \eqref{sumConverges}. Then \newline\noindent {\rm (i)} there exists an inner function $\theta$ such that its sequence of Schur--Nevanlinna coefficients with respect to $\Lambda$ coincides with $\Gamma$ and for every $w \in {\mathbb D} $ we have $$ \lim_{n \to \infty} |\theta_n(w)|<1, $$ and $$ \mathop{\rm dist\,}_{H^2}^2(P_\theta l_{w}, \spanmat\mathcal K_{\Lambda , \theta}) \asymp 1-\lim_{n \to \infty} |\theta_n(w)|^2 $$ uniformly in $w \in {\mathbb D}\setminus \Lambda$; \newline\noindent {\rm (ii)} there exists an inner function $\theta$ such that its sequence of Schur--Nevanlinna coefficients with respect to $\Lambda$ coincides with $\Gamma$ and for every $w \in {\mathbb D}$ we have $$\lim_{n \to \infty} |\theta_n(w)|=1 $$ and $$ P_\theta l_w \in \spanmat\mathcal K_{\Lambda , \theta}. $$ \end{proposition} We say that a sequence $\Lambda=\{\lambda_n\}_{n\ge 0} $ of points in ${\mathbb D}$ satisfies the Carleson condition and write $\Lambda \in (C)$ if $$ \inf_n \prod_{m \neq n}\Bigl| \frac {\lambda_m-\lambda_n}{1-\overline \lambda_m \lambda_n}\Bigr| > 0. $$ Set \begin{gather*} \widetilde k(\lambda, z)= \frac {k(\lambda, z)}{\|k(\lambda, z)\|_2}= \frac {\sqrt{1-|\lambda|^2}} {1-\overline {\lambda} z},\\ \widetilde {\mathcal K}_{\Lambda}=\{\widetilde k(\lambda, \cdot)\}_{\lambda \in \Lambda},\quad \widetilde {\mathcal K}_{\Lambda, \theta}=\{\widetilde k_\theta(\lambda, \cdot)\}_{\lambda \in \Lambda}. \end{gather*} Notice that the Carleson condition on $\Lambda$ is sufficient for the family $ \widetilde {\mathcal K}_{\Lambda}$ to be a Riesz sequence and is necessary for the families $ {\mathcal K}_{\Lambda}$, $ {\mathcal K}_{\Lambda, \theta}$ to be uniformly minimal (see \cite[Vol.2, Part D, Lemma 4.4.2]{11} for $ {\mathcal K}_{\Lambda}$ and \cite{5} for ${\mathcal K}_{\Lambda, \theta}$). The following result shows that for a fixed $\Lambda \in (C) $ different geometric behavior of ${\mathcal K}_{\Lambda, \theta}$ is possible. \begin{theorem} \label{Th4} Let $\Lambda \in (C) $, $\Gamma=\{\gamma_n\}_{n \ge 0}$ be a sequence of points in ${\mathbb D}$ satisfying condition \eqref{sumConverges}. Then \newline\noindent {\rm (i)} there exists an inner function $\theta$ such that its sequence of Schur--Nevanlinna coefficients with respect to $\Lambda$ coincides with $\Gamma$, $ \widetilde {\mathcal K}_{\Lambda, \theta}$ is a non complete in $K_\theta$ Riesz sequence, for every $\mu \in {\mathbb D}\setminus \Lambda$ we have $$ \lim_n |\theta_n(\mu)|<1, $$ and $$ \frac {\mathop{\rm dist\,}_{H^2}^2(P_{\theta} \widetilde {k}(\mu, \cdot), \spanmat\mathcal K_{\Lambda , \theta})}{\mathop{\rm dist\,}_{H^2}^2( \widetilde k(\mu, \cdot), K_{B_\Lambda})} \asymp 1-\lim_n |\theta_n(\mu)|^2, $$ uniformly in $\mu \in {\mathbb D}\setminus \Lambda$; \newline\noindent {\rm (ii)} there exists an inner function $\theta$ such that its sequence of Schur--Nevanlinna coefficients with respect to $\Lambda$ coincides with $\Gamma$, $ \widetilde {\mathcal K}_{\Lambda, \theta}$ is a Riesz basis in $K_\theta$, and for every $\mu \in {\mathbb D}\setminus \Lambda$ we have $\lim_n |\theta_n(\mu)|=1$. \end{theorem} It is interesting to relate Theorem~\ref{Th4} to the following question posed by Nikolski and partially resolved by Dyakonov \cite{10} : given an arbitrary inner function $\theta$, does the corresponding model space $K_\theta$ always possess an unconditional basis of reproducing kernels ? In other words ({see Theorem~C} below), given an inner function $\theta$, does there always exist a set $\Lambda$ satisfying the Carleson condition such that $ \mathop{\rm dist\,}_{L^\infty}(\theta, B_\Lambda H^\infty)<1$ and $ \mathop{\rm dist\,}_{L^\infty}(B_\Lambda, \theta H^\infty)<1$ ? \subsection{Vanishing condition} Here we consider the situation when \begin{equation} \lim_{n \to \infty} \theta(\lambda_n)=0. \label{limzero} \end{equation} We show that condition \eqref{limzero} characterizes compact Hankel operators with symbols of the form $\theta \overline {B_\Lambda}$, $\Lambda \in (C)$: \begin{proposition} \label{L5} Let $\Lambda=\{\lambda_n\}_{n \ge 0} \in (C)$, $\theta$ be an inner function. Then the following assertions are equivalent. \newline\noindent {\rm (i)} $\lim_{n\to\infty} \theta(\lambda_n)=0$. \newline\noindent {\rm (ii)} The Hankel operatop $H_{\theta \overline {B_\Lambda}}$ is compact. \newline\noindent {\rm (iii)} The operator $\theta(T_{B_\Lambda}) \vert K_{B_\Lambda}$ (see Section 2.4 below) is compact. \end{proposition} It is known (see \cite{2}) that if $\Lambda \in (C)$, $\theta$ is not a pure Blaschke product, and condition \eqref{limzero} is fulfilled, then $\widetilde {\mathcal K}_{\Lambda, \theta } $ is a Riesz basis in the closure of its linear hull, and it is not complete in $K_\theta$. If $\theta$ is a pure Blaschke product, then $\widetilde {\mathcal K}_{\Lambda, \theta } $ can be a Riesz basis, for example, in a special situation described in the following theorem. \begin{theorem} \label{Th6} Let $\Lambda=\{\lambda_n\}_{n \ge 0} \in (C)$, $\mathcal M=\{\mu_n\}_{n \ge 0} \in (C)$, be such that $\lim_{n \to \infty}B_\mathcal M(\lambda_n)=0$. Suppose that $\widetilde {\mathcal K}_{\Lambda, B_\mathcal M}$ is a Riesz basis in $K_{B_\mathcal M}$. Then $\lim_{n \to \infty}B_\Lambda(\mu_n)=0$ and $\widetilde {\mathcal K}_{\mathcal M, B_\Lambda}$ is a Riesz basis in $K_{B_\Lambda}$. \end{theorem} Combining Lemma~H below with Theorem~\ref{Th6} and using the fact that if ${\mathcal K}_{\Lambda, \theta}$ is uniformly minimal, then $\Lambda \in (C)$ (see \cite[Corollary 3.4]{5}), we deduce \begin{corollary} \label{Cor7} The following assertions are equivalent: \newline\noindent {\rm (i)} $\Lambda \in (C)$, $\mathcal M \in (C)$, $\lim_{n \to \infty}B_\mathcal M(\lambda_n)=0$, $\lim_{n \to \infty}B_\Lambda(\mu_n)=0$, $\widetilde {\mathcal K}_{\Lambda, B_\mathcal M}$ is a Riesz basis in $ K_{B_\mathcal M}$, $\widetilde{\mathcal K}_{\mathcal M, B_\Lambda}$ is a Riesz basis in $K_{B_\Lambda}$. \newline\noindent {\rm (ii)} $\Lambda \in (C)$, $\mathcal M \in (C)$, $\lim_{n \to \infty}B_\mathcal M(\lambda_n)=0$, $\widetilde {\mathcal K}_{\Lambda, B_\mathcal M}$ is a Riesz basis in $K_{B_\mathcal M}$ \newline\noindent {\rm (iii)} $\Lambda \in (C)$, $\mathcal M \in (C)$, $\lim_{n \to \infty}B_\mathcal M(\lambda_n)= 0$, $\mathcal K_{\Lambda, B_\mathcal M}$ is complete and minimal in $K_{B_\mathcal M}$. \newline\noindent {\rm (iv)} $\Lambda \in (B)$, $\mathcal M \in (C)$, $\lim_{n \to \infty}B_\mathcal M(\lambda_n)= 0$, $\mathcal K_{\Lambda, B_\mathcal M}$ is complete and uniformly minimal in $K_{B_\mathcal M}$. \end{corollary} By Proposition~\ref{Pr1}, if one of the assertions of the corollary is fulfilled, then $\sum_{n \ge 0} |\theta_n(\mu)|^2=\infty$, $\mu \in {\mathbb D} \setminus \Lambda$. Sometimes it is convenient to work with projections of Malmquist--Walsh functions $\{l_n\}_{n \ge 0}$, $ l_n=B_{0,n-1}\widetilde k(\lambda_n, \cdot)$, $ n \ge 0$, where $B_{0,n}=\prod_{i=0}^n b_{\lambda _i}$, $b_\lambda=(-\lambda/|\lambda|)\tau_\lambda$ is the Blaschke factor corresponding to $\lambda$, instead of projections of reproducing kernels. Proposition~\ref{L5} and Lemma~G below show that if $\lim_{n\to\infty} \theta(\lambda_n)=0$ then the Gram matrix of the family $\{P_\theta l_n\}_{n \ge 0}$ is of the form $I + K$ with $K$ compact. Families whose Gram matrices have such a form are asymptotically orthonormal families (see the definition in Section 2 below) and are widely studied (see, for example, \cite{3,6,9,13,14,15}). In a general situation it may be complicated to estimate the norms $\| P_\theta l_n\|_2$. However, if $\lim_{n\to\infty} \theta(\lambda_n) = 0$, we can do this. \begin{corollary} \label{Cor8} Let $\Lambda \in (C)$. Then the following assertions are equivalent \newline\noindent {\rm (i)} $\lim_{n\to\infty} \theta(\lambda_n)=0$. \newline\noindent {\rm (ii)} The Gram matrix of the family $\{P_\theta l_n\}_{n \ge 0}$ is of the form $I + K$ with $K$ compact. If these assertions are fulfilled, we have $$ \lim_{n \to \infty }\mathop{\rm dist\,}_{H^2} ^2(P_\theta l_{n}, \spanmat \mathcal K_{\Lambda_{n-1}, \theta}) = $$ and thus $\lim_{n\to\infty} \| P_\theta l_n\|_2 =1$. \end{corollary} \section{Necessary facts and definitions} \label{sect2} \subsection{Carleson's Interpolation theorem} A sequence $\{z_n\}_{n \ge 1} \subset {\mathbb D}$ is called an interpolating sequence if every interpolation problem $$ f(z_n) = a_n, \qquad n \ge 1, $$ with bounded data $\{a_n\}_{n \ge 1}$ has a solution $f \in H^\infty$. A famous theorem of L.Carleson (\cite{12}) states that a sequence is interpolating if and only if it satisfies the Carleson condition $(C)$. \subsection{Families of reproducing kernels and their projections} A family of vectors $\{x_n\}_{n \ge 1}$ in a Hilbert space $H$ is minimal if each element of the family lies outside the closed linear hull of the others, and is uniformly minimal if $\inf_{n \ge 1} \mathop{\rm dist\,}_H (\frac {x_n}{\|x_n\|_H}, \spanmat \{x_k\}_{ k \neq n})>0$ . Following, for example, \cite[Chapter VI, Section 1, p.132] {1}, we say that a family of vectors $X=\{x_n\}_{n\ge 1}$ in a Hilbert space $H$ is called a Riesz sequence if there exists a bounded on $\spanmat X$ and invertible linear operator $V$ mapping $X$ into an orthonormal family $\{Vx_n\}_{n\ge 1}$. Such an operator $V$ is called an orthogonalizer of $X$. A Riesz sequence complete in $H$ is called a Riesz basis. A family of vectors $\{x_n\}_{n\ge 1}$ in $H$ is called an asymptotically orthonormal sequence (AOS) if for every $ N \ge 1$ there exist positive numbers $c_N$, $C_N$ such that for every $\{a_n\}_{n=1}^\infty \in l^2$ we have $ \label{aob} c_N \sum_{n \ge N}|a_n|^2 \le \| \sum_{n \ge N }a_nx_n\|_H^2 \le C_N \sum_{n \ge N}|a_n|^2, $ where $ \label{aobc} \lim_{N \to \infty} c_N=\lim_{N \to \infty} C_N=1. $ A complete asymptotically orthonormal sequence is called an asymptotically orthonormal basis. A sequence $\Lambda=\{\lambda_n\} $ of points of the open unit disc is thin if $$ \lim_{n\to\infty} \prod_{m \neq n}\Bigl| \frac {\lambda_m-\lambda_n}{1-\overline \lambda_m \lambda_n}\Bigr|=1. $$ \begin{theoremAOS Let $\Lambda=\{\lambda_k\}_{k \ge 1}$, $\Lambda_{n, \infty}=\{\lambda_n\}_{k \ge n}$. \begin{itemize} \item[(1)] The sequence $\widetilde {\mathcal K}_{\Lambda}$ is an AOS if and only if $\Lambda$ is thin (\cite {8,14}). \item[(2)] If the sequence $\widetilde {\mathcal K}_{\Lambda, \theta}$ is an AOS then $\Lambda$ is thin (\cite[Proposition 5.1] {3}). \item[(3)] \cite[Theorem 5.2] {3} Let $\sup_{\lambda \in \Lambda} |\theta (\lambda)|<1$ and let the sequence $\widetilde {\mathcal K}_{\Lambda}$ be an AOS. Then either \begin{itemize} \item[a)] $\widetilde {\mathcal K}_{\Lambda, \theta}$ is an AOS or \item[b)] for some $p \ge 2$ the family $\widetilde {\mathcal K}_{\Lambda_{p, \infty}, \theta}$ is an asymptotically orthonormal basis in $K_\theta$. \end{itemize} \end{itemize} \end{theoremAOS} We say that an operator $V$ acting between two Hilbert spaces is a $U+\mathfrak{S}_\infty$ operator ($V \in (U+\mathfrak{S}_\infty)$) if $V=U+K$ with $U$ unitary, $K$ compact. We say that a matrix $A$ is an $I+\mathfrak{S}_\infty$ matrix ($A \in (I+\mathfrak{S}_\infty)$), if it defines a bounded invertible operator on $l^2$ having the form $I+K$ where $K$ is a compact and $I$ is the identity operator. Following \cite{8}, we say that a Riesz sequence $X$ is a $U+\mathfrak{S}_\infty$ family ($X \sim U+\mathfrak{S}_\infty $), if one (and thus, every) orthogonalizer of $X$ is a $U+\mathfrak{S}_\infty$ operator. \begin{theoremUK} (see \cite{15, 9}) Let $X$ be a family of vectors $\{x_n\}_{n\ge 1}$ in a Hilbert space. We denote by $G(X)$ the Gram matrix of $X$. The following assertions are equivalent : \begin{itemize} \item[1.] $X$ is an AOS. \item[2.] $X \sim U+\mathfrak{S}_\infty$. \item[3.]$G(X)\in (I+\mathfrak{S}_\infty)$. \end{itemize} \end{theoremUK} Next we need several results which can be found, for example, in \cite{1,11}. In what follows $ \Lambda \subset {\mathbb D} $, $\Lambda \in (B)$, $B=B_\Lambda$, $\theta$ is an inner function. \begin{theoremletterA} (see \cite[Lecture VI, pp. 132--135]{1}) \label{ThA} \begin{itemize} \item [(1)] The following assertions are equivalent : \begin{itemize} \item [(a)] $\widetilde {\mathcal K}_\Lambda$ is a Riesz basis in $K_B$. \item [(b)] ${\mathcal K}_\Lambda$ is a uniformly minimal family. \item[(c)] $\Lambda \in (C)$. \end{itemize} \item [(2)] Let $\mu \in {\mathbb D} \setminus \Lambda$. Then $\mathop{\rm dist\,}_{H^2}( \widetilde k(\mu, \cdot), K_B)=|B(\mu)|$. \end{itemize} \end{theoremletterA} \begin{lemmaletterB} \cite[p. 211]{1}. \label{LB} Let $\spanmat \mathcal K_{\Lambda, \theta} \neq K_{\theta}$. Then for every $\mu \in {\mathbb D} \setminus \{\Lambda\} $ we have $ k_{\theta}(\mu, \cdot) \notin \spanmat \mathcal K_{\Lambda, \theta}$. \end{lemmaletterB} \begin{theoremletterC} \cite[Vol.2, Part D, Theorem 4.4.6]{11}. \label{ThC} Let $\sup_{\lambda \in \Lambda} |\theta(\lambda)|<1$. The following assertions are equivalent: \begin{itemize} \item [(1)] The family $\widetilde {\mathcal K}_{\Lambda, \theta}$ is a Riesz basis in $K_\theta$. \item [(2)] $\Lambda \in (C)$ and the projection $P_{\theta} \vert K_B$ is an isomorphism onto $K_{\theta}$ (in particular, $\spanmat \mathcal K_{\Lambda, \theta}= K_{\theta}$). \item [(3)] $\Lambda \in (C)$ and $\mathop{\rm dist\,}_{L^\infty}(\theta, BH^\infty)<1$, $\mathop{\rm dist\,}_{L^\infty}(B, \theta H^\infty)<1$. \item [(4)] $\Lambda \in (C)$, $\mathop{\rm dist\,}_{L^\infty}(\theta, B H^\infty)<1$, and for some/every $\mu \in {\mathbb D} \setminus \Lambda$ we have $\mathop{\rm dist\,}_{L^\infty}(\theta , b_\mu B H^\infty)=1$. \end{itemize} \end{theoremletterC} \begin{theoremletterD}\cite[Vol.2, Part D, Theorem 4.4.8]{11}. \label{ThD} Let $\sup_{\lambda \in \Lambda} |\theta(\lambda)|<1$. The following assertions are equivalent: \begin{itemize} \item [(1)] The family $\widetilde {\mathcal K}_{\Lambda, \theta}$ is a Riesz sequence. \item [(2)] $\Lambda \in (C)$ and the projection $P_{\theta} \vert K_B$ is an isomorphism into $K_{\theta}$. \item [(3)] $\Lambda \in (C)$ and $\mathop{\rm dist\,}_{L^\infty}(\theta, BH^\infty)<1$. \end{itemize} \end{theoremletterD} Combining two previous theorems, we get the following result. \begin{propositionletter?} \label{PE} Let $\sup_{\lambda \in \Lambda} |\theta(\lambda)|<1$. The following assertions are equivalent: \begin{itemize} \item [(1)] The family $\mathcal K_{\Lambda, \theta}$ is a Riesz basis in the closure of its linear hull and is not complete in $K_\theta$. \item [(2)] $\Lambda \in (C)$ and the projection $P_{\theta} \vert K_B$ is an isomorphism onto a proper closed subspace of $K_{\theta}$. \item [(3)] $\Lambda \in (C)$ and $\mathop{\rm dist\,}_{L^\infty}(\theta, BH^\infty)<1$, $\mathop{\rm dist\,}_{L^\infty}(B, \theta H^\infty)=1$. \item [(4)] $\Lambda \in (C)$ and for some/every $\mu \in {\mathbb D}$ we have \newline\noindent $\mathop{\rm dist\,}_{L^\infty}(\theta , b_\mu B H^\infty)<1$. \end{itemize} \end{propositionletter?} \subsection{Distances} Let $\theta$ be an inner function, $\Lambda=\{\lambda _n\}_{n \ge 0} \in (B)$, $\mu \in {\mathbb D} \setminus \Lambda $, $ \Lambda_n=\{\lambda _k\}_{k=0}^n$, $B_{k,n}=\prod_{j=k}^n b_{\lambda_j}$. Furthermore, let $L=\{l_n\}_{n \ge 0}$ be the Malmquist--Walsh basis of $K_{B_\Lambda}$, $l_0=\widetilde k(\lambda_0, \cdot)$, $ l_n=B_{0,n-1}\widetilde k(\lambda_n, \cdot)$, $ n \ge 1$. Denote by $\{\gamma_n\}_{n \ge 0} $, $\{\theta_n\}_{n \ge 0} $ the Schur--Nevanlinna coefficients and functions corresponding to $\Lambda, \theta$. Here are several distance formulas from \cite{5} we need in this paper. \begin{itemize} \item [(1)] By \cite[Proposition 3.1]{5}, we have \begin{multline} \mathop{\rm dist\,}_{H^2} ^2(P_\theta l_{n}(z), \spanmat \mathcal K_{\Lambda_{n-1}, \theta}) \\ = (1-|\theta(\lambda_n)|^2) \prod_{k=1}^n \frac {1-|\theta_k(\lambda_n)|^2}{1-|\theta_k(\lambda_n)|^2|b_{\lambda_{k-1}}(\lambda_n)|^2}. \label{distMWlambdan} \end{multline} \item [(2)] By \cite[Proposition 3.2]{5} we have \begin{equation} \mathop{\rm dist\,}_{H^2} ^2(\widetilde k_{\theta}(\mu, \cdot), \spanmat \mathcal K_{\Lambda_n, \theta}) = |B_{0,n}(\mu)| ^2\prod_{k=1}^n \frac {1-|\theta_k(\mu)|^2}{1-|\theta_k(\mu)|^2|b_{\lambda_{k-1}}(\mu)|^2}. \label{distNRKmun} \end{equation} \item [(3)]Passing to the limit $n \to \infty$, we conclude that \begin{equation} \mathop{\rm dist\,}_{H^2} ^2(\widetilde k_{\theta}(\mu, \cdot), \spanmat \mathcal K_{\Lambda, \theta}) = |B_\Lambda(\mu)| ^2\prod_{k=1}^\infty \frac {1-|\theta_k(\mu)|^2}{1-|\theta_k(\mu)|^2|b_{\lambda_{k-1}}(\mu)|^2}. \label{distNRKmuinfty} \end{equation} and thus \begin{multline} \mathop{\rm dist\,}_{H^2} ^2(\widetilde k_{\theta}(\lambda_n, \cdot), \spanmat \mathcal K_{\Lambda \setminus \{\lambda_n\}, \theta})\\ =|B_{\Lambda \setminus \{\lambda_n\}}(\lambda_n)| ^2\prod_{k \neq n}^\infty \frac {1-|\theta_k(\lambda_n)|^2}{1-|\theta_k(\lambda_n)|^2|b_{\lambda_{k-1}}(\lambda_n)|^2}. \label{distNRKlambdaninfty} \end{multline} \end{itemize} The following useful identity can be verified by induction: \begin{multline} (1-|\theta(\mu)|^2) \prod_{k=1}^{n} \frac {1-|\theta_k(\mu)|^2}{1-|\theta_k(\mu)|^2|b_{\lambda_{k-1}}(\mu)|^2}\\= (1-|\theta_n(\mu)|^2) \prod_{k=0}^{n-1} \frac {|1-\overline \gamma_k \theta_k(\mu)|^2}{1- | \gamma_k|^2}. \label{usefulidentity} \end{multline} Combining \eqref{usefulidentity} with \eqref{distNRKmun} we obtain \begin{multline} \mathop{\rm dist\,}_{H^2} ^2(\widetilde k_\theta(\mu, \cdot), \spanmat \mathcal K_{\Lambda_n, \theta}) \\ = \frac { |B_{0,n}(\mu)| ^2} {1-|\theta(\mu)|^2} (1-|\theta_n(\mu)|^2) \prod_{k=0}^{n-1} \frac {|1-\overline \gamma_k \theta_k(\mu)|^2}{1- | \gamma_k|^2}. \label{distNRKmun2} \end{multline} Once again, passing to the limit $n \to \infty$, we conclude that \begin{multline} \mathop{\rm dist\,}_{H^2} ^2(\widetilde k_\theta(\mu, \cdot), \spanmat \mathcal K_{\Lambda, \theta}) \\ = \frac { |B_\Lambda(\mu)| ^2} {1-|\theta(\mu)|^2} \lim_{n\to\infty} (1-|\theta_n(\mu)|^2) \prod_{k=0}^{n-1} \frac {|1-\overline \gamma_k \theta_k(\mu)|^2}{1- | \gamma_k|^2}. \label{distNRKmuinfty2} \end{multline} \subsection{Hankel operators and model operators} Let ${{\varphi}} \in L^\infty$. The Hankel operator $H_\varphi : H^2 \to H^2_{-}$ is defined by $$ H_{\varphi} f := P_- M_{ \varphi} f, \qquad f \in H^2, $$ where $H_{-}^2=L^2 \ominus H^2$, $P_-$ is the projection onto $H_{-}^2$, $M_{a} $ is the operator of multiplication by the function $a$. Here are several facts we use later on. We denote by $C$ the space $C({\mathbb T})$ of continuous functions on ${\mathbb T}$. \begin{thmHa} \cite[Vol.1, Part B, Chapter 2, p.214]{11}. The Hankel operator $H_{ \varphi}$ is compact if and only if ${\varphi} \in H^\infty+C$. \end{thmHa} \begin{lemmaletterF} \cite[Appendix 4, p.311]{1}. \label{LF} Let ${\varphi} \in H^\infty+C$, $|{{\varphi}}|=1$ a.e. ${\mathbb T}$, and $\mathop{\rm dist\,}_{ L^\infty}(\overline {\varphi}, H^\infty+C)<1$. Then $\overline {\varphi}\in H^\infty+C$. \end{lemmaletterF} Let $V$ be an inner function. The model operator $T_V:K_V\to K_V$ is defined by $$ T_Vg:=P_{V} M_z g, \qquad g \in K_V. $$ We need the functional calculus for the model operator (see \cite[Lecture III]{1}): given $\psi \in H^\infty$, the mapping $\psi \to \psi (T_V)$ is defined by $\psi (T_V)=P_VM_\psi\vert K_V$, $[\psi (T_V)]^*=P_+M_{\overline {\psi }}\vert K_V$. The following formula relates the Hankel and the model operators (see \cite[Appendix 4, p.302, formula (1)]{1}): \begin{equation} \psi (T_V)P_V = M_VH_{\psi \overline {V}}, \qquad \psi \in H^\infty. \label{connectionFormula} \end{equation} \begin{lemmaletterG} \cite[Lemma 2.2]{5}. \label{LG} Let $\theta$ be an inner function, $\Lambda \in (B)$, and let $L=\{l_n\}_{n \ge 0}$ be the Malmquist--Walsh basis corresponding to $\Lambda$. Then the Gram matrix of the family $ \{P_\theta l_n\}_{n \ge 0}$ is equal to $I-AA^*$, where $A$ is the matrix of $\theta(T_{B_\Lambda})$ in the basis $L$. \end{lemmaletterG} \begin{lemmaletterH} \cite[Corollary 4.8]{5}. \label{LH} Let $\Lambda \in (C)$ and let $\lim_{n\to\infty} \theta (\lambda_n)=0$. Then the following assertions are equivalent: \begin{itemize} \item[(1)]The family $\mathcal K_{\Lambda,\theta}$ is minimal. \item[(2)]The family $\widetilde {\mathcal K}_{\Lambda,\theta}$ is a Riesz basis in the closure of its linear hull. \item[(3)] The class $\theta +BH^\infty$ contains a non-extreme point of $\mathcal B$. \item[(4)] $\mathop{\rm dist\,}_{L^\infty} (\theta , BH^\infty)<1$. \end{itemize} \end{lemmaletterH} \section{Functions with given Schur--Nevanlinna coefficients} \renewcommand*{\proofname}{Proof of Proposition~\ref{Pr1}} \begin{proof} By Lemma~B and \eqref{distNRKmuinfty}, the completeness of $\mathcal K_{\Lambda, \theta}$ implies that for every $ \mu \in {\mathbb D} \setminus \Lambda $ we have $$ \prod_{n \ge 1} \frac {1-|\theta_n(\mu)|^2}{1-|\theta_n(\mu)|^2|b_{\lambda_{n-1}}(\mu)|^2}=0. $$ Thus $\prod_{n \ge 1} {(1-|\theta_n(\mu)|^2)}=0$ and, hence, $\sum_{n \ge 1} |\theta_n(\mu)|^2=\infty$. \end{proof} Consequently, if for some $ \mu \in {\mathbb D} \setminus \Lambda $ we have $\sum_{n \ge 1} |\theta_n(\mu)|^2 < \infty$, then $\mathcal K_{\Lambda, \theta}$ is not complete in $K_\theta$. Later on in this section we show that this sufficient condition is not necessary. To proceed further on, we need to recall the following construction introduced in \cite{4}. \subsection {Inverse Schur--Nevanlinna process I} Let $\Lambda=\{\lambda _n\}_{n \ge 0} \in (B)$, $\{\gamma_n\}_{n\ge 0}$ be a sequence of points in ${\mathbb D}$. For $n \ge 0$ we set \begin{equation} \left. \begin{aligned} h_{n,0}&=\gamma_n, \qquad n \ge 0, \\ h_{n,k}&=\tau_{-\gamma_{n-k}} (\tau_{\lambda_{n-k}} h_{n,k-1}), \qquad 1 \le k \le n. \end{aligned} \right \} \label{ISN1} \end{equation} One can easily verify (see also \cite[Lemma 2.1]{4}) that for $ 0\le k\le n$ we have \begin{itemize} \item[(1)] $\|h_{n,k}\|_\infty < 1$ \item[(2)] $h_{n, n-k} =(h_{n,n})_k$, where $(h_{n,n})_k$ is the $k$-th Schur--Nevanlinna function corresponding to $ \Lambda$, $ h_{n,n}$. \end{itemize} By induction, one verifies that $$ 1-|h_{n,n}(\zeta)|^2=(1-|\gamma_n|^2)\prod_{k=0}^{n-1} \frac {1-|\gamma_k|^2}{|1+\overline {\gamma_k}\tau_{\lambda_k}(\zeta)h_{n,n-k-1} (\zeta)|^2}, \qquad \zeta \in {\mathbb T} . $$ Under condition \eqref{sumConverges}, the latter equality gives $$ 1-|h_{n,n}(\zeta)|^2\ge (1-|\gamma_n|^2)\prod_{k=0}^{n-1} \frac {1-|\gamma_k|^2}{(1+|\gamma_k|)^2}\ge c>0,\qquad \zeta \in {\mathbb T}, $$ where the constant $c$ does not depend on $n$. Let now $\theta$ be an inner function different from a finite Blaschke product, $\Lambda=\{\lambda _n\}_{n \ge 0} \in (B)$. Let $\{\gamma_n\}_{n\ge 0}$ be the sequence of the Schur--Nevanlinna coefficients corresponding to $\Lambda$, $\theta$. Recall that $B_{k,n}=\prod_{j=k}^n b_{\lambda_j}$. For $ 0\le k\le n$ we have \begin{itemize} \item[(3)] $h_{n,n-k}\in \theta_k + B_{k,n} H^\infty$ (and, in particular, $h_{n,n} \in \theta+B_{0,n} H^\infty$). \end{itemize} By a normal family argument, there exists a subsequence $\{h_{n_k,n_k}\}$ of $\{h_{n,n}\}$ that converges uniformly on compact subsets of the unit disc to a function $h \in \theta+B_\Lambda H^\infty$. Then \begin{equation} \|h\|_\infty<1 \label{star} \end{equation} and, hence, $\mathop{\rm dist\,}_{H^\infty}(\theta,B_\Lambda H^\infty)=\mathop{\rm dist\,}_{L^\infty}(\theta \overline{B_\Lambda}, H^\infty)<1$. If, additionally, $\Lambda \in (C)$, Theorem~D shows that $\widetilde {\mathcal K}_{\Lambda, \theta}$ is a Riesz sequence. Next, we consider a modification of the previous construction. \subsection {Inverse Schur--Nevanlinna process II} Given $ \theta \in {\mathcal B}$ which is not a finite Blaschke product, $\Lambda=\{\lambda_n\}_{n\ge 0} \in (B)$, let $\{\gamma_n\}_{n\ge 0}$ be the Schur--Nevanlinna coefficients and let $\{\theta_n\}_{n\ge 0}$ be the Schur--Nevanlinna functions corresponding to $\Lambda, \theta$. Given $\mu \in {\mathbb D} \setminus \Lambda$, we define for $n \ge 0$ : \begin{equation} \left. \begin{aligned} h_{\mu;n,0} &=\theta_n(\mu), \\ h_{\mu;n,k} & =\tau_{-\gamma_{n-k}} (\tau_{\lambda_{n-k}} h_{\mu;n,k-1}), \qquad 1 \le k \le n. \end{aligned} \right \} \end{equation} For $ 0\le k\le n$ we have \begin{itemize} \item[(1)] $\|h_{\mu;n,k}\|_\infty \le 1$ \item[(2)] $h_{\mu;n, n-k} =(h_{\mu;n,n})_k$, where $(h_{\mu;n,n})_k$ is the $k$-th Schur--Nevan\-linna function corresponding to $\Lambda$, $ h_{\mu;n,n}$. \item[(3)] $h_{\mu;n,n-k}\in \theta_k + b_\mu B_{k,n-1} H^\infty$ (and, in particular, $h_{\mu;n,n}\in \theta+b_\mu B_{0,n-1} H^\infty$). \end{itemize} Again, by a normal family argument, there exists a subsequence $\{h_{\mu;n_k,n_k}\}$ of $\{h_{\mu;n,n}\}$ that converges uniformly on compact subsets of the unit disc to a function $h_\mu \in \theta+b_\mu B H^\infty$. Suppose that condition \eqref{sumConverges} holds. By \eqref{distNRKmuinfty2}, $k_\theta(\mu, \cdot) \in \spanmat \mathcal K_{\Lambda, \theta}$ if and only if $\sup_n |\theta_n(\mu)| =1$. Furthermore, if $\sup_n |\theta_n(\mu)| =1$ for some $\mu \in {\mathbb D} \setminus \Lambda$, then the same equality holds for every $\mu \in {\mathbb D} \setminus \Lambda$. In this case the family $\mathcal K_{\Lambda, \theta}$ is complete in $K_\theta$, and hence for every $\mu \in {\mathbb D} \setminus \Lambda$ the family $\mathcal K_{\Lambda \cup \{\mu\}, \theta}$ is not minimal. In \cite[Theorem 4.7]{5}, we proved that the latter is equivalent to the fact that $\|\theta+Bh\|_\infty>1$ if $h \not\equiv 0$. Thus in this case $h_\mu$ is equal to the function $\theta$ itself. Now suppose that $\sup_n |\theta_n(\mu)| <1$ (and condition \eqref{sumConverges} still holds). By construction of $h_{\mu;n,n}$ we have \begin{multline*} \label{1-hmucarre} 1-|h_{\mu;n,n}|^2=(1-|\theta_n(\mu)|^2)\prod_{k=0}^{n-1} \frac {1-|\gamma_k|^2}{|1+\overline {\gamma_k}\tau_{\lambda_k}h_{\mu;n,n-k-1}|^2} \\ \ge (1-|\theta_n(\mu)|^2)\prod_{k=0}^{n-1} \frac {1-|\gamma_k|^2}{(1+|\gamma_k|^2)} \ge C(\mu)>0 \end{multline*} on the unit circle, where the constant $C(\mu)$ does not depend on $n$ (but depends on $\mu$). Thus, $\|h_\mu\|_\infty<1$ and, hence, $\mathop{\rm dist\,}_{H^\infty}(\theta,b_\mu B_\Lambda H^\infty)<1$. If, additionally, $\Lambda \in (C)$, Proposition~E shows that $\mathcal K_{\Lambda, \theta}$ is a Riesz sequence which is not complete in $K_\theta$. \subsection{Proof of Lemma~\ref{L2}} To prove part (i) of Lemma~\ref{L2}, we start with a limit function $h$ of the inverse Schur--Nevanlinna process \eqref{ISN1}. Let $\{h_n\}_{n\ge 0} $ be the Schur--Nevanlinna functions corresponding to $\Lambda, h$. The corresponding Schur--Nevanlinna coefficients are $\{ \gamma_n \}_{n\ge 0} $. By induction, we have \begin{equation} 1-|h(\zeta)|^2= (1-|h_n(\zeta)|^2) \prod_{k=0}^{n-1} \frac {1-|\gamma_k|^2}{|1+\overline{\gamma_{k}}\tau_{\lambda_k}(\zeta)h_{k+1}(\zeta)|^2}, \quad \zeta \in {\mathbb T}. \label{hinduction} \end{equation} By condition \eqref{sumConverges} we have \eqref{star}, and, again by condition \eqref{sumConverges}, we obtain that $\sup_n \|h_n\|_\infty<1$. To prove part (ii) of Lemma~\ref{L2}, we use yet another modification of the inverse Schur--Nevanlinna process. \begin{ISP3} Let $\Lambda=\{\lambda _n\}_{n \ge 0} \in (B)$, $\{\gamma_n\}_{n\ge 0}$ be a sequence of points in ${\mathbb D}$. For $n \ge 0$ we set \begin{equation} \left . \begin{aligned} h_{n,0}&=1,\\ h_{n,k}&=\tau_{-\gamma_{n-k}} (\tau_{\lambda_{n-k}} h_{n,k-1}), \qquad 1 \le k \le n. \end{aligned} \right \} \end{equation} \end{ISP3} For $ 0\le k\le n$ we have \begin{itemize} \item[(1)] $\|h_{n,k}\|_\infty = 1$ \item[(2)] $h_{n, n-k} =(h_{n,n})_k$ \item[(3)] $h_{ n, n-k}(\lambda_k)=\gamma_k$ \end{itemize} Thus the Schur--Nevanlinna coefficients of $h_{n,n}$ at the sequence of points $\{\lambda_0, \lambda_1, \dots , \lambda_{n-1}\}$ are $\gamma_0, \gamma_1, \dots , \gamma_{n-1}$. Once again, there exists a subsequence $\{h_{n_k,n_k}\}$ of $\{h_{n,n}\}$ that converges uniformly on compact subsets of the unit disc to a function $h \in {\mathcal B}$. From now on we write $h_{n,n}$ instead of $h_{n_k,n_k}$. Denote by $\{h_n$\} the Schur--Nevanlinna functions corresponding to $\Lambda, h$. Next we show that \begin{equation} |h_n(z)| \to 1, \quad z \in {\mathbb D} \setminus \Lambda. \label{hnzto1} \end{equation} By definition, we have \begin{multline*} h(z)-h_{n,n}(z) = \frac {h_1\tau_{\lambda_0}(z) +\gamma_0}{1+\overline {\gamma_0} h_1 \tau_{\lambda_0} (z)} - \frac {h_{n,n-1}\tau_{\lambda_0}(z) +\gamma_0}{1+\overline {\gamma_0} h_{n,n-1} \tau_{\lambda_0}(z) }=\\ = \frac {(h_1(z)-h_{n,n-1}(z)) \tau_{\lambda_0}(z)(1-|\gamma_0|^2)} {(1+\overline {\gamma_0} h_1 \tau_{\lambda_0}(z))(1+\overline {\gamma_0} h_{n,n-1} \tau_{\lambda_0}(z))}, \quad z \in \overline {\mathbb D}, \quad n \ge 1. \end{multline*} By induction, we get (for $z \in \overline {\mathbb D}$) \begin{multline*} h(z)-h_{n,n}(z) \\= (h_n(z) - 1)\prod_{k=0}^{n-1} \frac {(1-|\gamma_k|^2) \tau_{\lambda_k}(z)} {(1+\overline {\gamma_k} h_{k+1} \tau_{\lambda_k}(z))(1+\overline {\gamma_k} h_{n,n-k-1} \tau_{\lambda_k}(z))}. \end{multline*} Condition \eqref{sumConverges} gives $$ |h(z)-h_{n,n}(z)| \asymp |h_n(z) - 1|\ |B_{0,n-1}(z)|, $$ uniformly in $z \in \overline {\mathbb D}$ and $n \ge 1$. Since $\{h_{n,n}\}_{n \ge 0}$ converges to $h$ uniformly on compact subsets of ${\mathbb D}$, we have $\lim_{n \to \infty}|h_n(z)| = 1$ (even $\lim_{n \to \infty} h_n(z) = 1$), $z \in {\mathbb D} \setminus \Lambda$. On the other side, we have, as in \eqref{hinduction}, $$ 1-|h(\zeta)|^2 = (1-|h_n(\zeta)|^2 ) \prod_{k=0}^{n-1} \frac {1-|\gamma_k|^2} {|1+\overline {\gamma_k} \tau_{\lambda_k}(\zeta) h_{k+1}(\zeta)|^2}, \quad \zeta \in {\mathbb T}. $$ Suppose that $|h(\zeta)|<1-\varepsilon$ on a set $e \subset {\mathbb T}$ of positive Lebesgue measure. Then by \eqref{sumConverges}, for every $n >0$ we have $|h_n(\zeta)|<1-\delta \varepsilon$ on $e$, where the constant $\delta<1$ depends on the sequence $\{\gamma_n\}_{n \ge 0}$. Fix $z \in {\mathbb D} \setminus \Lambda$. Then the Jensen formula gives $|h_n(z)|<1-\delta \varepsilon \beta$ for some $\beta=\beta(e,z)>0$ that contradicts to \eqref{hnzto1}. Thus, $h$ is inner and we can take $\theta=h$. \qed \subsection{The proofs of Proposition~\ref{Th3} and Theorem~\ref{Th4}} In what follows we need \begin{AAK} (see \cite[p.204]{1}) Let $f \in L^\infty$ and $\mathop{\rm dist\,}_{L^\infty}(f, H^\infty)<1$. Then $f+H^\infty$ contains a unimodular function. \end{AAK} \renewcommand*{\proofname}{Proof of Proposition~\ref{Th3}} \begin{proof} (i) Let $\Gamma=\{\gamma_n\}_{n \ge 0} $ satisfy condition \eqref{sumConverges}. Pick some $\mu \in {\mathbb D} \setminus \Lambda $ and let $h$ be the function constructed in Lemma~\ref{L2} (i). Since $\|h\|_{L^\infty} < 1$, we have ${\|h \overline{b_\mu B_\Lambda}\|}_{L^\infty} < 1$, and the Adamyan--Arov--Krein theorem ensures the existence of a unimodular function $\varphi \in h \overline{b_\mu B_\Lambda}+H^\infty$. Put $\theta :=\varphi b_\mu B_\Lambda$. Then $\theta $ is inner and $\theta - h \in b_\mu B_\Lambda H^\infty$. Thus $ {\theta}_n(\mu) = h_n(\mu)$, $n \ge 0$. Since $\sup_{n \ge 0}|h_n(\mu)|<1$, we obtain that $\sup_{n \ge 0}|h_n(w)|<1$ for every $w \in {\mathbb D}$. Next, formula \eqref{distlmu} completes the proof. \newline\noindent (ii) Let $\Gamma=\{\gamma_n\}_{n \ge 0}$ satisfy condition \eqref{sumConverges}. It suffices to take the function $\theta$ from Lemma~\ref{L2} (ii) and use formula \eqref{distlmu}. \end{proof} Now we pass to projections of reproducing kernels. As we have already mentioned, the Carleson condition is necessary for $ {\mathcal K}_{\Lambda, \theta}$ to be a Riesz sequence (and, in particular, the points $\lambda_i$ have to be distinct). \renewcommand*{\proofname}{Proof of Theorem~\ref{Th4}} \begin{proof} (i) Pick some $\mu_0 \in {\mathbb D} \setminus \Lambda$ and let $\theta$ be the function constructed in the proof of Proposition~\ref{Th3} (i). Since \eqref{sumConverges} is fulfilled, we have $\mathop{\rm dist\,}_{H^\infty}(\theta,BH^\infty)<1$. Proposition~\ref{Th3} states that $\sup_n |\theta_n(\mu_0)|<1$. By \eqref{distNRKmuinfty2} and \eqref{sumConverges}, $k_\theta(\mu_0, \cdot) \notin \spanmat\mathcal K_{\Lambda , \theta}$ and, thus, $ \widetilde {\mathcal K}_{\Lambda, \theta}$ is not complete in $K_\theta$. Since $\Lambda \in (C) $ and $\mathop{\rm dist\,}_{H^\infty}(\theta,BH^\infty)<1$, $ \widetilde {\mathcal K}_{\Lambda, \theta}$ is a Riesz sequence which is not complete in $K_\theta$. As we have already mentioned, the Schwarz lemma ensures that $\sup_n |\theta_n(\mu)|<1$ for every $\mu \in {\mathbb D}\setminus \Lambda$. Since $$ \mathop{\rm dist\,}_{H^2}^2(P_{\theta} k(\mu, \cdot), \spanmat\mathcal K_{\Lambda , \theta}) = (1-|\theta(\mu)|^2)\mathop{\rm dist\,}_{H^2}^2(\widetilde k_\theta(\mu, \cdot), \spanmat \mathcal K_{\Lambda, \theta}), $$ by \eqref{distNRKmuinfty2} and Theorem~A we obtain that $$ \frac {\mathop{\rm dist\,}_{H^2}^2(P_{\theta} \widetilde {k}(\mu, \cdot), \spanmat\mathcal K_{\Lambda , \theta})}{\mathop{\rm dist\,}_{H^2}^2( \widetilde k(\mu, \cdot), K_B)} = \lim_{n\to\infty} (1-|\theta_n(\mu)|^2) \prod_{k=0}^{n-1} \frac {|1-\overline \gamma_k \theta_k(\mu)|^2}{1- | \gamma_k|^2}. $$ Taking into account \eqref{sumConverges}, we get for every $\mu \in {\mathbb D} \setminus \Lambda$ that $$ c(1-\lim_{n \to \infty} |\theta_n(\mu)|^2) \le \frac {\mathop{\rm dist\,}_{H^2}^2(P_{\theta} \widetilde {k}(\mu, \cdot), \spanmat\mathcal K_{\Lambda , \theta})}{\mathop{\rm dist\,}_{H^2}^2( \widetilde k(\mu, \cdot), K_B)} \le C(1-\lim_{n \to \infty} |\theta_n(\mu)|^2). $$ \newline\noindent (ii) Pick some $\mu_0 \in {\mathbb D} \setminus \Lambda$ and let $\theta$ be the function constructed in the proof of Proposition~\ref{Th3} (ii). Then use \eqref{distNRKmuinfty2} as in the proof of part (i). \end{proof} \section{Compact Hankel operators with symbols $\theta \overline B$} It is known (see \cite{2}) that if $\Lambda \in (C)$, $\lim_{n \to \infty} \theta(\lambda_n)=0$, and $\theta$ is not a pure Blaschke product, then $\widetilde {\mathcal K}_{\Lambda, \theta } $ is a Riesz basis in the closure of its linear hull, and this hull does not coincide with $K_\theta$. It is easily seen that for a pure Blaschke product $\theta$ this result is not true: we can take two interpolating Blaschke products $B_\Lambda$ and $B_\mathcal M$ such that $\lim_{\mu \in \mathcal M, |\mu| \to 1}B_\Lambda(\mu)=0$ and $\lim_{\lambda \in \Lambda, |\lambda| \to 1}B_\mathcal M(\lambda)=0$ and remove, if necessary, a finite number of $\lambda \in \Lambda$ or $\mu \in \mathcal M$. Then by Theorem~C and Carleson's interpolating theorem both families $\widetilde {K}_{\Lambda, B_\mathcal M}$ and $\widetilde {K}_{\mathcal M, B_\Lambda}$ are Riesz bases (in $K_{B_\mathcal M}$ and $K_{B_\Lambda}$ correspondingly). Theorem~\ref{Th6} shows that this example is the ``only possible" one. \begin{proof}[Proof of Proposition~\ref{L5}] (i) $\Rightarrow$ (ii) Let $\lim_{n\to\infty} \theta(\lambda_n)=0$. Since $H^\infty+C$ is an algebra, $\overline {B_{0,n}}H^\infty \subset H^\infty+C$. We have \begin{multline*} \mathop{\rm dist\,}_{L^\infty}(\theta \overline {B_\Lambda}, H^\infty+C \le \lim_{n\to\infty} (\mathop{\rm dist\,}_{L^\infty}(\theta \overline {B_\Lambda}, \overline {B_{0,n}}H^\infty))\\ =\lim_{n\to\infty} (\mathop{\rm dist\,}_{L^\infty}(\theta, {B_{n+1,\infty}}H^\infty)). \end{multline*} Since $\theta(\lambda_n) \to 0$, the latter limit is equal to zero by Carleson's Interpolation Theorem. Since $H^\infty+C$ is closed in $L^\infty$ (see \cite[Vol.1, Part B, Corollary 2.3.1]{11}), we have $\theta \overline {B_\Lambda} \in H^\infty+C$. By Hartman's theorem $H_{\theta\overline {B_\Lambda}}$ is compact. (ii) $\Rightarrow$ (iii) Let $H_{\theta\overline {B_\Lambda}}$ be compact. By \eqref{connectionFormula}, $\theta (T_ {B_\Lambda})P_ {B_\Lambda}$ is also compact and thus $\theta(T_ {B_\Lambda})\vert K_ {B_\Lambda}$ is compact. (iii) $\Rightarrow$ (i) Let $\theta(T_ {B_\Lambda})\vert K_ {B_\Lambda}$ be compact. Then $A=[\theta (T_{B_\Lambda})]^*=P_+M_{\overline{\theta }}\vert K_{B_\Lambda}$ is compact. By Theorem~A the family $\{\widetilde{k_{\lambda_n}}\}_{n\ge 0}$ is a Riesz basis and thus it tends weakly to zero. Since $A$ is compact, we have $\|A\widetilde{k_{\lambda_n}\|}=|\theta(\lambda_n)| \to 0$. \end{proof} \begin{proof}[Proof of Theorem~\ref{Th6}] By Theorem~C we have \begin{equation} \mathop{\rm dist\,}_{L^\infty}(B_\mathcal M\overline {B_\Lambda}, H^\infty)<1 \label{dbll1} \end{equation} and \begin{equation} \mathop{\rm dist\,}_{L^\infty}(B_\Lambda \overline {B_\mathcal M}, H^\infty)<1. \label{dbll1x} \end{equation} By Proposition~\ref{L5} we have $B_\mathcal M \overline {B_\Lambda} \in H^\infty+C$. Since $$\mathop{\rm dist\,}_{L^\infty}(B_\Lambda \overline {B_\mathcal M}, H^\infty+C) \le \mathop{\rm dist\,}_{L^\infty}(B_\Lambda \overline {B_\mathcal M}, H^\infty),$$ \eqref{dbll1x} gives $\mathop{\rm dist\,}_{L^\infty}(B_\Lambda \overline {B_\mathcal M}, H^\infty+C)<1$, and we can use Lemma~F with $u=B_\mathcal M \overline {B_\Lambda}$. Thus, $B_\Lambda \overline {B_\mathcal M} \in H^\infty+C $. By Proposition~\ref{L5}, we get $\lim_{n \to \infty}B_\Lambda(\mu_n)=0$. Thus, $\sup_n |B_\Lambda(\mu_n)|<1$. By the hypothesis, we have $\sup_n |B_\mathcal M(\lambda_n)|<1$, and by Theorem~C, the family $\widetilde {\mathcal K}_{\mathcal M, B_\Lambda}$ is a Riesz basis in $K_{B_\Lambda}$. \end{proof} To prove Corollary \ref{Cor8} we need the following well-known result. \begin{lemma} \label{le9} Let $X=\{x_n\}_{n\ge 1} \sim U+\mathfrak{S}_\infty$ and let $V$ be an orthogonalizer of $X$. Then \begin{itemize} \item[(i)]$V^{-1} \in (U+\mathfrak{S}_\infty)$ \item[(ii)] Let $X^*=\{x_n^*\}_{n\ge 1}$ be the family in $\spanmat X$ biorthogonal to $X$. Then $X^* \sim U+\mathfrak{S}_\infty$. \item[(iii)] $\lim_{n \to \infty} \| x_n\|=1$. \item[(iv)] $\lim_{n \to \infty }\mathop{\rm dist\,} (x_n, \spanmat_{ k \neq n} \{x_k\}) = 1$. \end{itemize} \end{lemma} \begin{proof}[Proof] \begin{itemize} \item[(i)]See, for example, \cite[Lemma 2.2(b)]{9} \item[(ii)] Since $(V^{-1})^*$ is an orthogonalizer of $X^*$ (\cite{1}, Lection 6), we have $X^* \sim U+\mathfrak{S}_\infty$. \item[(iii)] The family $\{e_n=Vx_n\}_{n \ge 0}$ is an orthonormal basis. By $(i)$, we have $V^{-1}=U+K$, where $U$ is a unitary operator and $K$ is a compact one. Then $$ \|x_n\|^2=(V^{-1}e_n,V^{-1}e_n)=(U e_n+K e_n, U e_n+K e_n). $$ Since $\{e_n\}_{n \ge 0}$ tends weakly to zero, we have $\lim_{n \to \infty} \|x_n\|^2 =1$. \item[(iv)] Since (see, for example, \cite[page 132]{1}) $$ \mathop{\rm dist\,} ^2(x_n, \spanmat \{x_k\}_{ k \neq n}) = \| x_n^*\|^{- 1}, $$ (i) and (iii) give $\lim_{n \to \infty} \| x_n^*\|=1$. Therefore, \newline\noindent $\lim_{n \to \infty } \mathop{\rm dist\,} (x_n, \spanmat_{ k \neq n} \{x_k\}) = 1$. \end{itemize} \end{proof} \begin{proof}[Proof of Corollary~\ref{Cor8}] $(i) \Rightarrow(ii)$ By Lemma~G, the Gram matrix of $\{P_\theta l_n\}_{n \ge 0}$ is the matrix of the operator $I-\theta(T_{B_\Lambda}) \theta(T_{B_\Lambda})^*$ in the basis $ \{l_n\}_{n \ge 0}$. By Proposition~\ref{L5}, the operator $\theta(T_{B_\Lambda})$ is compact and, hence, $\theta(T_{B_\Lambda}) \theta(T_{B_\Lambda})^*$ is also compact. To prove $(ii) \Rightarrow(i)$ it is sufficient to use the fact that for a bounded operator $A$ the compactness of $AA^*$ is equivalent to the compactness of $A$ (and apply again Lemma~G and Proposition~\ref{L5}). By Lemma~\ref{le9}, $\lim_{n \to \infty }\mathop{\rm dist\,}_{H^2} (P_\theta l_{n}, \spanmat \mathcal K_{\Lambda_{n-1}, \theta}) = 1$. \end{proof} \begin{rem} Let $\Lambda \in (C)$. The condition $\lim_{n\to\infty} \theta(\lambda_n)=0$ does not imply the minimality of $\{P_\theta l_n\}_{n \ge 0}$. However, if $\{P_\theta l_n\}_{n \ge 0}$ is minimal, then the (bounded linear) operator $P_\theta l_n \rightarrow l_n $ is an orthogonalizer of the family $\{P_\theta l_n\}_{n \ge 0}$ (it maps $\spanmat_{n \ge 0} \{P_\theta l_n\}$ onto $K_{B_\Lambda}$). \end{rem} Indeed, by Theorem~D and Lemma~H, the operator $P_{\theta} \vert K_B$ is an isomorphism onto its image. Thus it is invertible on the image and the inverse operator $V$ is also an isomorphism. By Lemma~G and Proposition~\ref{L5} we have $P_\theta=I+K$, where $K$ is a compact operator. By Lemma~9, $V=I+K_0$, where $K_0$ is a compact operator. \begin{rem} Each of the conditions $$ \lim_{n \to \infty }\mathop{\rm dist\,}_{H^2} (P_\theta l_{n}, \spanmat \mathcal K_{\Lambda_{n-1}, \theta}) = $$ (necessary for the family $\{P_\theta l_{n}\}_{n \ge 0}$ to be an asymptotically orthonormal sequence) and $$ \lim_{n \to \infty } \mathop{\rm dist\,}_{H^2} (\widetilde k_{\theta}(\lambda_n, \cdot), \spanmat \mathcal K_{\Lambda \setminus \{\lambda_n\}, \theta}) = 1 $$ (necessary for the family $\widetilde {\mathcal K}_{\Lambda, \theta} $ to be an asymptotically orthonormal sequence) implies that $$ \prod_{k=1}^\infty \frac {1-|\theta_k(\lambda_n)|^2}{1-|\theta_k(\lambda_n)|^2|b_{\lambda_{k-1}}(\lambda_n)|^2}=1, $$ see \eqref{distMWlambdan} and \eqref{distNRKlambdaninfty}. Certainly, the families $\{P_\theta l_{n}\}_{n \ge 0}$ and $\widetilde {\mathcal K}_{\Lambda, \theta} $ are not necessarily asymptotically orthonormal sequences simultaneously. For example, the thinness of $\Lambda$ is necessary for the family $\widetilde {\mathcal K}_{\Lambda, \theta} $ to be an asymptotically orthonormal sequence and is not necessary for the family $\{P_\theta l_{n}\}_{n \ge 0}$ to be an asymptotically orthonormal sequence. Conversely, the condition $\lim_{n \to \infty} \theta(\lambda_n) =0$ is necessary for the family $\{P_\theta l_{n}\}_{n \ge 0}$ to be an asymptotically orthonormal sequence and is not necessary for the family $\widetilde {\mathcal K}_{\Lambda, \theta} $ to be an asymptotically orthonormal sequence. \end{rem}
46caffd9ea4bd162dfc6d8821a055aa159ef0dac
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{SEC:1} \subsection{Viscous nonlinear wave equations} In this paper, we consider the following nonlinear wave equation (NLW) on the two-dimensional torus $\mathbb{T}^2 = (\mathbb{R}/\mathbb{Z})^2$, augmented by viscous effects: \begin{equation} \begin{cases} \partial_t^2 u + (1-\Delta) u + D \partial_t u + |u|^{p-1}u = \phi \xi \\ (u, \partial_t u)|_{t=0} = (u_0, u_1), \end{cases} \label{xNLW1} \end{equation} \noindent where $p > 1$, $D = |\nabla| = \sqrt{-\Delta}$, and $\xi$ denotes the (Gaussian) space-time white noise on $\mathbb{R}_+ \times \mathbb{T}^2$. Here, $\phi$ is a (possibly unbounded) operator on $L^2(\mathbb{T}^2)$. In particular, we are interested in the following two cases. \begin{itemize} \item[(i)] $\phi = D^\alpha$ for some suitable range of $\alpha < \frac 12$. In this case, the equation \eqref{xNLW1} reduces to the following stochastic viscous nonlinear wave equation (SvNLW): \begin{equation} \begin{cases} \partial_t^2 u + (1-\Delta) u + D \partial_t u + |u|^{p-1}u = D^\alpha \xi \\ (u, \partial_t u)|_{t=0} = (u_0, u_1). \end{cases} \label{SvNLW} \end{equation} \smallskip \item[(ii)] $\phi = 0$. In this case, the equation \eqref{xNLW1} reduces to the viscous nonlinear wave equation (vNLW) and we study the well-posedness issue with randomized initial data: \begin{equation} \begin{cases} \partial_t^2 u + (1-\Delta) u + D \partial_t u + |u|^{p-1}u = 0 \\ (u, \partial_t u)|_{t=0} = (u_0^\o, u_1^\o). \end{cases} \label{DvNLW} \end{equation} \noindent Here, $(u_0^\o, u_1^\o)$ denotes an appropriate randomization of a given pair $(u_0,u_1)$ of deterministic functions on $\mathbb{T}^2$. See Subsection \ref{SUBSEC:Dv}. \end{itemize} \noindent Our main goal in this paper is (i) to prove pathwise global well-posedness of \eqref{SvNLW} for $\alpha \le \alpha_p$ and (ii) to prove almost sure global well-posedness of \eqref{DvNLW}. As we see below, after the first order expansion (see \eqref{exp1} and \eqref{exp2}), the proof of pathwise global well-posedness of \eqref{SvNLW} and the proof of almost sure global well-posedness of \eqref{DvNLW} are reduced to establishing a certain energy bound and thus both of the problems can be treated essentially in a unified manner. See Sections \ref{SEC:GWP1} and \ref{SEC:GWP2}. In \cite{KC1}, Kuan-\v{C}ani\'{c} proposed the following viscous NLW on $\mathbb{R}^2$: \begin{equation} \partial_t^2 u - \Delta u + 2\mu D \partial_t u = F(u), \label{vNLW_gen} \end{equation} \noindent where $\mu > 0$ and $F(u)$ is a general external forcing. This equation typically shows up in fluid-structure interaction problems, such as the interaction between a stretched membrane and a viscous fluid. The viscosity term $2\mu D \partial_t u$ in \eqref{vNLW_gen} comes from the Dirichlet-Neumann operator typically arising in fluid-structure interaction problems in three dimensions. See \cite{KC1} and \cite{CKO} for the derivation of \eqref{vNLW_gen}. It is easy to see that, when $\mu \ge 1$, the equation \eqref{vNLW_gen} is purely parabolic (see \cite{CKO, LO}). On the other hand, when $0 < \mu < 1$, the viscous NLW \eqref{vNLW_gen} exhibits an interesting mixture of dispersive effects and parabolic smoothing. Since the precise value of $0 < \mu < 1$ does not play an important role, we simply set $\mu = \frac 12$. In addition, we consider a defocusing power-type nonlinearity of the form \[ F(u) = -|u|^{p-1}u, \] for positive real numbers $p > 1$. This power-type nonlinearity has been studied extensively for nonlinear dispersive equations (see, for example, \cite{TAO}). With $\mu = \frac 12$ and $F(u) = -|u|^{p-1}u$, the general form of vNLW \eqref{vNLW_gen} becomes the following version of vNLW: \begin{equation} \partial_t^2 u - \Delta u + D \partial_t u + |u|^{p-1}u = 0 \label{vNLW1} \end{equation} We now turn our attention to the analytical aspects of vNLW \eqref{vNLW1}. Note that as in the case of the usual NLW: \begin{equation} \partial_t^2 u - \Delta u + |u|^{p-1}u = 0, \label{NLW} \end{equation} the viscous NLW \eqref{vNLW1} on $\mathbb{R}^2$ enjoys the following scaling symmetry: $u(t,x) \mapsto u_\lambda (t, x) := \lambda^{\frac{2}{p-1}} u(\lambda t, \lambda x)$. Namely, if $u$ is a solution to \eqref{vNLW1}, then $u_\lambda$ is also a solution to \eqref{vNLW1} for any $\lambda > 0$ with rescaled initial data. This scaling symmetry induces the scaling critical Sobolev regularity $s_{\text{scaling}}$ on $\mathbb{R}^2$ given by \[ s_{\text{scaling}} = 1 - \frac{2}{p-1} \] such that under this scaling symmetry, the homogeneous Sobolev norm on $\mathbb{R}^2$ remains invariant. While there is no scaling symmetry on $\mathbb{T}^2$, the scaling critical regularity $s_{\text{scaling}}$ still plays an important role in studying nonlinear partial differential equations in the periodic setting, especially for dispersive equations. Namely, in both periodic and non-periodic settings, a dispersive equation is usually well-posed in $H^s$ for $s > s_{\text{scaling}}$ and is usually ill-posed in $H^s$ for $s < s_{\text{scaling}}$. On the one hand, there is a good local well-posedness theory for dispersive equations above the scaling regularities (see \cite{BOP2, Oh, Poc17} for the references therein). Moreover, we show in this paper that vNLW \eqref{vNLW1} is locally well-posed in $H^s(\mathbb{T}^2)$ for all $s \geq s_{\text{crit}}$ (with a strict inequality when $p = 3$), where $s_{\text{crit}}$ is defined by \begin{equation} s_{\text{crit}} := \max(s_{\text{scaling}}, 0) = \max\bigg( 1-\frac{2}{p-1}, 0 \bigg), \label{scrit1} \end{equation} \noindent for a given $p > 1$. See Appendix \ref{SEC:LWP3}. Here, the second regularity restriction 0 is required to make sense of powers of $u$. On the other hand, many dispersive equations are known to be ill-posed below the scaling critical regularity. Among these ill-posedness results, many of them are in the form of {\it norm inflation} (see \cite{CCT, BT08, CK, Kish19, Oh, OW, CP, Oka, Tz, OOTz, FO}), which is a stronger notion of ill-posedness. More precisely, norm inflation of the wave equation in $\H^s(\mathbb{R}^d) = H^s(\mathbb{R}^d) \times H^{s-1}(\mathbb{R}^d)$, for example, states the following: for any $\varepsilon > 0$, there exists a solution $u$ to \eqref{NLW} and $t \in (0,\varepsilon)$ such that \[ \| (u(0), \partial_t u(0)) \|_{\H^s} < \varepsilon \qquad \text{but} \qquad \| (u(t), \partial_t u(t)) \|_{\H^s} > \frac{1}{\varepsilon}. \] In \cite{KC1}, Kuan-\v{C}ani\'{c} proved norm inflation for vNLW \eqref{vNLW1} in $\H^s(\mathbb{R}^d)$ for $0 < s < s_{\text{scaling}}$ and any odd integers $p \geq 3$. Moreover, they pointed out that the viscous term has the potential to slow down the growth of the $H^s$ norm, i.e. to slow down the speed of the norm inflation. For details, see \cite{KC1}. Also, it is of interest to see if norm inflation for vNLW holds in negative Sobolev spaces. See \cite{dO}. In recent years, there is a growing interest in incorporating non-deterministic points of view in studying well-posedness of nonlinear dispersive equations below certain regularity thresholds. In particular, by considering randomized initial data (see \cite{BO96, BT08, CO, LM1, BT14, BOP1, BOP2, Poc45, OOP, BOP3}), one can prove well-posedness results for nonlinear dispersive equations below certain critical regularities. See also a survey paper \cite{BOP4} for this method. In \cite{KC1}, Kuan-\v{C}ani\'{c} proved almost sure local well-posedness of the quintic vNLW \eqref{vNLW1} (with $p = 5$) for an appropriate randomization of a given pair $(u_0, u_1)$ in $\H^s(\mathbb{R}^2)$ for $s > -\frac 16$. In \cite{CKO}, Kuan-Oh improved this result and proved almost sure local well-posedness of the quintic vNLW \eqref{vNLW1} (with $p = 5$) in $\H^s(\mathbb{R}^2)$ for $s > -\frac 15$. Furthermore, they proved almost sure global well-posedness of the defocusing quintic vNLW~\eqref{vNLW1} for the same range of $s > -\frac 15$. We point out that the result in \cite{CKO} easily extends to the case $1 < p < 5$, yielding almost sure global well-posedness of \eqref{vNLW1} in $\H^s(\mathbb{R}^2)$ for $s > -\frac 1p$. One of our main goals in this paper is to extend the result in \cite{CKO} to the super-quintic case $p > 5$. In this paper, we study vNLW on $\mathbb{T}^2$ so that we have a uniform treatment together with the stochastic vNLW \eqref{SvNLW}. We point out, however, that our result on the deterministic vNLW \eqref{DvNLW} with randomized initial data easily extends to vNLW on $\mathbb{R}^2$. See Remark \ref{REM:R2}. Let us now turn our attention to the viscous NLW with a stochastic forcing. In \cite{KC2}, Kuan-\v{C}ani\'{c} studied the stochastic viscous wave equation with a multiplicative noise on $\mathbb{R}^d$, $d = 1, 2$: \[\partial_t^2 u - \Delta u + D \partial_t u = f(u) \xi, \] where $f$ is Lipschitz and $\xi$ is the (Gaussian) space-time white noise on $\mathbb{R}_+ \times \mathbb{R}^2$. In \cite{LO}, T. Oh and the author studied (the renormalized version of) SvNLW \eqref{SvNLW} with $\alpha = \frac 12$. When $\alpha = \frac 12$, the solution is not a function but is only a distribution and thus a renormalization on the nonlinearity is required to give a proper meaning to the dynamics (which in particular forces us to consider $|u|^{p-1}u$ only for $p \in 2 \mathbb{N} + 1$ or $u^k$ for an integer $k \geq 2$). See \cite{LO} for details. In the cubic case, we proved pathwise global well-posedness. For an odd integer $p \geq 5$, we also used an invariant measure argument to prove almost sure global well-posedness with suitable random initial data.\footnote{Strictly speaking, almost sure global well-posedness holds for the noise $\sqrt 2 D^\frac 12\xi$, which makes the Gibbs measure for the standard NLW invariant under the SvNLW dynamics. For pathwise global well-posedness, a precise coefficient in front of the noise $D^\frac{1}{2} \xi$ does not play any role.} In the stochastic setting, our goal in this paper is to investigate further well-posedness of SvNLW \eqref{SvNLW} with an additive forcing $D^\alpha \xi$ and, in particular, prove pathwise global well-posedness for any $p > 1$, where the range of $\alpha < \frac 12$ depends on the degree $p >1$ of the nonlinearity. \begin{comment} Replacing $-\Delta$ by $1-\Delta$ makes some part of the argument simpler since a separate analysis at frequency zero is not needed. Also, this modification along with the extra factor $\sqrt{2}$ is needed for applying Bourgain's invariant measure argument (\cite{BO94, BO96}) for proving the almost sure global well-posedness result. Note that when considering \eqref{NLW1}, the stochastic convolution $\Psi$ satisfying \[ \partial_t^2 \Psi + (1-\Delta)\Psi + D\partial_t \Psi = D^{\frac 12}\xi \] is merely a distribution, and so a proper renormalization is required to give a meaning to the equation. \end{comment} \subsection{SvNLW with an additive stochastic forcing} \label{SUBSEC:Sv} Let us first consider SvNLW \eqref{SvNLW}. We say that $u$ is a solution to SvNLW \eqref{SvNLW} if $u$ satisfies the following Duhamel formulation of \eqref{SvNLW}: \[ u(t) = V(t) (u_0, u_1) - \int_0^t S(t-t') \big( |u|^{p-1} u \big) (t') dt' + \Psi. \] \noindent Here, $V(t)$ is the linear propagator defined by \begin{equation} V(t) (u_0, u_1) = e^{-\frac{D}{2} t} \bigg( \cos(t\jbb{D}) + \frac{D}{2\jbb{D}} \sin(t \jbb{D}) \bigg) u_0 + e^{-\frac{D}{2}t} \frac{\sin(t\jbb{D})}{\jbb{D}} u_1 \label{defV} \end{equation} \noindent and $S(t)$ is defined by \begin{equation} S(t) = e^{-\frac{D}{2}t} \frac{\sin(t \jbb{D})}{\jbb{D}}, \label{defS} \end{equation} \noindent where \[ \jbb{D} = \sqrt{1-\tfrac{3}{4}\Delta}, \] \noindent and $\Psi$ denotes the stochastic convolution defined by \begin{equation} \Psi := \Psi_\alpha = \int_0^t S(t-t') D^\alpha \xi (dt'). \label{Psi} \end{equation} \noindent A standard argument shows that $\Psi$ belongs to $C(\mathbb{R}_+; W^{\frac 12 - \alpha - \varepsilon, \infty} (\mathbb{T}^2))$ almost surely, where $\varepsilon > 0$ is sufficiently small; see Lemma \ref{LEM:regPsi} below. In particular, when $\alpha < \frac 12$, $\Psi$ is a well-defined function on $\mathbb{R}_+ \times \mathbb{T}^2$. We first state a local well-posedness result for SvNLW \eqref{SvNLW}. \begin{theorem}\label{THM:LWP1} Let $p > 1$ and $\alpha < \frac 12$. Define $q$, $r$, and $\sigma$ as follows. \begin{itemize} \item[(i)] When $1 < p < 2$, set $q = 2+\delta$, $r = \frac{4+2\delta}{1+\delta}$, and $\sigma = 0$, for some sufficiently small $\delta > 0$. \item[(ii)] When $p \geq 2$, set $q = p + \delta$, $r = 2p$, and $\sigma = 1 - \frac{1}{p+\delta} - \frac 1p$ for some arbitrary $\delta > 0$. \end{itemize} \noindent Let $s \geq \sigma$. Then, SvNLW \eqref{SvNLW} is pathwise locally well-posed in $\H^s(\mathbb{T}^2)$. More precisely, given any $(u_0, u_1) \in \H^s(\mathbb{T}^2)$, there exists $T = T_\o(u_0, u_1)$ (which is positive almost surely) and a unique solution $u$ to \eqref{SvNLW} with $(u, \partial_t u)|_{t=0} = (u_0, u_1)$ in the class \[ \Psi + C([0,T]; H^\sigma(\mathbb{T}^2)) \cap L^q([0,T]; L^r(\mathbb{T}^2)). \] \end{theorem} We present the proof of Theorem \ref{THM:LWP1} in Section \ref{SEC:LWP1}. The proof of Theorem \ref{THM:LWP1} is based on the following first order expansion (\cite{McKean, BO96, DPD}): \begin{equation} u = v + \Psi, \label{exp1} \end{equation} \noindent where the residual term $v$ satisfies the following equation: \begin{equation} \begin{cases} \partial_t^2 v + (1-\Delta) v + D\partial_t v + |v + \Psi|^{p-1}(v + \Psi) = 0 \\ (v, \partial_t v) |_{t=0} = (u_0, u_1). \end{cases} \label{SvNLW_res} \end{equation} \noindent See Proposition \ref{PROP:LWP1} for the pathwise local well-posedness result at the level of the residual term $v$ using the homogeneous Strichartz estimates for the viscous wave equation (Lemma \ref{LEM:hom_str}). The main idea of the proof of pathwise local well-posedness of SvNLW \eqref{SvNLW} comes from \cite{CKO}. Note that the nonlinearity $|u|^{p-1}u$ in SvNLW \eqref{SvNLW} is not necessarily algebraic for general $p>1$, which creates a difficulty for obtaining the difference estimate when applying the contraction argument. To deal with this issue, we apply the idea from Oh-Okamoto-Pocovnicu \cite{OOP} using the fundamental theorem of calculus. \begin{remark}\label{REM:R0}\rm (i) Using the same argument, the proof of Theorem \ref{THM:LWP1} works for both the defocusing case (with the nonlinearity $|u|^{p-1}u$) and the focusing case (with the nonlinearity $-|u|^{p-1}u$, i.e. with the negative sign). The same comment applies to Theorem \ref{THM:LWP2}. The proof of Theorem \ref{THM:LWP1} also works for SvNLW with nonlinearity $u^k$, where $k \geq 2$ is an integer. In fact, a simple argument based on Sobolev's inequality can be applied to prove local well-posedness of SvNLW with nonlinearity $u^k$ in the class $\Psi + C([0,T]; \H^s(\mathbb{T}^2))$ for $s \geq 1$. See, for example, Proposition 3.1 in \cite{LO}. \smallskip \noindent (ii) We point out that Theorem \ref{THM:LWP1} also applies if we have $-\Delta$ instead of $1-\Delta$ in \eqref{SvNLW} by using an essentially identical proof. The same comment applies to Theorems \ref{THM:GWP1}, \ref{THM:LWP2}, and \ref{THM:GWP2}. \smallskip \noindent (iii) As it is written in Theorem \ref{THM:LWP1}, we point out that the regularity of initial data can be lowered to the subcritical case, i.e. $s \geq s_{\text{crit}}$ (with a strict inequality when $p = 3$), where $s_{\text{crit}}$ is the critical regularity as defined in \eqref{scrit1} (note that $s_{\text{crit}} \leq \sigma$ with $\sigma$ defined in Theorem \ref{THM:LWP1}). See Theorem \ref{THM:LWP3} and Remark \ref{REM:LWP3} for details. \end{remark} \medskip We now turn our attention to pathwise global well-posedness of SvNLW \eqref{SvNLW}, and we restrict our attention to the defocusing case. Our pathwise global well-posedness result reads as follows. \begin{theorem}\label{THM:GWP1} Let $p > 1$ and $\alpha < \min(\frac 12, \frac{2}{p-1} - \frac 12)$. Let $\sigma = \max (0, 1 - \frac{1}{p+\delta} - \frac 1p)$ for some arbitrary $\delta > 0$ and let $s \geq \sigma$. Then, SvNLW \eqref{SvNLW} is pathwise globally well-posed in $\H^s(\mathbb{T}^2)$. More precisely, given any $(u_0, u_1) \in \H^s(\mathbb{T}^s)$, there exists a unique global-in-time solution $u$ to \eqref{SvNLW} with $(u, \partial_t u)|_{t=0} = (u_0, u_1)$ in the class \[ \Psi + C(\mathbb{R}_+; H^\sigma(\mathbb{T}^2)). \] \end{theorem} In Theorem \ref{THM:GWP1}, the uniqueness holds in the following sense. For any $t_0 \in \mathbb{R}_+$, there exists a time interval $I(t_0) \ni t_0$ such that the solution $u$ to \eqref{SvNLW} is unique in \[ \Psi + C(I(t_0); H^\sigma(\mathbb{T}^2)) \cap L^q(I(t_0); L^r(\mathbb{T}^2)), \] where $q,r \geq 2$ are as in Theorem \ref{THM:LWP1}. As stated in Theorem \ref{THM:GWP1}, when $1 < p \leq 3$, we have the condition $\alpha < \frac 12$; when $p > 3$, we have the condition $\alpha < \frac{2}{p-1} - \frac 12$. As $p \to \infty$, the condition for $\alpha$ becomes $\alpha \leq -\frac 12$. Note that when $1 < p < 5$, we can prove pathwise global well-posedness of SvNLW \eqref{SvNLW} with the space-time white noise (i.e. $\alpha = 0$). We prove Theorem \ref{THM:GWP1} by studying \eqref{SvNLW_res} for the residual term $v$ in Section \ref{SEC:GWP1}. From the proof of Theorem \ref{THM:LWP1}, we see that pathwise global well-posedness follows once we control the $\H^1$-norm of $\vec v(t) := (v(t), \partial_t v (t))$. For this purpose, we study the evolution of the energy \begin{equation} E(\vec v) = \frac 12 \int_{\mathbb{T}^2} (v^2 + |\nabla v|^2) dx + \frac 12 \int_{\mathbb{T}^2} (\partial_t v)^2 + \frac{1}{p+1} \int_{\mathbb{T}^2} |v|^{p+1} dx, \label{defE} \end{equation} \noindent which is conserved under the (deterministic) usual NLW: \[ \partial_t^2 u + (1-\Delta)u + |u|^{p-1}u = 0. \] \noindent Note that for our problem, we proceed with the first order expansion \eqref{exp1}, where the residual term $v = \Psi - u$ only satisfies \eqref{SvNLW_res}. In this case, the energy $E(\vec v)$ is not conserved under the equation \eqref{SvNLW_res} because of the perturbative term $|v+\Psi|^{p-1}(v+\Psi) - |v|^{p-1}v$. For our problem, we first follow the globalization argument by Burq-Tzvetkov \cite{BT2} and establish an exponential growth bound on $E(\vec v)$, which works in the sub-cubic case $1 < p \leq 3$. For the super-cubic case $p > 3$, this argument no longer works due to the high homogeneity of the non-linearity. When $3 < p \leq 5$, we use an integration by parts trick introduced by Oh-Pocovnicu \cite{OP16}. In the super-quintic case $p > 5$, we use a trick involving the Taylor expansion, where the idea comes from Latocca \cite{Lat}. One important prerequisite for studying the evolution of the energy $E(\vec v)$ is that the local-in-time solution $\vec v$ lies in $\H^1(\mathbb{T}^2)$, which is not guaranteed by the pathwise local well-posedness result (Theorem \ref{THM:LWP1}) as it is written. Nonetheless, due to the dissipative nature of the equation, we show that $\vec v(t)$ indeed belongs to $\H^1(\mathbb{T}^2)$ for any $t > 0$ by using the Schauder estimate (Lemma \ref{LEM:Sch}) along with Theorem \ref{THM:LWP1}. See Section \ref{SEC:GWP1} for details. \begin{remark}\label{REM:R1}\rm In \cite{LO}, T. Oh and the author studied SvNLW \eqref{SvNLW} with $\alpha = \frac 12$. In this case, due to $\alpha = \frac 12$, the stochastic term $\Psi$ defined in \eqref{Psi} turns out to be merely a distribution, so that we studied a renormalized version of \eqref{SvNLW} and proved pathwise global well-posedness in the cubic case. Because of the singular nature of the stochastic convolution in this setting, the standard Gronwall argument does not work, and so we used a Yudovich-type argument to bound the corresponding energy. In the same paper, we also proved almost sure global well-posedness of \eqref{SvNLW} with $p \in 2\mathbb{N}+1$ and with random initial data, using the formal invariance of the Gibbs measure. However, the argument only works for $\alpha = \frac 12$, so it does not apply to our problem with $\alpha < \frac 12$ in this paper. Instead, in this paper, we establish pathwise global well-posedness of SvNLW \eqref{SvNLW}. \end{remark} \subsection{Deterministic vNLW with randomized initial data}\label{SUBSEC:Dv} In this paper, we also consider the deterministic vNLW \eqref{DvNLW} with a randomization $(u_0^\o, u_1^\o)$ of the initial data $(u_0, u_1)$. To construct $(u_0^\o, u_1^\o)$, we first write $u_0$ and $u_1$ in terms of Fourier series:\footnote{Here and after, we drop the factor $2\pi$ for simplicity.} \[ u_j(x) = \sum_{n \in \mathbb{Z}^2} \widehat u_j (n) e^{in \cdot x}, \quad j=0,1, \] where $\widehat u_j(-n) = \overline{ \widehat u_j(n) }$ for all $n \in \mathbb{Z}^2$, $j=0,1$. For $j = 0,1$, we let $\{ g_{n,j} \}_{n \in \mathbb{Z}^2}$ be a sequence of mean zero complex-valued random variables such that $g_{-n,j} = \overline{g_{n,j}}$ for all $n \in \mathbb{Z}^2$, $j=0,1$. Moreover, we assume that $g_{0,j}$ is real-valued and $\{ g_{0,j}, \Re g_{n,j}, \Im g_{n,j} \}_{n \in \mathcal{I}, j=0,1}$ are independent. Here, $\mathcal{I}$ is the index set defined by \begin{equation} \mathcal{I} := (\mathbb{Z}_+ \times \{0\}) \cup (\mathbb{Z} \times \mathbb{Z}_+), \label{defI} \end{equation} \noindent so that $\mathbb{Z}^2 = \mathcal{I} \cup (-\mathcal{I}) \cup \{0\}$. Then, we can define the randomization $(u_0^\o, u_1^\o)$ of $(u_0, u_1)$ by \begin{equation} (u_0^\o, u_1^\o) := \bigg( \sum_{n \in \mathbb{Z}^2} g_{n,0}(\o) \widehat u_0(n) e^{in \cdot x} , \sum_{n \in \mathbb{Z}^2} g_{n,1}(\o) \widehat u_1(n) e^{in \cdot x} \bigg). \label{rand} \end{equation} \noindent We also assume that there exists a constant $c > 0$ such that, on the probability distributions $\mu_{n,j}$ of $g_{n,j}$, we have \begin{equation} \int e^{\gamma \cdot x} d\mu_{n,j}(x) \leq e^{c|\gamma|^2}, \quad j=0,1, \label{exp_bd} \end{equation} \noindent for all $\gamma \in \mathbb{R}^2$ when $n \in \mathbb{Z}^2\setminus\{0\}$ and all $\gamma \in \mathbb{R}$ when $n = 0$. Note that for standard complex-valued Gaussian random variables, standard Bernoulli random variables, and any random variables with compactly supported distributions, \eqref{exp_bd} is satisfied. We say that $u$ is a solution to the deterministic vNLW \eqref{DvNLW} with randomized initial data $(u_0^\o, u_1^\o)$ if $u$ satisfies the following Duhamel formulation of \eqref{DvNLW}: \[ u(t) = V(t) (u_0^\o, u_1^\o) - \int_0^t S(t-t') \big( |u|^{p-1} u \big) (t') dt', \] where $V(t)$ and $S(t)$ are as defined in \eqref{defV} and \eqref{defS}, respectively. \medskip We now state an almost sure local well-posedness result for the deterministic vNLW \eqref{DvNLW} with randomized initial data. As mentioned in Remark \ref{REM:R0}, the following local well-posedness result applies to both the defocusing case and the focusing case. \begin{theorem}\label{THM:LWP2} Let $p > 1$ and $-\frac{1}{p} < s \leq 0$. Given $(u_0, u_1) \in \H^s(\mathbb{T}^2)$, let $(u_0^\o, u_1^\o)$ be the randomization defined in \eqref{rand}, which satisfies \eqref{exp_bd}. Then, the deterministic vNLW \eqref{DvNLW} is almost surely locally well-posed with respect to the randomization $(u_0^\o, u_1^\o)$ as initial data. More precisely, we define $q$, $r$, and $\sigma$ as follows. \begin{itemize} \item[(i)] When $1 < p < 2$, set $q = 2+\delta$, $r = \frac{4+2\delta}{1+\delta}$, and $\sigma = 0$, for some sufficiently small $\delta > 0$. \item[(ii)] When $p \geq 2$, set $q = p+\delta$, $r = 2p$, and $\sigma = 1 - \frac{1}{p+\delta} - \frac 1p$ for some sufficiently small $\delta > 0$. \end{itemize} \noindent Then, there exist constants $C, c, \gamma > 0$ such that for each sufficiently small $0 < T \ll 1$, there exists a set $\O_T \subset \O$ with the following properties: \begin{itemize} \item[(i)] $P(\O_T^c) < C \exp \bigg( - \dfrac{c}{T^\gamma \| (u_0, u_1) \|_{\H^s}^2} \bigg)$. \item[(ii)] For each $\o \in \O_T$, there exists a unique solution $u = u^\o$ to \eqref{DvNLW} on $[0,T]$ with $(u, \partial_t u) |_{t=0} = (u_0^\o, u_1^\o)$ in the class \[ V(t)(u_0^\o, u_1^\o) + C([0,T]; H^\sigma(\mathbb{T}^2)) \cap L^q ([0,T]; L^r(\mathbb{T}^2)). \] \end{itemize} \end{theorem} To prove Theorem \ref{THM:LWP2}, we use a similar approach as in the case of SvNLW \eqref{SvNLW}. We consider the following first order expansion (\cite{McKean, BO96, DPD}): \begin{equation} u = v + z, \label{exp2} \end{equation} \noindent where \begin{equation} z(t) = z^\o(t) = V(t)(u_0^\o, u_1^\o) \label{defZ} \end{equation} \noindent is the solution of the linear stochastic viscous wave equation with initial data $(u_0^\o, u_1^\o)$: \begin{equation} \begin{cases} \partial_t^2 z + (1-\Delta) z + D \partial_t z = 0 \\ (z, \partial_t z)|_{t=0} = (u_0^\o, u_1^\o), \end{cases} \label{DvLW} \end{equation} \noindent and the residual term $v$ satisfies the following equation: \begin{equation} \partial_t^2 v + (1-\Delta) v + D\partial_t v + |v + z|^{p-1} (v + z) = 0. \label{DvNLW_res} \end{equation} The regularity properties of $z$ are established in Subsection \ref{SUBSEC:prob}. Once we have established the probabilistic estimates of $z$, the local well-posedness result for the residual term $v$ follows from similar steps as in the proof of Theorem \ref{THM:LWP1}. See Section \ref{SEC:LWP2} for details. The regularity condition $s > -\frac{1}{p}$ is sharp in our approach; see Remark \ref{REM:LWP2}. \begin{remark}\rm We can also prove a probabilistic continuous dependence of the solution to \eqref{DvNLW}, which is a notion introduced by Burq-Tzvetkov \cite{BT14}. Namely, given $s > -\frac{1}{p}$ and $(u_0, u_1) \in \H^s$, for any $\varepsilon > 0$ and $0 < p < 1$, there exists an event $A = A(u_0, u_1, \varepsilon)$ and $\delta = \delta(\varepsilon, T, p) > 0$ such that $P(A) > p$, and for each $\o \in A$, the local-in-time solution $u$ to \eqref{DvNLW} exists and satisfies $\| u \|_{C_T H^s} < \varepsilon$ whenever $\| (u_0, u_1) \|_{\H^s} < \delta$. See also \cite{Poc45, KC1}. The proof of this probabilistic continuous dependence follows essentially from the proof of local well-posedness of \eqref{DvNLW} in Section \ref{SEC:LWP2}. Thus, we omit details. \end{remark} \medskip Lastly, we turn our attention to almost sure global well-posedness of the deterministic vNLW \eqref{DvNLW} with randomized initial data, and we restrict our attention to the defocusing case. \begin{theorem}\label{THM:GWP2} Let $p > 1$ and $-\frac{1}{p} < s \leq 0$. Given $(u_0, u_1) \in \H^s(\mathbb{T}^2)$, let $(u_0^\o, u_1^\o)$ be the randomization defined in \eqref{rand}, which satisfies \eqref{exp_bd}. Then, the deterministic vNLW \eqref{DvNLW} is almost surely globally well-posed with respect to the randomization $(u_0^\o, u_1^\o)$ as initial data. More precisely, by letting $\sigma = \max (0, 1 - \frac{1}{p+\delta} - \frac 1p)$ for some sufficiently small $\delta > 0$, there exists $\O_0 \subset \O$ with $P(\O_0) = 1$ such that, for each $\o \in \O_0$, there exists a unique global-in-time solution $u = u^\o$ to \eqref{DvNLW} with $(u, \partial_t u) |_{t=0} = (u_0^\o, u_1^\o)$ in the class \[ V(t)(u_0^\o, u_1^\o) + C(\mathbb{R}_+; H^\sigma (\mathbb{T}^2)). \] \end{theorem} In Theorem \ref{THM:GWP2}, the uniqueness holds in the following sense. For any $t_0 \in \mathbb{R}_+$, there exists a time interval $I^\o(t_0) \ni t_0$ such that the solution $u$ to \eqref{DvNLW} is unique in \[ V(t)(u_0^\o, u_1^\o) + C(I^\o(t_0); H^\sigma (\mathbb{T}^2)) \cap L^q(I^\o(t_0); L^r(\mathbb{T}^2)), \] where $q, r \geq 2$ are as in Theorem \ref{THM:LWP2}. As in the case of Theorem \ref{THM:LWP2}, after we establish the probabilistic estimates of $z$, the proof of Theorem \ref{THM:GWP2} follows from similar steps as that of Theorem \ref{THM:GWP1}, i.e. the pathwise global well-posedness result for SvNLW \eqref{SvNLW}. See Section \ref{SEC:GWP2} for details. Again, as in the case of almost sure local well-posedness, the regularity condition $s > -\frac{1}{p}$ is sharp in our approach. \begin{remark} \label{REM:R2}\rm (i) The global well-posedness result for the deterministic vNLW \eqref{DvNLW} with randomized initial data can be easily extended to $\mathbb{R}^2$. On $\mathbb{R}^2$, one needs to replace the randomization in \eqref{rand} with the Wiener randomization (see \cite{ZF, LM1, BOP1, BOP2, CKO}). After establishing similar probabilistic estimates as in Lemma \ref{LEM:str_fin} and Lemma \ref{LEM:str_inf} with respect to the Wiener randomization (see \cite{LM1, Poc45, OP16, OP17}), one can then prove global well-posedness of the deterministic vNLW \eqref{DvNLW} with randomized initial data on $\mathbb{R}^2$ by applying essentially the same steps as in the proof of Theorem \ref{THM:LWP2} and Theorem \ref{THM:GWP2}. \smallskip \noindent (ii) In general, we can combine Theorem \ref{THM:GWP1} and Theorem \ref{THM:GWP2} to prove global well-posedness of the following SvNLW with additive noise and randomized initial data: \begin{equation*} \begin{cases} \partial_t^2 u + (1-\Delta) u + D \partial_t u + |u|^{p-1}u = D^\alpha \xi \\ (u, \partial_t u)|_{t=0} = (u_0^\o, u_1^\o), \end{cases} \end{equation*} \noindent where $p > 1$, $\alpha < \min (\frac 12, \frac{2}{p-1} - \frac 12)$, and $(u_0, u_1) \in \H^s(\mathbb{T}^2)$ for $-\frac{1}{p} < s \leq 1$. For simplicity, we only discuss them separately in this paper. \end{remark} \section{Preliminary lemmas} \label{SEC:2} In this section, we discuss some notations and lemmas that are necessary for proving our well-posedness results. We use $A \lesssim B$ to denote $A \leq CB$ for some constant $C>0$, and we write $A \sim B$ if $A \lesssim B$ and $B \lesssim A$. Also, we use $a+$ (and $a-$) to denote $a+\varepsilon$ (and $a-\varepsilon$, respectively) for arbitrarily small $\varepsilon > 0$. In addition, we use short-hand notations to work with space-time function spaces. For example, $C_T H_x^s = C([0,T]; H^s(\mathbb{T}^d))$. \subsection{Sobolev spaces and Besov spaces} Let $s \in \mathbb{R}$. We denote $H^s(\mathbb{T}^d)$ as the $L^2$-based Sobolev space with the norm: \[ \| u \|_{H^s(\mathbb{T}^d)} = \| \jb{n}^s \widehat u (n) \|_{\l_n^2(\mathbb{Z}^d)}, \] where $\widehat u (n)$ is the Fourier coefficient of $u$ and $\jb{\cdot} = (1 + |\cdot|)^{\frac 12}$. We then define $\H^s(\mathbb{T}^d)$ as \[ \H^s(\mathbb{T}^d) = H^s(\mathbb{T}^d) \times H^{s-1}(\mathbb{T}^d). \] Also, we denote $W^{s,p}(\mathbb{T}^d)$ as the $L^p$-based Sobolev space with the norm: \[ \| u \|_{W^{s,p}(\mathbb{T}^d)} = \big\| \mathcal{F}^{-1} ( \jb{n}^s \widehat u (n) ) \big\|_{L^p(\mathbb{T}^d)}, \] where $\mathcal{F}^{-1}$ denotes the inverse Fourier transform on $\mathbb{T}^d$. When $p=2$, we have $H^s(\mathbb{T}^d) = W^{s,2}(\mathbb{T}^d)$. Let $\varphi : \mathbb{R} \to [0,1]$ be a bump function such that $\varphi \in C_c([-\tfrac 85, \tfrac 85])$ and $\varphi \equiv 1$ on $[-\tfrac 54, \tfrac 54]$. For $\xi \in \mathbb{R}^d$, we define $\varphi_0(\xi) = \varphi(|\xi|)$ and \[ \varphi_j(\xi) = \varphi\big( \tfrac{|\xi|}{2^j} \big) - \varphi\big( \tfrac{|\xi|}{2^{j-1}} \big) \] for $j \in \mathbb{Z}_+$. Note that \begin{equation} \sum_{j \in \mathbb{Z}_{\geq 0}} \varphi_j(\xi) = 1 \label{phi_sum} \end{equation} \noindent for any $\xi \in \mathbb{R}^d$. For $j \in \mathbb{Z}_{\geq 0}$, we define the Littlewood-Paley projector $\mathbf{P}_j$ as \[ \mathbf{P}_j u = \mathcal{F}^{-1} (\varphi_j \widehat u). \] Due to \eqref{phi_sum}, we have \begin{equation} u = \sum_{j=0}^\infty \mathbf{P}_j u. \label{decomp} \end{equation} We also recall the definition of Besov spaces $B_{p,q}^s (\mathbb{T}^d)$ equipped with the norm: \[ \| u \|_{B_{p,q}^s(\mathbb{T}^d)} = \big\| 2^{sj} \| \mathbf{P}_j u \|_{L_x^p(\mathbb{T}^d)} \big\|_{\l_j^q(\mathbb{Z}_{\geq 0})}. \] Note that $H^s(\mathbb{T}^d) = B_{2,2}^s(\mathbb{T}^d)$. We then recall the definition of paraproducts introduced by Bony \cite{Bony}. For details, see \cite{BCD, GIP}. For given functions $u$ and $v$ on $\mathbb{T}^d$ of regularities $s_1$ and $s_2$, respectively. By \eqref{decomp}, we can write the product $uv$ as \begin{align*} uv &= u \mathbin{\scaleobj{0.7}{\tikz \draw (0,0) node[shape=circle,draw,inner sep=0pt,minimum size=8.5pt] {\scriptsize $<$};}} u + u \mathbin{\scaleobj{0.7}{\tikz \draw (0,0) node[shape=circle,draw,inner sep=0pt,minimum size=8.5pt] {\scriptsize $=$};}} v + u \mathbin{\scaleobj{0.7}{\tikz \draw (0,0) node[shape=circle,draw,inner sep=0pt,minimum size=8.5pt] {\scriptsize $>$};}} v \\ :\!\! &= \sum_{j < k-2} \mathbf{P}_j u \mathbf{P}_k v + \sum_{|j-k| \leq 2} \mathbf{P}_j u \mathbf{P}_k v + \sum_{k < j-2} \mathbf{P}_j u \mathbf{P}_k v. \end{align*} \noindent The term $u \mathbin{\scaleobj{0.7}{\tikz \draw (0,0) node[shape=circle,draw,inner sep=0pt,minimum size=8.5pt] {\scriptsize $<$};}} v$ (and the term $u \mathbin{\scaleobj{0.7}{\tikz \draw (0,0) node[shape=circle,draw,inner sep=0pt,minimum size=8.5pt] {\scriptsize $>$};}} v$) is called the paraproduct of $v$ by $u$ (and the paraproduct of $u$ by $v$, respectively), and it is well defined as a distribution of regularity $\min(s_2, s_1+s_2)$ (and $\min(s_1, s_1+s_2)$, respectively). The term $u \mathbin{\scaleobj{0.7}{\tikz \draw (0,0) node[shape=circle,draw,inner sep=0pt,minimum size=8.5pt] {\scriptsize $=$};}} v$ is called the resonant product of $u$ and $v$, and it is well defined in general only if $s_1+s_2 > 0$. With these definitions in hand, we recall some basic properties of Besov spaces. \begin{lemma}\label{LEM:Bes} \textup{(i)} Let $s_1,s_2 \in \mathbb{R}$ and $1 \leq p, p_1, p_2, q \leq \infty$ which satisfies $\frac{1}{p} = \frac{1}{p_1} + \frac{1}{p_2}$. Then, we have \begin{equation} \| u \mathbin{\scaleobj{0.7}{\tikz \draw (0,0) node[shape=circle,draw,inner sep=0pt,minimum size=8.5pt] {\scriptsize $<$};}} v \|_{B_{p,q}^{s_2}(\mathbb{T}^d)} \lesssim \| u \|_{L^{p_1}(\mathbb{T}^d)} \| v \|_{B_{p_2,q}^{s_2}(\mathbb{T}^d)}. \label{Bes_pl} \end{equation} \noindent When $s_1 + s_2 > 0$, we have \begin{equation} \| u \mathbin{\scaleobj{0.7}{\tikz \draw (0,0) node[shape=circle,draw,inner sep=0pt,minimum size=8.5pt] {\scriptsize $=$};}} v \|_{B_{p,q}^{s_1+s_2}(\mathbb{T}^d)} \lesssim \| u \|_{B_{p_1,q}^{s_1}(\mathbb{T}^d)} \| v \|_{B_{p_2,q}^{s_2}(\mathbb{T}^d)}. \label{Bes_pe} \end{equation} \smallskip \noindent \textup{(ii)} Let $s_1 < s_2$ and $1\leq p,q \leq \infty$. Then, we have \begin{equation} \| u \|_{B_{p,q}^{s_1}(\mathbb{T}^d)} \lesssim \| u \|_{W^{s_2,p}(\mathbb{T}^d)}. \label{Bes_emb1} \end{equation} \noindent In particular, when $q = \infty$, we have \begin{equation} \| u \|_{B_{p,\infty}^{s_1}(\mathbb{T}^d)} \lesssim \| u \|_{W^{s_1,p}(\mathbb{T}^d)}. \label{Bes_emb2} \end{equation} \end{lemma} See \cite{BCD, MW} for the proofs of \eqref{Bes_pl} and \eqref{Bes_pe} in the $\mathbb{R}^d$ setting, which can be easily extended to the $\mathbb{T}^d$ setting. The embedding \eqref{Bes_emb1} follows from the $L^p$ boundedness of $\mathbf{P}_j$ and the $\l^q$-summability of $\big\{ 2^{(s_1-s_2)j} \big\}_{j \in \mathbb{Z}_{\geq0}}$, and the embedding \eqref{Bes_emb2} follows easily from the $L^p$ boundedness of $\mathbf{P}_j$. Using \eqref{Bes_pl} and \eqref{Bes_pe}, we get the following product estimate. \begin{corollary}\label{COR:bilin} Let $s > 0$, $1 \leq p,q \leq \infty$ and $1 \leq p_1,p_2,q_1,q_2 \leq \infty$ satisfying \[ \frac{1}{p_1} + \frac{1}{q_1} = \frac{1}{p_2} + \frac{1}{q_2} = \frac{1}{p}. \] Then, \[ \| uv \|_{B_{p,q}^s(\mathbb{T}^d)} \lesssim \| u \|_{B_{p_1,q}^s(\mathbb{T}^d)} \| v \|_{L^{q_1}(\mathbb{T}^d)} + \| u \|_{L^{p_2}(\mathbb{T}^d)} \| v \|_{B_{q_2,q}^s(\mathbb{T}^d)}. \] \end{corollary} \medskip Next, we recall the following chain rule estimates. \begin{lemma}\label{LEM:chain} Let $u$ be a smooth function on $\mathbb{T}^d$, $s \in (0,1)$, $r \geq 2$. Let $F$ denote the function $F(u) = |u|^{r-1}u$ or $F(u) = |u|^r$. \smallskip \noindent \textup{(i)} Let $1 < p, p_1 < \infty$ and $1 < p_2 \leq \infty$ satisfying $\frac{1}{p} = \frac{1}{p_1} + \frac{1}{p_2}$. Then, we have \begin{equation} \| F(u) \|_{W^{s,p}(\mathbb{T}^d)} \lesssim \| u \|_{W^{s, p_1}(\mathbb{T}^d)} \big\| |u|^{r-1} \big\|_{L^{p_2}(\mathbb{T}^d)}. \label{chain1} \end{equation} \smallskip \noindent \textup{(ii)} Let $1 \leq p,q \leq \infty$ and $1 \leq p_1,p_2 \leq \infty$ satisfying $\frac{1}{p} = \frac{1}{p_1} + \frac{1}{p_2}$. Then, we have \begin{equation} \| F(u) \|_{B_{p,q}^s(\mathbb{T}^d)} \lesssim \| u \|_{B_{p_1,q}^s(\mathbb{T}^d)} \big\| |u|^{r-1} \big\|_{L^{p_2}(\mathbb{T}^d)}. \label{chain2} \end{equation} \end{lemma} The estimate \eqref{chain1} follows immediately from the fractional chain rule on $\mathbb{T}^d$ in \cite{Gat}. For the proof of \eqref{chain2}, see, for example, Lemma 3.5 in \cite{Lat} in the $\mathbb{R}^d$ setting, which can be easily extended to the $\mathbb{T}^d$ setting. \medskip Lastly, we recall the following Gagliardo-Nirenberg interpolation inequality. \begin{lemma}\label{LEM:Gag} Let $p_1, p_2 \in (1,\infty)$ and $s_1,s_2 > 0$. Let $p > 1$ and $\theta \in (0,1)$ satisfying \[ -\frac{s_1}{d} + \frac{1}{p} = (1-\theta)\bigg( \frac{1}{p_1} - \frac{s_2}{d} \bigg) + \frac{\theta}{p_2} \quad \text{and} \quad s_1 \leq (1-\theta)s_2. \] Then, for $u \in W^{s_2,p_1}(\mathbb{T}^d) \cap L^{p_2}(\mathbb{T}^d)$, we have \[ \| u \|_{W^{s_1,p}(\mathbb{T}^d)} \lesssim \| u \|_{W^{s_2,p_1}(\mathbb{T}^d)}^{1-\theta} \| u \|_{L^{p_2}(\mathbb{T}^d)}^\theta. \] \end{lemma} This inequality follows from a direct application of Sobolev's inequality on $\mathbb{T}^d$ (see \cite{BO}) and then interpolation. \subsection{On the stochastic term} \label{SEC:2.2} In this subsection, we aim to establish the regularity properties of the stochastic term $\Psi$ defined in \eqref{Psi}. To achieve this goal, we need the following lemma. Given $h \in \mathbb{R}$ and a function $f$, we define $\delta_h$ as the difference operator \begin{equation} \delta_h f (t) = f(t + h) - f(t). \label{diff} \end{equation} \begin{lemma}\label{LEM:reg} Let $\{ X_N \}_{N \in \mathbb{N}}$ and $X:\mathbb{R}_+ \to \mathcal{D}'(\mathbb{T}^d)$ be Wiener integrals. \smallskip \noindent\textup{(i)} Let $t \in \mathbb{R}_+$. If there exists $s_0 \in \mathbb{R}$ such that \begin{align*} \mathbb{E}\big[ |\widehat X(n, t)|^2\big]\lesssim \jb{n}^{ - d - 2s_0} \end{align*} \noindent for any $n \in \mathbb{Z}^d$, then we have $X(t) \in W^{s, \infty}(\mathbb{T}^d)$, $s < s_0$, almost surely. Furthermore, if there exists $\gamma > 0$ such that \begin{align*} \mathbb{E}\big[ |\widehat X_N(n, t) - \widehat X(n, t)|^2\big]\lesssim N^{-\gamma} \jb{n}^{ - d - 2s_0} \end{align*} \noindent for any $n \in \mathbb{Z}^d$ and $N \geq 1$, then $X_N(t)$ converges to $X(t)$ in $W^{s, \infty}(\mathbb{T}^d)$, $s < s_0$, almost surely. \noindent \smallskip \noindent\textup{(ii)} Let $T > 0$ and suppose that \textup{(i)} holds on $[0, T]$. If there exists $\sigma \in (0, 1)$ such that \begin{align*} \mathbb{E}\big[ |\delta_h \widehat X(n, t)|^2\big] \lesssim \jb{n}^{ - d - 2s_0+ \sigma} |h|^\sigma, \end{align*} \noindent for any $n \in \mathbb{Z}^d$, $t \in [0, T]$, and $h \in [-1, 1]$,\footnote{We impose $h \geq - t$ such that $t + h \geq 0$.} then we have $X \in C([0, T]; W^{s, \infty}(\mathbb{T}^d))$, $s < s_0 - \frac \s2$, almost surely. Furthermore, if there exists $\gamma > 0$ such that \begin{align*} \mathbb{E}\big[ |\delta_h \widehat X_N(n, t) - \delta_h \widehat X(n, t)|^2\big] \lesssim N^{-\gamma}\jb{n}^{ - d - 2s_0+ \sigma} |h|^\sigma, \end{align*} \noindent for any $n \in \mathbb{Z}^d$, $t \in [0, T]$, $h \in [-1, 1]$, and $N \geq 1$, then $X_N$ converges to $X$ in $C([0, T]; W^{s, \infty}(\mathbb{T}^d))$, $s < s_0 - \frac{\sigma}{2}$, almost surely. \end{lemma} For the proof of Lemma \ref{LEM:reg}, see Proposition 3.6 in \cite{MWX} and Appendix in \cite{OOTz}. \medskip We now go back to the stochastic object $\Psi$ initially defined in \eqref{Psi}, which can be written as the following stochastic convolution: \begin{equation} \Psi (t) = \Psi_\alpha(t) = \int_0^t S(t-t') D^\alpha dW(t'), \label{Psi2} \end{equation} \noindent where $S(t)$ is as defined in \eqref{defS} and $W$ is a cylindrical Wiener process on $L^2(\mathbb{T}^2)$: \begin{equation*} W(t) = \sum_{n \in \mathbb{Z}^2} B_n(t) e_n. \end{equation*} \noindent Here, $e_n(x) = e^{i n \cdot x}$ and $\{B_n\}_{n \in \mathbb{Z}^2}$ is defined by $B_n(t) = \jb{\xi, \mathbf 1_{[0, t]} \cdot e_n}_{t, x}$, where $\xi$ is the space-time white noise and $\jb{\cdot, \cdot}_{t, x}$ denotes the duality pairing on $\mathbb{R}_+ \times \mathbb{T}^2$. As a result of this definition, $\{B_n\}_{n \in \mathbb{Z}^2}$ is a family of independent complex-valued Brownian motions conditioned so that $B_{-n} = \overline{B_n}$ for any $n \in \mathbb{Z}^2$. Note that for any $n \in \mathbb{Z}^2$, we have \[ \text{Var}(B_n(t)) = \mathbb{E} \big[ \jb{\xi, \mathbf 1_{[0,t]} \cdot e_n}_{t,x} \overline{\jb{\xi, \mathbf 1_{[0,t]} \cdot e_n}_{t,x}} \big] = \| \mathbf 1_{[0,t]} \cdot e_n \|_{L_{t,x}^2}^2 = t. \] We now establish the regularity of the stochastic convolution $\Psi$ in the following lemma. Given $N \in \mathbb{N}$, we denote $\Psi_N = \pi_N \Psi$ as the truncated stochastic convolution, where $\pi_N$ is the frequency cutoff onto the spatial frequencies $\{|n| \leq N\}$. \begin{lemma}\label{LEM:regPsi} For any $\varepsilon > 0$ and $T > 0$, $\Psi_N$ converges to $\Psi$ in $C([0,T];W^{1-2\alpha -\varepsilon,\infty}(\mathbb{T}^2))$ almost surely. In particular, we have \[\Psi \in C([0,T];W^{\frac 12-\alpha -\varepsilon,\infty}(\mathbb{T}^2)) \] \noindent almost surely. \end{lemma} \begin{proof} Let $t \geq 0$. From \eqref{Psi2} and the It\^{o} isometry, we can compute \begin{align*} \mathbb{E} \big[ |\widehat\Psi (t,n)|^2 \big] = \int_0^t e^{- (t - t')|n|} \bigg[\frac{\sin ((t-t')\jbb{n} )}{\jbb{n}} \bigg]^2 |n|^{2\alpha} dt' \sim \frac{1}{\jb{n}^{3-2\alpha}} \end{align*} \noindent for any $n \in \mathbb{Z}^2\setminus\{0\}$. Hence from Lemma \ref{LEM:reg} (i), we have $\Psi(t) \in W^{\frac 12-\alpha-\varepsilon,\infty}(\mathbb{T}^2)$ almost surely for any $\varepsilon > 0$.\par Let $0 \leq t_2 \leq t_1$. From \eqref{Psi2} and the It\^{o} isometry, we compute \begin{equation} \begin{split} \mathbb{E} \big[ |\widehat\Psi (t_1,n) - \widehat\Psi (t_2,n)|^2 \big] &= \int_{t_2}^{t_1} e^{- (t_1 - t')|n|} \bigg[ \frac{\sin ((t_1 - t')\jbb{n} )}{\jbb{n}} \bigg]^2 |n|^{2\alpha} dt' \\ &\hspace{-100pt} + \int_0^{t_2} \bigg( e^{- \frac{(t_1 - t')|n|}{2}} \frac{\sin ((t_1 - t')\jbb{n} )}{\jbb{n}} - e^{- \frac{(t_2 - t')|n|}{2}} \frac{\sin ((t_2 - t')\jbb{n} )}{\jbb{n}} \bigg)^2 |n|^{2\alpha} dt' \\ & =: I_1 + I_2. \end{split} \label{II12} \end{equation} \noindent For $I_1$, a direct computation gives \[ I_1 \leq \frac{|t_1 - t_2|}{\jb{n}^{2-2\alpha}} \qquad \text{and} \qquad I_1 \leq \frac{1}{\jb{n}^{2-2\alpha}}\int_0^{t_1 - t_2} e^{-t'|n|} dt' \leq \frac{1}{\jb{n}^{3-2\alpha}}, \] and so we can interpolate these two inequalities to obtain the bound \begin{equation} I_1 \leq \frac{|t_1 - t_2|^\sigma}{\jb{n}^{3 - 2\alpha - \sigma}}, \label{II1} \end{equation} \noindent for some $\sigma \in [0,1]$. For $I_2$, by the mean value theorem, we have \begin{equation} I_2 \leq \frac{\jb{n}^\sigma |t_1 - t_2|^\sigma}{\jb{n}^{2-2\alpha}} \int_0^{t_2} \Big( e^{- \frac{(t_1 - t')|n|}{2}} + e^{- \frac{(t_2 - t')|n|}{2}} \Big)^{2-\sigma} dt' \lesssim \frac{|t_1 - t_2|^\sigma}{\jb{n}^{3-2\alpha-\sigma}}, \label{II2} \end{equation} \noindent for some $\sigma \in [0,1]$. Combining \eqref{II12}, \eqref{II1}, and \eqref{II2}, we obtain the bound \begin{align*} \mathbb{E} \big[ |\widehat\Psi(t_1,n) - \widehat\Psi(t_2,n)|^2 \big] \lesssim \frac{|t_1 - t_2|^{\sigma}}{\jb{n}^{3 - 2\alpha - \sigma}} \end{align*} \noindent for any $n \in \mathbb{Z}^2\setminus\{0\}$, $0 \leq t_2 \leq t_1$ with $t_1 - t_2 \leq 1$, and $\sigma \in [0,1]$. Thus, from Lemma \ref{LEM:reg} (ii), we have $\Psi(t) \in C(\mathbb{R}_+; W^{\frac 12-\alpha-\varepsilon,\infty}(\mathbb{T}^2))$ almost surely for any $\varepsilon > 0$.\par Proceeding as above, we get \[ \mathbb{E} \big[ |\widehat\Psi_M(t,n) - \widehat\Psi_N(t,n)|^2 \big] \leq C \mathbf 1_{|n| > N} \cdot \jb{n}^{-3+2\alpha} \leq C N^{-\gamma}\jb{n}^{-3+2\alpha+\gamma}\] for any $n \in \mathbb{Z}^2$, $M \geq N \geq 1$, and $\gamma \geq 0$. Similarly, with $\delta_h$ defined in \eqref{diff}, we have \begin{align*} \mathbb{E} \big[ |\delta_h\widehat\Psi_M(t,n) - \delta_h\widehat\Psi_N(t,n)|^2 \big] &\leq C \mathbf 1_{|n| > N} \cdot \jb{n}^{-3+2\alpha+\sigma} |h|^\sigma \\ &\leq C N^{-\gamma} \jb{n}^{-3+2\alpha+\sigma+\gamma}|h|^\sigma \end{align*} for any $n \in \mathbb{Z}^2$, $M \geq N \geq 1$, $h \in [-1, 1]$,\footnote{We impose $h \geq -t$ so that $t+h \geq 0$} $\gamma \geq 0$, and $\sigma \in [0,1]$. Thus, by Lemma \ref{LEM:reg}, given $T > 0$ and $\varepsilon > 0$, $\Psi_N$ converges to $\Psi$ in $C([0,T];W^{\frac 12 - \alpha - \varepsilon}(\mathbb{T}^2))$ almost surely. \end{proof} \begin{remark}\label{REM:dPsi}\rm One can use an integration by parts to write \[ \widehat \Psi (t, n) = -\int_0^t B_n(t') \frac{d}{ds} \Big|_{s=t'} \Big( e^{- \frac{|n|}{2}(t-s)} \frac{\sin ((t-s)\jbb{n} )}{\jbb{n}} |n|^\alpha \Big) dt' \] almost surely, which allows us to compute that \begin{align*} \partial_t \widehat \Psi (t, n) &= \int_0^t \bigg( -\frac{|n|}{2 \jbb{n}} e^{-\frac{|n|}{2} (t-t')} \sin((t-t')\jbb{n}) \\ &\quad + e^{-\frac{|n|}{2} (t-t')} \cos((t-t')\jbb{n}) \bigg) |n|^\alpha dB_n(t') \end{align*} \noindent almost surely. Using a similar argument as in the proof of Lemma \ref{LEM:regPsi}, we have $\partial_t \Psi \in C([0,T]; W^{-\frac 12 - \alpha -, \infty} (\mathbb{T}^2))$ almost surely. This will be useful in the proof of pathwise global well-posedness of SvNLW \eqref{SvNLW} in Subsection \ref{SUBSEC:GWP2}. \end{remark} \subsection{Linear estimates} In this subsection, we show some relevant linear estimates and the Strichartz estimates that are used to prove our well-posedness results. Let \begin{equation} P(t) = e^{-\frac{D}{2} t} \label{defP} \end{equation} be the Poisson kernel with a parameter $\frac{t}{2}$, which appears in the viscous wave linear propagator $V(t)$ defined in \eqref{defV}. We first recall the following Schauder-type estimate for the Poisson kernel $P(t)$. For a proof, see Lemma 2.3 in \cite{LO}. \begin{lemma}\label{LEM:Sch} Let $1 \leq p \leq q \leq \infty$ and $\b \geq 0$. Then, we have \[ \| D^\b P(t) \phi \|_{L^q(\mathbb{T}^d)} \lesssim t^{-\b-d(\frac{1}{p}-\frac{1}{q})} \| \phi \|_{L^p(\mathbb{T}^d)} \] \noindent for any $0 < t \leq 1$. \end{lemma} Next, we turn our attention to the Strichartz estimates for the homogeneous linear viscous wave equation on $\mathbb{T}^d$. Due to the boundedness of $V(t)$ in $\H^s(\mathbb{T}^d)$, we mainly need to show the following Strichartz estimate for the linear propagator $V(t)$ defined in \eqref{defV}. \begin{lemma}\label{LEM:hom_str} Given $s \geq 0$, suppose that $2 < q \leq \infty$, $2 \leq r \leq \infty$ satisfy the following scaling condition: \begin{equation} \frac{1}{q} + \frac{d}{r} = \frac{d}{2} - s. \label{hom_cond} \end{equation} \noindent Then, we have \begin{equation} \| V(t) (\phi_0, \phi_1) \|_{L^q ([0,T]; L_x^r(\mathbb{T}^d))} \lesssim \| (\phi_0, \phi_1) \|_{\H^s(\mathbb{T}^d)}, \end{equation} for all $0 < T \leq 1$. \end{lemma} \begin{proof} For the proof, we use the $TT^*$ method. We first consider the case when $s = 0$. Let \[ V_1(t) = e^{-\frac{D}{2}t} \cos(t\jbb{D}), \qquad V_2(t) = e^{-\frac{D}{2}t} \frac{D}{2\jbb{D}} \sin(t\jbb{D}), \] so that \[ V(t)(\phi_0, \phi_1) = V_1(t) \phi_0 + V_2(t) \phi_0 + S(t) \phi_1. \] Let $L: L^2(\mathbb{T}^d) \to L_T^q L_x^r(\mathbb{T}^d) $ be the linear operator given by $L \phi = V_1(t) \phi$. Note that $L^*$ is the linear operator given by \[ L^* f = \int_0^T V_1(t') f(t') dt' \] for any space-time Schwartz function $f$. By Minkowski's integral inequality, the Schauder estimate (Lemma \ref{LEM:Sch}) twice, the scaling condition \eqref{hom_cond}, and the Hardy-Littlewood-Sobolev inequality, we have \begin{align*} \| LL^* f \|_{L_T^q L_x^r} &\leq \bigg\| \int_0^T \big\| e^{-\frac{D}{2} (t+t')} \cos(t \jbb{D}) \cos(t' \jbb{D}) f(t') \big\|_{L_x^r} dt' \bigg\|_{L_T^q} \\ &\lesssim \bigg\| \int_0^T \frac{1}{|t-t'|^{2(\frac 12 - \frac{1}{r})}} \big\| e^{-\frac{D}{4} (t+t')} \cos(t \jbb{D}) \cos(t' \jbb{D}) f(t') \big\|_{L_x^2} dt' \bigg\|_{L_T^q} \\ &\lesssim \bigg\| \int_0^T \frac{1}{|t-t'|^{2(\frac{1}{r'} - \frac{1}{r})}} \| f(t') \|_{L_x^{r'}} dt' \bigg\|_{L_T^q} \\ &= \bigg\| \int_0^\infty \frac{1}{|t-t'|^{2/q}} \| \mathbf 1_{[0,T]}f(t') \|_{L_x^{r'}} dt' \bigg\|_{L_T^q} \\ &\lesssim \| f \|_{L_T^{q'}\! L_x^{r'}}. \end{align*} \noindent Thus, by a standard duality argument, we obtain \[ \| V_1(t) \phi_0 \|_{L_T^q L_x^r(\mathbb{T}^d)} \lesssim \| \phi_0 \|_{L^2(\mathbb{T}^d)}. \] By using similar arguments, we obtain \[ \| V_2(t) \phi_0 \|_{L_T^q L_x^r(\mathbb{T}^d)} \lesssim \| \phi_0 \|_{L^2}, \qquad \| S(t) \phi_1 \|_{L_T^q L_x^r} \lesssim \| \phi_0 \|_{H^{-1}(\mathbb{T}^d)}, \] so that we have \begin{equation} \| V(t) (\phi_0, \phi_1) \|_{L_T^q L_x^r(\mathbb{T}^d)} \lesssim \| (\phi_0, \phi_1) \|_{\H^0(\mathbb{T}^d)}. \label{hom1} \end{equation} When $s > 0$, by Sobolev's inequality, the scaling condition \eqref{hom_cond}, and \eqref{hom1}, we obtain \begin{align*} \| V(t) (\phi_0, \phi_1) \|_{L_T^q L_x^r} &\lesssim \| V(t) (\jb{\nabla}^s \phi_0, \jb{\nabla}^s \phi_1) \|_{L_T^q L_x^{1/(\frac{s}{d} + \frac{1}{r})}} \\ &= \| V(t) (\jb{\nabla}^s \phi_0, \jb{\nabla}^s \phi_1) \|_{L_T^q L_x^{d / (\frac{d}{2} - \frac{1}{q})}} \\ &\lesssim \| (\jb{\nabla}^s \phi_0, \jb{\nabla}^s \phi_1) \|_{\H^0} \\ &= \| (\phi_0, \phi_1) \|_{\H^s}, \end{align*} as desired. \end{proof} \begin{remark}\rm (i) Compared to the Strichartz estimates for the usual linear wave equations (\cite{GV,LS,KT,GKO}), the Strichartz estimates for the homogeneous linear viscous wave equation on $\mathbb{T}^d$ hold for a larger class of pairs $(q,r)$, which is due to the dissipative effects of the viscosity term. \smallskip \noindent (ii) In \cite{KC1}, Kuan-\v{C}ani\'{c} proved the Strichartz estimates for the homogeneous linear viscous wave equation on $\mathbb{R}^d$. They used the method from Keel-Tao \cite{KT}, so that their result requires $(q,r)$ to be $\sigma$-admissible for some $\sigma > 0$, i.e. $(q,r,\sigma) \neq (2,\infty,1)$ and \[ \frac{2}{q} + \frac{2\sigma}{r} \leq \sigma. \] We point out that the $TT^*$ method we use in the proof also works on $\mathbb{R}^d$ and does not have this $\sigma$-admissible restriction on $q$ and $r$. However, our proof works only for $s \geq 0$. \end{remark} We complete this subsection by establishing several inhomogeneous linear estimates. \begin{lemma}\label{LEM:lin1} Let $p \geq 2$ and let $S(t)$ be as in \eqref{defS}. Then, given $\delta > 0$, we have \begin{equation} \bigg\| \int_0^t S(t-t') F(t') dt' \bigg\|_{L^{p+\delta} ([0,T]; L_x^{2p}(\mathbb{T}^2))} \lesssim \| F \|_{L^1 ([0,T]; L^2(\mathbb{T}^2))} \label{lin1} \end{equation} for any $0 < T \leq 1$. \end{lemma} \begin{proof} We let \[ s = 1 - \frac{1}{p + \delta} - \frac{2}{2p} = 1 - \frac{1}{p + \delta} - \frac{1}{p}, \] so that $(p+\delta, 2p, s)$ satisfies the scaling condition in Lemma \ref{LEM:hom_str}. By Minkowski's integral inequality and Lemma \ref{LEM:hom_str}, we obtain \begin{align*} \bigg\| \int_0^t S(t-t') F(t') dt' \bigg\|_{L_T^{p+\delta} L_x^{2p}} &\lesssim \int_0^T \| \mathbf 1_{[0,t]}(t') S(t-t')F(t') \|_{L_T^{p+\delta} L_x^{2p}} dt' \\ &\lesssim \int_0^T \| F(t') \|_{H_x^{s-1}} dt' \\ &\leq \| F \|_{L_T^1 L_x^2}, \end{align*} so that \eqref{lin1} follows. \end{proof} \begin{comment} \begin{lemma}\label{LEM:lin2} Let $S(t)$ be as in \eqref{defS}. Then, we have \begin{equation} \bigg\| \int_0^t S(t-t') F(t') dt' \bigg\|_{L^2 ([0,T]; L_x^4(\mathbb{T}^2))} \lesssim \| F \|_{L^1 ([0,T]; L^1(\mathbb{T}^2))} \label{lin2} \end{equation} for any $0 < T \leq 1$. \end{lemma} \begin{proof} Note that $(2,4,0)$ satisfies the scaling condition in Lemma \ref{LEM:hom_str}. By Minkowski's integral inequality, Lemma \ref{LEM:hom_str}, and Sobolev's inequality, we obtain \begin{align*} \bigg\| \int_0^t S(t-t') F(t') dt' \bigg\|_{L_T^2 L_x^4} &\lesssim \int_0^T \| \mathbf 1_{[0,t]}(t') S(t-t')F(t') \|_{L_T^2 L_x^4} dt' \\ &\lesssim \int_0^T \| F(t') \|_{H_x^{-1}} dt' \\ &\lesssim \| F \|_{L_T^1 L_x^1}, \end{align*} so that \eqref{lin2} follows. \end{proof} \end{comment} \begin{lemma}\label{LEM:lin2} Let $S(t)$ be as in \eqref{defS}. Then, given $s \leq 1$, we have \begin{equation} \bigg\| \int_0^t S(t-t') F(t') dt' \bigg\|_{C([0,T]; H_x^s(\mathbb{T}^2))} \lesssim \| F \|_{L^1 ([0,T]; L_x^2(\mathbb{T}^2))}, \label{lin3} \end{equation} \begin{equation} \bigg\| \partial_t \int_0^t S(t-t') F(t') dt' \bigg\|_{C([0,T]; H_x^{s-1}(\mathbb{T}^2))} \lesssim \| F \|_{L^1 ([0,T]; L_x^2(\mathbb{T}^2))} \label{lin4} \end{equation} for any $0 < T \leq 1$. \end{lemma} \begin{proof} The estimate \eqref{lin3} follows from \eqref{defS} and Minkowski's integral inequality. The estimate \eqref{lin4} follows similarlly by noting that \[ \partial_t \int_0^t S(t-t') F(t') dt' = \int_0^t \partial_t S(t-t') F(t') dt', \] where \[ \partial_t S(t) = e^{-\frac{D}{2} t} \bigg( \cos(t \jbb{D}) - \frac{D}{2 \jbb{D}} \sin(t \jbb{D}) \bigg). \] \end{proof} \subsection{Probabilistic estimates} \label{SUBSEC:prob} In this subsection, we show several probabilistic Strichartz estimates of the random linear solution $z = V(t)(u_0^\o, u_1^\o)$ defined in \eqref{defZ}, where $(u_0^\o, u_1^\o)$ defined in \eqref{rand} is the randomization of the initial data $(u_0,u_1)$. We also consider probabilistic estimates of $\widetilde z$ defined by \begin{equation} \begin{split} \widetilde z = \widetilde z^\o :\!\! &= \jb{\nabla}^{-1} \partial_t z \\ &= -\frac{D}{2\jb{\nabla}} e^{-\frac{D}{2} t} \bigg( \cos(t\jbb{D}) + \frac{D}{2\jbb{D}} \sin(t \jbb{D}) \bigg) u_0^\o \\ &\hphantom{X}\, + \frac{1}{\jb{\nabla}} e^{-\frac{D}{2} t} \bigg( -\jbb{D} \sin(t \jbb{D}) + \frac{D}{2} \cos(t \jbb{D}) \bigg) u_0^\o \\ &\hphantom{X}\, - \frac{D}{2\jb{\nabla}} e^{-\frac{D}{2}t} \frac{\sin(t\jbb{D})}{\jbb{D}} u_1^\o + \frac{1}{\jb{\nabla}} e^{-\frac{D}{2}t} \cos(t\jbb{D}) u_1^\o. \end{split} \label{tZ} \end{equation} We first recall the following probabilistic estimate. For the proof, see \cite{BT08}. \begin{lemma}\label{LEM:prob} Let $\{g_n\}_{n \in \mathbb{Z}^2}$ be a sequence of mean zero complex-valued random variables such that $g_{-n} = \overline{g_n}$ for all $n \in \mathbb{Z}^2$. Furthermore, $g_0$ is real-valued and $\{ g_0, \Re g_n, \Im g_n \}_{n \in \mathcal{I}}$ are independent, where $\mathcal{I}$ is the index set defined in \eqref{defI}. Moreover, assume that \eqref{exp_bd} holds. Then, there exists $C > 0$ such that \[ \bigg\| \sum_{n \in \mathbb{Z}^2} g_n(\o) c_n \bigg\|_{L^p(\O)} \leq C \sqrt{p} \| c_n \|_{\l_n^2(\mathbb{Z}^2)} \] for any finite $p \geq 2$ and any sequence $\{c_n\} \in \l^2(\mathbb{Z}^2)$ that satisfies $c_{-n} = \overline{c_n}$ for all $n \in \mathbb{Z}^2$. \end{lemma} We now present the following probabilistic estimates. \begin{lemma}\label{LEM:str_fin} Let $1 \leq q < \infty$ and $\b \geq 0$, satisfying $q\b < 1$. Let $z^* = z$ or $\widetilde z$ defined in \eqref{defZ} or \eqref{tZ}, respectively. \smallskip \noindent \textup{(i)} When $2 \leq r < \infty$, there exist $C, c > 0$ depending only on $q$ and $r$ such that \begin{equation} P \big( \| D^\b z^* \|_{L^q([0,T]; L_x^r(\mathbb{T}^2))} > \lambda \big) \leq C \exp \bigg( -c \frac{\lambda^2}{T^{\frac{2}{q} - 2\b} \| (u_0, u_1) \|^2_{\H^0(\mathbb{T}^2)}} \bigg), \label{str_fin1} \end{equation} for any $0 < T \leq 1$ and $\lambda > 0$. \smallskip \noindent \textup{(ii)} When $r = \infty$, given any $\varepsilon > 0$, there exist $C, c > 0$ depending only on $q$ and $\varepsilon$ such that \begin{equation} P \big( \| D^\b z^* \|_{L^q([0,T]; L_x^\infty(\mathbb{T}^2))} > \lambda \big) \leq C \exp \bigg( -c \frac{\lambda^2}{T^{\frac{2}{q} - 2\b} \| (u_0, u_1) \|^2_{\H^\varepsilon(\mathbb{T}^2)}} \bigg), \label{str_fin2} \end{equation} for any $0 < T \leq 1$ and $\lambda > 0$. \end{lemma} \begin{remark}\rm Let $1 \leq q < \infty$ and $\b_0 \geq 0$, satisfying $q\b_0 < 1$. By applying Lemma \ref{LEM:str_fin} with $\b = 0$ and $\b = \b_0$, when $2 \leq r < \infty$, we obtain \[ P \big( \| \jb{D}^{\b_0} z^* \|_{L^q([0,T]; L_x^r(\mathbb{T}^2))} > \lambda \big) \leq C \exp \bigg( -c \frac{\lambda^2}{T^{\frac{2}{q} - 2\b_0} \| (u_0, u_1) \|^2_{\H^0(\mathbb{T}^2)}} \bigg), \] for any $0 < T \leq 1$ and $\lambda > 0$. Also, given any $\varepsilon > 0$, we obtain \[ P \big( \| \jb{D}^{\b_0} z^* \|_{L^q([0,T]; L_x^\infty(\mathbb{T}^2))} > \lambda \big) \leq C \exp \bigg( -c \frac{\lambda^2}{T^{\frac{2}{q} - 2\b_0} \| (u_0, u_1) \|^2_{\H^\varepsilon(\mathbb{T}^2)}} \bigg), \] for any $0 < T \leq 1$ and $\lambda > 0$. \end{remark} \begin{proof} (i) For $p \geq \max(q,r)$, by Lemma \ref{LEM:Sch}, Minkowski's integral inequality, and Lemma \ref{LEM:prob}, we have \begin{align*} \Big\| \big\| D^\b e^{-\frac{D}{2}t} \cos(t \jbb{D}) u_0^\o \big\|_{L_T^q L_x^r} \Big\|_{L^p(\O)} &\lesssim \Big\| \big\| t^{-\b} \| \cos(t \jbb{D}) u_0^\o \|_{L_x^r} \big\|_{L_t^q([0,T])} \Big\|_{L^p(\O)} \\ &\leq \Big\| \big\| t^{-\b} \| \cos(t \jbb{D}) u_0^\o \|_{L^p(\O)} \big\|_{L_x^r} \Big\|_{L_t^q([0,T])} \\ &\lesssim \sqrt{p} \Big\| \big\| t^{-\b} \| \cos(t \jbb{n}) \widehat u_0 (n) e^{in\cdot x} \|_{\l^2_n(\mathbb{Z}^2)} \big\|_{L_x^r} \Big\|_{L_t^q([0,T])} \\ &\leq \sqrt{p} \| t^{-\b} \|_{L_t^q([0,T])} \| u_0 \|_{L^2} \\ &\sim \sqrt{p} T^{\frac{1}{q}-\b} \| u_0 \|_{L^2}. \end{align*} \noindent Thus, the above step implies that we have \[ \big\| \| D^\b z^* \|_{L_T^q L_x^r} \big\|_{L^p(\O)} \lesssim \sqrt{p} T^{\frac{1}{q}-\b} \| (u_0,u_1) \|_{\H^0}, \] and so the tail estimate \eqref{str_fin1} follows from Chebyshev's inequality. \medskip \noindent (ii) Given $\varepsilon > 0$, we choose $\widetilde r \gg 1$ such that $\varepsilon \widetilde r > 2$. By Sobolev embedding theorem, we have \[ \| z^* \|_{L_T^q L_x^\infty} \lesssim \| \jb{\nabla}^\varepsilon z^* \|_{L_T^q L_x^{\widetilde r}}. \] Then, the tail estimate \eqref{str_fin2} follows from a similar argument as in (i). \end{proof} We now show a probabilistic estimate involving the $L_T^\infty$ norm. Let $V_+(t)$ and $V_-(t)$ be the linear propagators on $\mathbb{T}^2$ defined by \[ V_{\pm}(t)u := e^{-\frac{D}{2}t \pm i\jbb{D}t} u .\] We also define \[ U_{\pm}(t)u := e^{\pm i\jbb{D}t} u \] so that \[ V_{\pm}(t) = P(t) \circ U_{\pm}(t), \] where $P(t)$ is the Poisson kernel defined in \eqref{defP}. As in \eqref{rand}, given $\phi \in H^s(\mathbb{T}^2)$, we define its randomization $\phi^\o$ on $\mathbb{T}^2$ by \[ \phi^\o (x) := \sum_{n \in \mathbb{Z}^2} g_{n,0}(\o) \widehat \phi(n) e^{in \cdot x}. \] Then, we have the following probabilistic estimate. \begin{lemma}\label{LEM:str_inf1} Let $j \in \mathbb{Z}_+$, $2 \leq r \leq \infty$, $\b_1 \geq 0$, and $\b_2 \in \mathbb{R}$. Then, given any $\varepsilon > 0$, there exist $C, c > 0$ depending only on $r$ and $\varepsilon$ such that \[ P\big( \big\| D^{\b_1} \jbb{D}^{\b_2} V_{\pm} \phi^\o \big\|_{L^\infty ([j,j+1]; L_x^r(\mathbb{T}^2) )} > \lambda \big) \leq C \exp \bigg( -c \frac{\lambda^2}{j^{-2\b_1} \| \phi \|^2_{H^{\b_2+\varepsilon}(\mathbb{T}^2)}} \bigg), \] for any $\lambda > 0$. \end{lemma} \begin{proof} By the Schauder estimate (Lemma \ref{LEM:Sch}), we have \begin{align*} \big\| D^{\b_1} \jbb{D}^{\b_2} V_{\pm} \phi^\o \big\|_{L_t^\infty ([j,j+1]; L_x^r )} &\lesssim \Big\| t^{-\b_1} \big\| \jbb{D}^{\b_2} U_{\pm} \phi^\o \big\|_{L_x^r} \Big\|_{L_t^\infty ([j, j+1])} \\ &\leq j^{-\b_1} \big\| \jbb{D}^{\b_2} U_{\pm} \phi^\o \big\|_{L_t^\infty ([j,j+1]; L_x^r )}. \end{align*} \noindent The rest of the argument is analogous to that of Lemma 3.4 in \cite{OP16}, which can be easily extended to the $\mathbb{T}^2$ setting. Thus, we omit the rest of the proof. \end{proof} By using subadditivity and Lemma \ref{LEM:str_inf1}, we obtain the following result. \begin{lemma}\label{LEM:str_inf} Let $T \gg 1 \geq T_0 > 0$, $2 \leq r \leq \infty$, and $\b \geq 0$. Let $z^* = z$ or $\widetilde z$ defined in \eqref{defZ} or \eqref{tZ}, respectively. Then, given any $\varepsilon > 0$, there exist $C, c > 0$ depending only on $r$ and $\varepsilon$ such that \[ P \big( \| D^\b z^* \|_{L^\infty ([T_0, T]; L_x^r(\mathbb{T}^2))} > \lambda \big) \leq CT \exp \bigg( -c \frac{\lambda^2}{T_0^{-2\b} \| (u_0, u_1) \|^2_{\H^{\varepsilon}(\mathbb{T}^2)}} \bigg), \] for any $\lambda > 0$. \end{lemma} \section{Local well-posedness of SvNLW} \label{SEC:LWP1} In this section, we prove Theorem \ref{THM:LWP1}, i.e. the pathwise local well-posedness result for SvNLW \eqref{SvNLW}. As mentioned in Subsection \ref{SUBSEC:Sv}, we consider the following vNLW: \begin{equation} \begin{cases} \partial_t^2 v + (1-\Delta) v + D\partial_t v + F(v+\Psi) = 0 \\ (v, \partial_t v)|_{t=0} = (u_0, u_1) \end{cases} \label{vNLW} \end{equation} \noindent for given initial data $(u_0, u_1) \in \H^s(\mathbb{T}^2)$, $F(u) = |u|^{p-1}u$, and $\Psi$ is the stochastic convolution defined in \eqref{Psi}. By Lemma \ref{LEM:regPsi}, we can fix a good $\o \in \O$ such that $\Psi = \Psi(\o) \in C([0,T]; W^{\frac 12 - \alpha - \varepsilon, \infty}(\mathbb{T}^2))$ for $\alpha < \frac 12$ and sufficiently small $\varepsilon > 0$, so that \eqref{vNLW} becomes a deterministic equation. Then, we prove the following pathwise local well-posedness of \eqref{vNLW}. \begin{proposition}\label{PROP:LWP1} Let $p > 1$ and $\alpha < \frac 12$. Define $q$, $r$, and $\sigma$ as follows. \begin{itemize} \item[(i)] When $1 < p < 2$, set $q = 2+\delta$, $r = \frac{4+2\delta}{1+\delta}$, and $\sigma = 0$, for some sufficiently small $\delta > 0$. \item[(ii)] When $p \geq 2$, set $q = p+\delta$, $r = 2p$, and $\sigma = 1 - \frac{1}{p+\delta} - \frac{1}{p}$, for some arbitrary $\delta > 0$. \end{itemize} \noindent Let $s \geq \sigma$. Then, $\eqref{vNLW}$ is pathwise locally well-posed in $\H^s(\mathbb{T}^2)$. More precisely, given any $(u_0, u_1) \in \H^s(\mathbb{T}^2)$, there exists $0 < T = T_\o(u_0, u_1) \leq 1$ and a unique solution $\vec v = (v, \partial_t v)$ to \eqref{vNLW} in the class \[ (v, \partial_t v) \in C([0,T]; \H^\sigma (\mathbb{T}^2)) \quad \text{and} \quad v \in L^q([0,T]; L^r(\mathbb{T}^2)). \] \end{proposition} Note that Theorem \ref{THM:LWP1} follows immediately from Proposition \ref{PROP:LWP1}. The main idea of the proof of Proposition \ref{PROP:LWP1} comes from \cite{CKO}. \begin{proof} We first consider the case when $p \geq 2$. We write \eqref{vNLW} in the Duhamel formulation: \begin{equation} v(t) = \Gamma(v) := V(t)(u_0,u_1) - \int_0^t S(t-t') F(v+\Psi)(t') dt', \label{L1} \end{equation} \noindent where $V(t)$ and $S(t)$ are as defined in \eqref{defV} and \eqref{defS}, respectively. Let $\vec \Gamma(v) = (\Gamma(v), \partial_t\Gamma(v))$ and $\vec v = (v, \partial_t v)$. Given $0 < T \leq 1$, we define the space $\mathcal{X}(T)$ as \[ \mathcal{X}^\sigma(T) = \mathcal{X}_1^\sigma(T) \times \mathcal{X}_2^\sigma(T), \] where \begin{equation} \begin{split} &\mathcal{X}_1^\sigma(T) := C([0,T]; H^\sigma (\mathbb{T}^2)) \cap L^{p+\delta}([0,T]; L^{2p}(\mathbb{T}^2)), \\ &\mathcal{X}_2^\sigma(T) := C([0,T]; H^{\sigma-1} (\mathbb{T}^2)). \end{split} \label{X1} \end{equation} \noindent Here, $\delta > 0$ is arbitrary and $\sigma = 1 - \frac{1}{p+\delta} - \frac 1p$. Note that this choice of $\sigma$ along with the $L_T^{p+\delta} L_x^{2p}$ norm satisfies the scaling condition in Lemma \ref{LEM:hom_str}. Our goal is to show that $\vec \Gamma$ is a contraction on a ball in $\mathcal{X}^\sigma(T)$ for some $0 < T \leq 1$. By \eqref{L1}, Lemma \ref{LEM:hom_str}, \eqref{defV}, Lemma \ref{LEM:lin1}, Lemma \ref{LEM:lin2}, and Sobolev's inequality with the fact that $|\mathbb{T}^2| = 1$, we have \begin{equation} \begin{split} \| \vec \Gamma (v) \|_{\mathcal{X}^\sigma(T)} &\lesssim \| (u_0, u_1) \|_{\H^\sigma} + \big\| |v + \Psi|^p \big\|_{L_T^1 L_x^2} \\ &\lesssim \| (u_0, u_1) \|_{\H^s} + T^\theta \Big( \| v \|_{L_T^{p+\delta} L_x^{2p}}^p + \| \Psi \|_{L_T^{p+\delta} L_x^{2p}}^p \Big) \\ &\lesssim \| (u_0, u_1) \|_{\H^s} + T^\theta \Big( \| \vec v \|_{\mathcal{X}^\sigma(T)}^p + \| \Psi \|_{C_T W_x^{\frac 12 - \alpha - \varepsilon, \infty}}^p \Big) \end{split} \label{SLWP1} \end{equation} \noindent for some $\theta > 0$ and sufficiently small $\varepsilon > 0$. For the difference estimate, we use the idea from Oh-Okamoto-Pocovnicu \cite{OOP}. Noticing that $F'(u) = p|u|^{p-1}$, we use \eqref{L1}, Lemma \ref{LEM:hom_str}, Lemma \ref{LEM:lin1}, Lemma \ref{LEM:lin2}, the fundamental theorem of calculus, Minkowski's integral inequality, H\"older's inequality, and Sobolev's inequality to obtain \begin{equation} \begin{split} \| \vec \Gamma (v) - \vec \Gamma (w) \|_{\mathcal{X}^\sigma(T)} &\lesssim \| F(v+\Psi) - F(w+\Psi) \|_{L_T^1 L_x^2} \\ &= \bigg\| \int_0^1 F'(w+\Psi+\tau (v-w)) (v-w) d\tau \bigg\|_{L_T^1 L_x^2} \\ &\lesssim \int_0^1 \| w + \Psi + \tau(v-w) \|_{L_T^p L_x^{2p}}^{p-1} \| v-w \|_{L_T^p L_x^{2p}} d\tau \\ &\lesssim T^\theta \Big( \| v \|_{L_T^{p+\delta} L_x^{2p}}^{p-1} + \| w \|_{L_T^{p+\delta} L_x^{2p}}^{p-1} + \| \Psi \|_{L_T^{p+\delta} L_x^{2p}}^{p-1} \Big) \| v-w \|_{L_T^{p+\delta} L_x^{2p}} \\ &\lesssim T^\theta \Big( \| \vec v \|_{\mathcal{X}^\sigma(T)}^{p-1} + \| \vec w \|_{\mathcal{X}^\sigma(T)}^{p-1} + \| \Psi \|_{C_T W_x^{\frac 12 - \alpha - \varepsilon, \infty}}^{p-1} \Big) \| \vec v - \vec w \|_{\mathcal{X}^\sigma(T)} \end{split} \label{SLWP2} \end{equation} \noindent for some $\theta > 0$ and sufficiently small $\varepsilon > 0$. Thus, by choosing $T = T_\o ( \| (u_0,u_1) \|_{\H^s} ) > 0$ small enough, we obtain that $\vec \Gamma$ is a contraction on the ball $B_R \subset \mathcal{X}^\sigma(T)$ of radius $R \sim 1 + \| (u_0,u_1) \|_{\H^s}$. Note that at this point, the uniqueness of the solution $v$ only holds in the ball $B_R$, but we can use a standard continuity argument to extend the uniqueness of $v$ to the entire $\mathcal{X}^\sigma(T)$. For the case when $1 < p < 2$, we may have $p + \delta < 2$, so that Lemma \ref{LEM:hom_str} may not work for the $L_T^{p+\delta} L_x^{2p}$ norm. Instead, we consider the $L_T^q L_x^r$ norm with $q = 2+\delta$ and $r = \frac{4+2\delta}{1+\delta}$, where $\delta > 0$ is small enough so that $r$ is close enough to 4. We also set $\sigma = 0$, so that that this choice of $\sigma$ along with this $L_T^q L_x^r$ norm satisfies the scaling condition in Lemma \ref{LEM:hom_str}. Note that we also need to modify the definition of $\mathcal{X}_1^\sigma(T)$ using this $L_T^q L_x^r$ norm. We then modify \eqref{SLWP1} as follows. By \eqref{L1}, Lemma \ref{LEM:hom_str}, \eqref{defV}, Lemma \ref{LEM:lin1}, Lemma \ref{LEM:lin2}, and Sobolev's inequality, we have \begin{align*} \| \vec \Gamma (v) \|_{\mathcal{X}^0(T)} &\lesssim \| (u_0, u_1) \|_{\H^0} + \big\| |v + \Psi|^p \big\|_{L_T^1 L_x^2} \\ &\lesssim \| (u_0, u_1) \|_{\H^s} + T^\theta \Big( \| v \|_{L_T^{2+\delta} L_x^{2p}}^p + \| \Psi \|_{L_T^{p+\delta} L_x^{2p}}^p \Big) \\ &\lesssim \| (u_0, u_1) \|_{\H^s} + T^\theta \Big( \| \vec v \|_{\mathcal{X}^0(T)}^p + \| \Psi \|_{C_T W_x^{\frac 12 - \alpha - \varepsilon, \infty}}^p \Big) \end{align*} for some $\theta > 0$. Here, we can ensure that $2p \leq r = \frac{4+2\delta}{1+\delta}$ for any $1 < p < 2$ by choosing $\delta = \delta(p) > 0$ small enough. A similar modification can be applied to \eqref{SLWP2} to obtain a difference estimate, which then allows us to close the contraction argument. \end{proof} \begin{remark}\label{REM:LWP1}\rm We point out that the local well-posedness result of vNLW \eqref{vNLW} can be improved using the inhomogeneous Strichartz estimates. In particular, we can show that \eqref{vNLW} is locally well-posed in $\H^s(\mathbb{T}^2)$ as long as $s \geq s_{\text{crit}}$ (with a strict inequality when $p=3$), where $s_{\text{crit}}$ is the critical regularity as defined in \eqref{scrit1}. For details, see Theorem \ref{THM:LWP3} and Remark \ref{REM:LWP3}. \end{remark} \section{Almost sure local well-posedness of vNLW with randomized initial data} \label{SEC:LWP2} In this section, we study Theorem \ref{THM:LWP2}, i.e. the almost sure local well-posedness result for the deterministic vNLW \eqref{DvNLW} with randomized initial data. In this setting, we study the equation \eqref{DvNLW_res} with general deterministic initial data $(v_0, v_1)$: \begin{equation} \begin{cases} \partial_t^2 v + (1-\Delta) v + D \partial_t v + F(v+z) = 0 \\ (v, \partial_t v)|_{t=0} = (v_0, v_1), \end{cases} \label{DvNLW_main} \end{equation} where $F(u) = |u|^{p-1}u$. Here, we recall from \eqref{defZ} that $z = V(t)(u_0^\o, u_1^\o)$, where $V(t)$ is as defined in \eqref{defV} and $(u_0^\o, u_1^\o)$ defined in \eqref{rand} is the randomization of the deterministic initial data $(u_0, u_1) \in \H^s(\mathbb{T}^2)$. \begin{proposition}\label{PROP:LWP2} Let $p > 1$ and $- \frac{1}{p} < s \leq 0$. Define $q$, $r$, and $\sigma$ as follows. \begin{itemize} \item[(i)] When $1 < p < 2$, set $q = 2+\delta$, $r = \frac{4+2\delta}{1+\delta}$, and $\sigma = 0$, for some sufficiently small $\delta > 0$. \item[(ii)] When $p \geq 2$, set $q = p + \delta$, $r = 2p$, and $\sigma = 1 - \frac{1}{p} - \frac{1}{p+\delta}$, for some sufficiently small $\delta > 0$. \end{itemize} \noindent Fix $(v_0, v_1) \in \H^\sigma(\mathbb{T}^2)$. Then, there exist constants $C, c, \gamma > 0$ and $0 < T_0 \ll 1$ such that for each $0 < T \leq T_0$, there exists a set $\O_T \subset \O$ with the following properties: \begin{itemize} \item[(i)] The following exponential probability bound holds: \begin{equation} P(\O_T^c) < C \exp \bigg( -\frac{c}{T^\gamma \| (u_0, u_1) \|_{\H^s}^2} \bigg). \label{prob_bd} \end{equation} \item[(ii)] For each $\o \in \O_T$, there exists a unique solution $\vec v = (v, \partial_t v)$ to \eqref{DvNLW_main} in the class \[ (v, \partial_t v) \in C([0,T]; \H^{\sigma}(\mathbb{T}^2)) \qquad \text{and} \qquad v \in L^q([0,T]; L^r(\mathbb{T}^2)). \] \end{itemize} \end{proposition} Note that Theorem \ref{THM:LWP2} follows immediately from Proposition \ref{PROP:LWP2} by taking $(v_0, v_1) = (0, 0)$ in \eqref{DvNLW_main}. Again, the main idea of the proof of Proposition \ref{PROP:LWP2} comes from \cite{CKO}. \begin{proof} Fix $s$ that satisfies $- \frac 1p < s \leq 0$. Note that we can fix a choice of $\delta > 0$ sufficiently small such that $s > -\frac{1}{p+\delta}$. We define $\O_T \subset \O$ by \begin{equation} \O_T = \{ \o \in \O: \| z \|_{L^{p+\delta}([0,T]; L_x^{2p})} \leq 1 \}. \label{OT} \end{equation} Then, by Lemma \ref{LEM:str_fin}, we obtain the probability bound \eqref{prob_bd} with $\gamma = \frac{2}{p+\delta} + 2s > 0$ for any $0 < T \leq 1$. We write \eqref{DvNLW_main} in the Duhamel formulation: \[ v(t) = \Gamma(v) := V(t)(v_0, v_1) - \int_0^t S(t-t') F(v+z)(t') dt', \] where $V(t)$ and $S(t)$ are as defined in \eqref{defV} and \eqref{defS}, respectively. Let $\vec \Gamma(v) = (\Gamma(v), \partial_t \Gamma(v))$ and $\vec v = (v, \partial_t v)$. Given $0 < T \leq 1$, we define the space $Z(T)$ as \[ Z(T) = Z_1(T) \times Z_2(T), \] where \begin{align*} &Z_1(T) = C([0,T]; H^\sigma(\mathbb{T}^2)) \cap L^q([0,T]; L^r(\mathbb{T}^2)), \\ &Z_2(T) = C([0,T]; H^{\sigma-1}(\mathbb{T}^2)). \end{align*} Here, $q$, $r$, and $\sigma$ are as defined in the statement of the proposition. It remains to show that there exists $0 < T_0 \ll 1$ such that $\vec \Gamma$ is a contraction on a ball in $Z(T)$ for any $0 < T \leq T_0$ and for any $\o \in \O_T$, where $\O_T$ is as defined in \eqref{OT}. The remaining steps are similar to those in the proof of Proposition \ref{PROP:LWP1}, so we omit details. \end{proof} \begin{remark}\label{REM:LWP2}\rm (i) The regularity condition $s > -\frac{1}{p}$ seems to be sharp in our current approach based on the first order expansion \eqref{exp2}. Measuring the $p$th power term in $L^1$ in time requires us to measure $z$ in $L^p$ in time. In view of Lemma \ref{LEM:str_fin}, we need essentially $L^p$ integrability of $t^s$, which requires $s > -\frac{1}{p}$. Note that the restriction $s > -\frac 1p$ comes from the temporal integrability and has nothing to do with the spatial integrability. \smallskip \noindent (ii) For further improvement over Proposition \ref{PROP:LWP2}, one may investigate higher order expansions. See, for example, \cite{BOP3, OPTz}. \end{remark} \section{Global well-posedness of SvNLW} \label{SEC:GWP1} In this section, we aim to prove Theorem \ref{THM:GWP1}, i.e. pathwise global well-posedness of SvNLW \eqref{SvNLW}. As mentioned in Subsection \ref{SUBSEC:Sv}, we prove Theorem \ref{THM:GWP1} by studying the equation \eqref{SvNLW_res} for $v$ with $(v, \partial_t v)|_{t=0} = (u_0, u_1)$, for given initial data $(u_0, u_1) \in \H^s (\mathbb{T}^2)$ of \eqref{SvNLW}. Fix an arbitrary $T \geq 1$. In view of Proposition \ref{PROP:LWP1}, in order to show well-posedness of \eqref{vNLW} on $[0,T]$, it suffices to show that the $\H^\sigma$-norm of the solution $\vec v(t) = (v(t), \partial_t v(t))$ to \eqref{vNLW} remains finite on $[0,T]$, where $\sigma$ is as defined in Proposition \ref{PROP:LWP1}. This will allow us to iteratively apply the pathwise local well-posedness result in Proposition \ref{PROP:LWP1}. In fact, we show that the solution $\vec v(t)$ belongs to $\H^1(\mathbb{T}^2)$. Let $0 < t \leq 1$. From Lemma \ref{LEM:Sch}, we have \begin{equation} \| V(t)(u_0, u_1) \|_{\H^1} \lesssim ( 1 + t^{-1+\sigma} ) \| (u_0,u_1) \|_{\H^\sigma}. \label{H1bd} \end{equation} \noindent Then, let $0 < T_0 \leq 1$ be the local existence time as in the proof of Proposition \ref{PROP:LWP1}. Thus, given $s \geq \sigma,$ by \eqref{L1}, \eqref{H1bd}, Lemma \ref{LEM:lin2}, H\"older's inequality, and Sobolev's inequality, we have that for $0 < t \leq T_0$, \begin{equation} \begin{split} \| \vec v (t) \|_{\H^1} &\lesssim (1+t^{-1+\sigma}) \| (u_0,u_1) \|_{\H^\sigma} + \| (v + \Psi)^p \|_{L_{T_0}^1 L_x^2} \\ &\lesssim (1+t^{-1+\sigma}) \| (u_0,u_1) \|_{\H^s} + T_0^\theta \Big( \| v \|_{L_{T_0}^q L_x^r}^p + \| \Psi \|_{C_{T_0} W_x^{\frac 12 - \alpha - \varepsilon, \infty}}^p \Big), \end{split} \label{vH1} \end{equation} where $\delta > 0$, $\varepsilon > 0$ are sufficiently small, $\theta > 0$, and $q, r$ are as defined in the statement of Proposition \ref{PROP:LWP1}. Here, due to Lemma \ref{LEM:regPsi}, we can fix a good $\o \in \O$ such that $\Psi = \Psi(\o) \in C([0,T_0]; W^{\frac 12 - \alpha - \varepsilon, \infty}(\mathbb{T}^2))$ for $\alpha < \frac 12$ and sufficiently small $\varepsilon > 0$, so that we know from \eqref{vH1} that $\| \vec v (t) \|_{\H^1} < \infty$. A standard argument then shows that $\vec v \in C((0, T_0]; \H^1(\mathbb{T}^2))$. Thus, our main goal is to control the $\H^1$-norm of $\vec v (t)$ on $[0,T]$ by bounding the energy $E(\vec v)$ defined in \eqref{defE}. For the following computation, we need to work with the smooth solution $(v_N, \partial_t v_N)$ to the truncated equation with initial data $(\pi_N v_0, \pi_N v_1)$, where $\pi_N$ is the frequency truncation onto the frequencies $\{ |n| \leq N \}$. After establishing an upper bound for $E(\vec v(t))$ with the implicit constant independent of $N$, we can take $N \to \infty$ by using Proposition \ref{PROP:LWP1} (specifically, the continuous dependence of a solution on the initial data). Here, we omit details and work with $(v, \partial_t v)$ instead for simplicity. See, for example, \cite{OP16} for a standard argument. \subsection{Case $1 < p \leq 3$} \label{SUBSEC:GWP1} In this case, we follow the globalization argument by Burq-Tzvetkov \cite{BT2}. For simplicity of notation, we set $E(t) = E(\vec v(t))$. Given $T > 0$, we fix $0 < t \leq T$. By \eqref{defE} and \eqref{SvNLW_res}, we have \begin{equation} \begin{split} \partial_t E(t) &= \int_{\mathbb{T}^2} \partial_t v \big( \partial_t^2 v + (1-\Delta) v + |v|^{p-1}v \big) dx \\ &\leq -\int_{\mathbb{T}^2} \partial_t v\big( |v + \Psi|^{p-1}(v + \Psi) - |v|^{p-1}v \big) dx. \end{split} \label{E1} \end{equation} \noindent Let $F(u) = |u|^{p-1}u$, so that we can compute $F'(u) = p|u|^{p-1}$. Thus, by the fundamental theorem of calculus, we have \begin{equation} \begin{split} |v + \Psi|^{p-1}(v + \Psi) - |v|^{p-1}v &= F(v+\Psi) - F(v) \\ &= \Psi \int_0^1 F'(v + \tau \Psi) d\tau \\ &\lesssim |\Psi| |v|^{p-1} + |\Psi|^p. \end{split} \label{E2} \end{equation} \noindent Combining \eqref{E1} and \eqref{E2} and then applying the Cauchy-Schwartz inequality, we obtain \begin{equation} \begin{split} \partial_t E(t) &\lesssim \| \Psi \|_{L_x^\infty} \int_{\mathbb{T}^2} |\partial_t v| |v|^{p-1} dx + \int_{\mathbb{T}^2} |\partial_t v| |\Psi|^p dx \\ &\leq \| \Psi \|_{L_x^\infty} \bigg( \int_{\mathbb{T}^2} (\partial_t v)^2 dx \bigg)^{\frac 12} \bigg( \int_{\mathbb{T}^2} |v|^{2(p-1)} dx \bigg)^{\frac 12} + \| \Psi \|_{L_x^\infty}^{2p} \bigg( \int_{\mathbb{T}^2} (\partial_t v)^2 dx \bigg)^{\frac 12} \\ &\leq C(\Psi) E(t), \end{split} \label{E3} \end{equation} \noindent as long as $2(p-1) \leq p+1$, or equivalently, $p \leq 3$. By Gronwall's inequality on \eqref{E3}, we get \[ E(t) \lesssim e^{C(\Psi) t} \] for any $0 < t \leq T$. \subsection{Case $3 < p \leq 5$} \label{SUBSEC:GWP2} In this case, we follow the idea introduced by Oh-Pocovnicu \cite{OP16}. See also \cite{SX, LM2, MPTW} for similar arguments. In this setting, we let $\alpha < \frac{2}{p-1} - \frac 12$, the reason of which will become clear in the following steps. By \eqref{defE}, \eqref{SvNLW_res}, and Taylor's theorem, we have \begin{equation} \begin{split} \partial_t E(t) &= \int_{\mathbb{T}^2} \partial_t v \big( \partial_t^2 v + (1-\Delta) v + |v|^{p-1}v \big) dx \\ &= -\int_{\mathbb{T}^2} \partial_t v \big( |v + \Psi|^{p-1} (v + \Psi) - |v|^{p-1} v \big) dx - \int_{\mathbb{T}^2} \big( D^{\frac 12} \partial_t v \big)^2 dx \\ &\leq -p \int_{\mathbb{T}^2} \partial_t v \cdot |v|^{p-1} \Psi dx - \frac{p(p-1)}{2} \int_{\mathbb{T}^2} \partial_t v \cdot |v + \theta \Psi|^{p-3} (v + \theta \Psi) \Psi^2 dx \\ &=: A_1 + A_2, \end{split} \label{A1A2} \end{equation} \noindent where $\theta \in (0,1)$. To estimate $A_2$, by the Cauchy-Schwartz inequality and Cauchy's inequality, we have \begin{equation} \begin{split} |A_2| &\lesssim \int_{\mathbb{T}^2} |\partial_t v| \big( |v|^{p-2} \Psi^2 + \Psi^p \big) dx \\ &\lesssim \bigg( \int_{\mathbb{T}^2} (\partial_t v)^2 dx \bigg)^{1/2} \bigg( \| \Psi \|_{L_x^{\infty}}^4 \int_{\mathbb{T}^2} |v|^{2(p-2)} dx + \| \Psi \|_{L_x^{2p}}^{2p} \bigg)^{1/2} \\ &\lesssim (1 + \| \Psi \|_{L_x^{\infty}}^4) E(t) + \| \Psi \|_{L_x^{2p}}^p, \end{split} \label{A2} \end{equation} \noindent where in the last inequality, we need $2(p-2) \leq p+1$, which is equivalent to $p \leq 5$. To estimate $A_1$, for $0 < t_1 \leq t_2 \leq T$, by integration by parts and Young's inequality, we have \begin{equation} \begin{split} \int_{t_1}^{t_2} A_1 dt' &= - \int_{t_1}^{t_2} \int_{\mathbb{T}^2} \partial_t (|v|^{p-1}v) \Psi dx dt' \\ &= - \int_{\mathbb{T}^2} |v(t_2)|^{p-1} v(t_2) \Psi(t_2) dx + \int_{\mathbb{T}^2} |v(t_1)|^{p-1} v(t_1) \Psi(t_1) dx \\ &\hphantom{X}\, + \int_{t_1}^{t_2} \int_{\mathbb{T}^2} |v|^{p-1} v (\partial_t\Psi) dx dt' \\ &\lesssim \varepsilon \| v(t_2) \|_{L_x^{p+1}}^{p+1} + \frac{1}{\varepsilon} \| \Psi(t_2) \|_{L_x^{p+1}}^{p+1} + \| v(t_1) \|_{L_x^{p+1}}^{p+1} + \| \Psi(t_1) \|_{L_x^{p+1}}^{p+1} \\ &\hphantom{X}\, + \int_{t_1}^{t_2} \int_{\mathbb{T}^2} |v|^{p-1} v (\partial_t\Psi) dx dt', \end{split} \label{A1a} \end{equation} \noindent where $0 < \varepsilon < 1$. We see in Remark \ref{REM:dPsi} that $\partial_t \Psi \in C([0,T]; W^{-\frac 12 - \alpha -, \infty} (\mathbb{T}^2))$. By duality, H\"older's inequality, Lemma \ref{LEM:chain} (i), and Lemma \ref{LEM:Gag}, we obtain \begin{equation} \begin{split} \int_{t_1}^{t_2} &\int_{\mathbb{T}^2} |v|^{p-1} v (\partial_t\Psi) dx dt' \\ &= \int_{t_1}^{t_2} \int_{\mathbb{T}^2} \jb{\nabla}^{\frac 12+\alpha+} (|v|^{p-1}v) \jb{\nabla}^{-\frac 12-\alpha -} (\partial_t \Psi) dx dt' \\ &\lesssim \int_{t_1}^{t_2} \| v \|_{L_x^{p+1}}^{p-1} \big\| \jb{\nabla}^{\frac 12+\alpha +} v(t')\big\|_{L_x^{\frac{p+1}{2}}} \big\| \jb{\nabla}^{-\frac 12-\alpha -} (\partial_t\Psi)(t') \big\|_{L_x^\infty} dt' \\ &\lesssim \| \partial_t\Psi \|_{C_TW_x^{-\frac 12 - \alpha -, \infty}} \int_{t_1}^{t_2} E(t')^{\frac{p-1}{p+1}} \| \jb{\nabla} v \|_{L_x^2}^{\frac{2}{p-1}} \| v \|_{L_x^{p+1}}^{\frac{p-3}{p-1}} dt' \\ &\lesssim \| \partial_t\Psi \|_{C_TW_x^{-\frac 12 - \alpha -, \infty}} \int_{t_1}^{t_2} E(t') dt', \end{split} \label{A1b} \end{equation} \noindent where we require that \[ \frac 12 + \alpha + = \frac{2}{p-1},\] which is equivalent to $\alpha < \frac{2}{p-1} - \frac 12$. By combining \eqref{A1A2}, \eqref{A2}, \eqref{A1a}, and \eqref{A1b}, we have \[E(t_2) \leq (1+ C_1(\Psi)) \int_{t_1}^{t_2} E(t') dt' + C_2(\Psi, v(t_1)). \] By Gronwall's inequality, we get \[E(t) \lesssim e^{C(\Psi) t}\] for any $0 < t \leq T$. \subsection{Case $p > 5$} \label{SUBSEC:GWP3} In this case, we follow the idea by Latocca \cite{Lat}. In this setting, we also let $\alpha < \frac{2}{p-1} - \frac 12$. We need the following lemma to close the energy estimates in the Gronwall argument. We define $\b_p := \lceil \frac{p-3}{2} \rceil$, $F(u) := |u|^{p-1}u$, and $s_p := \frac{p-3}{p-1}$. \begin{lemma}\label{LEM:Bes_bd} For any $0 < t \leq T$ and every integer $1 \leq k \leq \b_p$, we have \begin{align*} \bigg| \int_{\mathbb{T}^2} F^{(k-1)}(v(t)) \Psi(t)^{k-1} &\partial_t\Psi(t) dx \bigg| \\ &\lesssim g\big( \| \Psi \|_{L^\infty([0,T]; X)}, \| \jb{\nabla}^{-1} \partial_t\Psi \|_{L^\infty([0,T]; Y)} \big) (1+E(t)), \end{align*} \noindent where $g$ is a polynomial with positive coefficients, and \[X := L^\infty (\mathbb{T}^2) \cap B_{\frac{p+1}{2},1}^{1-s_p} (\mathbb{T}^2) \quad \text{and} \quad Y := L^\infty (\mathbb{T}^2) \cap B_{\infty,1}^{s_p} (\mathbb{T}^2).\] \end{lemma} Note that given $\alpha < \frac{2}{p-1} - \frac 12$, by Lemma \ref{LEM:regPsi}, Remark \ref{REM:dPsi}, and Lemma \ref{LEM:Bes} (ii), we have \[ g\big( \| \Psi \|_{L^\infty([0,T]; X)}, \| \jb{\nabla}^{-1} \partial_t\Psi \|_{L^\infty([0,T]; Y)} \big) < \infty \] almost surely. \medskip Let us first assume Lemma \ref{LEM:Bes_bd} and work on the energy bound. As in the case when $p > 3$, we can compute that for $0 < t \leq T$, \begin{equation} \partial_t E(t) \leq -\int_{\mathbb{T}^2} \partial_t v (F(v + \Psi) - F(v)) dx. \label{dtE} \end{equation} \noindent For our convenience we compute that for $k \in \mathbb{Z}_+$, \[ F^{(k)} (u) = \begin{cases} C_{p,k} |u|^{p-k-1}u & \text{for $k$ even}, \\ C_{p,k} |u|^{p-k} & \text{for $k$ odd}. \end{cases} \] By Taylor's formula at the point $v(t,x)$ with integral remainder up to the order $\b_p = \lceil \frac{p-3}{2} \rceil$, we have \[ F(v + \Psi) - F(v) = \sum_{k=1}^{\b_p} \frac{1}{k!} F^{(k)}(v) \Psi^k + \int_v^{v+\Psi} \frac{F^{(\b_p + 1)}(\tau)}{\b_p!} (v+\Psi-\tau)^{\b_p} d\tau. \] Let $0 < t_1 \leq t_2 \leq T$. By integrating \eqref{dtE} from $t_1$ to $t_2$, we can write \begin{equation} E(t_2) \leq E(t_1) + \sum_{k=1}^{\b_p} C_k I_k + C_p R, \label{Et} \end{equation} \noindent where \[ I_k := -\int_{t_1}^{t_2} \int_{\mathbb{T}^2} \partial_t v F^{(k)}(v) \Psi^k dx dt' \quad \text{for} \quad 1 \leq k \leq \b_p, \] \[ R := -\int_{t_1}^{t_2} \int_{\mathbb{T}^2} \int_v^{v+\Psi} \partial_t v F^{(\b_p+1)}(\tau) (v+\Psi-\tau)^{\b_p} d\tau dx dt'. \] We first estimate $R$. Note that for $\tau \in [v, v+\Psi]$, we have \[ |F^{(\b_p+1)}(\tau)| \lesssim |v|^{p-\b_p-1} + |\Psi|^{p-\b_p-1}. \] Thus, by H\"older's inequality and Young's inequality, we have \begin{equation} \begin{split} R &\lesssim \int_{t_1}^{t_2} \int_{\mathbb{T}^2} \partial_t v (|v|^{p-\b_p-1} |\Psi|^{\b_p+1} + |\Psi|^p) dx dt' \\ &\lesssim \int_{t_1}^{t_2} \| \partial_t v(t') \|_{L_x^2} \| v(t') \|_{L_x^{p+1}}^{p-\b_p-1} \| \Psi(t') \|_{L_x^{r_p(\b_p+1)}}^{\b_p+1} dt' + \int_{t_1}^{t_2} \| \partial_t v(t') \|_{L_x^2}^2 dt' \\ &\hphantom{X}\, + \| \Psi \|_{L_T^{2p} L_x^{2p}}^{2p} \\ &\leq \| \Psi \|_{L_T^{2p} L_x^{2p}}^{2p} + \bigg( 1 + \| \Psi \|_{L_T^\infty L_x^{r_p(\b_p+1)}}^{\b_p+1} \bigg) \int_{t_1}^{t_2} \max\bigg\{ E(t'), E(t')^{\frac 12 + \frac{p-\b_p-1}{p+1}} \bigg\} dt', \end{split} \label{defR} \end{equation} \noindent where $r_p$ satisfies $\tfrac 12 + \tfrac{p-\b_p-1}{p+1} + \frac{1}{r_p} = 1$. Since $\b_p = \lceil \frac{p-3}{2} \rceil \geq \frac{p-3}{2}$, we have $\frac{p-\b_p-1}{p+1} \leq \frac 12$, so that \[ R \lesssim \| \Psi \|_{L_T^{2p} L_x^{2p}}^{2p} + \bigg( 1 + \| \Psi \|_{L_T^\infty L_x^{r_p(\b_p+1)}}^{\b_p+1} \bigg) \int_{t_1}^{t_2} (1+E(t')) dt'. \] We now estimate $I_k$. By Fubini's theorem and integration by parts in time, we have \begin{equation} \begin{split} |I_k| &= \bigg| -\int_{\mathbb{T}^2} \int_{t_1}^{t_2} \partial_t (F^{(k-1)}(v)) \Psi^k dt' dx \bigg| \\ &\leq \bigg| \int_{\mathbb{T}^2} F^{(k-1)}(v(t_2)) \Psi^k(t_2) dx \bigg| + \bigg| \int_{\mathbb{T}^2} F^{(k-1)}(v(t_1)) \Psi^k(t_1) dx \bigg| \\ &\hphantom{X}\, + \bigg| k \int_{\mathbb{T}^2} \int_{t_1}^{t_2} F^{(k-1)}(v(t')) \Psi(t')^{k-1} \partial_t\Psi(t') dt' dx \bigg| \\ &\lesssim \int_{\mathbb{T}^2} |v(t_2)|^{p-k+1} |\Psi(t_2)|^k + |v(t_1)|^{p-k+1} |\Psi(t_1)|^k dx \\ &\hphantom{X}\, + \bigg| \int_{t_1}^{t_2} \int_{\mathbb{T}^2} F^{(k-1)}(v(t')) \Psi(t')^{k-1} \partial_t\Psi(t') dx dt' \bigg| \\ &= J_k + K_k. \end{split} \label{Ik} \end{equation} \noindent To handle $J_k$, by H\"older's inequality and Young's inequality, we obtain \begin{equation} \begin{split} J_k &\leq E(t_2)^{\frac{p-k+1}{p+1}} \| \Psi(t_2) \|_{L_x^{p+1}}^k + E(t_1)^{\frac{p-k+1}{p+1}} \| \Psi(t_1) \|_{L_x^{p+1}}^k \\ &\leq \varepsilon E(t_2) + C_1 E(t_1) + C_2 \| \Psi \|_{L_T^\infty L_x^{p+1}}^{p+1}, \end{split} \label{Jk} \end{equation} \noindent where $0 < \varepsilon < 1$. To deal with $K_k$, by Lemma \ref{LEM:Bes_bd}, \begin{equation} K_k \lesssim g\big( \| \Psi \|_{L^\infty([0,T]; X)}, \| \jb{\nabla}^{-1} \partial_t\Psi \|_{L^\infty([0,T]; Y)} \big) \bigg( 1+\int_{t_1}^{t_2} E(t') dt' \bigg). \label{Kk} \end{equation} \noindent By combining \eqref{Et}, \eqref{defR}, \eqref{Ik}, \eqref{Jk}, \eqref{Kk}, we obtain \begin{align*} E(t_2) &\lesssim \bigg( 1+\| \Psi \|_{L_T^\infty L_x^{r_p(\b_p+1)}}^{\b_p+1} + g\big( \| \Psi \|_{L^\infty([0,T]; X)}, \| \jb{\nabla}^{-1} \partial_t\Psi \|_{L^\infty([0,T]; Y)} \big) \bigg) \\ &\hphantom{X}\, \times \bigg( 1+\int_{t_1}^{t_2} E(t') dt' \bigg) + \| \Psi \|_{L_T^{2p} L_x^{2p}}^{2p} + \| \Psi \|_{L_T^\infty L_x^{p+1}}^{p+1} + E(t_1). \end{align*} \noindent We can then use Gronwall's inequality to get the desired bound. \medskip We now provide the proof of Lemma \ref{LEM:Bes_bd}. \begin{proof}[Proof of Lemma \ref{LEM:Bes_bd}] Recall that $s_p = \frac{p-3}{p-1}$. We first consider the case when $k \geq 2$. By the Fourier-Plancherel theorem, we have \begin{equation} \begin{split} \bigg| \int_{\mathbb{T}^2} F^{(k-1)}(v(t)) &\Psi(t)^{k-1} \partial_t\Psi(t) dx \bigg| \\ &= \bigg| \sum_{j'=-1}^1 \sum_{j \geq 0} \int_{\mathbb{T}^2} \mathbf{P}_j (F^{(k-1)}(v(t)) \Psi(t)^{k-1}) \mathbf{P}_{j+j'} (\partial_t\Psi(t)) dx \bigg| \\ &\lesssim \sum_{j > 2} \int_{\mathbb{T}^2} |\mathbf{P}_j (F^{(k-1)}(v(t)) \Psi(t)^{k-1})| |\mathbf{P}_j (\partial_t\Psi(t))| dx \\ &\hphantom{X} + \sum_{j = 0}^2 \int_{\mathbb{T}^2} |\mathbf{P}_j (F^{(k-1)}(v(t)) \Psi(t)^{k-1})| |\mathbf{P}_j (\partial_t\Psi(t))| dx \\ &=: I_1 + I_2. \end{split} \label{I1I2} \end{equation} \noindent Let $r_k := \frac{(k-1)(p+1)}{k}$. To estimate $I_2$, by H\"older's inequality, Bernstein's inequality, and Young's inequality, we have \begin{equation} \begin{split} I_2 &\lesssim \| \Psi(t) \|_{L_x^{r_k}}^{k-1} \| v(t) \|_{L_x^{p+1}}^{p-k+1} \sum_{j=0}^2 \| \mathbf{P}_j \partial_t\Psi(t) \|_{L_x^\infty} \\ &\lesssim \| \Psi(t) \|_{L_x^{r_k}}^{k-1} \| \jb{\nabla}^{-1} \partial_t\Psi(t) \|_{L_x^\infty} E(t)^{\frac{p-k+1}{p+1}} \\ &\lesssim E(t) + \| \Psi \|_{L_T^\infty L_x^{r_k}}^{r_k} \| \jb{\nabla}^{-1} \partial_t\Psi \|_{L_T^\infty L_x^\infty}^{\frac{p+1}{k}}. \end{split} \label{I2} \end{equation} \noindent It remains to estimate $I_1$. By H\"older's inequality, Bernstein's inequality, and then H\"older's inequality for series, \begin{align*} I_1 &\lesssim \sum_{j > 2} 2^{j(1-s_p)} \| \mathbf{P}_j (F^{(k-1)}(v(t)) \Psi(t)^{k-1}) \|_{L_x^1} 2^{j s_p} \| \mathbf{P}_j (\jb{\nabla}^{-1}\partial_t\Psi(t)) \|_{L_x^\infty} \\ &\leq \| F^{(k-1)}(v(t)) \Psi(t)^{k-1} \|_{B_{1,\infty}^{1-s_p}} \| \jb{\nabla}^{-1}\partial_t\Psi \|_{B_{\infty,1}^{s_p}}. \end{align*} \noindent Then, by Corollary \ref{COR:bilin}, we have \begin{equation} \begin{split} \| F^{(k-1)}(v(t)) &\Psi(t)^{k-1} \|_{B_{1,\infty}^{1-s_p}} \lesssim \| F^{(k-1)} (v(t)) \|_{B_{\frac{p+1}{p+2-k}, \infty}^{1-s_p}} \| \Psi(t)^{k-1} \|_{L^{\frac{p+1}{k-1}}} \\ &\hphantom{X}\, + \| |v(t)|^{p-k+1} \|_{L^{\frac{p+1}{p-k+1}}} \| \Psi(t)^{k-1} \|_{B_{p_k,\infty}^{1-s_p}} \\ &\lesssim \| F^{(k-1)} (v(t)) \|_{B_{\frac{p+1}{p+2-k}, \infty}^{1-s_p}} \| \Psi(t) \|_{L^{p+1}}^{k-1} + E(t)^{\frac{p-k+1}{p+1}} \| \Psi(t)^{k-1} \|_{B_{p_k,\infty}^{1-s_p}}, \end{split} \label{I1-1} \end{equation} \noindent where $p_k$ satisfies $\frac{1}{p_k} + \frac{p-k+1}{p+1} = 1$. By Lemma \ref{LEM:chain} (ii), we have \begin{equation} \begin{split} \| \Psi(t)^{k-1} \|_{B_{p_k,\infty}^{1-s_p}} &\lesssim \| \Psi(t) \|_{B_{p_k,\infty}^{1-s_p}} \| \Psi(t) \|_{L^\infty}^{k-2} \\ &\leq \| \Psi(t) \|_{B_{\frac{p+1}{2},\infty}^{1-s_p}} \| \Psi(t) \|_{L^\infty}^{k-2}. \end{split} \label{I1-2} \end{equation} \noindent By Lemma \ref{LEM:chain} (ii), Lemma \ref{LEM:Bes} (ii), and Lemma \ref{LEM:Gag}, we have \begin{align*} \| F^{(k-1)} (v(t)) \|_{B_{\frac{p+1}{p+2-k}, \infty}^{1-s_p}} &\lesssim \| v(t) \|_{B_{\frac{p+1}{2}, \infty}^{1-s_p}} \big\| |v(t)|^{p-k} \big\|_{L^{\frac{p+1}{p-k}}} \\ &\lesssim \| v(t) \|_{W^{1-s_p, \frac{p+1}{2}}} E(t)^{\frac{p-k}{p+1}} \\ &\lesssim \| \jb{\nabla} v(t) \|_{L^2}^{1-\b} \| v(t) \|_{L^{p+1}}^\b E(t)^{\frac{p-k}{p+1}}, \end{align*} \noindent where $\b \in [0,s_p]$ satisfies $\frac{2}{p+1} = \frac{1-s_p}{2} + \frac{\b}{p+1}$, and so $\b = \frac{p-3}{p-1} = s_p$. Thus, we obtain \begin{equation} \| F^{(k-1)} (v(t)) \|_{B_{\frac{p+1}{p+2-k}, \infty}^{1-s_p}} \lesssim E(t)^{\frac{1-\b}{2} + \frac{\b}{p+1} + \frac{p-k}{p+1}} = E(t)^{\frac{2}{p+1} + \frac{p-k}{p+1}} \lesssim 1 + E(t). \label{I1-3} \end{equation} \noindent By combining \eqref{I1-1}, \eqref{I1-2}, and \eqref{I1-3}, we obtain the desired bound for $I_1$. For the case when $k=1$, after \eqref{I1I2}, we have the estimate $I_2 \lesssim E(t) + \| \jb{\nabla}^{-1} \partial_t\Psi \|_{L_T^\infty L_x^\infty}^{p+1}$. For the term $I_1$, by the estimate in \eqref{I1-3}, we have \[ I_1 \lesssim \| F(v(t)) \|_{B_{1,\infty}^{1-s_p}} \| \jb{\nabla}^{-1} \partial_t\Psi \|_{B_{\infty,1}^{s_p}} \lesssim \| \jb{\nabla}^{-1} \partial_t\Psi \|_{B_{\infty,1}^{s_p}} (1+E(t)), \] as desired. \end{proof} \section{Almost sure global well-posedness of vNLW with randomized initial data} \label{SEC:GWP2} In this section, we study Theorem \ref{THM:GWP2}, i.e. the almost sure global well-posedness of the deterministic vNLW \eqref{DvNLW} with randomized initial data. Due to the Borel-Cantelli lemma, It suffices to show the following ``almost'' almost sure global well-posedness result (see \cite{CO, BOP2}). \begin{proposition}\label{PROP:GWP2} Let $p > 1$ and $-\frac{1}{p} < s \leq 0$. Given initial data $(u_0, u_1) \in \H^s(\mathbb{T}^2)$, let $(u_0^\o, u_1^\o)$ be the randomization of $(u_0, u_1)$ defined in \eqref{rand}. Then, given any $T, \varepsilon > 0$, there exists $\O_{T,\varepsilon} \subset \O$ such that \begin{itemize} \item[(i)] $P(\O_{T,\varepsilon}^c) < \varepsilon$, \item[(ii)] For each $\o \in \O_{T,\varepsilon}$, there exists a (unique) solution $u$ to \eqref{DvNLW} on $[0,T]$ with $(u, \partial_t u) |_{t=0} = (u_0^\o, u_1^\o)$. \end{itemize} \end{proposition} The argument for proving Proposition \ref{PROP:GWP2} is similar to that of Theorem \ref{THM:GWP1}. The only difference for proving Proposition \ref{PROP:GWP2} is that, instead of dealing with the stochastic object $\Psi$ (as defined in \eqref{Psi2}), we need to work with the random linear solution $z(t) = V(t) (u_0^\o, u_1^\o)$. Thanks to Lemma \ref{LEM:str_fin} and Lemma \ref{LEM:str_inf}, we are able to bound $z$ in Strichartz spaces $L^q_t L^r_x$ for $1 \leq q,r \leq \infty$ outside an exceptional set of small probability. Note that in order to apply Lemma \ref{LEM:str_inf}, we need to consider well-posedness in the time interval $[T_0,T]$ (instead of $[0,T]$), where $0 < T_0 \leq 1$ is the local existence time as in Proposition \ref{PROP:LWP2}. We refer the readers to Section \ref{SEC:GWP1} for the rest of the details for proving Proposition \ref{PROP:GWP2}. \begin{comment} \subsection{The case $2 \leq p \leq 3$} We can apply a similar argument as in Subsection \ref{SUBSEC:GWP1} to bound $E(\vec v^\o)$ by replacing all occurrences of $v$ with $v^\o$ and all occurrences of $\Psi$ with $z^\o$. Note that the underlying constant depends on $\| z^\o \|_{L^\infty ([T_0,T]; L_x^\infty)}$, which by Lemma \ref{LEM:str_inf} is bounded by a constant multiple of $T_0^{s-\varepsilon_0} \| (u_0, u_1) \|_{\H^s}$ for any $\varepsilon_0 > 0$ satisfying $\varepsilon_0 \geq s$. \subsection{The case $3 < p \leq 5$} In this case, we again apply a similar argument as in Subsection \ref{SUBSEC:GWP2}, except for the steps in \eqref{A1b}. After consider the interval $[T_0,T]$ instead of $[0,T]$, and replacing all occurrences of $v$ with $v^\o$ and all occurrences of $\Psi$ with $z^\o$, by recalling the definition of $\widetilde z^\o$ in \eqref{tZ} and applying Lemma \ref{LEM:str_inf}, we modify \eqref{A1b} in the following way: \begin{equation}\label{A1b_modified} \begin{split} \int_{T_0}^t &\int_{\mathbb{T}^2} |v^\o|^{p-1} v^\o (\partial_t z^\o) dx dt' \\ &= \int_{T_0}^t \int_{\mathbb{T}^2} \jb{\nabla}^{\frac{2}{p-1}} (|v^\o|^{p-1} v^\o) \jb{\nabla}^{1-\frac{2}{p-1}} \widetilde z^\o dxdt' \\ &\lesssim \int_{T_0}^t \| v^\o \|_{L_x^{p+1}}^{p-1} \big\| \jb{\nabla}^{\frac{2}{p-1}} v^\o(t')\big\|_{L_x^{\frac{p+1}{2}}} \big\| \jb{\nabla}^{1-\frac{2}{p-1}} \widetilde z^\o (t') \big\|_{L_x^\infty} dt' \\ &\lesssim \| \widetilde z^\o \|_{L^\infty \big([T_0,T]; W_x^{1-\frac{2}{p-1}, \infty}\big) } \int_0^t E(\vec v^\o(t'))^{\frac{p-1}{p+1}} \| \jb{\nabla} v^\o \|_{L_x^2}^{\frac{2}{p-1}} \| v^\o \|_{L_x^{p+1}}^{\frac{p-3}{p-1}} dt' \\ &\lesssim \| \widetilde z^\o \|_{L^\infty \big([T_0,T]; W_x^{1-\frac{2}{p-1}, \infty}\big)} \int_{T_0}^t E(\vec v^\o(t')) dt', \end{split} \end{equation} \noindent where Lemma \ref{LEM:str_inf} tells us that \[ \| \widetilde z^\o \|_{L^\infty \big([T_0,T]; W_x^{1-\frac{2}{p-1}, \infty}\big)} \leq C_\o T_0^{-1+\frac{2}{p-1}+s-\varepsilon_0} \| (u_0,u_1) \|_{\H^s} \] for any $\varepsilon_0 > 0$ satisfying $\varepsilon_0 \geq -1+\frac{2}{p-1}+s$. \subsection{The case $p > 5$} In this case, we again argue in a similar way as in Subsection \ref{SUBSEC:GWP3} and replace all occurrences of $v$ with $v^\o$ and all occurrences of $\Psi$ with $z^\o$. Note that the underlying constant in the energy bound depends on $T, \varepsilon, p$ and also depends on $\| z^\o \|_{L^\infty([T_0,T]; X)}$ and $\| \widetilde z^\o \|_{L^\infty([T_0,T]; Y)}$. Here, we recall that \[X := L^\infty \cap B_{\frac{p+1}{2},1}^{1-s_p} \quad \text{and} \quad Y := L^\infty \cap B_{\infty,1}^{s_p}.\] By Lemma \ref{LEM:Bes} and Lemma \ref{LEM:str_inf}, we have the following bounds: \begin{equation} \begin{split} & \| z^\o \|_{L^\infty([T_0,T]; L_x^\infty)} \leq C_\o T_0^{s-\varepsilon_0} \| (u_0,u_1) \|_{\H^s} \\ & \| z^\o \|_{L^\infty \big( [T_0,T]; B_{\frac{p+1}{2},1}^{1-s_p} \big)} \leq C_\o T_0^{-1+s_p+s-\varepsilon_0} \| (u_0,u_1) \|_{\H^s} \\ & \| \widetilde z^\o \|_{L^\infty([T_0,T]; L_x^\infty)} \leq C_\o T_0^{s-\varepsilon_0} \| (u_0,u_1) \|_{\H^s} \\ & \| z^\o \|_{L^\infty \big( [T_0,T]; B_{\infty,1}^{s_p} \big)} \leq C_\o T_0^{-s_p+s-\varepsilon_0} \| (u_0,u_1) \|_{\H^s} \end{split} \end{equation} \noindent for any $\varepsilon_0 > 0$ satisfying $\varepsilon_0 \geq \max\{ s, -1+s_p+s, -s_p+s \}$. \end{comment}
af82d700be0d221fc003d93e8bcb0ddb07005779
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} The adversarial machine learning (AML) domain has been expanding rapidly recently due to increased adversarial attacks on various traditional ML and deep learning (DL) systems. An adversarial attack is a process of causing well-planned misclassifications from a target classifier. In short, let us assume a ML system $f$, input sample $x_{clean}$, which is a natural input (Non-adversarial) and its true label $y_{true}$. The ML system correctly classifies this input i.e. $f(x_{clean})=y_{true}$. Now the system will be said under adversarial attack if an adversary carefully crafts an input sample $x_{adv}$ such that $f(x_{adv})\neq y_{true}$. An adversary can attack a target ML-based system from the digital world as well as the physical world. When the adversary leverages its digital access to the target system, creates and presents an adversarial example (AX) digitally to the target system, the realized attack is called a digital adversarial attack. On the other hand, it is called a physical adversarial attack if the adversary realizes the attack from the physical world. The target system for these AXs could be a face recognition system (FRS), where a trained DL model tries to validate the claimed identity of an input face image. The adversarial attack can be of dodging type or impersonation type based on the attacker's objective. However, crafting impersonation (targeted) attacks is more challenging than dodging-type attacks. In this work, we focus on the generation of impersonation attacks. Also, an adversary can attack a target system during the training \cite{barreno2006can, biggio2011support, biggio2013poisoning, mei2015using}, testing \cite{goodfellow2014explaining, papernot2016distillation, papernot2016limitations, eykholt2018robust}, or model deployment stage\cite{miao2021machine, sehatbakhsh2020security}. For physical adversarial attacks, the standard methods to transfer digital AXs to Physical World include printing and painting. The success of physical attacks depends on physical transferability, which is the ability of digital AXs to successfully transfer/imitate to the physical world. However, the attack performance in the physical world has been relatively lower than in the digital world. Some practical FRSs use a printed image to verify a subject’s identity, e.g., person re-identification, automatic ID document (like a passport) photo-matching systems at international borders. When an adversary submits a physical adversarial image in a registration process that causes a mistake by the target FRS, this attack is called a physical image registration attack. It allows an adversary to impersonate a target identity; This causes serious security concerns\cite{kakizaki2021toward}. This work considers physical image registration setting during physical world evaluation and focuses on improving physical transferability. \begin{figure} \centering \includegraphics[width=\linewidth]{figure_pdf/reg_attack.png} \caption{Physical image registration attacks against FRSs. An adversary registers an AX $x_{adv}$ generated using a clean source image $x_s$ in the target system. At the time of face verification, the registered $x_{adv}$ results in the successful verification of a person at the security gate even the person ($x_p$) is different from the person of $x_{adv}$ image.} \label{fig:reg_attack} \end{figure} Effective optimization of adversarial noise during the attack generation process results in robust AXs following misclassification objectives. For a better physical attack success rate (ASR), the generation of smooth patterns is a well-known approach for lower \textit{physical reconstruction losses}. \textit{Physical reconstruction loss} is the total amount of information lost and the noise added to the physical AX while transferring it from the digital world\cite{kurakin2016adversarial,singh2021brightness}. The errors during printing, camera noises, change in camera angles, variable lighting conditions \cite{singh2021brightness}, attack surface characteristics, and realism is the critical parameters influencing the physical re-constructability of digital AXs, thereby the success of a physical AX. \noindent \textbf{Our main contributions from this work are as follows:} \begin{enumerate} \item We propose a novel smoothness regularizer for generating robust AXs with high physical transferability for attacking FRSs from the physical world. Our smoothness loss also provides black-box performance improvements to the generated attacks due to the regularization effect. \item We propose a novel patch-noise combo attack method for generating powerful digital and physical adversarial attacks against FRSs by combining patch and imperceptibly small adversarial noises. \item We perform extensive white-box and black-box evaluation in the digital and physical worlds for state-of-the-art attack generation algorithms, for the proposed smoothness regularizer and the patch-noise combo attack method. We present a practical methodology for the physical world evaluation of registration-based adversarial attacks. We also provide the physical world evaluation for the ineffectiveness of the attacks with imperceptibly small noises in the physical world. \end{enumerate} \subsection{Related Works} To reduce physical reconstruction loss, previous works focused on generating smoother patterns in the adversarial noise. Existing studies found that abrupt pixel variations in a digital image, when compared to smoother patterns, cause significant printing \cite{sharif2016accessorize} and camera \cite{mahendran2015understanding} errors when transferred to the physical world. The smooth adversarial patterns result in a better ASR for the printed AXs. Sharif et al. \cite{sharif2016accessorize} proposed a smoothness loss function to generate smoother adversarial patterns for physical AXs. Their smoothness loss is given below. \begin{equation}\label{eqn: tvm} T V(r)=\sum_{i, j}\left(\left(r_{i, j}-r_{i+1, j}\right)^{2}+\left(r_{i, j}-r_{i, j+1}\right)^{2}\right)^{\frac{1}{2}} \end{equation} \noindent Where $r_{i,j}$ is the pixel intensity in the noise image with coordinates $(i,j)$. This smoothness penalty is used as a regularizer in the adversarial loss function and minimizes the differences in the adjacent pixel values in an image $r$. They improved the smoothness of the adversarial patch, thereby improving the inconspicuousness and physical realizability of the generated adversarial patches. Though the smoothness loss used by Sharif et al. \cite{sharif2016accessorize} results in the performance of improvements of the generated AXs in the physical world, it suffers from some primary limitations. It causes more substantial constraints on the optimization procedure for adversarial attack generation, reducing the convergence rate and white box ASR in the digital environment. Also, this reduction in the feasible solution space restricts a large number of possible practical patterns. It treats the imperceptible noise as well as perceptible noise in the same manner. Moreover, it does not allow selective optimization of the adversarial noise. It does not allow the formation of smooth sub-patches within the main malicious patch when the pixel distribution within the sub-patch and the remaining area of the patch is substantially different, thus, making it unfeasible for generating AXs with a sub-region representing a small smooth area of significantly different colors or patterns. \section{Our Proposed Smoothness Loss} We propose a smoothness loss based on an activation threshold $\tau$ that causes calculation of total variation (TV) only for the pixel pairs having deviation greater than $\tau$ from an initial reference value. Our proposed smoothness penalty is given in equation \ref{our_loss}. \begin{multline}\label{our_loss} L_{\text {smooth}}=\sum_{i, j}(\left(p_{i+1, j}-p_{i, j}\right)^2 \cdot\left(M_{i+1, j} \cdot M_{i,j}\right)+ \\ \left(p_{i, j+1}-p_{i, j}\right)^2 \cdot\left(M_{i, j+1} \cdot M_{i, j}\right))^{\frac{1}{2}} \end{multline} \noindent Where, \begin{equation} M_{i, j}= \begin{cases}1 & p_{i, j} \geq \tau_{i,j} \text{ and } \tau_{i,j} \in Z \\ 0 & \text {else}\end{cases} \end{equation} \noindent $p_{i,j}$ is the difference in the value of a pixel from the reference value at location $(i,j)$ in the adversarial noise region. $M$ is a dynamic mask that activates the smoothness loss for pixels with intensities greater than a predefined level. The threshold matrix $Z$ activates the smoothness penalty for respective pixels in the adversarial patch region. The matrices $M$ and $Z$ have the exact dimensions as the source face image $x_s$ using which AX is generated. Each pixel-level threshold $\tau_{i,j} \in Z$ can have a predefined fixed value or can be updated iteratively. \subsection{Working of Existing \cite{sharif2016accessorize} vs. Our Smoothness Loss} The existing smoothness loss \cite{sharif2016accessorize} starts penalizing the total variation (TV) present in the input image's trainable pixels (adversarial noise pixels) right from the beginning of the attack generation process. This causes excessive constraints on the adversarial optimization process from the start, considerably limiting the feasible solution space for the adversarial noise patterns. On the other hand, our smoothness loss starts penalizing the TV only for pixel pairs with a significant deviation from an initial reference value. Thus the pixels away from the initial reference value only are smoothened. It is to be noted that giving very high weightage to our smoothness regularizer might result in confining the solution space near a ball (with radius proportional to thresholds in $Z$) around the reference value, but the constraints remain softer than the existing penalty \cite{sharif2016accessorize} because of the hinge type margin caused by $Z$. Hence our smoothness loss introduces delayed smoothness constraints only at selected pixel locations during the attack generation process resulting in faster and better converged final solutions while maintaining a similar level of smoothness present in the generated AXs. \section{Our Patch-Noise Combo Attack} Existing works focus on generating adversarial noise coming from a single distribution. To generate stronger AXs for FRSs, we combined an adversarial patch (eyeglass) noise $\delta_p$ with an imperceptibly small noise $\delta_s$ (calling imperceptible noise from hereon). The small noise $\delta_s$ is placed in the remaining area of the face image $x_s$. \begin{equation}\label{patch-noise update} x^{p-n}_{adv} = x_s + M_s \cdot \delta_s + M_p \cdot \delta_p \end{equation} \noindent Where, the mask matrix $M_p$ takes values 1 for the pixels at patch location in $x_s$ and 0 otherwise. In this attack, adversarial noises of different sizes and different distributions are combined to form a single strong AX. We abbreviate it as “patch-noise combo attack” due to the combination of adversarial noises coming from different distributions. Our patch-noise combo attack is illustrated in the Figure \ref{fig:noise_combo}. This attack causes increased ASR in the digital domain mainly because the increased feasible solution space resulted from additional adversarial noise. However, for the physical world success of this attack, the size constraints on the imperceptible noise play a vital role (can be understood further in Section \ref{res_dis}). The minimal size of the imperceptible noise $\delta_s$ results in digital world ASR increase only because the physical reconstruction losses neutralize the effect in the physical world. However, increasing the size (by relaxing $L_{\infty}$ size constraints) increases physical ASR but decreases the physical imperceptibility of generated AXs. Hence, a target domain-specific choice of the size constraints for $\delta_s$ can be made for generating powerful patch-noise combo attacks in the physical world. This type of attack can be successfully used for attacking FRSs digitally and physically where the submission of a printed image is required for the verification, e.g., registration attacks. \begin{figure} \centering \includegraphics[width=\linewidth]{figure_pdf/noise_combo_face.png} \caption{Generation of our patch-noise combo attack combining imperceptibly small noise with eyeglass patch for highly transferable digital and registration-based physical AXs.} \label{fig:noise_combo} \end{figure} \section{Experimental Setting} \label{exp_setting} \subsection{Pretrained DL Models} We used state-of-the-art DL models as deep feature extractors in the FRS setting. In the feature extractor setting, the final layer of a DL model outputs a vector of deep representative features for the given input compared to the output class probabilities in the classification setting. A properly trained classifier can be used as a feature extractor by removing the last softmax/classification layer. We used ResNet50\cite{he2016deep}, ResNet100\cite{he2016deep}, VGG16\cite{vgg16model}, SE-IR100\cite{hu2018squeeze}, and SphereFace\cite{Liu_2017_CVPR} model architectures. The VGG16 model was trained on VggFace\cite{vggface_data} data using the softmax loss. We trained two variants for each of ResNet50 and ResNet100 models using softmax and arcface\cite{deng2019arcface} loss functions on VggFace2\cite{vggface2} and MS1MV2\cite{deng2019arcface} data, respectively. The IR-SE100 model was also trained on MS1MV2 dataset. We calculated the verification threshold $\tau$ for best accuracies. Only four models were used at a time for each attack setting. The diverse model setting allows the elimination of unnecessary biases during the evaluation. \subsection{Algorithms for Attack Generation} For a comprehensive experimental analysis, we selected the four most widely used gradient-based attack generation algorithms. We applied all these algorithms in a feature-extractor setting. The algorithms that we use for the attack generation are given below. \noindent \textbf{(1) Projected Gradient Descent (PGD) Attack \cite{pgd}.} We initialized the PGD attack for source image $x_s$ with some initial Gaussian random noise $\delta$ as $x_0 \leftarrow x + \delta$. The update step during $t^{th}$ iteration of attack generation process for the PGD attack is given in equation \ref{pgd_update}. \begin{equation}\label{pgd_update} x^{t+1} \leftarrow {Clip}_{x,\epsilon}\left(x^t + \alpha \cdot Sign\left(\nabla L_{adv}\right)\right) \end{equation} \noindent Where, $\nabla L_{adv}$ is the gradients calculated w.r.t the adversarial loss function $L_{adv}$. \noindent \textbf{(2) Carlini and Wagner Attack (CW) \cite{cw}.} The Carlini Wagner attack minimized the $\Delta L$ and training adversarial noise $\delta$ while keeping $x+\delta \in [0,1]$ for all pixels in the adversarial region of the training image. For making sure to satisfy the above constraints, the following transformation was used. \begin{equation} x_i + \delta_i = \frac{tanh(w_i)+1}{2} \end{equation} Where, $w_i$'s were trainable parameters. \noindent \textbf{(3) Layerwise Origin-Target Synthesis (LOTS) Attack \cite{lots}.} This attack is proposed explicitly for feature extractors. In our setting, we calculated the loss for the final layer of the model only. \noindent \textbf{(4) Iterative Fast Gradient Sign (IFGSM) Attack \cite{ifgsm1,ifgsm2}.} This attack is almost the same as the PGD attack except the training images were initialized as $x_0 \leftarrow x$. \subsection{Black-box Attack Techniques} To generate black-box attacks, we used three techniques for attack robustness and transferability enhancement. \noindent \textbf{(a) Input Diversity Method \cite{input_div}:} we applied random crop transformations to the training image in each training iteration of the attack generation process. The random crop was limited to $7\%$ of the original image's length for every four edges. \noindent \textbf{(b) Ensemble Diversity Method \cite{ensemble_div}:} we used ResNet50\cite{he2016deep} and SE-IR50\cite{hu2018squeeze} models (with equal weights to loss) out of the four pre-trained DL models for attack generation and remaining models for black-box evaluation. \noindent \textbf{(c) Combination of Input and Ensemble Diversity: }we combined the input diversity \cite{input_div} and ensemble diversity \cite{ensemble_div} to further enhance the robustness and black-box transferability. \subsection{Type of Attacks and Adversarial Objective} All of the experimentations were performed for an impersonation attack objective. In the impersonation attacks against FRSs, a source image $x_s$ is perturbed to an adversarial image $x_{adv}$ considering an adversarial loss for impersonation $L_{imper}$, such that the deep features of $x_{adv}$ becomes similar to the deep features of a target identity's image $x_{tar}$. Hence, the adversarial image $x_{adv}$ is classified as $x_{tar}$ by the target model, causing a mistake by the target DL model. We used the following loss functions for generating impersonation attacks: \begin{equation}\label{adv_loss_fn} {L}_{adv}= \gamma \cdot {L}_{smooth} - \sum_{i}^{K} f_{d}\left(f_{i}\left(x_{t}\right), f_{i}\left(x_{train} \right)\right) \end{equation} \noindent Where, ${L}_{smooth}$ is either the TV loss or our smoothness loss function, $x_{train}$ is the face image $x_s$ combined with adversarial perturbations. For patch only attacks, $x_{train} = x_s + M_p \cdot \delta_p $. For the patch-noise combo attacks, $x_{train}$ follows equation \ref{patch-noise update}. $x_t$ is the image of target identity. $f_i$ is the pre-trained face feature extractor. For non-ensemble models, $K = 1$ and $f1$ is one of the feature extractors. For ensemble models \cite{ensemble_div}, $K=2$, and $f_1$ and $f_2$ represents ResNet50\cite{he2016deep}, SE-IR50\cite{hu2018squeeze} feature-extractors. $\gamma$ is the weight parameter for the smoothness loss function. For the instances with input diversity transformation \cite{input_div}, the training image become $x^{'}_{train} = f_{DI}\left( x_{train} \right)$. The function $f_{DI}$ applies input diversity transformation \cite{input_div}. $f_d$ calculates the $L_2$ distance between given inputs. \subsection{Ablation Study Instances} \begin{algorithm} \caption{Attack Evaluation Procedure Outline}\label{alg:attack_gen_procedure} \begin{algorithmic} \State \hskip-0.6em \textbf{Inputs:} Source image $x_s$, target image $x_t$; algorithms A = \{PGD,CW,LOTS,IFGSM\}; black-box methods B = \{None, DI, Ensemble, DI+Ensemble\}; attack techniques T = \{No regularizer, TV Loss, Our Loss, Patch-Noise Combo+TV Loss, Patch-Noise Combo+Our Loss\}; \State \hskip-0.6em \textbf{For} all $a_i \in A$, $b_i \in B$, $t_i \in T$ \textbf{do} \State Generate digital AXs $(X_{adv})$ using combination of $a_i$,$b_i$, and $t_i$, while following the loss function of equation \ref{adv_loss_fn} and update rule of $a_i$; \State \hskip-0.6em \textbf{Perform} \textit{digital} evaluation of $X_{adv}$; \State \hskip-0.6em \textbf{Perform} \textit{physical} evaluation of successful digital $X_{adv}$ as per section \ref{phy_pipeline}; \end{algorithmic} \end{algorithm} For the ablation study, we implemented a total of 80 attack combinations following Algorithm \ref{alg:attack_gen_procedure}; out of them, 48 were baselines, and 32 were our method’s instances. We took training face images for attack generation from VggFace2 data\cite{vggface2}. We generated 100 AXs for the digital evaluation for each attack combination and a subset of 10 AXs for the physical evaluation. \subsection{Parameter Settings} The attack parameters for all the baselines and our methods were kept identical for effective comparison between baselines and our methods. We set training iterations to 2000 for PGD, LOTS, and IFGSM attacks and 7000 for CW attacks after observing the convergence for the given iterations. The $\epsilon$ parameter was kept to 1 for all attacks as we are generating patch attacks. The learning rate parameter was also kept identical for all instances at 0.01 in the gradient descent setting. \begin{figure*} \centering \includegraphics[width=0.9\textwidth]{figure_pdf/phy_pipe_face.png} \caption{Our physical AX generation and evaluation pipeline in the registration attack setting.} \label{fig:phy_pipe} \end{figure*} \section{Physical AXs Generation Pipeline} \label{phy_pipeline} We considered the light conditions and the camera angle, two main physical parameters during the realization of the physical AXs. \noindent \textbf{1. Light conditions:} Two sub-parameters were considered for the light conditions parameter. \textbf{i. Brightness levels:} We considered two different brightness levels of 800 and 1200 lux. \textbf{ii. Light color temperature:} We captured the images under white light with color temperatures of 3000K, 5000K. \noindent \textbf{2. Angle of the camera w.r.t. the printed adversarial image:} To capture the effect of reflectivity of the attack surface, we captured a stream of images by moving the camera in a horizontal arc of radius 15cm (approx.) and by subtending an angle of approximately 45° at the center of the captured image. To transfer the successful digital AXs to the physical world for realizing physical adversarial attacks, we followed the pipeline shown in Figure \ref{fig:phy_pipe}. The steps are as follows: \noindent\textbf{Step 1: Generating successful digital AXs.} Powerful physically transferable digital AXs were first generated. \noindent\textbf{Step 2: Printing.} The generated AXs were then color printed on paper. \noindent\textbf{Step 3: Capturing printed AXs.} The printed AXs were then captured using a camera in an appropriate format for the target system. This step transfers the AXs in physical form back to the digital space for the evaluation. \noindent\textbf{Step 4: Data cleaning.} From captured images, blurry and improper images were then cleaned. Around 20 images for each AX then remained. \noindent\textbf{Step 5: MTCNN face detection \cite{zhang2016joint} and alignment.} To align and crop the captured physical AX as shown in Figure \ref{fig:phy_pipe} (after step-4), firstly, we performed MTCNN face detection. The detected faces were then aligned using the similarity alignment. \noindent\textbf{Step 6: Feeding cropped and aligned AXs to the face matcher.} The cropped and aligned AXs were fed to a target face matcher depending on the attack evaluation setting (black/white-box). \noindent\textbf{Step 7: Checking attack success.}Finally, the success or failure of the attack is checked by distance or cosine similarity-based thresholds obtained for best f1-scores. \begin{figure*} \centering \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=0.99\linewidth]{figure_pdf/dig_wb.pdf} \caption{ASR for the white-box digital AXs} \label{fig:dg_wb} \end{subfigure}% \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=0.99\linewidth]{figure_pdf/dig_bb.pdf} \caption{ASR for the black-box digital AXs} \label{fig:dg_bb} \end{subfigure} \caption{Mean adversarial ASR for white-box (left) and black-box (right) attacks in the \textit{digital} domain. The x-axis represents the different attack generation methods, and the y-axis represents ASR. The attack generation algorithms are denoted by ‘A’ and follow the combinations of Algorithm \ref{alg:attack_gen_procedure}.} \label{fig:dig_results} \end{figure*} \section{Results and Discussion} \label{res_dis} The comprehensive experimental analysis found that our smoothness loss and patch-noise combo attack method significantly exceeds conventional techniques, especially in the physical world. The black-box transferability was also found to be increased for the generated attacks. The performance gains over the TVM approach \cite{sharif2016accessorize} for both digital and physical worlds are mainly due to better optimization in the digital world, better handling of the areas to be smoothened in the adversarial patch, and convergence to more effective solutions. Our patch-noise combo attacks in the face recognition setting generated the most potent digital and physical domains attacks. For the white-box attacks in the digital domain, we can see from Figure \ref{fig:dg_wb} that the ASR for AXs from our smoothness loss is almost the same as the AXs generated from without any smoothness regularizer. Ideally, the AXs generated without any smoothness regularizer for the white-box case should have higher ASR as they are trained for only that single adversarial objective without any additional constraints (regularizers). Nevertheless, the attacks generated with TVM regularizer had low ASR. The reason for low ASR was the stricter smoothness constraints on the attack generation procedure by calculating total variation right from the start for all pixels in the adversarial noise region. Our smoothness loss causes fewer constraints by the calculation of total variation during the attack generation process. The fewer constraints are due to the threshold-based activation of total variation calculation. Also, due to this, the AXs generated from our patch-noise combo attack method (using our smoothness loss) considerably outperform the ones generated from the TVM approach. The ASR for our patch-noise combo attack was 1.48 times higher than the eyeglass patch-only attacks because the more significant number of trainable parameters resulted in a significantly larger feasible solution space. From the results for the digital black box attacks shown in Figure \ref{fig:dg_bb}, we found that the AXs generated using our smoothness loss significantly outperforms in the black-box transferability and resulted in 2.88 and 1.80 times higher mean ASR compared to the AXs generated using TVM and without TVM, respectively. Our patch-noise combo attack performed the best and recorded 6.36 times higher black-box mean ASR than TVM-based patch attack. However, the AXs generated from the patch-noise combo attack using TVM regularizer also had significantly better black-box performance than the other baselines. A good white-box ASR and not being overfitted are the two critical parameters that contribute to the better black-box performance of the adversarial noise. In the physical domain, the AXs from our smoothness loss and the patch-noise combo attack using our smoothness loss completely outperforms their respective baselines (Figure \ref{fig:phy_results}). The patch-noise combo attacks with our smoothness regularizer were the strongest in the physical domain and resulted in 2.39 and 4.74 times higher mean ASR for the white-box and black-box settings. The performance gap between ours and baseline methods in the physical domain was significantly higher than in the digital domain. Hence, proving the effectiveness of our smoothness loss and the patch-noise combo attack for excellent physical transferability of generated AXs. \subsection{Comparing Smoothness in Generated AXs} To better understand the superior performance of our smoothness regularizer and to confirm our hypothesis, we compare the total variation present in the generated AXs from ours and the conventional \cite{sharif2016accessorize} TVM-based smoothness regularizers. We calculated the total variation present in the AXs generated from the existing \cite{sharif2016accessorize} and our smoothness loss using the following equation \ref{eqn: tvm}. We found that AXs generated without using any smoothness regularizer, using TVM regularizer \cite{sharif2016accessorize}, using our smoothness loss, using patch-noise combo attack with TVM regularizer, and using patch-noise combo attack with our smoothness regularizer had a mean total variation of 39.31, 19.39, 20.93, 20.25, and 22.75, respectively. We can see a more significant reduction in the total variation in the generated AXs due to a smoothness regularizer. But we can also see that this difference is not very significant compared to the smoothness of generated AXs from our and the existing TVM-based smoothness regularizer. Hence, we can say that our smoothness loss introduces a similar amount of smoothness in the generated AXs while allowing them to reach much better optimal solutions. \begin{figure*} \centering \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=\linewidth]{figure_pdf/phy_wb.pdf} \caption{ASR for the white-box physical AXs} \label{fig:sub1} \end{subfigure}% \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=\linewidth]{figure_pdf/phy_bb.pdf} \caption{ASR for the black-box physical AXs} \label{fig:sub2} \end{subfigure} \caption{Mean adversarial ASR for white-box (left) and black-box (right) attacks in the \textit{physical} domain. The x-axis represents the different attack generation methods, and the y-axis represents ASR. The attack generation algorithms are denoted by ‘A’ and follow the combinations of Algorithm \ref{alg:attack_gen_procedure}.} \label{fig:phy_results} \end{figure*} \subsection{Physical Transferability of Successful Digital AXs} \begin{table} \centering \sisetup{detect-weight,mode=text} \renewrobustcmd{\bfseries}{\fontseries{b}\selectfont} \renewrobustcmd{\boldmath}{} \newrobustcmd{\B}{\bfseries} \addtolength{\tabcolsep}{0.29pt} \begin{tabular}{c|c?c|c|c|c} \toprule Sr. & Smoothness & \multicolumn{4}{c}{ AX Generation Method } \\ \cline{3-6} No. & Regularizer & A1 & A2 & A3 & A4 \\ \midrule 1 & S0 & $0.240$ & $0.340 $ & $0.320 $ & 0.315 \\ \midrule 2 & S1 & $0.250 $ & $0.345 $ & $0.447 $ & 0.379 \\ \midrule 3 & S2 & $0.320 $ & $0.432 $ & $0.390 $ & 0.420 \\ \midrule 4 & S3 & $0.700 $ & $0.780 $ & $0.750 $ & 0.830 \\ \midrule 5 & S4 & $0.830 $ & $0.890 $ & $0.710 $ & 0.838 \\ \bottomrule \end{tabular} \caption{Results for the Physical Transferability of the Successful Digital AXs. S0, S1, S2, S3, and S4 represents the use of no smoothness regularizer, existing smoothness loss \cite{sharif2016accessorize}, our smoothness loss, patch-noise combo and existing smoothness loss, and patch-noise combo and our smoothness loss.} \label{tab:physical_trans} \end{table} Table \ref{tab:physical_trans} shows the physical transferability of the successful digital AXs to the physical domain. It can be seen that the AXs generated using any smoothness-based regularizer have better ASR in the physical domain as compared to the AXs generated without any smoothness regularizer. Also, the physical transferability of AXs generated from our smoothness loss remained better than the AXs generated from existing TV minimization even after using softer regularizing smoothness constraints. \subsection{Imperceptible Noise Attacks in Physical World} We also evaluate the performance of physical AXs with imperceptibly small adversarial noise distributed over the entire face image. Conventionally, these kinds of attacks are prevalent in the digital world only. However, in this work, we check whether they are usable for the physical world attacks. In our experimentation, we first generated digital attacks for 7 different values (0.02, 0.05, 0.1, 0.25, 0.5, 0.75, 1) of the $epsilon$ parameter. It is to be noted that source images were normalized in the range $[0,1]$. For each value of the $epsilon$ parameter, we generated three successful digital AXs with different identities for the physical evaluation. We transferred all digital AXs to the physical world and checked the physical ASRs. From the results (Figure \ref{fig:imper_size}) for the white-box ResNet50\cite{he2016deep} model, we found direct proportionality between $\epsilon$ and physical ASR; This is because AXs with smaller $\epsilon$ have less prominent visible adversarial patterns to the target system. Less prominence or visibility is caused due to physical reconstruction losses. Also, the AXs with smaller $\epsilon$ are more sensitive to the small perturbations than those with larger $\epsilon$. Also, from a subjective evaluation, we found an inverse proportionality between $\epsilon$ and physical inconspicuousness. Hence, we conclude a trade-off between the ASR and inconspicuousness of AXs in the physical domain. For a physical attack to succeed, it must be physically inconspicuous and have a high attack success probability. That makes the simple adversarial noise attacks (adversarial noise not taking any real-world patch shape) an unpopular choice for the physical adversarial attacks. \begin{figure}[!h] \centering \includegraphics[width=0.95\linewidth]{figure_pdf/imperceptible.pdf} \caption{Change in physical ASR and imperceptibility with increasing size $\epsilon$ of the adversarial noise. Increasing $\epsilon$ increases physical ASR but decreases physical imperceptibility.} \label{fig:imper_size} \end{figure} \section{Conclusions} \label{conclusions} This paper proposed a novel smoothness regularizer and patch-noise combo attack method for generating powerful physical adversarial examples against practical FRSs. From extensive experimentation, we found that our proposed methods outperform all state-of-the-art baselines in the digital and physical worlds. The use of our smoothness loss results in better physical transferability. Our smoothness loss also allows generating much complex real-world adversarial patterns due to selective smoothening in adversarial noise, reducing unwanted boundary losses. In our patch-noise combo attack, we confirm that using imperceptibly small adversarial noise along with adversarial patches can result in \textit{significant} performance improvements in the physical world. However, the size of imperceptible noise has the trade-off of ASR and physical imperceptibility. The generated digital and physical AXs from our methods allow an adequate risk assessment for the practical FRSs. {\small \bibliographystyle{ieee_fullname}
c8efb8b4a691df1e9e2e15b31ef399cad09e1d43
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Fluctuation is one of the most important quantities in nonequilibrium statistical mechanics. A milestone is the fluctuation-response relation in the linear response regime~\cite{Joh28}, which connects the fluctuation of currents to the response of currents to small external perturbations. The fluctuation-response relation was first proved on the basis of the consistency with the second law of thermodynamics~\cite{Nyq28}, and later its microscopic foundation was revealed~\cite{Tak52, Kub57}. The fluctuation theorem~\cite{ECM93, GC95, Jar97, Kur98} reproduces the fluctuation-response relation as its low-order description~\cite{ES95, Gal96}. Applying this technique, higher-order extensions and further generalizations of fluctuation-response relation have been obtained~\cite{SD,SU,Nak11, APE16, Shi22}. These equalities are obtained around zero current, and the fluctuation of current around a finite amount of current is not easy to characterize. Recently-obtained relations on current fluctuations thus take the form of inequalities, not equalities, to evaluate the fluctuation of current in general stationary systems. The thermodynamic uncertainty relation is a prominent example of this research direction, which provides a lower bound of the relative fluctuation (i.e., fluctuation divided by the square of its average) of an arbitrary current by the inverse of entropy production~\cite{BS15, Ging16, GRH17, DS20}. Although this inequality does not achieve its equality in general nonequilibrium setups~\cite{Shi21}, the thermodynamic uncertainty relation is considered to be a good clue to understand nonequilibrium stationary systems~\cite{HG20}, and various extensions~\cite{BHS18, DS18, VH19, HV19, LGU20, KS20, VVH20, DS21, VS21, Hase21, LPP21} and similar inequalities connecting fluctuation and entropy production~\cite{SST16, PS18, SFS18, SS19} have been investigated intensively. The aforementioned results uncover several {\it lower} bounds on the fluctuation of currents. Very recently, two {\it upper} bounds on the fluctuation of currents were proposed. These inequalities apply to stationary cross-transport systems where current A flows along thermodynamic force and current B flows against thermodynamic force. Currents A and B can be regarded as a fuel (free energy consumption) and a load (work extraction), respectively. The first inequality claims that the fluctuation of current B is smaller than A, and the second inequality claims that the relative fluctuation of current A is smaller than B. The second inequality was first proposed by Ito {\it et al.}~\cite{Ito19} in a cyclic heat engine in a slightly different form, and then Saryal {\it et al.}~\cite{Sar21} formulated these two inequalities for general setups and proved them in the linear response regime with time-reversal symmetry. They also demonstrated the validity of these inequalities beyond the linear response regime by numerical simulations. These inequalities are also verified in cyclic heat engines~\cite{Ito19, Sar21b} and generalized stationary setups in the linear response regime~\cite{Sar21c, Moh21}. Motivated by these observations, in this paper, we investigate an upper bound on currents in stationary cross-transport systems beyond the linear response regime. We consider two simple models to revisit the inequalities proposed in \cite{Sar21}. The first model is a chemical reaction system consisting of several reactions with two types of particles, and the second model is a thermoelectric transport system. In the first model, we examine the stationary state and find that the inequalities are violated in a general nonequilibrium condition beyond the linear response regime, which is shown by constructing concrete setups. A key observation behind this construction is the existence of a reaction with negligible current but infinitely large current fluctuation. Through this model, we establish that the fluctuation of one of the currents in the cross transport cannot be bounded from above by average currents and the fluctuation of another current. Moreover, although the above construction in the first model requires highly nonequilibrium conditions, we numerically demonstrate that these inequalities are also frequently violated in mild nonequilibrium conditions by using the second model, i.e., the thermoelectric transport system. This numerical simulation clearly shows that these inequalities are violated in a wide parameter range, including the case that the corresponding heat engine is not inefficient. \section{Input-output fluctuation inequalities} We first explain the input-output fluctuation conjecture, which was given by Saryal {\it et al.}~\cite{Sar21}. They considered a stationary system with two currents $J_{\rm A}$ and $J_{\rm B}$, which transport two different matters, A and B. For instance, A is heat and B is electrons. Another example is that A and B are two different kinds of particles. For the convenience of explanation, we shall employ the description with the latter setup, while our results directly apply to the former cases. We denote the difference of their conjugate intensive variable by $d_{\rm A}$ and $d_{\rm B}$, respectively. The contributions from current A and B to entropy production rate are given by $I_{\rm A}:=\DAJ_{\rm A}$ and $I_{\rm B}:=\DBJ_{\rm B}$, whose sum is equal to the total entropy production rate $\dot{\sigma}=I_{\rm A}+I_{\rm B}$. Suppose that A is fuel, $I_{\rm A}>0$, and B is work extraction, $I_{\rm B}<0$. We call these two currents $I_{\rm A}$ and $I_{\rm B}$ also as the input current and the output current, respectively. We express the fluctuation (the scaled second cumulant) of a current as $\langle \mathit{\Delta} I^2\rangle_{\rm c}=\lim_{\tau\to \infty} \tau \left\langle \(\frac1\tau \int_0^\tau dt I(t)-\langle I\rangle \)^2\right\rangle $. Saryal {\it et al.}~\cite{Sar21} claimed the following two inequalities on the fluctuations of input and output currents. \be{ \item The fluctuation of the output current $I_{\rm B}$ should be smaller than that of the input current $I_{\rm A}$: \eqa{ \langle \mathit{\Delta} I_{\rm B}^2 \rangle_{\rm c} \leq \langle \mathit{\Delta} I_{\rm A}^2 \rangle_{\rm c} . }{conjecture1} \item The relative fluctuation of the output current $I_{\rm B}$ should be larger than that of the input current $I_{\rm A}$: \eqa{ \frac{\langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c}}{I_{\rm A}^2}\leq \frac{\langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c}}{I_{\rm B}^2}. }{conjecture2} } Saryal {\it et al.} proved these inequalities in systems with time-reversal symmetry in the linear response regime. In addition, on the basis of numerical simulations, they strongly suggest the validity of these inequalities in general nonequilibrium stationary systems. Note that their proof in the linear response regime is based on the linear expansion of currents with the Onsager matrix and thus cannot be extended to a nonlinear regime directly. \section{First counterexample: Chemical reactions with Poisson processes} Contrary to the aforementioned expectation, we shall construct concrete counterexamples to these two inequalities beyond the linear response regime. We also show that there exists no upper bound on a current fluctuation as long as we use the average currents and another current fluctuation. \subsection{Setup} We consider a transport system with a single internal state attached to four particle baths; two for particle A and the other two for particle B. Particles are carried by reactions that occur inside the system. The whole system is in an isothermal condition, and reactions are driven by consuming chemical potential. As an example, in reaction 1 three particles A are transported from bath HA to bath LA, and at the same time, four particles B are transported from bath LB to HB (see \fref{schematic}). Remark that this formulation is not restricted to chemical reactions but also general Markov processes with a single internal state. Another example is a multiterminal ballistic transport in the semiclassical regime~\cite{BHS18}. \figin{8.5cm}{schematic}{ (a) An example of a reaction, referred to as reaction 1 in the main text. In this reaction, three particles A flow from particle bath HA to HL, which induces transport of four particles B from LB to HB. (b) A schematic of the key reaction to construct counterexamples. This reaction concerns only one of particles A or B. This reaction rarely occurs, while it transports many particles. }{schematic} Let $a_i$ and $b_i$ be the entropy production associated with particles A and B in the $i$-th reaction, respectively. In our setup, these quantities are given by $a_i=\beta \mathit{\Delta} \mu_{\rm A} n_i^{\rm A}$ and $b_i=\beta \mathit{\Delta} \mu_{\rm B} n_i^{\rm B}$, where $n_i^{\rm A}$ (resp. $n_i^{\rm B}$) is the number of particles A (resp. B) transported from HA (resp. HB) to LA (resp. LB) in the $i$-th reaction, and $\mathit{\Delta} \mu_{\rm A}:=\mu_{\rm HA}-\mu_{\rm LA}$ (resp. $\mathit{\Delta} \mu_{\rm B}:=\mu_{\rm HB}-\mu_{\rm LB}$) is the chemical potential difference between HA and LA (resp. HB and LB). In this reaction system, the combination $(n_i^A , n_i^B)$ is fixed for each reaction $i$. If particles flow from LA to HA (resp. LB to HB) in reaction $i$, we set negative $n_i^{\rm A}$ (resp. $n_i^{\rm B}$). We assume that all reactions follow the Poisson processes. Due to the local detailed-balance condition, the jump rate of the $i$-th forward and backward reactions are written as \balign{ P_i^{\rm F}&=T_i e^{a_i+b_i}, \\ P_i^{\rm B}&=T_i, } with $T_i\geq 0$. Here, the forward and backward reactions accompany the same transition coefficient $T_i$ due to the time-reversal symmetry of our system. The entropy production rate associated with particle A is written as \eq{ I_{\rm A}=\sum_i a_i (P_i^{\rm F}-P_i^{\rm B})=\sum_i T_i a_i(e^{a_i+b_i}-1). } With noting $I_{\rm A}=\beta \Di \mu_{\rm A} J_{\rm A}$, the above expression in the linear response regime $\mathit{\Delta} \mu_{\rm A}, \mathit{\Delta} \mu_{\rm B}\to 0$ suggests \eq{ J_{\rm A}= \sum_i \beta T_i [(n_i^{\rm A})^2\Di \mu_{\rm A}+n_i^{\rm A}n_i^{\rm B}\Di \mu_{\rm B}], } which defines the Onsager matrix. The second cumulants of the $i$-th forward and backward processes are also given by $T_i e^{a_i+b_i}$ and $T_i$, which follows from a basic property of a Poisson process that all the cumulants of a Poisson process are the same. With recalling that the variance of the sum of two independent stochastic variables is equal to the sum of the variances of these two; \eq{ {\rm Var} (X\pm Y)={\rm Var} (X)+{\rm Var} (Y), } the fluctuation of $I_{\rm A}$ and $I_{\rm B}$ (i.e., scaled variance by time $\tau$) is calculated as \balign{ \langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c}&=\sum_i T_i a^2_i(e^{a_i+b_i}+1), \\ \langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c}&=\sum_i T_i b^2_i(e^{a_i+b_i}+1). } Then, the inequalities \eqref{conjecture1} and \eqref{conjecture2} in this reaction system read \balign{ \sum_i T_i b^2_i(e^{a_i+b_i}+1)&\leq \sum_i T_i a^2_i(e^{a_i+b_i}+1), \label{con1} \\ \frac{\sum_i T_i a^2_i(e^{a_i+b_i}+1)}{\( \sum_i T_i a_i(e^{a_i+b_i}-1)\) ^2}&\leq \frac{\sum_i T_i b^2_i(e^{a_i+b_i}+1)}{\( \sum_i T_i b_i(e^{a_i+b_i}-1)\) ^2}, \label{con-2} } under the conditions $\sum_i T_i a_i(e^{a_i+b_i}-1)>0$ and $\sum_i T_i b_i(e^{a_i+b_i}-1)<0$. For the sake of notational simplicity, we introduce the following symbols: \balign{ C_{1,i}^X:=&T_i X_i(e^{a_i+b_i}-1), \\ C_{2,i}^X:=&T_i X^2_i(e^{a_i+b_i}+1), } with $X=a,b$. Then, these inequalities are written in a concise form: \balign{ \sum_i C_{2,i}^b\leq& \sum_i C_{2,i}^a, \label{con1C} \\ \frac{\sum_i C_{2,i}^a}{(\sum_i C_{1,i}^a)^2}\leq& \frac{\sum_i C_{2,i}^b}{(\sum_i C_{1,i}^b)^2} \, , \label{con2C} } under the conditions $ \sum_i C_{1,i}^a >0 $ and $ \sum_i C_{1,i}^b <0$. \subsection{Construction of counterexamples} A crucial observation for the violation of inequalities \eqref{conjecture1} and \eqref{conjecture2} is the following: There exists a reaction concerning only A (i.e., particle B is completely irrelevant) such that $C_{1,i}^a$ vanishes while $C_{2,i}^a$ diverges in some limit (see \fref{schematic}.(b)). Obviously, similar reactions exist for particle B. We set $T_i$ as \eq{ T_i=\frac{k}{(a_i)^{3/2}e^{a_i}} } with a constant $k$, and take $a_i$ sufficiently large. Note that by changing $n_i^{\rm A}$ we can prepare arbitrarily large $a_i$ with keeping other $a_j$'s. Taking the $a_i\to \infty$ limit, we have \balign{ \lim_{a_i\to \infty}C_{1,i}^a&=\lim_{a_i\to \infty}\frac{ k } {\sqrt{a_i}}(1-e^{-a_i})=0, \\ \lim_{a_i\to \infty}C_{2,i}^a&=\lim_{a_i\to \infty} k \sqrt{a_i}(1+e^{-a_i})\to +\infty . } We name this reaction a {\it spike reaction}. A counterexample to \eref{conjecture2} is a reaction system with two reactions: We set reaction 1 as a normal cross-transport reaction satisfying $C_{1,1}^a, C_{1,1}^b, C_{2,1}^a, C_{2,1}^b=O(1)$ with $C_{1,1}^a>0$ and $C_{1,1}^b<0$, and reaction 2 as the spike reaction. By setting $a_i$ sufficiently large, the left-hand side of \eref{con2C} can become arbitrarily large with keeping its right-hand side at $O(1)$, which violates \eref{con2C} (i.e., \eref{conjecture2}). A counterexample to \eref{conjecture1} is a reaction system with two reactions: We again set reaction 1 as a normal cross-transport reaction satisfying $C_{1,1}^a, C_{1,1}^b, C_{2,1}^a, C_{2,1}^b=O(1)$ with $C_{1,1}^a>0$ and $C_{1,1}^b<0$, and reaction 2 as the spike reaction concerning particle B. By setting $b_i$ sufficiently large, positive work can be extracted (i.e., $C_{1,1}^b+C_{1,2}^b<0$) and the left-hand side of \eref{con1C} can become arbitrarily large with keeping its right-hand side at $O(1)$, which violates \eref{con1C} (i.e., \eref{conjecture1}). We verify how large nonequilibrium driving is needed to violate the inequalities. We set $T_1=1$, $a_1=2$, and $b_1=-1$, which are realized with $\beta\Di \mu_{\rm A}=\beta\Di \mu_{\rm B}=1$, $n_1^{\rm A}=2$, and $n_1^{\rm B}=-1$. We first demonstrate the violation of \eref{conjecture2}. We set reaction 2 as the spike reaction concerning particle A with $k=1/2$. Then, \eref{conjecture2} reads \eq{ \frac{4(e+1)+k\sqrt{a}(1+e^{-a})}{\( 2(e-1)+\frac{k}{\sqrt{a}}(1-e^{-a})\) ^2} \leq \frac{e+1}{(e-1)^2}\simeq 1.259. } On the other hand, the left-hand side takes $1.2611\cdots$ with $a=9$ (i.e., $n_2^{\rm A}=9$), which exceeds the right-hand side $1.2593\cdots$. We next demonstrate the violation of \eref{conjecture1}. We set reaction 2 as the spike reaction concerning particle B with $k=4.3$. Then, \eref{conjecture1} reads \eq{ e+1+k\sqrt{b}(1+e^{-b})\leq 4(e+1)\simeq 14.9. } On the other hand, the left-hand side takes $15.10\cdots$ with $b=7$ (i.e., $n_2^{\rm B}=7$), which exceeds the right-hand side $14.87\cdots$, with keeping current B negative: $I_{\rm B}=-(e-1)+\frac{k}{\sqrt{b}}(1-e^{-b})=-0.0945\cdots$. \bigskip We shall clarify the physical picture of the spike reaction, which plays a crucial role in the counterexamples. The spike reaction is a kind of leakage which occurs very rarely but accompanies extremely large entropy production once it happens. The balance between these two (small probability and large entropy production) provides negligible average and diverging fluctuation. Here, if we consider thermoelectric transport instead of cross-transport of two particle currents, the spike reaction is interpreted as a rare stochastic path with a large amount of heat transport. We remark that our construction requires finite $\Di \mu_{\rm A}$ (or $\Di \mu_{\rm B}$) and large $n_i^{\rm A}$ (or $n_i^{\rm B}$), and thus this counterexample works only beyond the linear response regime. The existence of such a leakage reaction suggests that we cannot expect modified versions of inequalities such as $\langle \mathit{\Delta} I_{\rm A}\rangle_{\rm c} \geq \eta \langle \mathit{\Delta} I_{\rm B}\rangle_{\rm c}$ and $\langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c}/I_{\rm B}^2\geq \eta\cdot{\langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c}}/{I_{\rm A}^2}$ with the efficiency $\eta:=-I_{\rm B}/I_{\rm A}$. More generally, we claim that there is no upper bound of $\langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c}$ and $\langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c}$ in the following form: \balign{ \langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c} &\leq f(I_{\rm A}, I_{\rm B}, \langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c}), \\ \langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c} &\leq g(I_{\rm A}, I_{\rm B}, \langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c}), } where $f$ and $g$ are functions with no singular points. This theorem is readily proven in the following manner: By employing the spike reaction, we have a diverging $\langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c}$ (resp. $\langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c}$) with keeping $I_{\rm A}$, $I_{\rm B}$, and $\langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c}$ (resp. $\langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c}$) at $O(1)$, which clearly violates these inequalities. \section{Second example: Overdamped thermoelectric transport} Although we have constructed explicit counterexamples to Eqs.~\eqref{conjecture1} and \eqref{conjecture2}, one may still feel that the violation of Eqs.~\eqref{conjecture1} and \eqref{conjecture2} is very rare phenomena. To examine how frequently or how rarely these inequalities are violated, we consider a simple thermoelectric device introduced in Ref.~\cite{Rutten07}, which can be described as an overdamped probabilistic process. This device transports electrons between two leads through a two-level quantum dot. We assume that there is always at most one electron in the quantum dot due to the repulsion between electrons. Consequently, the quantum dot can take three possible states: it is either empty (state $0$) or contain one electron in energy level $E_1$ (state $1$) or $E_2~(>E_1)$ (state $2$). Each energy level $E_i$ is connected to lead $i$ with chemical potential $\mu_i~(\mu_2>\mu_1)$ and temperature $T_c$. The transition rates describing the electron exchange between the leads and the quantum dot are given by \begin{align} w_{i0} &= \gamma_if(x_i), \\ w_{0i} &= \gamma_i[1 - f(x_i)], \end{align} where $\gamma_i>0$ denotes the coupling strength to lead $i$, $f(x)=1/(1+e^x)$ is the Fermi distribution, and we defined $x_i:=(E_i-\mu_i)/T_c$. The electron transitions between state $1$ and state $2$ are mediated by two heat baths; a cold bath at temperature $T_c$ and a hot bath at temperature $T_h~(>T_c)$. These transition rates are given by \begin{align} w_{12}&=w_{12}^c+w_{12}^h,\\ w_{21}&=w_{21}^c+w_{21}^h, \end{align} where we set $w_{21}^a=\gamma_an(x_a)$, $w_{12}^a=\gamma_a[n(x_a)+1]$ with $n(x):=1/(e^x-1)$ as the Bose-Einstein distribution. We here defined $x_a:=(E_2-E_1)/T_a$ for $a\in\{c,h\}$ and $\gamma_c$ and $\gamma_h$ as the coupling strength to the heat baths. Notice that the symbols $c$ and $h$ correspond to the cold and hot heat baths. Operationally, this device can work as a heat engine that converts part of the heat absorbed from the hot heat bath into work in the form of the transport of electrons from lower to higher chemical potentials. Let $\ket{p_t}=[p_0(t),p_1(t),p_2(t)]^\top$ be the probability distribution of the quantum dot at time $t$, then its time evolution can be described by the master equation \begin{equation} \ket{\dot p_t}=\mathsf{W}\ket{p_t}, \end{equation} where $\mathsf{W}=[w_{ij}]\in\mathbb{R}^{3\times 3}$ satisfies the normalization condition, $\sum_iw_{ij}=0$. Hereinafter, we exclusively focus on the steady-state dynamics of the system. The steady-state distribution $\ket{p^{\rm ss}}$ is unique and can be obtained by solving equation $\mathsf{W}\ket{p^{\rm ss}}=0$. \figin{8.5cm}{FluctuationRatio}{ (a) A schematic of the thermoelectric device. Two leads supply electrons to a two-level system. The transitions between these two levels are driven by two heat baths with different temperatures. (b) Numerical results of random sampling. A single dot depicts a point $(\eta,r)$ for each parameter, and the dashed line depicts the upper bound of $r$ according to Eq.~\eqref{conjecture2}. The parameter ranges are $\beta_h\in[0.1,0.5]$, $\beta_c\in[5,10]$, $\gamma_i,\gamma_a\in[1,10]$, $\mu_1\in[0.1,0.3]$ and $\mu_2\in[0.5,0.7]$. Here, $\beta_h$ and $\beta_c$ are inverse temperatures of $T_h$ and $T_c$, respectively. (c) Numerical results as changing $\gamma_c$. Plotted are ratio $r$ (solid line) and efficiency $\eta$ (dash-dotted line). The other parameters are fixed as $\beta_h=0.1$, $\beta_c=10$, $\gamma_1=\gamma_2=\gamma_h=10$, $\mu_1=0.1$ and $\mu_2=0.5$. }{thermoelectric} To examine Eq.~\eqref{conjecture2}, we consider the input and output currents as follows: \begin{align} J_{\rm A}&=(E_2-E_1)( w_{21}^hp_1^{\rm ss} - w_{12}^hp_2^{\rm ss} ),\\ J_{\rm B}&=w_{10}p_0^{\rm ss} - w_{01}p_1^{\rm ss}. \end{align} Specifically, $J_{\rm A}$ is the heat flux from the hot heat bath to the system and $J_{\rm B}$ is the electron flux from lead $1$ to lead $2$. The total entropy production rate reads \cite{Rutten07} \begin{equation} \dot\sigma=J_{\rm A} d_{\rm A}+J_{\rm B} d_{\rm B}=I_{\rm A} + I_{\rm B}, \end{equation} where $d_{\rm A}=1/T_c-1/T_h$ and $d_{\rm B}=(\mu_1-\mu_2)/T_c$ are the thermodynamic forces conjugated to $J_{\rm A}$ and $J_{\rm B}$, respectively. As long as the device works as a heat engine, we always have $I_{\rm A}>0$ and $I_{\rm B}<0$. The finite-time fluctuations of $I_{\rm A}$ and $I_{\rm B}$ can be calculated by means of full counting statistics. Introducing the counting fields $\chi_{\rm A}$ and $\chi_{\rm B}$, the characteristic function is written as \begin{equation} \calZ(\chi_{\rm A},\chi_{\rm B})=\bra{1}e^{\mathsf{W}(\chi_{\rm A},\chi_{\rm B})\tau}\ket{p^{\rm ss}}, \end{equation} where $\bra{1}:=[1,1,1]$ is the all-one vector and the modified rate matrix is given by \begin{equation} \mathsf{W}(\chi_{\rm A},\chi_{\rm B})=\begin{bmatrix} w_{00} & w_{01}e^{-\chi_{\rm B}} & w_{02}\\ w_{10}e^{\chi_{\rm B}} & w_{11} & w_{12}^c+w_{12}^he^{-\chi_{\rm A}}\\ w_{20} & w_{21}^c+w_{21}^he^{\chi_{\rm A}} & w_{22} \end{bmatrix}. \end{equation} Using the characteristic function $\calZ(\chi_{\rm A},\chi_{\rm B})$, the fluctuations of the input and output currents can thus be calculated using $\calZ(\chi_{\rm A},\chi_{\rm B})$ as follows: \begin{align} \langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c} &=(d_{\rm A}\Delta E)^2\left.{\frac{\partial^2}{\partial\chi_{\rm A}^2}\lim_{\tau\to\infty}\frac{1}{\tau}\ln\calZ(\chi_{\rm A},0)}\right|_{\chi_{\rm A}=0},\label{eq:fluctuation.A}\\ \langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c} &=(d_{\rm B})^2\left.{\frac{\partial^2}{\partial\chi_{\rm B}^2}\lim_{\tau\to\infty}\frac{1}{\tau}\ln\calZ(0,\chi_{\rm B})}\right|_{\chi_{\rm B}=0},\label{eq:fluctuation.B} \end{align} where $\Delta E=E_2-E_1$. These quantities can be easily evaluated using the dominant eigenvalue of $\mathsf{W}(\chi_{\rm A},\chi_{\rm B})$ with the largest real part. Now we shall numerically test Eq.~\eqref{conjecture2} with changing parameters. First, we randomly sample the temperatures $T_c$ and $T_h$, coupling strengths $\gamma_i$ and $\gamma_a$, chemical potentials $\mu_i$ ($i=1,2$ and $a\in\{c,h\}$), while the energy levels $E_i$ are fixed as $E_1=0$ and $E_2=1$. For each parameter setting, the fluctuations of the input and output currents in Eqs.~\eqref{eq:fluctuation.A} and \eqref{eq:fluctuation.B} are calculated using numerical differentiation at $\epsilon=10^{-4}$. Note that we exclude all parameter samples where the device does not function as a heat engine. Specifically, only parameters that result in $I_{\rm A}>0$ and $I_{\rm B}<0$ are retained. In Fig.~\ref{f:thermoelectric}(b), we plot all selected points $(\eta,r)$ in a two-dimensional plane, where $\eta$ is the efficiency of the device and $r$ is the ratio defined as \begin{equation} r=\frac{\langle \mathit{\Delta} I_{\rm A}^2\rangle_{\rm c}}{I_{\rm A}^2}\left(\frac{\langle \mathit{\Delta} I_{\rm B}^2\rangle_{\rm c}}{I_{\rm B}^2}\right)^{-1}, \end{equation} which should be smaller than or equal to $1$, according to Eq.~\eqref{conjecture2}. As can be seen, there are many points above the line $r=1$, which implies that Eq.~\eqref{conjecture2} is violated. Next, in order to make clear when Eq.~\eqref{conjecture2} is violated, we fix all parameters except for $\gamma_c$, which is varied from $10^{-2}$ to $10^{2}$. In this far-from-equilibrium regime, we confirm that the device always works as a heat engine. We calculate $r$ and $\eta$ as functions of $\gamma_c$, which is plotted in Fig.~\ref{f:thermoelectric}(c). It can be verified that Eq.~\eqref{conjecture2} does not hold (i.e., $r>1$) for $\gamma_c\in(0.1,4)$. In this parameter range, the efficiency $\eta$ of the device is about $0.19$, which is not so inefficient. This implies that Eq.~\eqref{conjecture2} can be easily violated in a wide range where the device can be operated as a useful heat engine. \section{Conclusion} We have shown that two inequalities \eqref{conjecture1} and \eqref{conjecture2} are violated in general nonequilibrium conditions by explicitly constructing counterexamples to these inequalities. The crucial element of our counterexample is the spike reaction, which has arbitrarily small current and arbitrarily large current fluctuation. Our counterexamples not only refute these conjectures but also deny the existence of upper bounds on current fluctuation in a certain form. Our result suggests that one possible direction to obtain upper bounds on current fluctuation is to take higher-order cumulants of currents. Utilization of higher-order cumulants in stochastic thermodynamics has recently been attempted in the context of thermodynamic uncertainty relations~\cite{DS20, Kam21} and reaction networks~\cite{BS15b}. With the help of these results, we may reach useful upper bounds of current, which is left as a future problem. \bigskip \para{Acknowledgement} NS is supported by JSPS KAKENHI Grants-in-Aid for Early-Career Scientists Grant Number JP19K14615. KS is supported by Grants-in-Aid for Scientific Research Grant Number JP19H05603 and JP19H05791.
09c99ec44b0d6d1657b3ec15627b28b68459a337
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} In strong-field ionization of atomic and molecular targets by intense laser pulses, the time-dependent Schr{\"o}dinger equation (TDSE) is often used within the single-active-electron (SAE) approximation to describe the ionization process. In this approach, the SAE orbital is propagated in the combined potential of the atom or molecule and the external field. SAE potentials have been successfully applied for some atoms~\cite{TongJPB05,PhysRevLett.81.1207} and molecules~\cite{PhysRevA.81.033416,PhysRevA.81.063406,doi:10.1080/00268970701871007,PhysRevLett.104.223001}. While the performance of the SAE approximation is generally accepted, some cases where account of multielectron effects are needed have been discussed in the literature including, for example, the CO~\cite{PhysRevA.96.053421,PhysRevA.101.013433} and OCS~\cite{PhysRevA.102.063111} molecules. For these molecules, the calculated ionization yields and their orientation dependence are affected by multielectron polarization (MEP) or some artifacts of solving the TDSE within the SAE approximation such as the shifting of population from the highest occupied molecular orbital (HOMO) to lower-lying orbitals of the potential. The latter observation was recently illustrated for CO in Ref.~\cite{PhysRevA.101.013433}: the dipole matrix elements which couple the HOMO to lower-lying orbitals are strongly dependent on molecular orientation, and the total ionization yields (TIYs) calculated at different orientation angles were strongly affected by such dipole transitions and the associated artificial shifting of population. As a consequence, for CO, solving the TDSE within the SAE approximation without accounting for MEP predicts the wrong orientation dependence of TIYs~\cite{PhysRevA.101.013433}: the TDSE results predict a maximum TIY at orientation angle $\beta=180^\circ$, that is, when the maximum of the electric field points from the O-end to the C-end, which is contrary to experimental observations~\cite{PhysRevLett.108.183001}. The performance of the TDSE method for CO was significantly improved upon inclusion of MEP~\cite{PhysRevA.101.013433}. Indeed, by extending the TDSE method with a MEP treatment following the approach of Refs.~\cite{PhysRevA.95.023407,0953-4075-51-10-105601}, the inclusion of MEP within the SAE model results in negligible dipole coupling of the HOMO to lower-lying orbitals and the predicted angular distribution of TIYs is in good agreement with experimental~\cite{PhysRevLett.108.183001} and theoretical data~\cite{PhysRevLett.111.163001,PhysRevA.95.023407}. In this connection, we also note that inclusion of MEP recently led to improved agrement between theory and experiment for odd-even high harmonic generation in CO \cite{PhysRevA.105.023106}. In the case of CO, the long-range correction term of the induced dipole potential was not needed to produce the correct trend in TIYs for the CO molecule. It is sufficient to simply turn-off the laser-interaction within a certain molecular cut-off radius, $r_c$. The effective turning-off of the molecule-laser interaction for $r< r_c$ is a consequence of the polarization of the remaining electrons. The electric field associated with this polarization counteracts the applied external field and leads to a cancellation of the interaction. In this sense the cancellation is a result of the rearrangement of the remaining electrons until they feel no effective field, i.e., a rearrangement that leads to a field inside $r_c$ that has a direction opposite to the applied field, but with the same magnitude. We will come back to this effect and the value of $r_c$ below. For OCS, experimental measurements of TIYs and their orientation dependence have attracted much attention in recent literature~\cite{PhysRevA.89.013405,PhysRevA.98.043425,HansenJPhysB2011,Yu_2017,Johansen_2016} due to discrepancies between experimental observations and theoretical predictions. In Ref.~\cite{HansenJPhysB2011}, the experiments were conducted using linearly polarized laser pulses with 30-fs duration at an 800-nm wavelength and intensities of 1.5$\times10^{14}$~W/cm$^2$ and 1.8$\times10^{14}$~W/cm$^2$. At these conditions, the TIY was measured as a function of the orientation angle, and a minimum TIY was obtained at laser polarization parallel to the molecular axis ($\beta=0^\circ$), whereas the maximum TIY was obtained at laser polarization perpendicular to the molecular axis ($\beta=90^\circ$). The orientation dependence of the TIYs presents a challenge to ionization models. For the OCS molecule, the molecular Ammosov-Delone-Krainov model~\cite{PhysRevA.66.033402} and the strong-field approximation (SFA)~\cite{sfa1,sfa2,sfa3} predict the angular dependence of TIYs to follow the orbital structure. In these models, the maximum TIY is predicted at $\beta$ close to 35$^\circ$. Also the Stark-corrected molecular tunneling theory~\cite{PhysRevA.82.053404,Holmegaard2010} and the weak-field asymptotic theory of tunneling, which includes dipole effects~\cite{PhysRevA.84.053423,PhysRevA.87.013406}, did not reproduce the experimental results for the OCS molecule~\cite{PhysRevA.83.023405}. In Ref.~\cite{PhysRevA.102.063111}, we presented theoretical calculations of orientation-dependent TIYs from the HOMO of OCS in a strong linearly polarized laser field by solving the TDSE within the SAE approximation and including MEP effects. The MEP term was represented by an induced dipole term which contains the polarizability of the OCS$^+$ cation parallel to the laser polarization. After adequately accounting for the laser-induced dipole potential associated with the MEP term, the calculated TIYs and their orientation dependence are in good agreement with the experimental measurements reported in Ref.~\cite{HansenJPhysB2011}. The results indicated that the polarizability anisotropy of OCS$^+$ was primarily responsible for the orientation dependence of TIYs from the HOMO of OCS. \begin{figure} \includegraphics[width=0.5\textwidth]{fig1.png} \caption{\label{co2_homo} Illustration of the degenerate HOMOs of $\pi$ symmetry in CO$_2$ in the molecular fixed (superscript M) (a) $(xz)^M$ and (b) $(yz)^M$ planes. In (a), the laboratory-frame $z^L$-axis and orientation angle ($\beta$) are illustrated.} \end{figure} \begin{table}\caption{\label{molparam} HOMO energies ($E_\text{HOMO}$) and molecular-fixed frame polarizability components ($\alpha_{xx}$, $\alpha_{zz}$) of the O$_2^+$, CO$_2^+$, and CS$_2^+$ cations as obtained from quantum chemistry calculations at the B3LYP level of theory (MP2 for CO$_2^+$ polarizability) and with an aug-cc-pVTZ basis set. All quantities are in atomic units.} \begin{ruledtabular} \begin{tabular}{lccc} &$E_\text{HOMO}$ & $\alpha_{xx}$ & $\alpha_{zz}$ \\ \hline O$_2^+$ & -0.3199 & 5.08 & 9.41 \\ CO$_2^+$ & -0.3845 & 7.29 & 30.42 \\ CS$_2^+$ & -0.2805 & 28.32 & 76.77 \\ \end{tabular} \end{ruledtabular} \end{table} In this paper, we study strong-field ionization of aligned nonpolar molecular targets: O$_2$, CO$_2$, and CS$_2$. The HOMOs of these molecules have $\pi_g$ symmetry, see the degenerate HOMOs of CO$_2$ in Fig.~\ref{co2_homo}, and the ionization potentials are comparable; for the ionization potentials we use the negative of the HOMO energies listed in Table~\ref{molparam}. The HOMO($yz$) in Fig.~1(b) has a node in the polarization direction, its contribution to ionization is therefore negligible compared to that of the HOMO($xz$) in Fig.~1(a). Hence only the HOMO($xz$) will be considered in the following. For CO$_2$, experimental measurements~\cite{PhysRevLett.98.243001} revealed a narrow angular distribution of TIYs with a maximum TIY at alignment angle $\beta=45^\circ$. For CS$_2$, experimental data~\cite{PhysRevLett.100.093006} are consistent with those for CO$_2$ in that an alignment angle of $\beta=45^\circ$ provides the largest ionization yield. Moreover, the CS$_2$ measurements revealed sharp radial structures in the photoelectron momentum distributions (PMDs) of aligned CS$_2$, an effect that was attributed to Rydberg states brought into resonance by the ac Stark shift~\cite{PhysRevLett.100.093006}. In our earlier work on CO$_2$~\cite{PhysRevA.80.023401}, strong-field ionization from the HOMO of CO$_2$ was modeled by SAE-TDSE calculations without accounting for MEP, and the theoretical calculations overestimated the yield at alignment angle $\beta=0^\circ$. Moreover, the TDSE calculations suffered from shifting of population into lower-lying orbitals. Here, we revisit strong-field ionization of CO$_2$ in light of the recent advances in the treatment of MEP within the SAE approximation. The questions we address here are whether the TDSE results for O$_2$, CO$_2$, and CS$_2$ can be improved simply by turning off the external field within $r_c$, thereby minimizing the shifting of population to lower-bound states, or whether the long-range part of the MEP term, represented by a field-induced dipole term, which depends on the polarizability of the cations, see Table~\ref{molparam} and discussion below, has an effect on the angular distributions of TIYs and PMDs. To address these questions, TDSE calculations were conducted using linearly-polarized laser pulses with different laser peak intensities and pulse durations. First, we show how the SAE-TDSE performance is improved once the external field is turned off within $r_c$, we use the CO$_2$ as a proof-of-principle case. Then, we discuss the effects of long-range MEP on alignment dependence of TIYs and PMDs for O$_2$, CO$_2$ and CS$_2$. The theoretical and computational models are presented in Sec.~\ref{compdet}, followed by results and discussion in Sec.~\ref{res} and conclusions in Sec.~\ref{conc}. Atomic units are used throughout unless otherwise stated. \section{Theoretical Models} \label{compdet} The SAE potentials describing O$_2$, CO$_2$, and CS$_2$ were determined from quantum chemistry calculations~\cite{gamess}, following the procedure detailed in Ref.~\cite{PhysRevA.81.033416}. For O$_2$ and CO$_2$, the HOMO was obtained in TDSE calculations by propagation in imaginary time. For CS$_2$, the HOMO was obtained following the procedure laid out in Ref.~\cite{PhysRevA.101.013433}. In our TDSE method, the time-dependent wavefunction $\psi(\vec{r},t)$ of the active orbital is represented by a partial wave expansion in which the spherical harmonics $Y_{lm}(\Omega)$ are used to describe the angular degrees of freedom and a radial grid is used for the time-dependent reduced radial waves, $f_{lm}(r,t)$, i.e., \begin{equation} \label{Eq1} \psi(\vec{r},t)=\sum_{lm} \frac{f_{lm}(r,t)}{r} Y_{lm}(\Omega). \end{equation} The TDSE is solved for an effective one-electron potential describing the interaction with the nucleus, the remaining electrons, and the external field. The TDSE is propagated in the length gauge (LG)~\cite{Kjeldsen2007a} with a combined split-operator~\cite{PhysRevA.38.6000} Crank-Nicolson method. The electric field, $E(t)$, linearly-polarized along the laboratory-frame $z$-axis (from now on the superscript 'L' denoting the laboratory-fixed frame is skipped for brevity), is defined in terms of the vector potential $A(t)$ by \begin{equation} \vec{E}(t) = -\partial_t \vec{A}(t) = -\partial_t \left(\frac{E_0}{\omega}\sin^2(\pi t/\tau)\cos(\omega t+\phi) \right)\hat{z}, \label{E_field} \end{equation} where $E_0$ is the field amplitude, $\omega$ the angular frequency, and $\phi$ the carrier-envelope phase (CEP) for a laser pulse with duration $\tau$. We use a frequency of $\omega=0.057$~a.u. corresponding to a wavelength of 800~nm. The CEP is kept fixed ($\phi=-\pi/2$). The radial grid contains up to 4096 points and extends to 320 a.u. For the listed molecules, the size of the angular basis set is limited by setting $l_{max}=30$ ($l_{max}=40$ for convergence tests) in Eq.~(\ref{Eq1}). The ATI spectra were produced by projecting $\psi(\vec{r},t=\tau)$ at the end of the laser pulse on scattering states of the Coulomb potential in the asymptotic region, and the TIYs were obtained by integrating the above threshold ionization spectra. This approach was recently implemented successfully to obtain TIYs from oriented CO~\cite{PhysRevA.101.013433} and OCS~\cite{PhysRevA.102.063111}. \subsection{Extending TDSE methodology with multielectron polarization} \label{sec:mep} The theory for the effect of MEP on strong-field ionization was developed in Refs.~\cite{PhysRevLett.95.073001,doi:10.1080/09500340601043413,PhysRevA.82.053404,Holmegaard2010}. For the nonpolar molecules addressed here, in the case when MEP is taken into consideration, the effective potential describing the interaction of the active electron with the core and the time-dependent external field is given asymptotically at large distances as \begin{equation} \label{saepot2} V_{eff}(\vec{r},t) = \vec{r}\cdot\vec{E}(t) -\frac{Z}{r} - \frac{ \vec{\mu}_{ind}\cdot \vec{r} }{r^3} \cdots, \end{equation} where $\vec{\mu}_{ind}$ is the induced dipole of the cation. Notice that the SAE potential used in most TDSE calculations is missing the induced dipole potential $- \vec{\mu}_{ind}\cdot \vec{r} /r^3$. The MEP term is expressed as $- \vec{\mu}_{ind}\cdot \vec{r} /r^3 = -(\bm{\alpha}\cdot \vec{E}(t) )\cdot\vec{r}/r^3$, where $\bm{\alpha}$ denotes the polarizability tensor. For the linear molecules considered here, and a linearly polarized field with polarization along the $z$ direction, the product $\bm{\alpha}\cdot\vec{E}(t)$ simplifies to $\left(\alpha_{\perp}E_z,0, \alpha_{||}E_z \right)$. In the laboratory frame, the components perpendicular ($\alpha_{\perp}$) and parallel ($\alpha_{||}$) to the laser polarization can be obtained from the molecular-fixed frame components, $\alpha_{xx}$ and $\alpha_{zz}$ in Table~\ref{molparam} by a simple rotation: \begin{eqnarray} \alpha_{\perp} = (\alpha_{zz}-\alpha_{xx})\sin(\beta)\cos(\beta), \\ \alpha_{||}=\alpha_{xx}\sin^2(\beta) +\alpha_{zz}\cos^2(\beta). \end{eqnarray} At orientation angles $\beta=0^\circ$ or 90$^\circ$, $\alpha_{\perp}$ and the corresponding induced dipole component vanishes. At other orientation angles, however, there is a non-vanishing contribution to the induced dipole from $\alpha_{\perp}$. We have checked for the molecules considered here that the induced dipole component from $\alpha_{\perp}$ can be omitted: For CO$_2$ (CS$_2$) at $\beta=45^\circ$ within a static external field $E_z=-0.035$~a.u., the laboratory-fixed frame induced dipole components are $\mu_{ind,x}$=0.59 (2.60) and $\mu_{ind,z}=-1.71$ (-6.15)~Debye, as obtained from quantum chemistry calculations in Gaussian~\cite{g16}. For the O$_2$ molecule, the contribution to the induced dipole from $\alpha_{\perp}$ is negligible because its polarizability components and the polarizability anisotropy $(\alpha_{zz}-\alpha_{xx})$ are very small, see Table~\ref{molparam}. Based on the preceding discussion, the MEP term is approximated as $- \vec{\mu}_{ind}\cdot \vec{r} /r^3 \approx -\alpha_{||} \vec{E}(t)\cdot\vec{r}/r^3$, where $\alpha_{||}$ is the static polarizability of the cation parallel to the laser polarization axis. A cutoff radius is chosen close to the core at a radial distance \begin{equation} r_{c}=\alpha_{||}^{1/3}, \label{r_c} \end{equation} such that the MEP cancels the external field at $r\le r_c$~\cite{0953-4075-51-10-105601,PhysRevLett.95.073001,doi:10.1080/09500340601043413}. The interaction term including MEP correction is expressed in the LG at each radial grid point $r_i$ as \begin{equation} \label{Eq2} V_{LG}^{Ext}(r_i,t)= \begin{cases} \left(1-\frac{\alpha_{||}}{r_i^3}\right)E(t)\sqrt{\frac{2}{3}}r_i \bar{P}_{1}(\zeta), \, \, r > r_c \\ 0, ~r\le r_c \\ \end{cases} \end{equation} where $E(t)$ is the electric field at time $t$, $\bar{P}_1$ is a normalized Legendre function, and $\zeta=\cos(\theta)$ where $\theta$ is the polar angle of the electron coordinate $\vec{r}$. Based on the above equation, one can see that MEP results in two related effects: the electrons in the cation polarize and set up a field that counteracts the externally applied field at short distances. Hence, the interaction between the single active electron and the laser field is effectively turned-off at $r \le r_c$~\cite{PhysRevLett.95.073001,doi:10.1080/09500340601043413}. At long range, that is at $r > r_c$ , the MEP is represented by an induced dipole potential with a magnitude that depends on the external field strength and the polarizability of the cation. The polarizability components for the O$_2^+$, CO$_2^+$, and CS$_2^+$ cations were obtained from the NIST computational chemistry database (CCCBDB)~\cite{cccbdb}, see Table~\ref{molparam}. The quantum chemistry calculations of molecular polarizability were conducted at the B3LYP (MP2 for CO$_2^+$) level of theory. \section{Results and Discussion} \label{res} \subsection{Improving the single-active-electron approximation for CO$_2$ } \begin{figure} \includegraphics[width=0.5\textwidth]{fig2.png \caption{\label{co2_ati} (Scale is logarithmic on the vertical axis) Bound state spectrum of CO$_2$ after the end of an 800-nm laser pulse containing 5 optical cycles with peak intensity of 5.6$\times$10$^{13}$~W/cm$^2$. The solid (dotted) line denotes TDSE calculations without (with) MEP correction. } \end{figure} Our earlier TDSE calculations for CO~\cite{PhysRevA.82.043413} and CO$_2$~\cite{PhysRevA.80.023401} within the SAE approximation suffered from shifting of population to lower-lying orbitals of the potential as was recently discussed for CO in Ref.~\cite{PhysRevA.101.013433}. The problem is illustrated for CO$_2$ in Fig.~\ref{co2_ati} (solid line). In this figure, the bound state spectrum is produced for CO$_2$ after probing the molecule by a 5-cycle laser pulse with an intensity of 5.6$\times$10$^{13}$~W/cm$^2$ and $\omega=0.057$~a.u. In Fig.~\ref{co2_ati}, the peaks at $\sim -0.4$~a.u. and $-0.55$~a.u. correspond to the ($\Pi_g$) HOMO, see Fig.~\ref{co2_homo}, and HOMO-1 of CO$_2$. In the present approach, we consider only the HOMO as being active and it should not populate the HOMO-1, since that latter orbital is already occupied. Here, we consider an improved theory for calculating the TIYs from aligned CO$_2$ which takes into account MEP effect and, thereby, resulting in minimized shifting of population from the HOMO to the lower-lying occupied orbitals of the potential. This is accomplished by turning off the external field within $r_c$ of Eq.~(\ref{r_c}), such that the MEP cancels the external field at $r\le r_c$~\cite{0953-4075-51-10-105601,PhysRevLett.95.073001,doi:10.1080/09500340601043413}. The improvement of the SAE approximation following the implementation of this effect is illustrated in Fig.~\ref{co2_ati} (dotted line). Here it can be seen that the population in the HOMO-1 (at energy -0.55~a.u.) is reduced by 3-4 orders of magnitude. Meanwhile, the population in the excited states is less sensitive to turning the external field off within the cutoff radius $r_c$. This is promising in particular for cases where strong-field ionization is affected by the excited state manifold. The preceding results and discussion show that it is necessary to turn off the external field within $r_c$ in all TDSE calculations within the SAE approximation. \subsection{Effect of long-range multielectron polarization on alignment-dependent total ionization yields and photoelectron momentum distributions of CO$_2$ } \begin{figure*} \includegraphics[width=1.0\textwidth]{fig3.png \caption{\label{co2_tiy} Effect of MEP on alignment dependence of TIYs from the HOMO($xz$) orbital of the CO$_2$ molecule at peak intensities of (a) 1.4$\times$10$^{13}$ (b) 3.2$\times$10$^{13}$ (c) 5.6$\times$10$^{13}$ and (d) 8.8$\times$10$^{13}$~W/cm$^2$. The dashed lines denote no field within $r_{c}$ while solid lines denote full MEP including the long-range laser-induced dipole potential.} \end{figure*} Now we discuss, in addition to turning-off the time-dependent interaction below $r_c$, the effect of accounting for the long-range MEP correction in TDSE calculations on the calculated TIYs from the HOMO $xz$ orbital of aligned CO$_2$ (shown in Fig.~\ref{co2_homo} (a)). The probe laser pulses contain five optical cycles, a wavelength of 800~nm, and peak laser intensities of 1.4$\times$10$^{13}$, 3.2$\times$10$^{13}$, 5.6$\times$10$^{13}$, and 8.8$\times$10$^{13}$~W/cm$^2$. The effect of the long-range MEP correction on angular distributions of TIYs is shown in Fig.~\ref{co2_tiy}. The TIYs were calculated by integrating the photoelectron spectra produced by projecting the wave packet at the end of the laser pulse on Coulomb scattering states in the asymptotic region, see Sec.~\ref{compdet} and Refs.~\cite{PhysRevA.94.023414,PhysRevA.102.063111,PhysRevA.101.013433}. \begin{figure*} \includegraphics[width=0.75\textwidth]{fig4.png \caption{\label{co2_tiy_ncyc} Effect of MEP on alignment dependence of TIYs from the HOMO($xz$) orbital of the CO$_2$ molecule at peak intensity of 8.8$\times$10$^{13}$W/cm$^2$ for pulses containing (a) 2, (b) 5, and (c) 8 optical cycles. The dotted lines denote no field within $r_{c}$ while solid lines denote full MEP including the long-range laser-induced dipole potential.} \end{figure*} We judge the quality of the theoretical TIYs for aligned CO$_2$ based on the following two criteria: the alignment angle of maximum TIY, and the ratio of TIYs at alignment angles $\beta=45^\circ$ and $0^\circ$. Based on early experimental measurements on CO$_2$~\cite{PhysRevLett.98.243001}, the alignment angle of maximum TIY should be $\beta=45^\circ$ and the ratio TIY($\beta=0^\circ$)/TIY($\beta=45^\circ$) is approaching zero. In Fig.~\ref{co2_tiy}, we compare the angular distributions of TIYs for CO$_2$ obtained from TDSE calculations with and without accounting for long-range MEP correction, implemented in Eq.~(\ref{Eq2}). Notice that in both cases, the field is turned off within $r_c$, as we have established based on the results of Sec.~III.A. From the TDSE calculations for CO$_2$ at the relatively lower intensities of 1.4$\times$10$^{13}$ and 3.2$\times$10$^{13}$~W/cm$^2$, see Fig.~\ref{co2_tiy}~(a) and (b), it is evident that although the maximum ionization yield is predicted correctly simply by turning off the external field within $r_{c}$, the alignment dependence of the TIY seems to be correctly described only when the full MEP term, including the long-range induced dipole potential, is accounted for. The effect of including long-range MEP seems to decrease the relative ionization probability at $\beta=30^\circ$. For CO$_2$ at the higher intensities of 5.6$\times$10$^{13}$ and 8.8$\times$10$^{13}$~W/cm$^2$, see Fig.~\ref{co2_tiy}~(c) and (d), the full MEP term, including the long-range induced dipole potential, should be accounted for in order to predict correctly the alignment angle of maximum TIY. Regarding the ratio of TIYs, i.e. TIY($\beta=0^\circ$)/TIY($\beta=45^\circ$), the TDSE model without full MEP treatment (without long-range induced dipole potential ) overestimate the ratio at the higher intensities. Next, we discuss the connection between the MEP effect and pulse length, for TDSE calculations at a laser intensity of 8.8$\times$10$^{13}$W/cm$^2$. Alignment-dependent TIYs were calculated for CO$_2$ probed by laser pulses containing 2, 5, and 8 optical cycles, and the results are shown in Fig.~\ref{co2_tiy_ncyc}. For all considered pulse lengths, the orientation angle of maximum TIY shifts from $30^\circ$ (when the long-range MEP term is omitted) to $45^\circ$ (when full MEP is accounted for), indicating that this characteristic of the results is insensitive to pulse length. In short, taking MEP into account improves the prediction of orientation angle ($\beta$) of maximum TIY, in comparison with the experimental measurements, in particular at high laser intensities. \begin{figure*} \includegraphics[width=0.7\textwidth]{fig5.png} \caption{\label{co2_pmds} Effect of MEP on laboratory-frame PMDs from the HOMO($xz$) orbital of the CO$_2$ molecule at a peak intensity of 8.8$\times$10$^{13}$W/cm$^2$ and alignment angle $\beta=45^\circ$ for 800 nm pulses containing (a,b) 2 and (c,d) 8 cycles. In (a,c), the external field is turned off within $r_c$ while in (b,d) the full MEP term is considered.} \end{figure*} Finally, we consider the effect of MEP on PMDs for CO$_2$, probed by 800 nm laser pulses containing 2 and 8 optical cycles at a laser intensity of 8.8$\times$10$^{13}$W/cm$^2$. The PMDs were produced by projecting the wave packet on Coulomb scattering states in the asymptotic region, see Sec.~\ref{compdet}. In Fig.~\ref{co2_pmds}, we show PMDs for aligned CO$_2$ at alignment angle of maximum TIY, $\beta=45^\circ$, obtained with and without long-range MEP correction. From the figure for both 2- and 8-cycle pulses, apart from reduction in overall ionized yield, we do not find characteristic imprints of long-range MEP in the PMDs of CO$_2$. When we compare the 2- and 8-cycle results, we notice the emergence of multiple substructures in the 8-cycle case, which are associated with above-threshold ionization rings, that can be resolved for the longer pulse. We have produced PMDs for CO$_2$ at other alignment angles and reached the same conclusion in those cases regarding the effect of the long-range part of the MEP term. In particular we did not find any significant effect in the PMD of the presence or absence of the long-range part of the MEP term at an alignment angle of $\beta=0^\circ$. We hence face a situation, where the long-range part of the MEP, the induced dipole potential, may change the TIY (Figs. 3 and 4), but not the shape of the PMDs. \subsection{Effect of long-range multielectron polarization on alignment-dependent total ionization yields and photoelectron momentum distributions of CS$_2$ } For the CS$_2$ molecule, the HOMO was probed by laser pulses containing 5 optical cycles with a laser peak intensity of 4.5$\times$10$^{13}$W/cm$^2$. The alignment-dependent TIYs are shown in Fig.~\ref{cs2_tiy}(a), where the dotted line denotes no field within $r_{c}$ while the solid line denotes the full MEP treatment, see Sec.~\ref{sec:mep}. From Fig.~\ref{cs2_tiy}~(a), we clearly see that MEP has a significant effect on the angular distribution of TIYs: the alignment angle $\beta$ of maximum TIY shifts from $\beta=30^\circ$ to $45^\circ$ upon accounting for long-range MEP term in the TDSE treatment. We notice that the effect of MEP on the angular distribution of CS$_2$ closely resembles the result for CO$_2$. This makes sense since the molecules have identical orbital symmetry and comparable ionization energies. Also, the Keldysh parameter ($\gamma=1.38$) for CS$_2$ at a laser intensity of 4.5$\times$10$^{13}$W/cm$^2$ is comparable to the one for CO$_2$ at 8.8$\times$10$^{13}$W/cm$^2$, $\gamma=1.2$, suggesting that these molecules are probed within similar ionization regimes. Turning to the PMDs of aligned CS$_2$, the effect of MEP is illustrated in Fig.~\ref{cs2_tiy} for aligned CS$_2$ at alignment angle $\beta=45^\circ$. In Fig.~\ref{cs2_tiy}~(b) the external field is turned off within $r_c$, whereas in Fig.~\ref{cs2_tiy}~(c) the full MEP term is accounted for. A comparison of the two images reveals no clear observable imprint of MEP on PMDs of aligned CS$_2$. \begin{figure*} \includegraphics[width=1.0\textwidth]{fig6.png} \caption{\label{cs2_tiy} Effect of MEP on (a) alignment dependence of TIYs and (b,c) photoelectron momentum distributions from the HOMO($xz$) orbital of the CS$_2$ molecule at peak intensity of 4.5$\times$10$^{13}$W/cm$^2$ for pulses containing 5 cycles. In (a), the dotted line denotes no field within $r_{c}$ while the solid line denotes full MEP; the TIYs are given on a relative scale. The PMD in (b) refers to TDSE calculations with no field within $r_{c}$ while (c) refers to full MEP account. } \end{figure*} \subsection{Effect of long-range multielectron polarization on alignment-dependent total ionization yields and photoelectron momentum distributions of O$_2$ } The HOMO of O$_2$ was probed by laser pulses containing 5 optical cycles with a laser peak intensity of 8.8$\times$10$^{13}$W/cm$^2$. The alignment-dependent TIYs are shown in Fig.~\ref{o2_tiy}(a), where the dotted line denotes no field within $r_{c}$, while the solid line denotes the full MEP treatment, see Sec.~\ref{sec:mep}. From Fig.~\ref{o2_tiy}~(a), we can clearly see that the angular distribution of TIYs has a sharp peak at an alignment angle of $\beta=45^\circ$ and no significant effect of MEP is observed. This can be due to the fact that the O$_2^+$ ion has a relatively small polarizability along the laser polarization ($\alpha_{||}$) compared to CO$_2$ and CS$_2$, see Table~\ref{molparam}. \begin{figure*} \includegraphics[width=1.0\textwidth]{fig7.png} \caption{\label{o2_tiy} Effect of MEP on (a) alignment dependence of TIYs and (b,c) photoelectron momentum distributions from the HOMO($xz$) orbital of the O$_2$ molecule at peak intensity of 8.8$\times$10$^{13}$W/cm$^2$ for pulses containing 5 cycles. In (a), the dotted line denotes no field within $r_{c}$ while solid line denotes full MEP, and the TIYs are given on a relative scale. The PMD in (b) refers to TDSE calculations with no field within $r_{c}$ while (c) refers to full MEP account. } \end{figure*} Now we refer to the effect of MEP on PMDs of O$_2$. We compare the PMDs at alignment angle of maximum TIYs; $\beta=45^\circ$, in Fig.~\ref{o2_tiy}~(b,c). We find no clear observable effect of MEP in the PMDs of O$_2$. This can be understood since the polarizability of the O$_2^+$ cation along the laser polarization ($\alpha_{||}$) is relatively small, compared those for CO$_2$ and CS$_2$. Notice that even in the cases of CO$_2$ and CS$_2$ where the cation polarizability is significantly larger, see Table~\ref{molparam}, we did not find observable effects of MEP in the PMDs. \section{Conclusions} \label{conc} In this work, we revisited strong-field ionization of aligned O$_2$, CO$_2$, and CS$_2$ molecules. We investigated the effect of accounting for MEP in the TDSE methodology within the SAE approximation on alignment dependence of TIYs and PMDs. Generally, MEP results in two related effects. Firstly, the electrons in the cation polarize and set up a field that counteracts the externally applied field at short distances. This effect means that the interaction between the single active electron and the laser field is effectively turned-off at distances smaller than $r_c \sim (\alpha_{||})^\frac{1}{3}$. Secondly, the interaction of the time-dependent laser field with the polarizability of the cation results in an induced dipole potential for $r > r_c$. In general, TDSE calculations within the SAE approximation and without the MEP effects, suffered from shifting of population to lower bound states of the potential, as was demonstrated for CO$_2$. This problem is resolved by turning off the external within a critical radius $r_c$. Now, turning to the effect of long-range MEP correction, taking this correction term into account improves the calculated angular distributions of TIYs for molecules with large polarizabilities of their cations, i.e. CO$_2$ and CS$_2$, in particular at high intensities. The effect of long-range MEP in the PMDs is negligible for the considered molecules, intensities and pulse durations. The present findings are relevant for future investigations of MEP on angular distributions of TIYs and PMDs of oriented polar molecules. \section{Acknowledgments} The numerical results presented in this work were obtained at the Centre for Scientific Computing (CSCAA), Aarhus. \providecommand{\noopsort}[1]{}\providecommand{\singleletter}[1]{#1}%
39049a2fd4a457741c6a93f507490d323d858c6e
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section*{Remerciements}\label{sec:Remerciements} \addcontentsline{toc}{chapter}{\nameref{sec:Remerciements}} \vspace{1cm} Je tiens à remercier toutes les personnes qui ont contribué au succès de mon stage et qui m’ont aidé lors de la rédaction de ce mémoire. Je remercie tout particulièrement M. Luca Zaccarian, mon référent au LAAS, qui m'a soumis un sujet, l'a guidé d'un point de vue scientifique et m'a accompagné tout au long de mon travail. Ma reconnaissance va également à M. Gautier Hattenberger, mon tuteur ENAC, qui a encadré mon expérience et m'a épaulé lors de la préparation de l'implémentation. Je n'oublie pas les membres de l'équipe drone de l'ENAC, Jean Philippe Condomines et Murat Bronz, qui ont bien voulu m'accorder un peu de leur temps. Aussi, je témoigne toute ma sympathie à Mme Lucie Baudouin, responsable de l'équipe MAC, qui a transmis ma candidature et m'a ainsi offert l'opportunité de ce stage. Je remercie également toute l’équipe pédagogique de l’École Nationale de l'Aviation Civile et les intervenants professionnels responsables de ma formation, pour avoir assuré la partie théorique de celle-ci. Enfin, je tiens à témoigner toute ma reconnaissance à ma compagne et à mes proches, pour leur soutien constant et leurs encouragements dans la réalisation de ce mémoire. \clearpage\null\newpage \vspace*{2cm} \section*{Résumé}\label{sec:Résumé} \vspace{1cm} \addcontentsline{toc}{chapter}{\nameref{sec:Résumé}} Que ce soit pour leur maniabilité, leur autonomie ou leur ergonomie, les drones convertibles, c'est-à-dire ceux ayant la capacité de décoller ou d’atterrir à la verticale et de voler comme un avion, présentent de nombreux intérêts. Cependant, leurs dynamiques étant complexifiées par divers phénomènes comme les non-linéarités, les couplages aérodynamiques ou encore le nombre important de degrés de liberté, il est nécessaire d'utiliser de nouveaux outils de commande. Ainsi, devient centrale la commande hybride, utile lors de choix binaires. Dès lors, le drone étant en mesure de se déplacer de deux manières, en vol pseudo-stationnaire et en vol horizontal, se pose la question de la pertinence d'une commande vis-à-vis de l'autre, en fonction du contexte opérationnel. Cette problématique trouve ses réponses dans la conception de deux lois de commande non-linéaires, basées sur des fonctions de Lyapunov, qui permettent de valider les exigences. Donc, en fonction de la configuration, il s’agira pour le mécanisme hybride de sélectionner le mode de vol opportun. Enfin, dans l’objectif d’un vol en conditions réelles, une implémentation a été initiée. \clearpage\null\newpage \vspace*{2cm} \section*{Abstract}\label{sec:Abstract} \vspace{1cm} \addcontentsline{toc}{chapter}{\nameref{sec:Abstract}} Whether for their maneuverability, autonomy or ergonomics, convertible UAVs, meaning those with the ability to take off or land vertically and fly like an airplane, present many interests. However, their dynamics are complicated by various phenomena such as non-linearities, aerodynamic couplings or the large number of degrees of freedom, and it is necessary to use new control tools. Thus, hybrid control becomes crucial, useful when making binary choices. Since the drone is able to move in two ways, in pseudo-stationary flight and in horizontal flight, the question of the relevance of a command with respect to the other, according to the operational context, arises. This problem is answered by the design of two nonlinear control laws, based on Lyapunov functions, which allow to validate the requirements. Therefore, depending on the configuration, the hybrid mechanism will have to select the appropriate flight mode. Finally, with the objective of a flight in real conditions, an implementation has been initiated. \clearpage\null\newpage \addcontentsline{toc}{chapter}{Table des matières} \tableofcontents \newpage \addcontentsline{toc}{chapter}{Table des figures} \listoffigures \clearpage\null\newpage \vspace*{2cm} \section*{Sujet et objectifs}\label{sec:sujet} \vspace{1cm} \addcontentsline{toc}{chapter}{\nameref{sec:sujet}} Lors de l’utilisation d’un drone convertible (capable de passer d’un mode avion à un mode de vol stationnaire), se pose la question de la planification des déplacements locaux. Effectivement, lors de grands trajets, il est préférable d'effectuer une transition pour voler comme un avion, afin d’être le moins consommateur en énergie. Cependant, quand le mouvement intervient sur des distances plus courtes, on peut se demander quel mode de pilotage est le plus opportun ? L’objectif de ce stage est de déterminer une couche de commande en guidage permettant de définir, de manière formelle et stable, la meilleure commande pour effectuer ce déplacement. Cet asservissement sera optimisé notamment sur des critères de consommation énergétique. Il s’agira de définir un modèle de drone, dans un premier temps relativement simple, de manière à pouvoir choisir les outils nécessaires à l’élaboration de cette couche de guidage. Il est possible, en fonction des résultats de simulation, d'effectuer des tests en situation réelle sur des maquettes de drone, en collaboration avec l’ENAC. En rapport avec le contexte défini ci-dessus, le stage suivra une approche mathématique rigoureuse, basée sur la description moderne des systèmes dynamiques hybrides \cite{65}. La loi de commande proposée sera caractérisée par un mécanisme de commutation basé sur des variables logiques. Ces dernières font partie de l’état interne de la dynamique hybride. Dès lors que les conditions de saut sont validées, il y a une commutation. Cependant, cette dernière doit garantir, par sa structure, l’absence de phénomènes Zeno et avoir un comportement approprié issu des propriétés comme l’hystérésis de commutation entre les différents modes de vol. On axera le stage sur différentes manœuvres de vol telles que des manœuvres d’évitement d’obstacles (décrites dans \cite{9064903}) ou des manœuvres de récupération d’urgence (présentées dans \cite{DBLP:conf/IEEEcca/AndreettoFZ16}). \clearpage\null\newpage \setcounter{section}{0} \section*{Introduction}\label{sec:Introduction} \addcontentsline{toc}{chapter}{\nameref{sec:Introduction}} \vspace{1cm} L'essor des drones est sans appel. Aujourd'hui, nous les utilisons dans de plus en plus de domaines tels que la surveillance, la météorologie, l'agriculture ou la topographie. Chaque contexte opérationnel ayant ses caractéristiques et ses exigences propres, il s'agit de concevoir un appareil qui soit adapté à sa mission. Ainsi, on peut distinguer trois grandes architectures : les aéronefs à rotor, les aéronefs à ailes fixes et les convertibles, chacun présentant des avantages et des inconvénients. Les aéronefs à rotor possèdent une très grande agilité et la capacité d'effectuer un vol stationnaire. Cependant, leur sustentation étant réalisée uniquement par les hélices, ils sont très énergivores et ne permettent pas des vols de longues durées. Les aéronefs à ailes fixes ont des temps de vol très importants car ils génèrent leur portance grâce à un profil aérodynamique. Toutefois, ils n'ont pas la possibilité d'effectuer de vol stationnaire, ce qui engendre un domaine de vol relativement réduit. Enfin, les convertibles, sujet de l'étude de notre stage, sont un compromis entre les deux architectures précédentes. Étant équipés d'une aile fixe, ils ont la possibilité de voler comme un avion, avec les avantages énergétiques que cela leur confère, mais aussi de se stabiliser en hovering pour maintenir une position. Ainsi, ils ont une enveloppe de vol très importante. \paragraph{} La motivation opérationnelle de ce travail réside dans la situation qui suit : supposons que le drone soit stable en hovering (vol stationnaire vertical) en un point de l'espace. On souhaite déplacer ce drone en un autre point de l'espace, distinct du premier. Dès lors, la problématique autour de laquelle s'articule notre réflexion est la suivante : est-il préférable de maintenir une orientation relativement proche de l'équilibre, drone à la verticale, et de se déplacer vers la cible ou bien faut-il basculer en vol horizontal pour rejoindre ce point ? \paragraph{} Notre objectif est d'obtenir une loi de commande, basée modèle, permettant d'assurer le contrôle du drone sur l'intégralité de son domaine de vol. Dans chacun des modes de vol, les manœuvres sont identiques mais réalisées de manières différentes, en fonction de la configuration. Par exemple, pour effectuer un changement de niveau de vol, il est possible d'effectuer un vol en montée rectiligne uniforme, utilisant la portance générée par la vitesse du drone pour sustenter ce dernier, ou de voler en hovering, compensant la gravité avec une force opposée, générée par les hélices, tout surplus de puissance étant converti en énergie potentielle et donc en hauteur. De cette possibilité qu'est le vol dans plusieurs configurations, résulte la question du choix de la configuration en fonction de la mission et des critères tels que la consommation énergétique. Ainsi, le contrôleur devant être en mesure de maintenir un vol en hovering et un vol horizontal, un mécanisme hybride est nécessaire. Concrètement, le vol en hovering doit permettre d'orienter le drone dans une situation qui lui permette de rejoindre un point cible et stabiliser sa position sur ce point. Le vol horizontal doit, quant à lui, permettre d'orienter le drone de manière à maintenir un vol stabilisé, à une vitesse constante, tout en rejoignant un point cible à une distance relativement élevée. Ainsi, notre choix d'asservissement réside dans des commandes par retour d'état, sur modèle linéarisé et non-linéaire, basées sur des fonctions de Lyapunov, ce qui assure ainsi leur convergence et leur attractivité. Aussi, il est nécessaire d'étudier le modèle du drone pour déterminer une inversion de modèle, ce qui rend possible la définition des commandes sur les actionneurs, pour obtenir les moments voulus. \\ \indent Dans l'idée de couvrir l'intégralité des capacités du drone, nous nous tournons vers un modèle unique, sans singularité. C'est donc naturellement que, pour décrire l'orientation du drone, nous utilisons une représentation complexe, à base de quaternions unitaires. De plus, la complexité de la commande provient des divers phénomènes qui entrent en jeu. On peut notamment penser aux non-linéarités, très présentes dans la mesure où nous atteignons des angles d'incidence importants et, par conséquent, le décrochage de la partie non-soufflée de l'aile. Citons aussi les couplages aérodynamiques qui nécessitent des commandes particulières ainsi que des efforts supérieurs sur les gouvernes pour obtenir le découplage. De plus, les modèles reposent sur l'identification, parfois fastidieuse et imprécise, des coefficients aérodynamiques. De même, le drone possédant six degrés de liberté et seulement quatre actionneurs indépendants, cela engendre un sous-actionnement. \paragraph{} Par ailleurs, soulignons qu'une commande basée modèle permet d'envisager une certification EASA, à laquelle sont soumis les drones civils actuels. En cela, il est intéressant de constater que si d'autres commandes ont été étudiées dans le même objectif et donnent de bons résultats, notamment la commande sans modèle \cite{olszaneckibarth:hal-02542982}, elles ne permettent pas la réglementation, en raison de l'absence de preuve démontrant leur convergence. Un autre type de commande existe, basé sur de l'inversion numérique de la dynamique du drone (INDI : Incremental Nonlinear Dynamic Inversion) \cite{smeur:hal-02293693}. Dans celle-ci, on intègre les mesures des gyromètres pour obtenir le comportement de l'aéronef ; cependant la forte densité de bruit complexifie l'intégration, ce qui a tendance à faire diverger la commande. \paragraph{} Notre travail a été pensé en trois phases : la mise en place d'un modèle, l'étude des lois de commande et leurs simulations, et les expérimentations. L'étude du modèle est le point de départ, en ce qu'il nous permet de comprendre le comportement du drone. Pour cela, nous avons choisi de nous appuyer sur les travaux de thèse de M. Leandro Ribeiro Lustosa \cite{lustosa:hal-03035938}. Celle-ci envisage une modélisation des drones convertibles (\textit{tail-sitter}) sans singularité, avec des quaternions. La représentation matricielle des équations envisagées permet un calcul plus simple des équations, en faisant abstraction des angles de dérapage et d'incidence du drone. Cependant, cette modélisation s'appuie sur des coefficients aérodynamiques pour lesquels il est nécessaire de faire une identification. Il en est de même avec la loi de commande proposée dans cet article \cite{DBLP:journals/automatica/KaiHS19}.\\ \indent Une fois l'étude du modèle aboutie, nous nous sommes intéressés au vol en mode vertical, l'objectif étant de réaliser de petits trajets avec une loi de commande stabilisante non-linéaire. Cependant, nous observons certaines limites lors de déplacements plus importants, ce qui justifie un passage en mode horizontal. Ainsi, en mode hovering, une loi de commande non-linéaire sera conçue sur la base d'une commande \textit{zero-moment} \cite{2020e-MicCenZacFra}.\\ \indent Par la suite, nous avons analysé le comportement du drone en vol horizontal, notamment au travers d'une linéarisation autour d'un point d'équilibre. Puis, nous avons commencé à étudier la possibilité de concevoir une loi de commande non-linéaire permettant de stabiliser le drone vers une direction fixée, à une vitesse de vol choisie. \\ \indent Ces études ont été suivies d'une implémentation, pour effectuer des simulations, dans la plate-forme Simulink. \paragraph{} La suite de ce mémoire présente les études réalisées, les résultats obtenus et les enseignements qui en découlent. \newpage \chapter{Présentation et déroulement du stage} \section{Présentation du LAAS \texorpdfstring{\cite{LAAS}}{}} \subsection{Présentation générale} J'ai effectué mon stage de fin d'études au sein du Laboratoire d'Analyse et d'Architecture des Systèmes (LAAS), structure rattachée au Centre National de la Recherche Scientifique (CNRS). Plus précisément, il s'est déroulé dans l'équipe Méthodes et Algorithmes en Commande (MAC), au sein du département "Décision et Optimisation".\\ Le Laboratoire d'Analyse et d'Architecture des Systèmes (LAAS-CNRS) est une unité propre du CNRS, en lien avec l'Institut des sciences de l'ingénierie et des systèmes (INSIS) et l'Institut des sciences de l'information et de leurs interactions (INS2I). Le laboratoire, implanté à Toulouse, au sein du complexe scientifique de Rangueil, développe des démarches cohérentes pour comprendre, concevoir et maîtriser des systèmes complexes. \subsection{Le département Décision et Optimisation} Ce département du LAAS mène des activités de recherche théoriques et méthodologiques pour la conception de lois mathématiques et de techniques algorithmiques servant à la commande et à la décision. Les trois équipes (DISCO - Diagnostic, Supervision et Conduite, MAC - Méthodes et Algorithmes en Commande, ROC - Recherche Opérationnelle, Optimisation Combinatoire et Contraintes) composant le département couvrent une variété de champs disciplinéaires de l’automatique et de l’informatique. Elles partagent certaines particularités comme : être centrées sur des classes de modèles représentant des réalités physiques, fonctionnelles ou organisationnelles que l’on souhaite piloter ; proposer des outils théoriques pour l’analyse des propriétés et performances atteignables ou atteintes ; adosser ces résultats à des méthodes de conception de lois de commande, de diagnostic ou d’optimisation ; illustrer les résultats sur des exemples d’applications fournis par des partenaires extérieurs qui, dans l’échange, alimentent les équipes en problématiques nouvelles. \subsection{Équipe MAC} Les domaines de recherche dans lesquels s'inscrit le groupe MAC concernent les méthodes et les techniques de commande pour les systèmes à états continus. Autrement dit, ses activités sont ancrées dans le domaine de l'automatique et de la théorie des systèmes. Les thématiques principales autour desquelles s'articulent les travaux de l'équipe sont la commande robuste, la prise en compte de non-linéarités et l'optimisation. Les travaux menés sont principalement orientés sur les problèmes de modélisation, d'estimation, d'analyse et de commande de systèmes dynamiques. \newpage \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{images/BFermee.png} \caption{Vision de la modélisation de l'équipe MAC} \label{fig:mac_vision} \end{figure} \section{Formations au cours du stage} Avant toutes choses, soulignons que ce stage a été l'occasion de mobiliser des connaissances acquises lors de ma formation à l'ENAC, notamment sur la linéarisation d'un modèle. Celles-ci ont pu être complétées par des échanges réguliers avec mon maître de stage et des recherches personnelles. \paragraph{} La première partie du stage a été consacrée à l'étude d'une nouvelle méthode de commande : la commande hybride. Celle-ci permet de modéliser la partie continue et la partie discrète d'un système et de voir leurs interactions. Cet apprentissage s'est déroulé en deux étapes importantes. Premièrement, j'ai participé aux cours donnés par Sophie Tarbouriech et Isabelle Queinnec, qui m'ont permis d'acquérir les notions fondamentales. En effet, m'ont été proposés les aspects théoriques de la commande hybride et divers exemples et exercices. Puis, j'ai travaillé sur la simulation d'un article \cite{DBLP:conf/IEEEcca/AndreettoFZ16}, dans l'objectif d'obtenir les mêmes résultats que ceux présentés dans celui-ci et ainsi m'initier aux fonctionnements et problématiques hybrides. J'ai observé que l'utilisation de mécanismes hybrides dans le contexte de ce stage est très intéressante, en ce qu'elle nous permet la conception de contrôleurs avec des performances prouvées mathématiquement. La principale difficulté rencontrée dans cette tâche a été l'assimilation de la notion de temps généralisé, composante de cette loi de commande. \\ \indent Ce papier \cite{DBLP:conf/IEEEcca/AndreettoFZ16}, présentant une loi de commande basée sur un contrôleur local et un contrôleur global, a aussi été le point de départ de notre travail, dans la mesure où il a inspiré la création de deux contrôleurs permettant de stabiliser le vol en hovering et le vol horizontal. Parallèlement, le contrôleur temps quasi optimal (QTO), non-linéaire saturé, présent dans la loi de commande globale, a nécessité une étude approfondie de sa forme et de son fonctionnement, via des travaux récents \cite{journals/csysl/InvernizziLZ20}. \\ \indent Ce stage visant l'étude d'un drone convertible tel que DarkO, c'est naturellement que j'ai étudié son processus de développement, et notamment ses différentes formes. L'impact de ces dernières sur la commande du drone, c'est-à-dire les changements dans la dynamique de DarkO en fonction de la forme de l'aile, est développé dans l'annexe \ref{ann:comp}. \\ \indent Aussi, la simulation du mécanisme hybride a demandé un apprentissage car bien qu'elle s'opère sur la plateforme Simulink (Matlab), elle nécessite une \textit{toolbox, Hybrid Equations Toolbox (HyEQ)}, développée par Ricardo Sanfelice \cite{sanfelice_2017} (figure \ref{fig:sim_hybrid}). \newpage \begin{figure}[h] \centering \includegraphics[width=0.4\textwidth]{images/HybridSimulator2.png} \caption{Modèle Simulink de simulation hybride} \label{fig:sim_hybrid} \end{figure} Cet outil permet de décrire l'ensemble des espaces définis dans la figure \ref{fig:sim_hybrid} (\textit{flow map, flow set, jump map, jump set} et l'espace état) et de représenter graphiquement les résultats. \nomenclature{Flow map}{Fonction décrivant l'évolution continue de la dynamique.} \nomenclature{Flow set}{Espace décrivant les conditions de saut de la dynamique continue.} \nomenclature{Jump map}{Fonction décrivant l'évolution discrète de la dynamique.} \nomenclature{Jump set}{Espace décrivant les conditions de saut de la dynamique discrète.} \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{images/HybridSystem.png} \caption{Description mathématique d'un système hybride} \label{fig:math_hybrid} \end{figure} \nomenclature{$\dot x$}{Évolution continue de la dynamique.} \nomenclature{$x^{+}$}{Évolution discrète de la dynamique.} Pour se familiariser avec la \textit{toolbox}, plusieurs systèmes ont été étudiés tels qu'un pendule (simple et rebondissant sur un mur), un réservoir d'eau et un système de chauffage dans une pièce. \paragraph{} Un soin particulier a été apporté à l'apprentissage des LMIs, outil puissant de commande moderne. Pour cela, j'ai suivi le cours de Riccardo Bertollo, qui propose plusieurs exemples permettant de mettre en contexte les notions théoriques liées à l'utilisation des LMIs. Bien que nous regrettons, faute de temps, de n'avoir pu utiliser cet outil, nous avons entrevu leurs intérêts et imaginé leurs utilisations dans l'optimisation de certaines lois de commande, proposées par la suite. \nomenclature{LMI}{Linear Matrix Inequality ou Inégalité matricielle linéaire.} \clearpage\null\newpage \chapter{Description du drone} \section{Modélisations} La dynamique des drones de type \textit{tail-sitter} est particulièrement difficile à appréhender, notamment à cause des effets aérodynamiques et des couplages tridimensionnels. Dans cette section, nous allons décrire le modèle mathématique utilisé pour modéliser le comportement du drone, inspiré d'un travail de thèse \cite{Lustosa2017LaP}. \paragraph{} Dans un premier temps, nous allons décrire les référentiels utilisés, les systèmes d'axes, les paramètres cinématiques et le vecteur de commande. Puis, on décrira les équations du modèle ainsi que les forces et moments qui sont en action. Pour finir, nous appliquerons des hypothèses simplificatrices pour permettre le contrôle du drone. \paragraph{} Pour toute la suite de ce rapport, nous utiliserons la notation suivante: tous les vecteurs seront notés avec une lettre minuscule, en gras, alors que les scalaires seront en lettre minuscule, simple. Par exemple, $\boldsymbol{x} \in \mathbb{R}^n$ est un vecteur de dimension n, contrairement à $a \in \mathbb{R}$, qui est un scalaire. \subsection{Référentiels et systèmes d'axes} \subsubsection{Les repères} \noindent Les référentiels utilisés sont les référentiels usuels de la mécanique du vol. \renewcommand \labelitemi{$\blacksquare$} \begin{itemize} \item $\mathcal{I}$ est le repère inertiel. Il est lié à un point O de la surface terrestre. On le suppose galiléen, donc le théorème fondamental de la dynamique s'applique. On associe à $\mathcal{I}$ le système d'axes $\left[ x_{0},y_{0},z_{0}\right]$, où $x_{0}$ pointe vers le nord, $y_{0}$ pointe vers l'ouest et $z_{0}$ forme un trièdre direct. \item $\mathcal{B}$ est le repère du corps. Il est lié au centre de gravité G du drone. On associe à $\mathcal{B}$ le système d'axes $\left[ x_{b},y_{b},z_{b}\right]$, où $x_{b}$ est l'axe de roulis du drone, porté par l'axe des moteurs, $y_{b}$ est l'axe de tangage du drone, porté par l'axe des ailes et $z_{b}$ est l'axe de lacet, formant un trièdre direct. \item $\mathcal{A}$ est le repère aérodynamique. Il est lié au centre de gravité G du drone. On associe à $\mathcal{A}$ le système d'axes $\left[ x_{a},y_{a},z_{a}\right]$. Ce système d'axes est particulièrement bien adapté pour l'expression des efforts aérodynamiques. \end{itemize} \newpage Le schéma ci-dessous illustre quelques-uns de ces repères. \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{images/darko_ref.jpg} \caption{Référentiels du drone} \label{fig:ref_drone} \end{figure} \subsubsection{Quaternions et matrices de changement de base entre les repères} \nomenclature{Angles d'Euler}{Technique permettant de représenter l'orientation d'un solide par rapport à un repère, avec des singularités.} Dans ce travail, nous adoptons une représentation de l'attitude du drone avec le formalisme des quaternions unitaires. Cette représentation permet d'éviter les singularités (présentent avec les angles d'Euler) et de simplifier les équations. Soit un quaternion $q$, couramment représenté par un vecteur de dimension quatre, avec une norme unitaire, composé d'une partie scalaire $\eta \in \mathbb{R}$ et d'une partie vectorielle $\boldsymbol{\epsilon} \in \mathbb{R}^{3}$ tel que $q = \left [ \eta ~ \epsilon^\top \right]^\top$. Les matrices de changement de base permettent de passer librement d'un repère à un autre. Nous travaillons dans les bases orthonormées, donc les matrices de changement de base appartiennent au groupe spécial orthogonal SO(3). \begin{subequations} \begin{align} R(q) &= I_{3} + 2\eta \skewsym{\epsilon} + 2\skewsym{\epsilon}^{2}\\ &= I_{3} + 2\eta \skewsym{\epsilon} + 2(\epsilon\epsilon^\top - \epsilon^\top\epsilon I_{3}) \end{align} \end{subequations} \subsection{Paramètres du système} Dans cette section, nous allons exprimer les paramètres cinématiques permettant de décrire le mouvement du drone dans l'espace, en rotation comme en translation. Par la suite, nous nous intéresserons aux propriétés cinétiques telles que la masse, le centrage et l'inertie du véhicule. Ces quantités permettent de faire le lien entre les forces et les dérivées des paramètres cinématiques. \subsubsection{Paramètres cinématiques} Les paramètres cinématiques qui permettent de décrire le mouvement du drone dans l'espace sont la position, la vitesse, l'attitude et la vitesse angulaire. Ainsi, on prendra comme vecteur d'état du système: \begin{align} \left[\boldsymbol{p},~ \boldsymbol{v},~ \boldsymbol{q},~ \boldsymbol{\omega}\right] \end{align} Les composantes sont définies de la manière suivante: \begin{itemize} \item $\boldsymbol{p} = {}^{\mathcal{I}}OG$ est la position du centre de gravité du drone par rapport à $\mathcal{I}$, exprimée dans le repère inertiel. \item $\boldsymbol{v}={}^{\mathcal{I}}V_{(G/\mathcal{I})}$ est la vitesse du centre de gravité par rapport à $\mathcal{I}$, exprimée dans le repère inertiel. \item $\boldsymbol{q} = \left [ \eta ~ \epsilon^\top \right]^\top$ est l'orientation du drone exprimée dans le repère corps. \item $\boldsymbol{\omega} = [p,~q,~r]^\top = {}^{\mathcal{B}} \Omega_{(G/\mathcal{I})}$ est le vecteur vitesse instantanée de rotation entre le repère corps et le repère inertiel, exprimé dans le repère corps. \end{itemize} \subsubsection{Paramètres cinétiques} Les paramètres cinétiques caractéristiques du drone sont sa masse, son centrage et sa matrice d'inertie. Le véhicule étant à propulsion électrique, il n'y a pas de variation de masse au cours du temps. Ainsi, tous les paramètres cinétiques sont constants au cours du vol.\\ On définit : \begin{itemize} \item La masse du drone, notée $m$. \item Le centre de gravité, noté $G$. \item La matrice d'inertie du drone, exprimée au point G dans le repère du corps, notée $J = diag(J1,J2,J3)$. \end{itemize} \ \\ \noindent De plus, le drone évolue dans l'atmosphère terrestre, il est donc soumis à la gravité que nous définissons: \begin{align} \boldsymbol{g} = \begin{bmatrix} 0 \\ 0 \\ g \end{bmatrix} \end{align} avec $g = \SI{9.81}{\meter\per\square\second}$. \subsubsection{Description du drone} Le drone étudié est DarkO, drone conçu et fabriqué à l'ENAC. Il est constitué de plusieurs pièces imprimées en 3D, avec comme matériau d'impression l'Onyx. Ce matériau, à base de fibres de carbone omnidirectionnelles, confère une résistance accrue des pièces ainsi qu'une certaine souplesse permettant d'absorber les chocs.\\ \indent Pour ce qui est de la structure, DarkO est un drone de type \textit{tail-sitter}, avec deux moteurs situés en avant de l'aile et deux élevons surdimensionnés, agissant comme surface de contrôle. \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{images/darko_ensemble.jpg} \caption{Modélisation de DarkO} \label{fig:vue3d} \end{figure} \subsubsection{Vecteur de commande} Le drone est constitué de deux moteurs permettant de générer de la poussée. On peut mettre cet effort généré sous la forme : \begin{align} T_{i} =\begin{bmatrix} k_{f}\omega_{i}^{2} \\ 0 \\ 0 \end{bmatrix}_{b},~i\in [1,2] \end{align} où $\omega_{i}$ représente la vitesse de rotation du moteur en \SI{}{\radian\per\second} et $k_{f}$ est une constante représentant la force générée par l'hélice en \SI{}{\kilogram\meter}.\newline \\ Nous pouvons faire varier la vitesse indépendamment de chacun d'eux, de manière à générer des efforts différentiels. \\La rotation des deux moteurs génère aussi des moments: \begin{align} N_{i} =\begin{bmatrix} (-1)^{i} k_{m} \omega_{i}^{2} \\ 0 \\ 0 \end{bmatrix}_{b} ,~i\in [1,2] \end{align} où $k_{m}$ est une constante représentant le moment généré par l'hélice en \SI{}{\kilogram\square\meter}.\\ On peut exprimer le moment moteur en fonction de la traction engendrée par l'hélice : \begin{align} N_{i} = (-1)^{i} \frac{k_{m} }{k_{f}}T_{i} ,~i\in [1,2] \end{align} De plus, deux élevons sont présents dans l'aile volante. Ils se situent dans la partie d'aile soufflée par les moteurs. Ils permettent de générer des forces et des moments. Ainsi, nous devons définir deux matrices anti-symétriques, représentant l'efficacité des élevons à générer des forces et des moments: \begin{align} \Delta_{f,i} = \skewsym{\xi_{f}} \delta_{i} = \begin{bmatrix} 0 & 0 & \xi_{f}\delta_{i} \\ 0 & 0 & 0 \\ -\xi_{f}\delta_{i} & 0 & 0 \end{bmatrix} \end{align} \begin{align} \Delta_{m,i} = \skewsym{\xi_{m}} \delta_{i} = \begin{bmatrix} 0 & 0 & \xi_{m}\delta_{i} \\ 0 & 0 & 0 \\ -\xi_{m}\delta_{i} & 0 & 0 \end{bmatrix} \end{align} La complexité d'un tel système réside dans le fait que l'utilisation des élevons génère en même temps des couples (utilisés pour orienter le drone) et des efforts, qui ont tendance à le déstabiliser. \newline \\ \noindent NOTE 1: on définit w1>0 et w2<0 car nous avons des hélices contre-rotatives.\\ NOTE 2: le signe des élevons est pris, par convention, positif pour un moment à cabrer. \newline \\ \noindent Il est donc possible de choisir comme vecteur de commande du drone: \begin{align} \left[\omega_{1},~ \omega_{2},~ \delta_{1},~ \delta_{2}\right] \end{align} Effectivement, ces commandes représentent les actions possibles sur les moteurs et sur les ailerons. Nous observerons pas la suite qu'il est possible d'obtenir des surfaces de contrôle virtuelles, à partir de ces entrées effectives. \subsubsection{Saturation des commandes} Les actionneurs présents sur le drone possèdent des dynamiques qui limitent leurs actions. Chaque actionneur ayant ses caractéristiques propres, nous allons détailler les saturations appliquées, leur sens physique et leur seuil. \paragraph{} Pour les moteurs électriques, générant de la traction grâce aux hélices, il est nécessaire de saturer la vitesse de rotation pour avoir un modèle réaliste. Effectivement, saturer la vitesse de rotation permet de générer un modèle à énergie finie. Physiquement, cette saturation provient de la limite de tension que peut accepter le moteur, dans la mesure où la vitesse de rotation est directement liée à la tension présente aux bornes du moteur. Dans notre cas, la saturation permet de maintenir la vitesse de rotation du moteur $\omega \in [200~; 1000]~\SI{}{\radian\per\second}$. La chaîne d'actionnement des moteurs, constituée notamment de l'ESC,\nomenclature{ESC}{Electronic Speed Control, contrôleur de moteur sans balai.} du moteur et de l'hélice peut être représentée par une dynamique du premier ordre. Cependant, nous avons fait le choix d'utiliser une saturation sur l'accélération du moteur pour représenter le temps de réaction de l'ensemble. En effet, ce choix technique permet de simplifier la mise en place de la simulation. Toutefois, il est possible de montrer que la saturation agit de la même manière que le premier ordre, bien qu'il existe quelques subtilités, en fonction de la fréquence du signal. Ainsi, nous avons $\dot \omega \in [-3000~; 3000]~\SI{}{\radian\per\square\second}$. On observe une grande réactivité dans cette chaîne d'actionnement, notamment par la faible inertie de l'hélice, par la commande exclusivement électrique, et une électronique embarquée à haute fréquence. \\ \indent Les seconds actionneurs sont les élevons qui sont mus par des servomoteurs. Physiquement, leurs positions sont contraintes par la forme du drone et les limites des servomoteurs. Ainsi, nous pouvons observer une limite en position angulaire, qui se traduit dans le modèle par une saturation de la déflexion de gouverne. On maintient donc $\delta \in [-30~; 30]\text{\textdegree}$. Aussi, une limite importante pour les élevons est la saturation en vitesse angulaire. En effet, vu les efforts engendrés par ceux-ci, il est impossible d'atteindre des vitesses d'actionnement très élevées. De plus, avec la technologie utilisée, actionnement par servomoteur, il n'existe aucun réglage de vitesse, celui-ci se déplaçant toujours à 0.2 seconde pour 60~\textdegree. Ainsi $\dot \delta \in \{-5.24, 5.24\} ~\SI{}{\radian\per\square\second}$. \subsection{Représentation dynamique} La représentation dynamique du drone est extraite de la modélisation proposée dans \cite{lustosa:hal-03035938}, avec les modifications proposées dans \cite{olszaneckibarth:hal-02542982}, concernant l'utilisation de la formule de Diederich dans les simulations. \nomenclature{Formule de Diederich}{Formule permettant de déterminer la courbe de portance d'un profil.} \\ \noindent On obtient, du théorème fondamental de la dynamique, les équations suivantes: \begin{align} \left\{ \begin{array}{l} \boldsymbol{\dot p} = \boldsymbol{v}\\ \boldsymbol{\dot v} = \frac{1}{m}R(q)\sum F_{b}(x, u, w) + \boldsymbol{g}\\ \boldsymbol{\dot q} = \frac{1}{2}\boldsymbol{q} \otimes \boldsymbol{\omega_{b}}\\ \boldsymbol{\dot \omega_{b}} = J^{-1} \sum M_{b}(x,u,w) - J^{-1}\skewsym{\boldsymbol{\omega_{b}}} J\boldsymbol{\omega_{b}} \end{array} \right. \end{align} L'expression de l'ensemble des forces sur le drone est définie par: \begin{multline} \sum F_{b} = T_{1}+ T_{2} - \frac{S}{4S_{p}} \Phi^{(fv)} T_{1} - \frac{S}{4S_{p}} \Phi^{(fv)} T_{2} + \frac{S}{4S_{p}} \Phi^{(fv)} \Delta_{f,1} T_{1} + \frac{S}{4S_{p}} \Phi^{(fv)} \Delta_{f,2} T_{2}\\ +\frac{1}{4} \rho S \eta \Phi^{(fv)} (\Delta_{f,1} + \Delta_{f,2}) v_{b} + \frac{1}{4} \rho S \eta \Phi^{(mv)} (\Delta_{f,1} + \Delta_{f,2}) B \omega_{b} -\frac{1}{2} \rho S \eta \Phi^{(fv)} v_{b} - \frac{1}{2} \rho S \eta \Phi^{(mv)} B \omega_{b} \end{multline} Que nous pouvons factoriser en : \begin{multline} \sum F_{b} = T_{1} + T_{2} + \frac{S}{4S_{p}} \Phi^{(fv)} \Big( \Delta_{f,1} - I\Big) T_{1} + \frac{S}{4S_{p}} \Phi^{(fv)} \Big( \Delta_{f,2} - I\Big) T_{2} \\ + \frac{1}{4} \rho S \eta \Phi^{(fv)} \Big(\Delta_{f,1}+ \Delta_{f,2} - 2I \Big) v_{b} + \frac{1}{4} \rho S \eta \Phi^{(mv)} \Big(\Delta_{f,1} + \Delta_{f,2} - 2I\Big) B \omega_{b} \end{multline} avec $\eta = \sqrt{v_{b}^{2} + \mu c^{2} \omega_{b}^{2}}$.\\ \nomenclature{$V_{b}$}{Vitesse du drone exprimée dans le repère $\mathcal{B}$ en \SI{}{\meter\per\second}.}\\ Pour tout $i \in [1,2]$, représentant la partie droite et gauche du drone: \begin{itemize} \item $T_{i}$ est la poussée du moteur. \item $\frac{S}{4S_{p}} \Phi^{(fv)} T_{i}$ est l'effort engendré par le flux d'air de l'hélice sur l'aile. \item $\frac{S}{4S_{p}} \Phi^{(fv)} \skewsym{\xi_{f}} \delta_{i} T_{i}$ est l'effort engendré par le flux d'air de l'hélice sur l'aileron. \item $\frac{1}{4} \rho S \Phi^{(fv)} \skewsym{\xi_{f}} (\delta_{1} + \delta_{2}) v v_{b}$ est l'effort engendré par la vitesse linéaire du drone sur les ailerons. \item $\frac{1}{4} \rho S \Phi^{(mv)} \skewsym{\xi_{f}} (\delta_{1} + \delta_{2}) B v \omega_{b}$ est l'effort engendré par la vitesse angulaire du drone sur les ailerons. \item $\frac{1}{2} \rho S \Phi^{(fv)} v v_{b} $ est l'effort engendré par la vitesse linéaire du drone sur l'aile. \item $\frac{1}{2} \rho S \Phi^{(mv)} v B \omega_{b} $ est l'effort engendré par la vitesse angulaire du drone sur l'aile. \end{itemize} \ \\ L'expression de l'ensemble des moments sur le drone peut s'exprimer de la manière suivante : \begin{multline} \sum M_{b} = -\frac{1}{2} \rho S B \Phi^{(mv)} v v_{b} -\frac{1}{2} \rho S B \Phi^{(mv)} v B \omega_{b} - \frac{S}{4S_{p}} B \Phi^{(mv)} T_{1} - \frac{S}{4S_{p}} B \Phi^{(mv)} T_{2} + \skewsym{p_{1}} T_{1} + \skewsym{p_{2}} T_{2} \\ - \frac{S}{4S_{p}} \skewsym{a_{1}} \Phi^{(fv)} T_{1} - \frac{S}{4S_{p}} \skewsym{a_{2}} \Phi^{(fv)} T_{2} + \frac{S}{4S_{p}} \skewsym{a_{1}} \Phi^{(fv)} \skewsym{\xi_{f}} \delta_{1} T_{1} + \frac{S}{4S_{p}} \skewsym{a_{2}} \Phi^{(fv)} \skewsym{\xi_{f}} \delta_{2} T_{2} \\ + N_{1} + N_{2} + \frac{1}{4} \rho S \skewsym{a_{1}} \Phi^{(fv)} \skewsym{\xi_{f}} \delta_{1} v v_{b} + \frac{1}{4} \rho S \skewsym{a_{2}} \Phi^{(fv)} \skewsym{\xi_{f}} \delta_{2} v v_{b} \\ +\frac{1}{4} \rho S \skewsym{a_{1}} \Phi^{(mv)} \skewsym{\xi_{f}} \delta_{1} B v \omega_{b} + \frac{1}{4} \rho S \skewsym{a_{2}} \Phi^{(mv)} \skewsym{\xi_{f}} \delta_{2} B v \omega_{b} + \frac{1}{4} \rho S B \Phi^{(mv)} \skewsym{\xi_{m}} (\delta_{1} + \delta_{2}) v v_{b} \\ + \frac{1}{4} \rho S B \Phi^{(m\omega)} \skewsym{\xi_{m}} (\delta_{1} + \delta_{2}) v B \omega_{b} + \frac{S}{4S_{p}} B \Phi^{(mv)} \skewsym{\xi_{m}} \delta_{1}T_{1} + \frac{S}{4S_{p}} B \Phi^{(mv)} \skewsym{\xi_{m}} \delta_{2}T_{2} \end{multline} Que nous pouvons factoriser en : \begin{multline} \sum M_{b} = - \frac{S}{4S_{p}} \bigg[ B \Phi^{(mv)} \Big(\Delta_{m,1}- I \Big) + \skewsym{a_{1}} \Phi^{(fv)} \Big(I + \Delta_{m,1}\Big) \bigg] T_{1} - \frac{S}{4S_{p}} \bigg[ B \Phi^{(mv)} \Big(\Delta_{m,2} - I \Big)\\ + \skewsym{a_{2}} \Phi^{(fv)} \Big(I + \Delta_{m,2}\Big) \bigg] T_{2} + \frac{1}{4} \rho S \eta \bigg[ \Big(\skewsym{a_{1}} \Phi^{(fv)} + B \Phi^{(mv)} \Big) \Delta_{m,1} + \Big( \skewsym{a_{2}} \Phi^{(fv)} + B \Phi^{(mv)} \Big) \Delta_{m,2}\\ - 2 B \Phi^{(mv)} \bigg] v_{b} +\frac{1}{4} \rho S \eta \bigg[ \Big( \skewsym{a_{1}} + B \Big) \Delta_{m,1} + \Big ( \skewsym{a_{2}} + B \Big) \Delta_{m,2} - 2 B \bigg] \Phi^{(mv)} B \omega_{b} + \skewsym{p_{1}} T_{1} + \skewsym{p_{2}} T_{2}\\ + N_{1} + N_{2} \end{multline} Pour tout $i \in [1,2]$, représentant la partie droite et gauche du drone: \begin{itemize} \item $\frac{1}{2} \rho S B \Phi^{(mv)} v v_{b}$ est le moment engendré par l'aile en fonction de la vitesse linéaire. \item $\frac{1}{2} \rho S B \Phi^{(mv)} v B \omega_{b} $ est le moment engendré par l'aile en fonction de la vitesse angulaire. \item $\frac{S}{4S_{p}} B \Phi^{(mv)} T_{i}$ est le moment engendré par le flux d'air de l'hélice sur l'aile. \item $\skewsym{p_{i}} T_{i}$ est le moment engendré par la poussée du moteur. \item $\frac{S}{4S_{p}} \skewsym{a_{i}} \Phi^{(fv)} T_{i}$ est le moment engendré par le flux d'air de l'hélice sur l'aile, dû au décalage du centre aérodynamique par rapport au centre de masse. \item $\frac{S}{4S_{p}} \skewsym{a_{i}} \Phi^{(fv)} \skewsym{\xi_{f}} \delta_{i} T_{i}$ est le moment engendré par le flux d'air de l'hélice sur l'aileron, dû au décalage du centre aérodynamique par rapport au centre de masse. \item $N_{i}$ est le moment engendré par la réaction du moteur. \item $\frac{1}{4} \rho S \skewsym{a_{i}} \Phi^{(fv)} \skewsym{\xi_{f}} \delta_{i} v v_{b}$ est le moment engendré par l'aileron en fonction de la vitesse linéaire du drone. \item $\frac{1}{4} \rho S \skewsym{a_{i}} \Phi^{(mv)} \skewsym{\xi_{f}} \delta_{i} B v \omega_{b}$ est le moment engendré par l'aileron en fonction de la vitesse angulaire du drone. \item $\frac{1}{4} \rho S B \Phi^{(mv)} \skewsym{\xi_{m}} (\delta_{1} + \delta_{2}) v v_{b}$ est le moment engendré par la vitesse linéaire du drone sur les ailerons. \item $\frac{1}{4} \rho S B \Phi^{(mv)} \skewsym{\xi_{m}} (\delta_{1} + \delta_{2}) v B \omega_{b}$ est le moment engendré par la vitesse angulaire du drone sur les ailerons. \item $\frac{S}{4S_{p}} B \Phi^{(mv)} \skewsym{\xi_{m}} \delta_{i}T_{i}$est le moment engendré par le flux d'air de l'hélice sur les ailerons. \end{itemize} \newpage \section{Étude des modèles } Comme nous travaillons sur plusieurs lois de commande agissant dans des conditions de vol différentes, nous avons besoin de décrire au mieux la dynamique du drone dans la phase de vol concernée. L'objectif de cette partie est de développer les hypothèses retenues, ainsi que les équations de dynamique. \subsection{Modèle non-linéaire simplifié} Dans cette section, nous prenons comme hypothèse que les efforts et les moments engendrés par la vitesse linéaire et angulaire du drone sont très faibles, devant les efforts engendrés par les hélices et le flux d'air qu'elles génèrent. On suppose que nous sommes dans un environnement sans vent, conformément à ce qui a été discuté avec M. Murat Bronz. Cette supposition s'explique par le fait que l'on cherche à stabiliser le drone à la verticale sans vitesse, donc que tous les effets engendrés par une vitesse air sont négligeables. \\ \indent Lors de la convergence du drone vers un point, celui-ci se déplace en pseudo-stationnaire donc la vitesse air reste faible et inutilisée pour la stabilisation du drone. Dès lors, on la traite comme une perturbation. Les effets de la vitesse angulaire sont négligés dans le modèle et traités comme une perturbation lors de l'orientation du drone. Cela engendre des transitoires lors de la convergence. Il est donc nécessaire d'avoir des preuves de convergence des lois de commande pour assurer le rejet des effets déstabilisants. \newline \\ \noindent On prend ainsi: \begin{align} \left\{ \begin{array}{l} \boldsymbol{\dot p} = \boldsymbol{v}\\ \boldsymbol{\dot v} = \frac{1}{m}R(q)\sum F_{b}(x, u, w) + \boldsymbol{g}\\ \boldsymbol{\dot q} = \frac{1}{2}\boldsymbol{q} \otimes \boldsymbol{\omega_{b}}\\ \boldsymbol{\dot \omega_{b}} = J^{-1} \sum M_{b}(x,u,w) - J^{-1}\skewsym{\boldsymbol{\omega_{b}}} J\boldsymbol{\omega_{b}} \end{array} \right. \end{align} Avec l'expression des forces définie par : \begin{flalign} \sum F_{b} &= \Big(I - \frac{S}{4S_{p}} \Phi^{(fv)} \Big) T_{1} + T_{2}) + \frac{S}{4S_{p}} \Phi^{(fv)} (\Delta_{f,1} T_{1} + \Delta_{f,2} T_{2}) \end{flalign} Et l'expression des moments : \begin{multline} \sum M_{b} = - \frac{S}{4S_{p}} B \Phi^{(mv)} (T_{1} + T_{2} ) + \frac{S}{4S_{p}} B \Phi^{(mv)} (\Delta_{m,1}T_{1} + \Delta_{m,2}T_{2}) - \frac{S}{4S_{p}} \skewsym{a_{1}} \Phi^{(fv)} (T_{1} - T_{2} )\\ + \frac{S}{4S_{p}} \skewsym{a_{1}} \Phi^{(fv)} (\Delta_{f,1} T_{1}- \Delta_{f,2} T_{2}) +\frac{k_{m} }{k_{f}}(T_{1}- T_{2} ) + \skewsym{p_{1}} T_{1} + \skewsym{p_{2}} T_{2} \end{multline} On peut exprimer cette expression sous la forme: \begin{flalign} \sum F_{b} &= \begin{bmatrix} 1-\frac{S}{4S_{p}} C_{d0} \\ 0 \\ 0 \end{bmatrix}_{b}(T_{1,x} + T_{2,x}) + \begin{bmatrix} 0 \\ 0 \\ -\frac{S}{4S_{p}}(2\pi + C_{d0})\xi_{f} \end{bmatrix}_{b} (\delta_{1}T_{1,x} + \delta_{2}T_{2,x}) \end{flalign} \begin{multline} \sum M_{b} = \begin{bmatrix} \frac{k_{m} }{k_{f}} \\ 0\\ p_{y}+\frac{S}{4S_{p}} a_{y} C_{d0} \end{bmatrix} (T_{1,x} - T_{2,x}) +\begin{bmatrix} \frac{S}{4S_{p}}a_{y}( 2\pi + C_{d0})\xi_{f} \\ 0 \\ 0\end{bmatrix}(\delta_{1}T_{1,x} - \delta_{2}T_{2,x})\\ + \begin{bmatrix} 0 \\ \frac{S}{4S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m} \\ 0\end{bmatrix}(\delta_{1}T_{1,x} + \delta_{2}T_{2,x}) \end{multline} \noindent On voit apparaître les surfaces de contrôle du drone. Effectivement, la manipulation des équations nous a montré que le drone possède un couplage de la vitesse de rotation de l'hélice avec la déflexion de gouverne soufflée par cette dernière. Ainsi, on préférera utiliser le produit des deux comme commande fictive, pour simplifier la description de la dynamique. Aussi, on observe que l'on n'a pas de découplage entre la force et le moment exercés sur le drone. En d'autres termes, une action quelconque sur les commandes du drone ne permet pas de générer une force sans créer de moment. En réalité, nous observerons plus loin que nous allons prendre des hypothèses pour approcher le découplage. (cf chapitre \ref{chap:hover}) \newline \\ \noindent Mettons les équations sous la forme matricielle, avec un nouveau vecteur de commande basé sur les commandes virtuelles obtenues précédemment : \begin{align} u = \begin{bmatrix}T_{1,x} & T_{2,x} & \delta_{1}T_{1,x} & \delta_{2}T_{2,x} \end{bmatrix} ^\top \end{align} \begin{subequations} \begin{flalign}\label{eq:force_matrice} \sum F_{b} &= \begin{bmatrix} ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) & ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & -(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f}) & -(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f}) \end{bmatrix} \begin{bmatrix}T_{1,x} \\ T_{2,x} \\ \delta_{1}T_{1,x} \\ \delta_{2}T_{2,x} \end{bmatrix}\\ &=F_{b}u \end{flalign} \begin{flalign}\label{eq:moment_matrice} \sum M_{b} &= \begin{bmatrix} (\frac{k_{m} }{k_{f}}) & -(\frac{k_{m} }{k_{f}}) & \frac{S_{wet}}{4S_{p}}a_{y}( 2\pi + C_{d0})\xi_{f} & -\frac{S_{wet}}{4S_{p}}a_{y}( 2\pi + C_{d0})\xi_{f} \\ 0 & 0 & \frac{S_{wet}}{4S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m} & \frac{S_{wet}}{4S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m} \\ (p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0}) & -(p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0}) & 0 & 0 \end{bmatrix} \begin{bmatrix}T_{1,x} \\ T_{2,x} \\ \delta_{1}T_{1,x} \\ \delta_{2}T_{2,x} \end{bmatrix}\\ &=M_{b}u \end{flalign} \end{subequations} avec $F_{b}$, $M_{b} \in \mathbb{R}^{3x4}$, respectivement, les matrices d'entrée de force et de moment.\newline \\ On note que la deuxième ligne de la matrice de force est nulle, donc il n'est pas possible de créer de forces sur l'axe $y$ avec les commandes présentes sur le drone. Aussi, aucune ligne n'est nulle dans la matrice de moment, ce qui permet de générer des moments sur tous les axes et donc d'orienter de drone. De plus, nous avons $\rank(F_{b}) = 2$ et $\rank(M_{b}) = 3$. \\ Pour la suite, nous utilisons le modèle suivant pour la commande en vol pseudo-stationnaire (hovering): \begin{align} \left\{ \begin{array}{l} \boldsymbol{\dot p} = \boldsymbol{v}\\ m\boldsymbol{\dot v} = R(q)F_{b}u - m\boldsymbol{g}\\ \boldsymbol{\dot q} = \frac{1}{2}\boldsymbol{q} \otimes \boldsymbol{\omega_{b}}\\ J \boldsymbol{\dot \omega_{b}} = M_{b}u - \skewsym{\boldsymbol{\omega_{b}}}J\boldsymbol{\omega_{b}} \end{array} \right. \end{align} \subsection{Modèle non-linéaire augmenté par la vitesse air} Nous allons augmenter le système simplifié précédent en y ajoutant les termes perturbatifs dépendants de $v_{b}$, $\delta_{1}$ et $\delta_{2}$. \begin{align} \left\{ \begin{array}{l} \boldsymbol{\dot p} = \boldsymbol{v}\\ m\boldsymbol{\dot v} = R(q)F_{b}u - m\boldsymbol{g} + R(q)F_{p}(v_{b},~u)\\ \boldsymbol{\dot q} = \frac{1}{2}\boldsymbol{q} \otimes \boldsymbol{\omega_{b}}\\ J \boldsymbol{\dot \omega_{b}} = M_{b}u - \skewsym{\boldsymbol{\omega_{b}}}J\boldsymbol{\omega_{b}} + M_{p}(v_{b},~u) \end{array} \right. \end{align} Nous pouvons définir: \begin{multline} F_{p}(v_{b},~u) = \frac{1}{4} \rho S \eta \Phi^{(fv)} \Big(\Delta_{f,1} + \Delta_{f,2} - 2I \Big) v_{b} \\ = \frac{1}{2} \rho S \eta \begin{bmatrix} -C_{d0}v_{b,x} \\ 0 \\ -(2\pi +C_{d0})v_{b,z}\end{bmatrix} + \frac{1}{4} \rho S \eta \xi_{f} \begin{bmatrix} C_{d0} v_{b,z} \\ 0 \\ -(2\pi +C_{d0}) v_{b,x}\end{bmatrix}(\delta_{1}+\delta_{2}) \end{multline} aussi: \begin{multline} M_{p}(v_{b},~u) = -\frac{1}{2} \rho S \eta B \Phi^{(mv)} v_{b} + \frac{1}{4} \rho S \eta \bigg[ \skewsym{a_{1}} \Phi^{(fv)} (\Delta_{m,1} -\Delta_{m,2}) + B \Phi^{(mv)} (\Delta_{m,1} +\Delta_{m,2}) \bigg] v_{b} \\ = \frac{1}{2} \rho S \eta \begin{bmatrix} 0 \\ \Delta_{r}(2\pi +C_{d0}) v_{b,z} \\ 0\end{bmatrix}+ \frac{1}{4} \rho S \eta \left( \begin{bmatrix} 0 \\ \Delta_{r}(2\pi +C_{d0})\xi_{m} v_{b,x} \\ 0\end{bmatrix}(\delta_{1}+\delta_{2})\right.\\\left. + \begin{bmatrix} a_{y}(2\pi +C_{d0})\xi_{f} v_{b,x} \\ 0 \\ a_{y}C_{d0}\xi_{f} v_{b,z} \end{bmatrix} (\delta_{1}-\delta_{2})\right) \end{multline} Pour cette nouvelle représentation, nous allons définir un nouveau vecteur de commande : \begin{align} u' = \begin{bmatrix}T1+T2 & T1-T2 & \delta_{1}+\delta_{2} & \delta_{1}-\delta_{2} \end{bmatrix} ^\top \end{align} Ainsi, on va pouvoir combiner $ F_{b}u + F_{p}(v_{b},~u) = F(u')$, ce qui nous donne : \begin{subequations} \label{eq:F} \begin{align}\label{eq:Fx} F_{x} = ( 1-\frac{S_{wet}}{4S_{p}} C_{d0})(T1+T2) - \frac{1}{2} \rho S \eta C_{d0}v_{b,x} + \frac{1}{4} \rho S \eta \xi_{f} C_{d0}v_{b,z} (\delta_{1}+\delta_{2}) \end{align} \begin{align} F_{y} = 0 \end{align} \begin{multline} F_{z} = -\frac{S_{wet}}{8S_{p}}(2\pi + C_{d0})\xi_{f}\left[ (\delta_{1}+\delta_{2})(T1+T2) + (\delta_{1}-\delta_{2})(T1-T2) \right] - \frac{1}{2} \rho S \eta (2\pi +C_{d0})v_{b,z}\\- \frac{1}{4} \rho S \eta \xi_{f} (2\pi +C_{d0}) v_{b,x}(\delta_{1}+\delta_{2}) \end{multline} \end{subequations} et combiner $M_{b}u + M_{p}(v_{b},~u) = M(u')$, ce qui nous donne : \begin{subequations} \label{eq:M} \begin{multline} M_{x} = \left(\frac{k_{m}}{k_{f}} + \frac{S_{wet}}{8S_{p}} a_{y}( 2\pi + C_{d0})\xi_{f} (\delta_{1}+\delta_{2}) \right)(T1-T2)+ \bigg(\frac{S_{wet}}{8S_{p}}a_{y}( 2\pi + C_{d0})\xi_{f} (T1+T2)\\ + \frac{1}{4} \rho S \eta a_{y}(2\pi +C_{d0})\xi_{f} v_{b,x} \bigg)(\delta_{1}-\delta_{2}) \end{multline} \begin{multline} M_{y} = \left(\frac{S_{wet}}{8S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m}(T1-T2) + \frac{1}{4} \rho S \eta \Delta_{r}(2\pi +C_{d0})\xi_{m} v_{b,x} \right)(\delta_{1}+\delta_{2})\\ + \frac{S_{wet}}{8S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m}(T1+T2)(\delta_{1}-\delta_{2}) + \frac{1}{2} \rho S \eta \Delta_{r}(2\pi +C_{d0}) v_{b,z} \end{multline} \begin{align} M_{z} = \left((p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0}) \right)(T1-T2) + \frac{1}{4} \rho S \eta a_{y}C_{d0}\xi_{f} v_{b,z} (\delta_{1}-\delta_{2}) \end{align} \end{subequations} Nous utiliserons cette modélisation pour effectuer la commande en vol horizontal du drone. \clearpage\null\newpage \chapter{Commande hovering}\label{chap:hover} Dans cette section, nous allons développer des lois de commande conçues pour stabiliser le drone à la verticale. La convergence amènera le drone à s'orienter de manière à annuler la somme du poids du drone et de la traction générée par les hélices. \section{Étude du modèle linéarisé} La première étude porte sur la linéarisation du modèle sur un point d'équilibre. Considérons comme modèle non-linéaire : \begin{align}\label{eq:dyna} \left\{ \begin{array}{l} \boldsymbol{\dot p} = \boldsymbol{v}\\ m\boldsymbol{\dot v} = R(q)F_{b}u - m\boldsymbol{g}\\ \boldsymbol{\dot q} = \frac{1}{2}\boldsymbol{q} \otimes \boldsymbol{\omega_{b}}\\ J \boldsymbol{\dot \omega_{b}} = M_{b}u - \skewsym{\boldsymbol{\omega_{b}}}J\boldsymbol{\omega_{b}} \end{array} \right. \end{align} avec comme vecteur d'état $x = \begin{bmatrix} \boldsymbol{p} & \boldsymbol{v} & \boldsymbol{q} & \boldsymbol{\omega_{b}} \end{bmatrix}^\top$.\\ \subsection{Caractérisation du point d'équilibre} \noindent Pour définir le point d'équilibre, on commence par annuler toutes les dérivées.\\ La première égalité de (\ref{eq:dyna}) nous donne: \begin{align} \boldsymbol{\dot p} = \boldsymbol{v} = 0 \implies \boldsymbol{v} = 0 \end{align} La troisième égalité de (\ref{eq:dyna}) nous donne: \begin{align} \boldsymbol{\dot q} = \frac{1}{2}\boldsymbol{q} \otimes \boldsymbol{\omega_{b}} = 0 \implies \boldsymbol{\omega_{b}} = 0 \end{align} Cette implication s'explique par le fait que la norme du quaternion est 1 donc il ne s'annule jamais. On en déduit donc que $\overline{\boldsymbol{\omega_{b}}} = 0$.\\ À partir de l'égalité précédente, \begin{align} J \boldsymbol{\dot \omega_{b}} = M_{b}\overline{u} - \skewsym{\boldsymbol{\omega_{b}}}J\boldsymbol{\omega_{b}} = 0 \implies M_{b}\overline{u} = 0 \end{align} Ainsi, on sait que l'équilibre est atteint quand $\overline{u} \in \ker M_{b}$.\\ La base générant le noyau de $M_{b}$ est de la forme $[1~1~0~0]^\top$ et, par conséquent, $\overline{u} = \lambda [1~1~0~0]^\top ,\text{ avec } \lambda \in \mathds{R}_{+}^{*}$. \\ La seconde égalité de (\ref{eq:dyna}) nous donne: \begin{align} m\boldsymbol{\dot v} = R(q)F_{b}\overline{u} - m\boldsymbol{g} = 0 \implies R(q)F_{b}\overline{u} = m\boldsymbol{g} \end{align} On définit: \begin{align} \begin{pmatrix}T\\0\\0\end{pmatrix} = F_{b}u = F_{b}\lambda \begin{pmatrix}1\\1\\0\\0\end{pmatrix} \end{align} L'objectif étant de déterminer l'orientation à l'équilibre, nous devons déterminer le quaternion solution de: \begin{align} R(q) \begin{pmatrix}T\\0\\0\end{pmatrix} + \begin{pmatrix}0\\0\\ mg\end{pmatrix} = \begin{pmatrix}0\\0\\ 0\end{pmatrix} \end{align} Cela correspond à l'ensemble de rotation projetant l'axe $e_{1}$ vers l'axe $e_{3}$.\\ Il est possible d'exprimer l'ensemble de la matrice de rotation en fonction des éléments du quaternion ainsi: \begin{align} \begin{pmatrix} \eta^{2} + \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2} & 2\epsilon_{1} \epsilon_{2} - 2\eta\epsilon_{3} & 2\eta \epsilon_{2} + 2\epsilon_{1}\epsilon_{3}\\ 2\eta \epsilon_{3} + 2\epsilon_{1}\epsilon_{2} & \eta^{2} - \epsilon_{1}^{2} + \epsilon_{2}^{2} - \epsilon_{3}^{2} & 2\epsilon_{2} \epsilon_{3} - 2\eta\epsilon_{1} \\ 2\epsilon_{1} \epsilon_{3} - 2\eta\epsilon_{2} & 2\eta\epsilon_{1} + 2\epsilon_{2} \epsilon_{3} &\eta^{2} - \epsilon_{1}^{2} - \epsilon_{2}^{2} + \epsilon_{3}^{2} \end{pmatrix}\begin{pmatrix}T\\0\\0\end{pmatrix} = \begin{pmatrix}0\\0\\ mg\end{pmatrix} \end{align} En observant attentivement l'égalité ci-dessus, on observe que la matrice multiplie un vecteur dont seule sa première composante est non nulle. De ce fait, uniquement la première colonne de la matrice de rotation est multipliée à un terme différent de zéro. Ainsi, on peut simplifier l'équation matricielle précédente en un système de trois équations scalaires: \begin{align} \left\{ \begin{array}{l} (\eta^{2} + \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}) T = 0\\ (2\eta \epsilon_{3} + 2\epsilon_{1}\epsilon_{2}) T = 0\\ ( 2\epsilon_{1} \epsilon_{3} - 2\eta\epsilon_{2})T = mg \end{array} \right. \implies \left\{ \begin{array}{l} \eta^{2} + \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2} = 0\\ 2\eta \epsilon_{3} + 2\epsilon_{1}\epsilon_{2} = 0\\ ( 2\epsilon_{1} \epsilon_{3} - 2\eta\epsilon_{2})T = mg \end{array} \right. \end{align} Une solution évidente de ce système est $\eta =\epsilon_{2} = \frac{1}{\sqrt{2}} \text{ et } \epsilon_{1} = \epsilon_{3} = 0$. Le quaternion associé est $\overline{q}= [\frac{1}{\sqrt{2}}~0~\frac{1}{\sqrt{2}}~0]^\top$. (Il serait cependant possible de déterminer l'ensemble des orientations du drone qui satisferait l'égalité. En pratique, il existe une multitude de quaternions solutions de cette égalité car il est possible de stabiliser le drone à la verticale avec n'importe quelle rotation, selon son axe longitudinal). \newline \\ On peut déterminer la valeur de $\lambda$ permettant d'obtenir cet équilibre: \begin{align} ( 2\epsilon_{1} \epsilon_{3} + 2\eta\epsilon_{2})T = mg \implies 2\eta\epsilon_{2}T = mg \implies T = \frac{mg}{2\eta\epsilon_{2}} = mg \end{align} \begin{align} \lambda = \frac{mg}{( 1-\frac{S_{wet}}{4S_{p}} C_{d0})} \end{align} On observe que l'on applique un effort supérieur au poids du drone pour s'opposer aux pertes aérodynamiques.\\ On obtient ainsi un point d'équilibre pour notre système qui est défini par: \begin{align} \left\{ \begin{array}{l} \boldsymbol{\overline{p}}= \boldsymbol{p_{e}}, \text{ avec } p_{e} \in \mathds{R}^{3} \\ \boldsymbol{\overline{v}} = 0\\ \boldsymbol{\overline{q}} = [\frac{1}{\sqrt{2}}~0~\frac{1}{\sqrt{2}}~0]^\top\\ \boldsymbol{\overline{\omega_{b}}} = 0\\ \boldsymbol{\overline{u}} = \lambda [1~1~0~0]^\top = \frac{mg}{( 1-\frac{S_{wet}}{4S_{p}} C_{d0})} [1~1~0~0]^\top \end{array} \right. \end{align} \subsection{Linéarisation sur un point d'équilibre} On linéarise autour de la position d'équilibre ci-dessus ; on définit chaque variable comme la somme de la position d'équilibre et une déviation (variable avec une tilde) : $p = \overline{p} + \tilde{p}$.\\ La linéarisation d'un quaternion nécessite une attention particulière. Nous nous sommes inspirés de \cite[Proof Lemma 1]{tregouet:hal-01760720} pour la réaliser. Effectivement, nous avons $\boldsymbol{q} = \left [ \eta ~ \epsilon^\top \right]^\top$, mais lors de la linéarisation, il est nécessaire de remplacer $\eta$ par sa valeur "contrainte", en raison de la norme unitaire du quaternion. Ainsi, $\eta = (1- \epsilon^\top \epsilon)^\frac{1}{2} = \sqrt{1 - \epsilon_{1}^2- \epsilon_{2}^2- \epsilon_{3}^2}$. L'équation du mouvement linéarisée a pour vecteur d'état $x = \begin{bmatrix} \boldsymbol{\tilde{p}} & \boldsymbol{\tilde{v}} & \boldsymbol{\tilde{\epsilon}} & \boldsymbol{\tilde{\omega_{b}}} \end{bmatrix}^\top$. \begin{align} \boldsymbol{\dot x} = A \boldsymbol{x} + B \boldsymbol{u} \end{align} avec : \begin{align} A_{ij} &= \frac{\partial f_{i}}{\partial x_{j}} \text{ et } B_{ij} = \frac{\partial f_{i}}{\partial u_{j}} \end{align} Le point de départ est l'équation de dynamique suivante: \begin{align} f = \begin{pmatrix} v\\ \boldsymbol{g} + \frac{1}{m}R(q)F_{b}u\\ \frac{1}{2}q \otimes \omega_{b} \\ J^{-1}M_{b}u-J^{-1}\skewsym{\omega_{b}}J\omega_{b} \end{pmatrix} \end{align} Nous allons effectuer un développement en série de Taylor, que l'on arrête au premier ordre de chaque équation. La première équation ne dépend que de la vitesse du drone. Ainsi, la dérivée sera nulle sauf par rapport à la vitesse et le résultat sera égal à l'identité. La seconde équation dépend de l'orientation du drone. Pour calculer la dérivé par rapport à $\epsilon$, nous avons besoin de $F_{b}u$. \nomenclature{Série de Taylor}{Série de termes qui coïncide avec la fonction au voisinage d'un point.} \begin{subequations} \begin{align} F_{b}u &= \begin{bmatrix} ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) & ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & -(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f}) & -(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f}) \end{bmatrix} \begin{bmatrix}T_{1,x} \\ T_{2,x} \\ \delta_{1}T_{1,x} \\ \delta_{2}T_{2,x} \end{bmatrix}\\ &=\begin{bmatrix} ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) (T_{1,x} +T_{2,x})\\ 0 \\ -(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f})(\delta_{1}T_{1,x} + \delta_{2}T_{2,x}) \end{bmatrix} \end{align} \end{subequations} Plaçons nous à $\overline{u} = \frac{mg}{2( 1-\frac{S_{wet}}{4S_{p}} C_{d0})} [1~1~0~0]^\top$, ainsi: \begin{subequations} \begin{align} \frac{1}{m}F_{b}u &= \frac{1}{m}\begin{bmatrix} ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) (T_{1,x} +T_{2,x})\\ 0 \\ -(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f})(\delta_{1}T_{1,x} + \delta_{2}T_{2,x}) \end{bmatrix} \\ &= \begin{bmatrix} g\\ 0 \\ 0 \end{bmatrix} \end{align} \end{subequations} À partir de ce calcul, nous avons: \begin{subequations} \begin{align} \frac{\partial\frac{1}{m}R(q)F_{b}u}{\partial \epsilon} &= \begin{bmatrix} 0 & -4\epsilon_{2}g & 0\\ 2\epsilon_{2}g & 0 & 2\sqrt{1 - \epsilon_{2}^{2}}g \\ 0 & (2\sqrt{1 - \epsilon_{2}^{2}} - \frac{2\epsilon_{2}^{2}}{\sqrt{1 - \epsilon_{2}^{2}}})g & 0 \end{bmatrix}\\ &= \begin{bmatrix} 0 & 2\sqrt{2}g & 0\\ -\sqrt{2}g & 0 & \sqrt{2}g \\ 0 & -\sqrt{2}g & 0 \end{bmatrix}\\ &=A_{\dot v ,\epsilon} \end{align} \end{subequations} \iffalse \begin{align} R(q) &= \begin{pmatrix} 1 - 2\epsilon_{2}^{2} - 2\epsilon_{3}^{2} & 2\epsilon_{1} \epsilon_{2} - 2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}\epsilon_{3} & 2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}} \epsilon_{2} + 2\epsilon_{1}\epsilon_{3}\\ 2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}} \epsilon_{3} + 2\epsilon_{1}\epsilon_{2} & 1 - 2\epsilon_{1}^{2} - 2\epsilon_{3}^{2} & 2\epsilon_{2} \epsilon_{3} - 2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}\epsilon_{1} \\ 2\epsilon_{1} \epsilon_{3} - 2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}\epsilon_{2} & 2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}\epsilon_{1} + 2\epsilon_{2} \epsilon_{3} & 1 - 2\epsilon_{1}^{2} - 2\epsilon_{2}^{2} \end{pmatrix}\\ &=\begin{pmatrix} 1 - 2\epsilon_{2}^{2} & 0 & 2\sqrt{1 - \epsilon_{2}^{2}} \epsilon_{2} \\ 0 & 0 & 0 \\ -2\sqrt{1 - \epsilon_{2}^{2}}\epsilon_{2} & 0 & 1 - 2\epsilon_{2}^{2} \end{pmatrix} = \begin{pmatrix} 0 & 0 & -1\\ 0 & 0 & 0 \\ 1 & 0 & 0 \end{pmatrix} \end{align} \begin{align} R(q)F_{b}u &=\begin{pmatrix} 0 & 0 & -1\\ 0 & 0 & 0 \\ 1 & 0 & 0 \end{pmatrix}\begin{bmatrix} ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) (T_{1,x} +T_{2,x})\\ 0 \\ -(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f})(\delta_{1}T_{1,x} + \delta_{2}T_{2,x}) \end{bmatrix} \\ &= \begin{bmatrix}(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f})(\delta_{1}T_{1,x} + \delta_{2}T_{2,x}) \\ 0 \\ ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) (T_{1,x} +T_{2,x}) \end{bmatrix} \end{align} \fi La troisième équation dépend de l'orientation et de la vitesse angulaire. Commençons par expliciter l'expression de cette équation. \begin{align} \dot q =\frac{1}{2}\begin{bmatrix} -\epsilon_{1}\omega_{1} -\epsilon_{2}\omega_{2} -\epsilon_{3}\omega_{3}\\ \eta -\epsilon_{3}\omega_{2} +\epsilon_{2}\omega_{3} \\ \epsilon_{3}\omega_{1} + \eta - \epsilon_{1}\omega_{3} \\ -\epsilon_{2}\omega_{1} + \epsilon_{1}\omega_{2} + \eta \end{bmatrix} = \frac{1}{2}\begin{bmatrix} -\epsilon_{1}\omega_{1} -\epsilon_{2}\omega_{2} -\epsilon_{3}\omega_{3}\\ \sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}} -\epsilon_{3}\omega_{2} +\epsilon_{2}\omega_{3} \\ \epsilon_{3}\omega_{1} + \sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}} - \epsilon_{1}\omega_{3} \\ -\epsilon_{2}\omega_{1} + \epsilon_{1}\omega_{2} + \sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}} \end{bmatrix} \end{align} Seule la partie vectorielle nous intéresse pour la linéarisation. Ainsi, il est possible de calculer l'expression de la linéarisation de l'équation d'orientation, par rapport à la partie vectorielle du quaternion. \begin{align} \frac{\partial\dot q_{\epsilon}}{\partial \epsilon} &= \frac{1}{2}\begin{bmatrix} \frac{-2\epsilon_{1}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{1} & \omega_{3}-\frac{2\epsilon_{2}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{1} & -\omega_{2}- \frac{2\epsilon_{3}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{1}\\ -\omega_{3}-\frac{2\epsilon_{1}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{2} & \frac{-2\epsilon_{2}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{2} & \omega_{1}-\frac{2\epsilon_{3}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{2} \\ \omega_{2}-\frac{2\epsilon_{1}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{3} & -\omega_{1}-\frac{2\epsilon_{2}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{3} & \frac{-2\epsilon_{3}}{2\sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}}}\omega_{3} \end{bmatrix} = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0& 0 \\ 0 & 0 & 0 \end{bmatrix} \end{align} De la même manière, il est possible de décrire l'expression de la linéarisation de l'équation de rotation, par rapport à la vitesse angulaire. \begin{subequations} \begin{align} \frac{\partial\dot q_{\epsilon}}{\partial \omega} &= \frac{1}{2}\begin{bmatrix} \sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}} & -\epsilon_{3} & \epsilon_{2}\\ \epsilon_{3} & \sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}} & -\epsilon_{1} \\ -\epsilon_{2} & \epsilon_{1} & \sqrt{1 - \epsilon_{1}^{2} - \epsilon_{2}^{2} - \epsilon_{3}^{2}} \end{bmatrix} = \frac{1}{2}\begin{bmatrix} \frac{\sqrt{2}}{2} & 0 & -\frac{\sqrt{2}}{2} \\ 0 & \frac{\sqrt{2}}{2}& 0 \\ \frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} \end{bmatrix}\\ &=A_{\dot q ,\omega} \end{align} \end{subequations} La dernière équation ne dépend que de la vitesse angulaire mais le résultat de la linéarisation est nul. Ainsi, on obtient la matrice d'état suivante: \begin{subequations} \begin{align} A &=\begin{bmatrix} 0 & \mathds{1}_{3} & 0 & 0 \\ 0 & 0 & A_{\dot v ,\epsilon} & 0 \\ 0 & 0 & 0 & A_{\dot q ,\omega} \\ 0 & 0 & 0 & 0 \end{bmatrix}\\ &=\begin{bmatrix} 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 2\sqrt{2}g & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & -\sqrt{2}g & 0 & \sqrt{2}g & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & -\sqrt{2}g & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{\sqrt{2}}{4} & 0 & -\frac{\sqrt{2}}{4}\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{\sqrt{2}}{4} & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{\sqrt{2}}{4} & 0 & \frac{\sqrt{2}}{4}\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ \end{bmatrix} \end{align} \end{subequations} Pour déterminer la matrice de commande, nous allons calculer la matrice jacobienne de l'équation de dynamique, par rapport à la commande exprimée au point d'équilibre. \ \\ \noindent La première et la troisième équation ne font pas apparaître de terme de commande; ainsi les dérivées partielles seront nulles.\\ La dérivée partielle de la seconde équation nous donne: \begin{align} \frac{\partial\frac{1}{m}R(q)F_{b}u}{\partial u} &= \frac{1}{m}\begin{bmatrix} 0 & 0 & (\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f}) & (\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f})\\ 0 & 0 & 0 & 0 \\ ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) & ( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) & 0 & 0 \end{bmatrix} \end{align} On observe que seul le terme $J^{-1}M_{b}u$ de la quatrième équation dépend de la commande. Pour déterminer la dérivée partielle, nous allons commencer par calculer l'expression de ce terme. \begin{subequations} \begin{align} &J^{-1}M_{b}u =\begin{bmatrix} \frac{1}{J_{1}}(\frac{k_{m} }{k_{f}}(T_{1,x}-T_{2,x}) + a_{y}( 2\pi + C_{d0})\xi_{m}(\delta_{1}T_{1,x}- \delta_{2}T_{2,x}))\\ \frac{1}{J_{2}}\frac{S_{wet}}{4S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m}(\delta_{1}T_{1,x}+ \delta_{2}T_{2,x})\\ \frac{1}{J_{3}}(p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0})(T_{1,x}-T_{2,x}) \end{bmatrix} \end{align} \end{subequations} Il est maintenant possible d'obtenir la dérivée partielle par rapport à la commande de la dernière équation. \begin{align} \frac{\partial \dot \omega}{\partial u} &= \begin{bmatrix} \frac{1}{J_{1}}(\frac{k_{m}}{k_{f}}) & -\frac{1}{J_{1}}(\frac{k_{m} }{k_{f}}) & \frac{1}{J_{1}} a_{y}( 2\pi + C_{d0})\xi_{m} & -\frac{1}{J_{1}} a_{y}( 2\pi + C_{d0})\xi_{m} \\ 0 & 0 & \frac{1}{J_{2}}\frac{S_{wet}}{4S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m} & \frac{1}{J_{2}}\frac{S_{wet}}{4S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m} \\ \frac{1}{J_{3}}(p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0}) & -\frac{1}{J_{3}}(p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0}) & 0 & 0 \end{bmatrix} \end{align} \begin{align} B &=\begin{bmatrix} 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & \frac{1}{m}(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f}) & \frac{1}{m}(\frac{S_{wet}}{4S_{p}}(2\pi + C_{d0})\xi_{f})\\ 0 & 0 & 0 & 0\\ \frac{1}{m}( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) & \frac{1}{m}( 1-\frac{S_{wet}}{4S_{p}} C_{d0}) & 0 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\ \frac{1}{J_{1}}(\frac{k_{m} }{k_{f}}) & -\frac{1}{J_{1}}(\frac{k_{m} }{k_{f}}) & \frac{1}{J_{1}} a_{y}( 2\pi + C_{d0})\xi_{m} & -\frac{1}{J_{1}} a_{y}( 2\pi + C_{d0})\xi_{m}\\ 0 & 0 & \frac{1}{J_{2}}\frac{S_{wet}}{4S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m} & \frac{1}{J_{2}}\frac{S_{wet}}{4S_{p}} \Delta_{r}( 2\pi + C_{d0})\xi_{m}\\ \frac{1}{J_{3}}(p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0}) & -\frac{1}{J_{3}}(p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0}) & 0 & 0\\ \end{bmatrix} \end{align} On observe que l'on obtient une dynamique linéarisée contrôlable. \subsection{Commande par retour d'état LQR}\label{control_lin} À partir de la modélisation linéarisée précédente, nous pouvons déterminer un retour d'état. Nous avons choisi de déterminer les gains du retour d'état avec un calcul de type LQR, l'objectif étant de minimiser une fonction de coût quadratique : \begin{align} J(u) = \int_{0}^{\infty} (x^\top Q x + u^\top R u + 2x^\top N u) \,dt \end{align} avec $Q = \mathbb{1}_{12x12}$, $R = \mathbb{1}_{4x4}$ et $N = \mathbb{0}_{12x4}$. \newline \\ La matrice calculée par la fonction implémentée dans Matlab nous donne: \begin{align} \begin{bmatrix} 0.08&-0.71&0.70&0.14&-1.04&0.92&0.00&5.75&-1.29&-5.69&0.05&0.00&-0.81\\ 0.08&0.71&0.70&0.14&1.04&0.92&0.00&-5.75&-1.29&5.69&-0.05&0.00&0.81\\ -0.70&-0.05&0.08&-1.13&-0.07&0.09&0.00&-0.11&-15.32&-0.88&-0.71&-1.41&-0.06\\ -0.70&0.05&0.08&-1.13&0.07&0.09&0.00&0.11&-15.32&0.88&0.71&-1.41&0.06\\\end{bmatrix} \end{align} \indent On observe que cette matrice est de dimension 4 par 13. La septième colonne (composée de zéros) s'explique par le fait que la première composante du quaternion n'est pas contrôlée car c'est une variable fixée par la partie vectorielle du quaternion.\\ \newpage \indent Il est possible de faire évoluer cette commande vers une commande LQR, avec intégrateur. Ainsi, seraient annulées toutes les erreurs statiques qui proviendraient d'une perturbation telle qu'un vent constant face au drone. Cependant, l'ajout d'un intégrateur peut déstabiliser la dynamique de l'aéronef. Cette proposition a été élaborée sur la base d'un projet de commande réalisé à l'ENAC, où ce mécanisme avait été utilisé. \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{images/LQI.png} \caption{Schéma représentant le fonctionnement d'un contrôle LQR avec intégrateur.} \label{fig:lqi} \end{figure}\\ On cherche à stabiliser une position donc on sélectionne uniquement les trois premières composantes du vecteur d'état pour les intégrer. \newline \\ On définit le retour d'état comme : \begin{align} u = -K \begin{bmatrix} x\\ x_{i} \end{bmatrix} \end{align} avec $x = \begin{bmatrix} \boldsymbol{p} & \boldsymbol{v} & \boldsymbol{q} & \boldsymbol{\omega_{b}} \end{bmatrix}^\top$ et $x_{i} = \int_{ }^{ } (\boldsymbol{p_{e}} - \boldsymbol{p})^\top \, \mathrm{d}t $. \subsection{Simulation} La position cible est le point d'origine $p=[0,~0,~0]^\top$, maintenu malgré un vent contant de \SI{5}{\meter\per\second}, débutant à dix secondes, face au drone. \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{images/position_LQI.png} \caption{Position du drone avec un contrôleur LQR et un intégrateur.} \label{fig:pos_lqi} \end{figure} \newpage On observe que le drone s'oriente dans le lit du vent, de manière à minimiser son impact et surtout à utiliser le vent pour générer de la portance, comme observé sur l'axe de tangage dans la figure \ref{fig:orient_lqi} \begin{figure}[h] \centering \includegraphics[width=0.69\textwidth]{images/orientation_LQI.png} \caption{Angles d'orientation du drone avec le contrôleur LQR et un intégrateur.} \label{fig:orient_lqi} \end{figure}\\ \indent Dès lors, on observe une diminution de la vitesse de rotation des moteurs dans la figure \ref{fig:cmd_lqi} et donc une consommation électrique plus faible. On en déduit l'importance d'orienter le drone en présence de vent. De plus, les élevons maintiennent une déflexion constante : cela créé un couple qui stabilise le drone à une incidence de -60°. \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/commande_LQI.png} \caption{Commande générée par le contrôleur LQR et un intégrateur.} \label{fig:cmd_lqi} \end{figure}\\ \newpage \subsection{Stabilité de la linéarisation}\label{stab_lin} L'intérêt d'une linéarisation a été discuté précédemment mais l'information importante est son domaine de stabilité. On le définit par l'ensemble des points initiaux pour lesquels le système converge vers l'équilibre. Dans notre cas, on cherche à déterminer le sous-espace rouge de la figure \ref{fig:stab}, qui représente l'ensemble de convergence basé sur la fonction de Luyapunov. L'intégralité du domaine noir est définie par la propriété $\dot V(x) < 0 $. L'ensemble bleu est la plus grande boule incluse dans l'ensemble rouge qui vérifie la propriété de convergence. Cette condition est extrêmement restrictive et complexe à obtenir mathématiquement puisque sa démonstration repose sur la majoration des erreurs quadratiques. Nous avons fait le choix, au vu du temps disponible, d'obtenir la borne supérieure de la fonction de Lyapunov, par simulation. Cette méthode empirique repose sur un échantillonage de trajectoires, leur simulation et l'analyse de convergence. On peut effectuer cette analyse grâce à la monotonie de la décroissance de la fonction de Lyapunov, prouvant ainsi la convergence.\\ \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{images/stabilite_linearisation.png} \caption{Schéma représentant la stabilité d'une linéarisation autour d'un point d'équilibre.} \label{fig:stab} \end{figure}\\ L'intégralité des contrôleurs proposés dans ce mémoire repose sur cette analyse. De ce fait, on effectue le passage hybride sur le critère de validité de la linéarisation pour s'assurer d'être, dans toutes les situations de vol, piloté par un contrôleur qui assure la convergence. \section{Commande non-linéaire basée sur la commande \textit{zero-moment}}\label{cmd_zero_moment} La commande proposée dans \citetitle{2020e-MicCenZacFra} \cite{2020e-MicCenZacFra} est une commande hiérarchique non-linéaire, basée sur la possibilité de générer, indépendamment, un effort longitudinal au drone et des moments dans les trois directions. Pour utiliser cette loi de commande dans le contrôle de DarkO, nous avons commencé par l'implémenter telle qu'elle est décrite dans l'article \cite{2020e-MicCenZacFra} pour commander un modèle de drone de type quadricoptère. Lors de cette implémentation, nous nous sommes rendus compte que les équations proposées dans le papier étaient incorrectes et ne permettaient pas de stabiliser la position du drone. Un travail important a été fourni pour calculer l'intégralité de la commande et ainsi obtenir les équations de commande. Se trouve dans l'annexe \ref{sec.appendix_mic} une synthèse des équations corrigées de l'article. Dès que les équations ont été obtenues, une simulation a été menée de manière à s'assurer de la qualité des formules. Celle-ci a été suivie d'une implémentation, avec comme système dynamique, un modèle de DarkO. \newpage \begin{figure}[h] \centering \includegraphics[width=1\textwidth]{images/diagramme_michieletto.png} \caption{Diagramme représentant la stratégie de contrôle \cite[Fig.1]{2020e-MicCenZacFra}.} \label{fig:diagram_miche} \end{figure} \noindent La première équation qui entre en jeu est la stabilisation en fonction de l'erreur de position et de l'erreur de vitesse : \begin{align} \label{eq:stab_ep_ev} f_{r} = m\boldsymbol{g} - k_{pp} \boldsymbol{e_{p}} - k_{pd}\boldsymbol{e_{v}} \end{align} avec $\boldsymbol{e_{p}} = \boldsymbol{p} - \boldsymbol{p_{r}} $ et $\boldsymbol{e_{v}} = \boldsymbol{v}$. \newline \\ L'équation de distribution est définie par: \begin{align} \boldsymbol{u} = M_{b}^{\#}\boldsymbol{\tau_{r}} + \boldsymbol{\overline{u}}f \end{align} avec $\tau_{r}$ et $f$, respectivement, le couple et la force nécessaires pour orienter et stabiliser le drone. $\overline{u}$ est défini dans l'équation \ref{eq:u_barre}. \paragraph{} L'hypothèse de génération de force sans moment n'est pas exactement vérifiée dans notre cas mais plusieurs articles utilisent cette même approximation \cite{hamel_minhduc}. Le point important de cette commande est l'inversion du modèle. Il est nécessaire d'inverser la matrice des coefficients des moments pour obtenir la commande à appliquer sur les actionneurs, de manière à avoir les moments souhaités. Dans notre cas, nous utilisons la pseudo-inverse de \ref{eq:moment_matrice}. \nomenclature{$M_{b}^{\#}$}{Pseudo inverse de $M_{b}$ \nomunit{}.} \nomenclature{$\Gamma_{c}$}{Moment généré par la loi de commande \nomunit{}.} \begin{subequations} \begin{align} \begin{bmatrix}T_{1,x} \\ T_{2,x} \\ \delta_{1}T_{1,x} \\ \delta_{2}T_{2,x} \end{bmatrix} &= M_{b}^{\#} \Gamma_{c}\\ &=\begin{bmatrix} 0&0&-3.23\\ 0&0&3.23\\ -4.51&-27.75&-1.49\\ 4.51&-27.75&1.49\\ \end{bmatrix}\begin{bmatrix}\Gamma_{x} \\ \Gamma_{y} \\ \Gamma_{z} \end{bmatrix} \end{align} \end{subequations} Trois constats s'imposent. En effet, on observe que pour générer du moment, selon l'axe z, on utilise majoritairement le différentiel de poussée ; que le moment en y sera généré par une utilisation symétrique des ailerons avec une grande efficacité, et que le moment selon l'axe x provient d'une utilisation différentielle des ailerons. \paragraph{} Le fonctionnement de cette loi de commande repose sur sa capacité à générer une force qui vienne s'opposer à la gravité, sans avoir de moment. L'étude attentive de \ref{eq:force_matrice} et de \ref{eq:moment_matrice} nous permet d'extraire l'espace du vecteur de commande, validant l'exigence précédemment exposée. On décide de normaliser ce vecteur, pour simplifier la commande. On observe qu'aucun moment n'est obtenu dès lors que l'on maintient les ailerons au neutre et que l'on utilise les vitesses de rotation des hélices de manière symétrique. Cette configuration génère ainsi une force dirigée selon l'axe x. L'espace du vecteur de commande est donc de la forme : \begin{align} \label{eq:u_barre} \overline{}{u} = \kappa* \begin{bmatrix}1 \\ 1 \\ 0 \\ 0 \end{bmatrix} \end{align} avec $\kappa = \lVert F_{b}*[1,1,0,0]^\top \rVert$ un gain permettant de normaliser le vecteur. \subsection{Saturation de la commande} La problématique principale de cette commande est la fonction de stabilisation de l'erreur de position et de vitesse présentée dans l'équation \ref{eq:stab_ep_ev}. Effectivement, cette fonction est linéaire donc lors de grandes consignes de déplacement, la loi de commande sature les actionneurs, ce qui empêche le trajet. Lors du stage, nous avons étudié deux manières de résoudre ce problème.\\ \indent La première est extraite de la théorie \textit{reférence governor}, qui s'appuie sur une saturation entre les couches de hauts niveaux et les couches de bas niveaux du contrôleur. Dans notre cas, nous saturons $f_r$ avec comme limite la capacité du drone à générer de la force, une fois la gravité compensée. On utilisera la forme du contrôleur stabilisant quasi temps-optimal proposée dans l'article \cite{journals/csysl/InvernizziLZ20} : \begin{align} \gamma(e_p, e_v) = -\sigma_{M_{i}}\left(k_p \left( e_p + e_v\mu\left(\frac{\lVert e_v \rVert}{2M_i}, \frac{k_v}{k_p}\right)\right)\right) \end{align} avec $\mu$ une fonction continue approximant le maximum de deux nombres positifs et $\sigma_{M_{i}}$ une fonction de saturation continue et différentiable. \paragraph{} Un choix courant est la fonction \textit{arctan(x)} mais il existe d'autres types de fonctions sigmoïdes. Nous avons fait le choix d'utiliser la fonction de Gompertz : \begin{align} \sigma_{M_{i}}(x) = 2M_{i} e^{-e^{b-cx}}-M_{i} \end{align} avec $b = -\ln(\frac{1}{2})$ et $c = 1$. \newline \\ L'avantage de cette fonction est présenté dans le graphique suivant. En effet, elle s'approche plus de la fonction de saturation discontinue que la fonction \textit{arctan}. \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/compraison_saturation.png} \caption{Comparaison de deux fonctions sigmoïdes} \label{fig:sigmoide} \end{figure} La seconde est basée sur la théorie \textit{error governor}, c'est-à-dire que nous allons saturer l'erreur pour limiter sa croissance et ainsi rester dans le domaine de stabilité de la commande proportionnelle. Dans notre cas, on vient limiter la croissance de $e_p \text{ et } e_v$ (erreurs de position et de vitesse décrites dans l'équation \ref{eq:stab_ep_ev}) à une valeur de 1m et 1 m/s. Ces valeurs ont été trouvées empiriquement avec les simulations, mais permettent à la commande de rester conservative. \subsubsection{Rotation selon l'axe de roulis} Une fois le drone équilibré à la verticale, il maintient sa position. Cependant, il reste un degré de liberté : la rotation sur son axe de roulis, correspondant à une rotation autour de l'axe vertical du référentiel terrestre. Il est ainsi possible d'orienter le drone dans toutes les directions autour de cet axe. Cette capacité est très intéressante car elle permet de diriger le drone vers la cible, avant de passer en vol horizontal. La loi de commande hiérarchique permet ainsi d'ajouter, avec une priorité faible, la convergence de l'orientation du drone, vers un repère cible. La théorie est décrite dans la remarque 3, page 8 de \cite{2020e-MicCenZacFra}. Il est cependant nécessaire d'ajouter le terme de convergence d'orientation dans l'action du \textit{feedforward}. Ce terme est défini dans l'annexe \ref{sec.appendix_res_orient}. \subsection{Simulation}\label{sim_hover_nl} La position cible est le point $p=[5,~5,~5]^\top$, atteint et maintenu, comme on peut l'observer sur la figure \ref{fig:pos_hier}. \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{images/pos_hier.png} \caption{Position du drone avec une commande hiérarchique.} \label{fig:pos_hier} \end{figure}\\ Nous avons initialisé le drone à une orientation relativement éloignée de son équilibre pour prouver la convergence de la commande ; les angles sont initialisés à roulis égal à 10°, tangage égal à -45° et lacet égal à 25°. Cette orientation correspond à un quaternion initial $q=[0.90,~0.19,~0.36,~0.15]^\top$. Toutefois, on observe sur la figure \ref{fig:orient_hier} que le drone s'aligne avec l'axe vertical, c'est-à-dire en vol pseudo-stationnaire. \newpage \begin{figure}[h] \centering \includegraphics[width=0.69\textwidth]{images/orient_hier.png} \caption{Angle d’orientation du drone avec une commande hiérarchique.} \label{fig:orient_hier} \end{figure} Le drone maintient une orientation très proche de la verticale, son point d'équilibre. Ainsi, il est maintenu en l'air par la traction des hélices, ce qui explique la vitesse de rotation élevée dans la figure \ref{fig:cmd_hier}. De plus, on peut aussi observer que nous touchons les saturations, au début, quand le drone cherche à converger vers sa position d'équilibre. \begin{figure}[h] \centering \includegraphics[width=0.95\textwidth]{images/cmd_hier.png} \caption{Commande générée par le contrôleur hiérarchique.} \label{fig:cmd_hier} \end{figure}\\ Les résultats de cette commande, avec la saturation, sont présentés sur la figure \ref{fig:position_switch_hovering}. Effectivement, sur cette dernière, on observera que le contrôleur est en mesure de stabiliser un vol pseudo-stationnaire avec une cible relativement éloignée, sans diverger. \chapter{Commande en vol} Lors d'un vol horizontal, l'avion se maintient dans les airs grâce à la portance de l'aile, portance générée par l'écoulement de l'air sur cette dernière. Ainsi, c'est la vitesse de l'avion qui permet de compenser la gravité. La traction générée par l'hélice permet d'accélérer le drone de manière à atteindre la vitesse de vol, mais aussi de s'opposer à la traînée induite par l'aile. \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/vue_force.png} \caption{Représentation des forces sur un drone} \label{fig:vue_force} \end{figure} \section{Commande sur modèle linéarisé} Nous allons décrire la méthode utilisée pour effectuer la linéarisation de la dynamique du drone à l'aide des fonctions Matlab. \\ La première action est d'obtenir le point de trim. Celui-ci est défini par l'ensemble des valeurs du vecteur d'état et du vecteur de commande qui annule l'ensemble des dérivées de la dynamique du drone. La linéarisation est effectuée pour une vitesse de $v = \SI{5}{\meter\per\second}$. \begin{align} u_{eq} = \begin{bmatrix} 2.18& 2.18& 0.92& 0.92 \end{bmatrix} \end{align} \begin{align} x_{eq} = \begin{bmatrix} 0& 0 & 0 & 5 & 0 & 0 & 0.85 & 0 & -0.52 & 0 & 0 & 0. & 0 & \end{bmatrix} \end{align} On observe dans le vecteur d'état que la vitesse, selon l'axe x, est fixée à la vitesse de trim et que le drone prend de l'incidence pour maintenir le vol horizontal. Effectivement, le quaternion est égal à $q_{eq} = \begin{bmatrix}0.85 & 0 & -0.52 & 0 \end{bmatrix}$, ce qui correspond à une rotation autour de l'axe y de 62.67 \textdegree. Pour la suite, on linéarise la dynamique de notre drone en prenant comme vecteur d'état : \begin{align} x = \left[p_{z},~ \boldsymbol{v},~ \boldsymbol{\epsilon},~ \boldsymbol{\omega}\right] \end{align} \begin{align} A = \begin{bmatrix} 0&0&0&1&0&0&0&0&0&0\\ 0&-2.56&0&1.58&0&53.84&0&0&0&0\\ 0&0&0&0&-16.76&0&10.20&-0.05&0&-0.12\\ 0&1.30&0&-0.83&0&-20.06&0&0&0&0\\ 0&0&0&0&-0&0&0&0.43&0&-0.26\\ 0&0&0&0&0&-0.27&0&0&0.43&0\\ 0&0&0&0&0&0&0&0.26&0&0.43\\ 0&0&0&0&0&0&0&-3.42&0&0.17\\ 0&4.77&0&-5.87&0&-90.65&0&0&-7.77&0\\ 0&0&0&0&0&0&0&-0.98&0&0.41\\ \end{bmatrix} \end{align} \begin{align} B = \begin{bmatrix} 0&0&0&0\\ 0.92&0.92&2.31&2.31\\ 0&0&0&0\\ 1.79&1.79&-1.21&-1.21\\ 0&0&0&0\\ 0&0&0&0\\ 0&0&0&0\\ 7.33&-7.33&-68.36&68.36\\ 0&0&-11.60&-11.60\\ -25.58&25.58&-0.18&0.18\\ \end{bmatrix} \end{align} Comme nous l'attendions, la linéarisation montre les mêmes caractéristiques que le modèle non-linéaire. Effectivement, on observe, dans la matrice de commande, que nous ne pouvons que commander l'accélération linéaire et angulaire du drone. \section{Commande non-linéaire} De la même manière que nous avons utilisé une commande hiérarchique pour contrôler le drone en hovering, il est possible de concevoir une commande permettant de maintenir un vol horizontal, à une vitesse fixée. \subsection{Commande de type "ligne de mire"} Nous nous somme inspirés de la commande proposée dans \cite{DBLP:conf/isie/AndersenK17}. Définissons d'abord le vecteur cible, avec $\boldsymbol{p_{c}}$ le vecteur représentant les coordonnées du point cible : \begin{align} \boldsymbol{u_c} = \frac{\boldsymbol{p_{c}} - \boldsymbol{p}}{\lVert \boldsymbol{p_{c}} - \boldsymbol{p}\rVert} = [v_{px}~v_{py}~v_{pz} ]^{\top} \end{align} On définit le vecteur unitaire portant la vitesse du drone. \begin{align} \boldsymbol{u_{v}} = \frac{\boldsymbol{v}}{\lVert \boldsymbol{v}\rVert} \end{align} L'objectif est de faire converger le vecteur vitesse vers le vecteur cible et ainsi diriger le drone vers le point $\boldsymbol{p_{c}}$. On peut caractériser la différence d'orientation comme une rotation portée par l'axe défini par le produit vectoriel des deux vecteurs $\boldsymbol{u_{e}} = \boldsymbol{u_c} \wedge \boldsymbol{u_{v}}$ et de valeur égale au produit scalaire $\cos{\theta} = \langle \boldsymbol{u_c} | \boldsymbol{u_{v}} \rangle $. On obtient ainsi le quaternion erreur suivant: \begin{align} q_{e} = \begin{bmatrix} \sqrt{\frac{1+ \langle \boldsymbol{u_c} | \boldsymbol{u_{v}} \rangle}{2}} ,~ \frac{ \boldsymbol{u_c} \wedge \boldsymbol{u_{v}}}{\lVert \boldsymbol{u_c} \wedge \boldsymbol{u_{v}}\rVert} \sqrt{\frac{1 \langle \boldsymbol{u_c} | \boldsymbol{u_{v}} \rangle}{2}} \end{bmatrix}^\top \end{align} Ce quaternion est valable tant que $\lVert \boldsymbol{u_c} \wedge \boldsymbol{u_{v}}\rVert \ne 0$. Si cette égalité est vérifiée, deux cas sont possible : soit les deux vecteurs sont alignés, ce qui correspond à $\langle \boldsymbol{u_c} | \boldsymbol{u_{v}} \rangle = 1$ et il n'est plus nécessaire d'effectuer une rotation donc $ q_{e} = [1,~0,~0,~0]^\top$, soit les deux vecteurs sont opposés, ce qui correspond à $\langle \boldsymbol{u_c} | \boldsymbol{u_{v}} \rangle = -1$ et il est nécessaire d'effectuer une rotation de 180°. \newline \\ \noindent On obtient le couple à appliquer sur le drone avec : \begin{align} \boldsymbol{\Gamma_{c}} = -k_{c} \sign(\eta_{e}) \boldsymbol{\epsilon_{e}} + \skewsym{\boldsymbol{\omega_{b}}}J\boldsymbol{\omega_{b}} - k_{d} \boldsymbol{\omega_{b}} \end{align} avec $q_{e} = [\eta_{e},~\epsilon_{e}]^\top$.\newline \\Nous avons choisi d'utiliser un retour discontinu, basé sur le $\sign(\eta_{e})$ pour assurer la convergence, même dans le cas où $\eta_{e} \to 0$. \subsection{Allocation des commandes} La problématique principale de toutes les lois de commande sur modèle non-linéaire est l'allocation des commandes, pour déterminer la quantité à appliquer sur les actionneurs, et ce dans le but d'obtenir l'effet désiré (génération de forces ou de moments). La commande hiérarchique proposée s'appuie sur un suivi de vitesse agissant sur les entrées virtuelles. On suppose que la vitesse de convergence de l'orientation du drone est plus rapide que le suivi de vitesse. Ainsi, on propose un contrôleur de type PID pour le suivi de la vitesse cible. \begin{align} (T1+T2) = k_{p}(v_{c} - v_{b,x}) + k_{i}\int_{}^{} v_{b,x} \,dt + k_{d}*\dot{v}_{b,x} \end{align} avec $k_{p}$, $k_{i}$ et $k_{d}$, respectivement, le gain proportionnel, intégral et dérivé, assurant le suivi de vitesse. De plus, nous avons $v_{c}$ la vitesse cible et $v_{b,x}$ la vitesse selon l'axe $x$ du drone et donc exprimée dans le repère du corps $\mathcal{B}$. \newline \\ Ainsi, comme nous avons fixé $T1+T2$, il nous reste les trois commandes $T1-T2$, $(\delta_{1}+\delta_{2})$ et $(\delta_{1}-\delta_{2})$ pour générer les moments nécessaires à l'orientation du drone. Ainsi, on définit $\bar{u} = \begin{bmatrix} T1-T2 & \delta_{1}+\delta_{2} & \delta_{1}-\delta_{2} \end{bmatrix} ^\top $ comme vecteur de commande pour l'orientation. Le modèle étant relativement complexe, nous allons utiliser un état interne au contrôleur, qui permettra la convergence des moments générés sur le drone vers les moments commandés. La dynamique interne est de la forme: \begin{align} \dot{\bar{u}} = - k_{u} \frac{\partial M}{\partial \bar{u}}^{-1} ( M(\bar{u}) - \Gamma_{c} ) \end{align} avec $M$ une fonction non-linéaire exprimant le lien entre les commandes et les moments générés sur le drone, définie en \ref{eq:M} et $\frac{\partial M}{\partial \bar{u}}$ une matrice 3x3 représentant la jacobienne de M par rapport à $\bar{u}$. \newline \\ On définit $C_{l} = ( 2\pi + C_{d0})$ : \begin{subequations} \begin{align} \frac{\partial M}{\partial \bar{u}} = \begin{bmatrix} \frac{k_{m}}{k_{f}} + \frac{S_{wet}}{8S_{p}} a_{y}C_{l}\xi_{f} (\delta_{1}+\delta_{2}) & \frac{S_{wet}}{8S_{p}} a_{y}C_{l}\xi_{f} (T1-T2)& \partial M_{1,3} \\ \frac{S_{wet}}{8S_{p}} \Delta_{r}C_{l}\xi_{m}(\delta_{1}+\delta_{2})& \partial M_{2,2} & \frac{S_{wet}}{8S_{p}} \Delta_{r}C_{l}\xi_{m}(T1+T2)\\ \left((p_{y}+\frac{S_{wet}}{4S_{p}} a_{y} C_{d0}) \right) & 0 & \frac{1}{4} \rho S \eta a_{y}C_{d0}\xi_{f} v_{b,z} \end{bmatrix} \end{align} avec : \begin{align} \partial M_{1,3}= \frac{S_{wet}}{8S_{p}}a_{y}( 2\pi + C_{d0})\xi_{f} (T1+T2) + \frac{1}{4} \rho S \eta a_{y}(2\pi +C_{d0})\xi_{f} v_{b,x} \end{align} \begin{align} \partial M_{2,2} = \frac{S_{wet}}{8S_{p}} \Delta_{r}C_{l}\xi_{m}(T1-T2) + \frac{1}{4} \rho S \eta \Delta_{r}(2\pi +C_{d0})\xi_{m} v_{b,x} \end{align} \end{subequations} \newpage Les simulations ont montré que notre système est mal conditionné. Cela veut dire qu'il est impossible de déterminer l'inverse de la matrice jacobienne. Cette condition est représentée par un \textit{condition number}, défini par $\kappa = \frac{\lVert \lambda_{max}\rVert}{\lVert \lambda_{min}\rVert}$. Il est admis, lors de l'utilisation d'une précision double flottant, qu'un \textit{condition number} supérieur à $10^{14}$ ne permet pas d'inverser efficacement une matrice \cite{pillow_2018}. Nous avons quand même obtenu des résultats lors d'un vol dans un plan vertical. Pour ce faire, nous avons utilisé une décomposition en valeurs singulières de la matrice, avant d'utiliser cette forme pour l'inverser. L'avantage de cela est la possibilité de contraindre les valeurs singulières pour obtenir un approximation de l'inverse. \subsection{Simulation}\label{sim_vol_nl} La dynamique présentée précédemment pour l'allocation des commandes a été implémentée pour un vol à la vitesse $V_{b,x} = \SI{20}{\meter\per\second}$, en direction du point $p=[1000,~0,~1000]^\top$, contenu dans un plan vertical, et ce pour s'affranchir du problème cité précédemment. On initialise le modèle à une vitesse, dans le repère inertiel $\mathcal{I}$, de $V = [10,~0,~0]^\top$ et à une orientation nulle, c'est-à-dire $q=[1,~0,~0,~0]^\top$. \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{images/pos_temp_vol_nl.png} \caption{Position du drone avec une commande non-linéaire de vol.} \label{fig:pos_vol_nl} \end{figure}\\ La figure \ref{fig:pos_vol_nl} indique une légère oscillation de la position. Ce problème devra être résolu pour envisager une implémentation. \newpage \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/pos_XY_vol_nl.png} \caption{Position, dans le plan, du drone avec une commande non-linéaire de vol.} \label{fig:pos_plan_vol_nl} \end{figure} On observe, sur la figure \ref{fig:pos_plan_vol_nl}, que le drone ne suit pas une trajectoire rectiligne : cela est dû au type de commande "ligne de mire". Effectivement, on n'a pas d'exigence, comme lors d'un suivi de trajectoire. Ce dernier impliquerait une définition d'une erreur de \textit{cross track} et une commande plus gourmande énergiquement. Notre commande permet uniquement d'atteindre un point d'intérêt. \begin{figure}[h] \centering \includegraphics[width=0.69\textwidth]{images/orien_vol_nl.png} \caption{Angle d’orientation du drone avec une commande non-linéaire de vol.} \label{fig:orient_vol_nl} \end{figure} La figure \ref{fig:orient_vol_nl} montre que l'on stabilise l'assiette du drone vers -54° alors que notre trajectoire décrit un angle avec l'axe horizontal de 45°. La différence entre les deux est l'angle d'incidence. Effectivement, la loi de commande fait converger l'orientation de la vitesse du drone vers le point cible. \newpage \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{images/cmd_vol_nl.png} \caption{Commande générée par la commande non-linéaire de vol.} \label{fig:cmd_vol_nl} \end{figure} Les commandes nécessaires à la convergence du drone vers le point cible sont exposées dans la figure \ref{fig:cmd_vol_nl}. Les moteurs stabilisent leur vitesse à $\lvert\omega \rvert = \SI{661}{\radian\per\second}$. Cette vitesse est relativement proche de celle obtenue dans la commande présentée dans \ref{cmd_zero_moment}. Les deux simulations \ref{sim_hover_nl} et \ref{sim_vol_nl} présentent les mêmes caractéristiques, en ce qu'elles proposent d'amener le drone vers un point formant un angle de 45° avec l'horizontal. Cependant, la commande non-linéaire basée sur la commande \textit{zero-moment} propose une convergence en cinq secondes pour effectuer un déplacement de 8.6 mètres, ce qui nous donne une vitesse air de \SI{1.72}{\meter\per\second}. Quant à la commande ci-dessus, nous arrivons à stabiliser une vitesse air de \SI{20}{\meter\per\second}. Ainsi, on observe l'avantage énergétique du vol horizontal par rapport au vol en pseudo-stationnaire. \chapter{Transitions} L'obtention des lois de commande précédentes permet d'utiliser la théorie hybride pour effectuer un passage d'une loi de commande à l'autre. \section{Vol en hovering, du non-linéaire au linéaire} Contrairement aux commandes non-linéaires, les commandes linéaires ont des outils et des méthodes d'optimisation basés sur divers critères, rendant possible l'optimisation des vitesses de convergence, tels que les LMIs. La problématique d'une commande linéarisée réside dans la validité du domaine. En effet, comme cette commande est basée sur une linéarisation du modèle en un point d'équilibre, dès que le drone s'éloigne trop de ce point, le modèle est invalide et la commande n'est plus stabilisante. L'idée est donc de passer d'une commande à l'autre, sur la base de l'évaluation d'une fonction de Lyapunov, celle-ci décrivant le domaine de stabilité de la commande linéaire. Ainsi, le drone sera contrôlé avec la commande non-linéaire, basée \textit{zero-moment}, à l'extérieur du domaine de stabilité et avec la commande linéaire, à l'intérieur de celui-ci. \\ La simulation présentée ci-dessous, dans la figure \ref{fig:position_switch_hovering} montre l'évolution de la position du drone pour une cible définie par: \begin{align} p_{cible} = \left\{ \begin{array}{ll} \left [ 100, 100, 50\right], & \forall t \in \left[0;100\right[ \\ \left[0, 0, 0\right],& \forall t \in [100, \infty[ \end{array} \right. \end{align} \begin{figure}[h] \centering \includegraphics[width=0.59\textwidth]{images/position_hovering_switch.png} \caption{Évolution de la position du drone en hovering} \label{fig:position_switch_hovering} \end{figure}\\ \noindent On définit la fonction de Lyapunov par : \begin{align} V(\delta x) = \delta x^\top S \delta x \end{align} avec S la solution de l'équation de Riccati donnée par la commande LQR de Matlab. Ainsi, S permet de s'assurer que le bouclage $A-BK$ est Hurwitz et que V(x) est bien une fonction de Lyapunov.\\ La figure \ref{fig:Vx_switch_hovering} présente son évolution ainsi que les conditions de passage. \nomenclature{Équation de Riccati}{Équation différentielle utilisée en commande optimale, assurant les propriétés d'optimalité.} \nomenclature{Hurwitz}{Une matrice carrée est appelée matrice de Hurwitz si toutes les valeurs propres de cette dernière ont une partie réelle strictement négative.} \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/Vx_switch_hovering.png} \caption{Évolution de la valeur de la fonction de Lyapunov} \label{fig:Vx_switch_hovering} \end{figure}\\ L'avantage de ce type de commande est la possibilité d'ajouter un mécanisme d'hystéresis, ce qui évite de multiplier les sauts. Celui-ci repose sur deux valeurs: dans notre cas, on passe de la commande non-linéaire à la commande linéaire si $V(x) < 250$ mais on n'effectuera le passage de la commande linéaire vers la commande non-linéaire que si $V(x) < 400$.\\ Il est possible, en simulation, de suivre les sauts effectués, présentés dans la figure \ref{fig:saut_switch_hovering} \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/evolution_switch_hover.png} \caption{Évolution des sauts effectués} \label{fig:saut_switch_hovering} \end{figure} \newpage \section{D'un vol horizontal à un hovering} L'obtention d'une commande de vol horizontal, sur modèle linéarisé, nous permet d'effectuer une simulation entre un vol horizontal et une stabilisation en hovering. La simulation présentée ci-dessous (figure \ref{fig:position_switch_vol_hovering}) montre l'évolution de la position du drone pour une cible définie par: \begin{align} p_{cible} = \left\{ \begin{array}{ll} \left [ 50, 0, 0\right], & \forall t \in \left[0;40\right[ \\ \left[100, 0, 0\right],& \forall t \in [40, \infty[ \end{array} \right. \end{align} \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/position_vol_hover_linearise.png} \caption{Évolution de la position du drone vol et hovering} \label{fig:position_switch_vol_hovering} \end{figure}\\ On observe un changement de consigne au bout de quarante secondes, après une stabilisation du drone en hovering. Ce changement correspond à une nouvelle commande opérateur, qui souhaite stabiliser le drone sur un autre point. Cette évolution de commande s'observe aisément sur la figure \ref{fig:Vx_switch_vol_hovering}, qui représente l'évolution de la fonction de Lyapunov et ainsi un saut lors de la nouvelle cible. \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/lyapunov_vol_hover_linearise.png} \caption{Évolution de la valeur de la fonction de Lyapunov, lors d'un vol en hovering} \label{fig:Vx_switch_vol_hovering} \end{figure} \newpage On suit l'évolution du contrôleur ainsi que la sélection des lois de commande avec le diagramme de sauts de la figure \ref{fig:saut_switch_vol_hovering}. \begin{figure}[h] \centering \includegraphics[width=0.6\textwidth]{images/saut_vol_hover_linearise.png} \caption{Évolution des sauts effectués lors d'un vol en hovering} \label{fig:saut_switch_vol_hovering} \end{figure}\\ Comme nous l'avons vu, il est possible de faire tourner le drone lors d'un hovering ; ainsi il est en capacité, en vol horizontal, d'aller dans toutes les directions. \section{Implémentations} L'ENAC dispose d'une volière où il est possible de réaliser des expérimentations. Dans celle-ci, pour contrôler les drones, nous utilisons la platerforme Paparazzi. Il s'agit d'un projet \textit{open-source} de développement matériel et logiciel d'un système de pilote automatique et de station sol pour la commande des drones. La création d'un autopilote est réalisée à l'aide de fichiers descriptifs en XML ; l'implémention de lois de commande est en C. Il a donc été nécessaire de coder la loi de commande à l'aide des outils proposés par Paparazi et notamment la bibliothèque \textit{math} et l'estimation de l'état du drone. L'intégralité du code source est disponible \cite{sansou_2021}. Si nous avions eu assez de temps, nous aurions poursuivi l'intégration de la loi de commande. Pour celle-ci, nous aurions simulé le drone avec sa commande codée en C, grâce aux outils de Paparazzi. Cela permet de détecter d'éventuelles erreurs. Par la suite, nous aurions téléversé l'auto-pilote dans le drone cible. Dans notre cas, il aurait été opportun d'utiliser, en premier lieux, un quadricoptère, cible initiale de la commande \textit{zero-moment} \cite{2020e-MicCenZacFra}. Par la suite, nous aurions testé notre implémentation sur DarkO, dans une atmosphère contrôlée, comme celle de la volière. Enfin, il aurait été possible d'utiliser un module de génération de vent et de rafales pour perturber le vol du drone et tester la robustesse des lois de commande. \newpage \section*{Conclusion}\label{sec:conclusion} \addcontentsline{toc}{chapter}{\nameref{sec:conclusion}} \vspace{1cm} L'objectif principal de ce mémoire était d'obtenir un contrôleur en mesure d'utiliser les deux modes de vol d'un drone convertible, pour relier deux points, en fonction des exigences de la mission. Au moment où cette conclusion est rédigée, si de nombreux axes de recherche ont été explorés, cette problématique n'a pas entièrement trouvé réponse. \paragraph{} En premier lieu, nous avons entrepris l'étude du modèle de DarkO. La manipulation des équations, avec l'exhibition des surfaces de contrôle virtuelles et l'obtention de la dynamique de l'appareil, m'a permis de mieux saisir les enjeux et les spécificités techniques du drone. Aussi, une parfaite compréhension du contexte opérationnel, permettant la soumission d'hypothèses simplificatrices, engendre la clarification du modèle, qui devient la base préalable à toutes lois de commande. Dès lors, il convient de souligner qu'une attention particulière a été apportée à cette tâche, notre asservissement découlant de cette dernière. À partir de cette première étape, nous avons proposé quatre lois de commande, deux par mode de vol, basées sur une linéarisation du modèle et sur une commande non-linéaire. Pour le vol en hovering, nous avons conçu une linéarisation autour d'un point d'équilibre, pour obtenir une loi de commande linéaire par retour d'état. L'avantage de cette dernière réside dans sa possibilité d'optimisation du bouclage et ainsi du réglage de sa vitesse de convergence. Toutefois, elle possède un domaine de stabilité réduit, en ce qu'il s'agit d'une loi de commande locale, valable au voisinage du point d'équilibre. Au contraire, la seconde loi proposée, non-linéaire, est globale. Celle-ci, stable sur tout le domaine de vol, ne permet pas, toutefois, d'optimiser la vitesse de convergence, étant donné sa complexité. La même logique a été utilisée pour le vol horizontal. Au vu des avantages et des inconvénients observés sur les lois de commande, il nous a semblé opportun d'envisager un passage hybride sur la base de la stabilité des bouclages. Autrement dit, on utilise le contrôleur non-linéaire là où le contrôleur linéaire est instable, de manière à faire converger l'aéronef vers la cible. Dès que le drone entre dans le domaine de stabilité du contrôleur linéaire, le mécanisme hybride se charge du changement de loi, utilisant la vitesse de convergence maximale permise par l'optimisation linéaire. L'avantage de ce mécanisme réside dans l'obtention d'un contrôleur ayant l'autorité sur tout le domaine de vol, assurant la convergence, tout en optimisant les capacités du drone. Bien que les premiers résultats ne soient obtenus que par simulation, ils semblent prometteurs pour une intégration en volière. \paragraph{} Toutefois, il convient de noter que, pour répondre pleinement à notre question initiale, d'autres points restent à aborder. En effet, évaluer la pertinence de l'utilisation d'une commande vis-à-vis de l'autre ne peut se faire sans une étude énergétique des manoeuvres. Celle-ci permettrait d'obtenir les conditions de passage d'un contrôleur à l'autre, sur la base de la consommation. \vspace{1cm} \section*{Perspectives}\label{sec:perspectives} \addcontentsline{toc}{chapter}{\nameref{sec:perspectives}} \vspace{1cm} Comme cela vient d'être évoqué, les limites de ce travail semblent claires, dans la mesure où il est nécessaire d'obtenir des résultats d'essais en vol, suite aux simulations effectuées. Nonobstant, plusieurs points collatéraux ont été soulevés lors de ce stage et mériteraient une étude plus approfondie. Premièrement, il serait intéressant de mener une analyse plus poussée des saturations, notamment sur l'utilisation d'un modèle saturé ou du premier ordre, pour la limite en accélération angulaire des moteurs. Celle-ci permettrait de mettre en lumière et peut-être de simuler l'apparition du cycle limite, observé lors des campagnes de test en volière antérieures à ce stage. Ce phénomène a été évoqué lors d'une réunion de stage mais son étude n'a pas été menée, par manque de temps.\\ Aussi, il semble pertinent d'utiliser des LMIs pour optimiser le contrôleur linéaire proposé dans \ref{control_lin}. Effectivement, si celui-ci s'appuie sur la minimisation d'une erreur quadratique, sa convergence pourrait être optimisée grâce aux LMIs.\\ Enfin, a été décrit dans le paragraphe \ref{stab_lin} la manière que nous avons utilisée pour obtenir le domaine de stabilité de la linéarisation. Cependant, il serait beaucoup plus rigoureux d'effectuer une analyse mathématique de la stabilité de la linéarisation, basée sur la majoration des termes quadratiques. \vspace{4cm} \paragraph{} Pour conclure cet écrit et ce d'un point de vue plus personnel, je souhaiterais souligner que ce mémoire est l'aboutissement de mon projet de fin d'études mais aussi la conclusion de mon diplôme d'ingénieur. Cependant, il n'apparaît pas comme une fin en soit car il s'inscrit dans une démarche de recherche qui dépasse ce stage. Effectivement, les résultats obtenus sont les prémisses d'un doctorat, conjointement mené avec l'ENAC et l'ONERA, qui doit débuter en octobre. Le double objectif de cette expérience, c'est-à-dire celui de s'initier aux modèles de drone et d'acquérir une méthodologie de recherche, a été entièrement rempli. Ce stage a été, pour moi, une grande opportunité, en ce qu'il m'a initié à de nouvelles méthodes de commande, m'a permis de débuter une recherche bibliographique et a engagé un questionnement sur les problématiques de commande des convertibles. \newpage \addcontentsline{toc}{chapter}{Glossaire} \printnomenclature[4cm] \clearpage\null\newpage \addcontentsline{toc}{chapter}{Bibliographie} \printbibliography[title=Bibliographie] \newpage \addcontentsline{toc}{chapter}{Annexes} \vspace*{7cm} \begin{center} \Huge\bfseries Annexes \end{center} \clearpage\null\newpage
ff16bdfa3c6dab2931017fc3fa6b0dbfa31b480d
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:intro} In the context of increasing demand for seasonal migrant farm labour in member European Union states and its supply side disruption due to the pandemic~\cite{granier2021migrant}, autonomous crop monitoring has gained further importance for plant phenotyping, yield monitoring, crop protection, and harvesting. The availability of different sensors and systems has enabled crop monitoring at different levels from global low resolution satellite mapping~\cite{rembold2013using} to drone-based crop-level mapping~\cite{maimaitijiang2020crop,stefas2019vision} to individualized plant level mapping using mobile robots~\cite{qiao2005mapping} and mobile manipulators~\cite{shafiekhani2017vinobot}, with an increase in the level of detail and precision. While global crop monitoring is necessary to make coarse yield predictions, fruit mapping is key to accurate yield monitoring and to performing automated precise interventions. Fruit mapping consists of the localization of fruits and estimation of their shape. With the advent of inexpensive RGB-D cameras, fusing instance masks from panoptic segmentation networks with depth information provides 3D information about the size and location of the fruits. However, autonomous mapping of crops such as sweet peppers can be a challenging task since the plants have complex structures, with many leaves that may partially occlude fruits. Therefore, obtaining accurate information about the location and shape of fruits can be difficult. Even if observations from multiple views are acquired, fruits can often be only partially covered. To enable shape prediction in these cases, we present a system to estimate the shape of both partially and fully observed fruits. We build upon ideas of Lehnert\etal\cite{lehnert2016sweet} who proposed to match the shape of sweet peppers with superellipsoids. Whereas their experiments were limited to controlled environments with single pepper plants, we integrated our superellipsoid matching system with our previously developed viewpoint planner~\cite{zaenker2020viewpoint}. As a result, we are able to apply our fruit mapping system on data captured with an RGB-D camera on a robotic arm in various scenarios containing multiple plants with sweet peppers. \figref{fig:coverfig} shows an example application of our system using data of sweet pepper crops in a glasshouse. As can be seen, fruit masks are detected in the RGB image to subsequently generate a fruit point cloud from depth data. From a sequence of point clouds, we generate a fruit map in form of truncated signed distance fields~(TSDF) with the mapping framework voxblox~\cite{oleynikova2017voxblox}. The surface cloud of this TSDF map is clustered to separate fruits, and superellipsoids are fitted by first estimating center and normals of the points and then minimizing the distance of detected points to the superellipsoid surface. \begin{figure} \centering \includegraphics[width=\linewidth]{images/matched_superellipsoids_2} \caption{Illustration of matched superellipsoids to fruits. Map generated from multiple views in a commercial glasshouse environment. Estimated superellipsoid surfaces are visualized as blue point clouds. While the left fruit has been observed from almost all directions, only half of the right fruit has been mapped. In both cases, our system was able to accurately predict their shape. } \label{fig:coverfig} \end{figure} Our main contributions are the following: \begin{itemize \item A complete framework that accurately maps and estimates fruit shapes using multiple views, \item An implementation in ROS, providing easy integration with our previously developed ROI viewpoint planner, \item An evaluation of the accuracy of the estimated fruit volumes in various simulated scenarios with multiple crops, \item Qualitative results on data recorded in a commercial glasshouse environment. \end{itemize} \section{Related Work} \label{sec:related} Several approaches exist that are based on reconstruction using 3D data collected from different viewpoints to obtain a full 3D~model, however, with no explicit modeling of shape. For example, Wang\etal\cite{wang2020fruit} developed automatic fruit shape measurement based on 3D reconstruction, using a Kinect sensor and an electric turntable. Similarly, Jadhav\etal\cite{jadhav2019volumetric} investigated the volumetric 3D reconstruction of different fruits based on voxel mapping using silhouette probabilities and inter-image homographies, with multiple RGB cameras and a checkerboard. Complete reconstruction approaches are generally suitable for ground truth dataset generation or volumetric estimation in laboratory conditions. However, the reconstruction methods are computationally expensive and are generally not suitable for resource-constrained, real-time agriculture automation tasks. Moreover, occlusions due to the plant leaves or unreachability of the sensor to cover the complete view can lead to incomplete scanning of the fruits. Viewpoint planning uses the hitherto accumulated information to plan the next best view for maximising the information gain. As an example, Roy and Isler\cite{roy2017active} used a viewpoint planning approach to count apples in orchards, however, without any volumetric estimation. In our previous work~\cite{zaenker2020viewpoint}, we formulated a sampling approach based on regions of interest~(ROI), i.e., fruits that outperforms those that do not consider ROIs, with respect to the number of detected fruits and the estimated volume. However, the previous approach suffered from inaccuracies in fruit volume estimation as no shape estimation or modeling was carried out for predicting the unobserved fruit regions. State-of-the-art shape completion or fruit modeling approaches do not use a viewpoint planner for maximizing the information gain, instead they typically attempt to predict fruit shape and pose using data from a single view or few views. Kang\etal\cite{kang2020visual} used the DasNet deep learning network~\cite{kang2020fruit} for fruit recognition, and 3D Sphere Hough Transform to estimate the fruit pose and size, for autonomous apple harvesting. Similarly, Lin \etal \cite{lin2019guava} demonstrated that sphere fitting works better than a bounding box method for pose estimation of guavas. However, while spherical fitting provides acceptable results for autonomous harvesting, the reduction of different fruits to simple spheres is neither generalizable, nor reliable for localized yield predictions. Ge\etal\cite{ge2020symmetry} formulated another approach based on shape from symmetry~\cite{thrun2005shape}, to generate and rate different hypotheses for the symmetrical plane and the mirrored point sets, for the partial view, to reconstruct the complete shape of strawberry fruits for fruit localization. Furthermore, photogrammetry-based methods have been used for estimating real length and width after fitting ellipses for apples and mangoes, respectively, in the 2D plane~\cite{gongal2018apple,wang2017tree}. The most closely related work is the approach by Lehnert\etal\cite{lehnert2016sweet} that fits superellipsoids to sweet peppers. Here, point clouds from different viewpoints were merged into a single point cloud using different registration methods of which Kinect Fusion~(KinFu) was found to perform best at pose tracking. After registration and segmentation of red sweet papers based on color using the HSV colour space, sweet pepper pose estimation is performed using constrained non-linear least squares optimization. A superellipsoid model is then used for estimating parameters of the fruit shape and for obtaining the 6 DoF transform between the registered point cloud and the model. KinFu can be used for realtime mapping of scenes while concurrently obtaining the camera pose by tracking the depth frames continuously as in~\cite{lehnert2016sweet}. However, as the viewpoint planner used in our previous approach~\cite{zaenker2020viewpoint} plans discrete viewpoints for maximising information gain, KinFu cannot perform continuous tracking and registration which needs small movements in successive frames for the convergence of ICP alignment~\cite{pirovano2012kinfu}. Oleynikova\etal\cite{oleynikova2017voxblox} developed voxblox to build TSDFs based map representations for local planning of Micro Aerial Vehicles. Unlike KinFu, which requires a known map size, large amounts of memory, and GPU computational power, voxblox can dynamically grow maps as it adds point cloud data from different viewpoints. As voxblox can run on a single CPU core with low memory requirements and still build TSDF maps faster than building occupancy maps, we replaced the 3D~occupancy maps in~\cite{zaenker2020ecmr} with TSDF maps. In conclusion, most state-of-the-art approaches for fruit mapping fall into three categories -- naive complete reconstruction methods, viewpoint planning without any shape completion, and geometric shape completion methods. Our approach combines a viewpoint planner with shape completion for mapping of fruits for estimation of count and volume, in the wild, with an improved TSDF based mapping. \begin{figure*}[h] \centering \includegraphics[width=\linewidth]{images/system_overview} \caption{Overview of our system. Color and depth images are converted into a fruit point cloud from generated fruit masks, which is processed by voxblox~\cite{oleynikova2017voxblox} into a truncated signed distance field~(TSDF) map. The surface point cloud from this map is used to fit superellipsoids to individual fruits, which can be visualized together with the map, or used to estimate position and volume.} \label{fig:system_overview} \end{figure*} \section{System Overview} \label{sec:approach} Our approach aims at estimating the shape of detected fruits, which might be partially occluded. We use our previously developed viewpoint planner~\cite{zaenker2020viewpoint} to move a camera placed on a robotic arm, which enables us to observe fruits from different perspectives. In order to estimate the shape of detected fruits, we build a map of the environment. Previously, we generated an octree with marked regions of interest~(ROIs), i.e., fruits, to guide the planner and estimate the fruit position and size. While this enabled ROI targeted viewpoint planning and a rough estimation of fruit positions, due to the limited accuracy of the octree map, the shape of fruits could not be accurately determined. For the new approach presented in this paper, we therefore build a separate map of the environment specifically for the fruits. We use the masks of detected fruits to generate a separate fruit point cloud as input for the fruit mapping. This point cloud is processed to remove outliers and forwarded to the voxblox mapping system~\cite{oleynikova2017voxblox}, which creates a TSDF map of the fruits. Our superellipsoid matching system receives the surface point cloud generated from that map, clusters it into individual fruits, and optimizes the parameters of a superellipsoid to find the best fitting shape for the corresponding points. The parameters of the superellipsoid can be used to compute the fruit position and volume. Addionally, a fruit point cloud for visualization purposes is generated. \figref{fig:system_overview} shows an overview of the approach described above. \section{Fruit Mapping and Shape Estimation} \subsection{Fruit Detection and Mapping} \label{sec:detection_mapping} In order to match superellipsoid to fruits, they have to be detected first. Like in our previous work, we provide two methods to detect fruits in images. The first one is a color thresholder for detecting red pixels, and is used in our simulated experiments with only red peppers. For our real world data, we utilize a neural network trained on a dataset recorded at the University of Bonn~\cite{halstead2020fruit} to detect the fruit masks. In both cases, we end with a set of pixels belonging to fruits. We match those with the point cloud generated from the depth image of the RGB-D camera, and extract a cloud only containing the fruit points. This cloud is used to generate the map used for our shape completion, while the complete cloud can be used to generate an additional map containing full plants. Before that, outliers are removed using statistical outlier removal to counter depth noise. For generating the map used to match superellipsoids to fruits, we utilize the mapping framework voxblox \cite{oleynikova2017voxblox}. We configure voxblox with a TSDF voxel size of 0.004 m and 64 voxels per side. We disable ICP tracking feature of voxblox and utilize position feedbacks from the robot arm. \subsection{Clustering and Shape Estimation} \label{sec:approach_sampling} From the fruit TSDF map generated with voxblox, we extract the surface point cloud to match our fruit predictions. In a first processing step, we extract clusters to identify individual fruits. We utilize Euclidean cluster extraction with a cluster tolerance of 0.01 m, a minimum cluster size of 100 points and a maximum cluster size of 10000 points for that. For each extracted cluster, we first estimate the normals of the points. Taking into account the normals, a cluster center $w$ is estimated using a closed form least-squares solution for minimizing the sum of perpendicular distances from the estimated point to all the lines \cite{traa2013least}. We also use L2 regularization to bias the solution towards a reference point (i.e., the mean of all points in a cluster) with the regularization value of $\lambda = 2.5$ \cite{traa2013least}. This center is used as start point for the optimization of the superellipsoid. As in \cite{lehnert2016sweet}, we represent superellipsoids with the following equation: \begin{equation} f(x, y, z) = \left[ \left(\frac{x}{a}\right)^\frac{2}{\varepsilon_2} + \left(\frac{y}{b}\right)^\frac{2}{\varepsilon_2} \right]^\frac{\varepsilon_2}{\varepsilon_1} + \left(\frac{z}{c}\right)^\frac{2}{\varepsilon_1} = 1 \end{equation} The parameters $a$, $b$, $c$, $\varepsilon_1$, and $\varepsilon_2$, together with the translation $t_x$, $t_y$, $t_z$ and rotation $\phi$, $\theta$, $\psi$ make up 11 parameters to optimize. We set the initial value of $t_x$, $t_y$, $t_z$ to the estimated center and the rotation to 0. For the superellipsoid parameters, we start with initial values of $a=b=c=0.05\ m$ and $\varepsilon_1=\varepsilon_2=0.5$. Compared to \cite{lehnert2016sweet}, we changed the cost function to achieve better fits. Jakli{\v{c}} \etal \cite{jaklic2000superquadrics} describe approximated distance of a point to a superellipsoid as: \begin{equation} d = |r_0 - \beta r_0| = |r_0| \cdot |1-f^{-\frac{\varepsilon_1}{2}}(x_0, y_0, z_0)| \end{equation} where $r_0 = (x_0, y_0, z_0)$ represents the coordinates of a point with respect to the superellipsoid center. $\beta$ is the scaling factor to project $r_0$ to the superellipsoid surface, and computed by solving $f(\beta x_0, \beta y_0, \beta z_0)$ for $\beta$. To find the best fitting shape, we minimize the sum of $d$ over all points. We get the following optimization task, with priors encouraging the superellipsoid center to be closer to the estimated center and the $a$, $b$, and $c$ parameters to be close to each other: \begin{equation} \min_{a, ..., \psi} \sum_i \biggl [ d_i^2 + \alpha ||t-w||_2^2 + \gamma \bigl((a-b)^2+(b-c)^2+(c-a)^2 \bigr) \biggr ] \end{equation} We apply the Levenberg–Marquardt algorithm to optimize the parameters. The numerical computations are performed using the open source Ceres solver \cite{ceres-solver}. We limit $a$, $b$, and $c$ between 0.02 and 0.15 m, and $\varepsilon_1$ and $\varepsilon_2$ between 0.3 and 0.9, to avoid unrealistically small, large or deformed superellipsoids that don't realistically represent a fruit. We set regularization constants $\alpha = \gamma = 0.1$. We also limit the maximum number of iterations to 100 and discard optimizations that terminated without convergence. \subsection{Shape Evaluation} \label{sec:approach_evaluation} Our node provides the results of the matched superellipsoids in multiple forms. For visualization, surface point clouds are generated from the optimized parameters. We provide a colored point cloud with different colors for each cluster, as well a labeled point cloud including the computed normals. For further usage, the superellipsoid parameters and volume are published. We compute the volume using the following formula, as described in \cite{jaklic2000superquadrics}: \begin{equation} V = 2abc\varepsilon_1\varepsilon_2B\left(\frac{\varepsilon_1}{2}+1, \varepsilon_1\right)B\left(\frac{\varepsilon_2}{2}, \frac{\varepsilon_2}{2}\right); \end{equation} where $B$ is the beta function: \begin{equation} B(x, y) = 2\int_{0}^{\frac{\pi}{2}} \sin^{2x-1}\phi cos^{2y-1} \phi d\phi = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y)} \end{equation} For our simulated environments, we extract a point cloud from the mesh models of the fruits and optimize superellipsoid parameters to fit this point cloud for each fruit. We read the position and orientation of the plants directly from the Gazebo simulator and can therefore generate a ground truth superellipsoid for each fruit in the scene. We can match ground truth and detected ellipsoids by comparing the distance of the centers and the volumes. \section{Experiments} \label{sec:exp} We carried out experiments with of our shape estimation method in a simulated environment for quantitative analysis and with data collected from the glasshouse to validate our approach in real world conditions. For our evaluation in simulated scenarios, we used the Gazebo based simulation setup presented in \cite{zaenker2020viewpoint}, but with an additional new environment with more and different plants. It simulates a UR5e arm from Universal Robots with an RGB-D camera placed at its flange. We configured the planner to move the arm to new views autonomously. We placed the arm on a static pole for the first scenario, and for the other two, it was attached to a retractable pole hanging from the ceiling, to enable good coverage of the fruits. The three scenarios are described with pictures in \Cref{fig:simulatedenv1,fig:simulatedenv2,fig:simulatedenv3}. \subsection{Simulated Scenarios} To evaluate the accuracy of the fruit shape estimation with our new method to our old approach, we compare the average estimated fruit center distance and volume accuracy of the detected fruits. Additionally, we set a new restriction on the detected fruits -- they are counted only when the specified minimum accuracy criterion is met. For the evaluation, we consider the number of fruits with minimum accuracy 0 (i.e. the detected volume must not be more than twice the ground truth volume) and minimum accuracy 0.5 (the detected volume must not be more than 50\% larger or smaller than the ground truth.) This gives us the following metrics: \begin{itemize} \item \textit{Detected fruits}: Number of found fruits that can be matched with ground truth fruits, which means that their center distance is less than~$20\,cm$, and their volume accuracy is greater than the specified minimum. \item \textit{Center distance}: Average distance of the fruit centers from the ground truth centers. \item \textit{Volume accuracy}: Average accuracy of the cluster volumes. The accuracy is computed as follows: \begin{equation} acc_{V} = 1 - \frac{|V_{det} - V_{gt}|}{V_{gt}} \end{equation} where $V_{det}$ is the detected volume and $V_{gt}$, the ground truth volume. For detected volumes less than the ground truth volume, the $acc_{V}$ varies from 0 to 1, with 1 representing the best possible accuracy when they are equal. On the other hand, for $V_{det}$ greater than $2V_{gt}$, the $acc_{V}$ turns negative. For our old method, the volumes are computed as bounding box volumes of the detected clusters. For the new method, we use the superellipsoid volume as described in \Cref{sec:approach_evaluation}. \end{itemize} For each scenario, we executed 20 trials, each with a planning time of three minutes. \begin{figure*} \centering \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/simulated_env_1_cropped} \caption{Scenario 1} \label{fig:simulatedenv1} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/simulated_env_2_cropped} \caption{Scenario 2} \label{fig:simulatedenv2} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/simulated_env_3_cropped} \caption{Scenario 3} \label{fig:simulatedenv3} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/detected_fruits_w14} \caption{Fruits Scenario 1} \label{fig:det_fruits_w14} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/detected_fruits_w19} \caption{Fruits Scenario 2} \label{fig:det_fruits_w19} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/detected_fruits_w22} \caption{Fruits Scenario 3} \label{fig:det_fruits_w22} \end{subfigure} \par\bigskip \begin{subfigure}[b]{0.32\linewidth} \centering \begin{tabular}{ c | c | c | c |} \cline{2-4} & Fruits & Center & Vol. \\ \hline\hline \makecell[c]{Old\\(all)} & \makecell[r]{12.8\\ $\pm$ 0.9} & \makecell[r]{2.5\\ $\pm$ 0.5} & \makecell[r]{-0.12\\ $\pm$ 0.79} \\ \hline \makecell[c]{SE\\(all)} & \makecell[r]{13.2\\ $\pm$ 0.9} & \makecell[r]{2.9\\ $\pm$ 0.7} & \makecell[r]{0.26\\ $\pm$ 0.27} \\ \hline\hline \makecell[c]{Old\\(MA0)} & \makecell[r]{8.7\\ $\pm$ 2.6} & \makecell[r]{2.6\\ $\pm$ 1.1} & \makecell[r]{0.45\\ $\pm$ 0.12} \\ \hline \makecell[c]{SE\\(MA0)} & \makecell[r]{9.8\\ $\pm$ 1.9} & \makecell[r]{2.3\\ $\pm$ 0.8} & \makecell[r]{0.69\\ $\pm$ 0.06} \\ \hline\hline \makecell[c]{Old\\(MA50)} & \makecell[r]{4.7\\ $\pm$ 2.2} & \makecell[r]{1.6\\ $\pm$ 0.8} & \makecell[r]{0.65\\ $\pm$ 0.17} \\ \hline \makecell[c]{SE\\(MA50)} & \makecell[r]{7.7\\ $\pm$ 1.9} & \makecell[r]{1.9\\ $\pm$ 0.9} & \makecell[r]{0.81\\ $\pm$ 0.04} \\ \hline \end{tabular} \caption{Results Scenario 1} \label{tab:res_table_1} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \begin{tabular}{ c | c | c | c |} \cline{2-4} & Fruits & Center & Vol. \\ \hline\hline \makecell[c]{Old\\(all)} & \makecell[r]{25.5\\ $\pm$ 1.0} & \makecell[r]{2.2\\ $\pm$ 0.3} & \makecell[r]{-0.05\\ $\pm$ 0.21} \\ \hline \makecell[c]{SE\\(all)} & \makecell[r]{26.5\\ $\pm$ 1.2} & \makecell[r]{1.8\\ $\pm$ 0.6} & \makecell[r]{0.35\\ $\pm$ 0.23} \\ \hline\hline \makecell[c]{Old\\(MA0)} & \makecell[r]{16.4\\ $\pm$ 3.4} & \makecell[r]{2.1\\ $\pm$ 0.5} & \makecell[r]{0.35\\ $\pm$ 0.06} \\ \hline \makecell[c]{SE\\(MA0)} & \makecell[r]{22.4\\ $\pm$ 2.4} & \makecell[r]{1.4\\ $\pm$ 0.6} & \makecell[r]{0.67\\ $\pm$ 0.04} \\ \hline\hline \makecell[c]{Old\\(MA50)} & \makecell[r]{6.0\\ $\pm$ 2.0} & \makecell[r]{1.8\\ $\pm$ 0.4} & \makecell[r]{0.66\\ $\pm$ 0.07} \\ \hline \makecell[c]{SE\\(MA50)} & \makecell[r]{17.7\\ $\pm$ 2.1} & \makecell[r]{1.2\\ $\pm$ 0.4} & \makecell[r]{0.78\\ $\pm$ 0.03} \\ \hline \end{tabular} \caption{Results Scenario 2} \label{tab:res_table_2} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \begin{tabular}{ c | c | c | c |} \cline{2-4} & Fruits & Center & Vol. \\ \hline\hline \makecell[c]{Old\\(all)} & \makecell[r]{41.1\\ $\pm$ 3.3} & \makecell[r]{2.4\\ $\pm$ 0.4} & \makecell[r]{-0.19\\ $\pm$ 0.27} \\ \hline \makecell[c]{SE\\(all)} & \makecell[r]{40.9\\ $\pm$ 3.9} & \makecell[r]{1.9\\ $\pm$ 0.4} & \makecell[r]{0.22\\ $\pm$ 0.22} \\ \hline\hline \makecell[c]{Old\\(MA0)} & \makecell[r]{28.0\\ $\pm$ 4.7} & \makecell[r]{2.5\\ $\pm$ 0.5} & \makecell[r]{0.44\\ $\pm$ 0.06} \\ \hline \makecell[c]{SE\\(MA0)} & \makecell[r]{33.6\\ $\pm$ 3.9} & \makecell[r]{1.3\\ $\pm$ 0.3} & \makecell[r]{0.70\\ $\pm$ 0.04} \\ \hline\hline \makecell[c]{Old\\(MA50)} & \makecell[r]{12.4\\ $\pm$ 3.6} & \makecell[r]{2.1\\ $\pm$ 0.6} & \makecell[r]{0.71\\ $\pm$ 0.04} \\ \hline \makecell[c]{SE\\(MA50)} & \makecell[r]{27.2\\ $\pm$ 3.9} & \makecell[r]{1.2\\ $\pm$ 0.3} & \makecell[r]{0.80\\ $\pm$ 0.02} \\ \hline \end{tabular} \caption{Results Scenario 3} \label{tab:res_table_3} \end{subfigure} \caption{\textit{(a-c)}: Our three simulated scenarios. \textit{Scenario 1:} Simulated environment with static arm, as used in \cite{zaenker2020viewpoint}, with 4 plants and 14 fruits. \textit{Scenario 2}: Simulated environment with retractable arm, as in \cite{zaenker2020viewpoint}, with 4 plants and 28 fruits. \textit{Scenario 3}: New simulated environment. It also uses the retractable arm, but contains a total of 12 plants, ordered in two rows, with different growth stages and fruits. There are a total of 47 red fruits in this environment.\\ \textit{(d-f)}: Results for the three simulated scenarios. For each tested approach, 20 trials with a duration of three minutes each were performed. The plots show the average number of detected fruits of our superellipsoid matcher (\textbf{SE}) compared to our old octree-based approach (\textbf{Old}), with no minimum accuracy (\textbf{all}), a minimum accuracy of 0 (\textbf{MA0}), and a minimum accuracy of 0.5 (\textbf{MA50}). As can be seen, while the number of detected fruits with no accuracy bounds is similar, our new approach detects much more fruits with good accuracy.\\ \textit{(g-i)}: The average numerical results at the end of the episodes regarding number of detected fruits (\textbf{Fruits}), center distance in cm (\textbf{Center}), and volume accuracy (\textbf{Vol.}). } \label{fig:res_detected_fruits} \end{figure*} \Cref{fig:det_fruits_w14,fig:det_fruits_w19,fig:det_fruits_w22} illustrate the number of detected fruits over the three minutes planning time, and \Cref{tab:res_table_1,tab:res_table_2,tab:res_table_3} show the quantitative results for the three scenarios. While the number of detected fruits with no volume accuracy bounds is similar to our old approach, our current approach with the superellipsoid matcher recognizes signifcantly greater number of fruits, when the minimum volume accuracy bound is applied. With a minimum accuracy of 0.5, we detect an average of 7.7 fruits with our new aapproach compared to 4.7 with the old approach in Scenario 1, 17.7 compared to 6.0 in Scenario 2, and 27.2 compared to 12.4 in Scenario 3. It can also be seen that with our old approach, the number of detected fruits with minimum accuracy drops towards the end. This can happen if nearby fruits are combined to a single fruit, which greatly decreases the volume accuracy. Since our new method uses a more accurate map and better clustering, this happens less often, leading to a considerable improvement in count and volume estimation. The average center distances are similar for both approaches. However, the average volume accuracy of our superellipsoid matcher is much higher. When counting all detected fruits, with average accuracies between 0.22 and 0.35, it is still quite low. This is because the clustering still can fail if there are not enough fruit points detected and nearby fruits are merged, leading to overestimated shapes with negative accuracies, which bring down the average. When removing those outliers, which was done via prior assumptions about the maximum fruit size, the average accuracy increases appreciably, with accuracies between 0.67 and 0.70 compared to only between 0.35 and 0.45 with our old approach. This accuracy covers on average over 70\% of the detected fruits in Scenario 1 and over 80\% in Scenario 2 and 3. The evaluation demonstrates that our approach with superellipsoid based shape completion can lead to a higher number of accurately detected fruits. While there are still some outliers, the volume accuracy for most of the sweet peppers shows that they can be satisfactorily approximated through superellipsoids, even if only partially observed by our viewpoint planner. \subsection{Real-World Glasshouse Experiment} To evaluate how our approach handles real-word data, we utilized a recording of the data feed gathered from our previously developed viewpoint planner in a capsicum glasshouse. Color and depth images were generated using a RealSense L515 Lidar sensor, and the data includes the arm configuration and the camera poses. The recorded images are passed through a neural network~\cite{halstead2020fruit} to generate fruit masks which are fused with the depth images to generate the fruit point clouds used for voxblox mapping. In addition to the fruit map used to estimate shapes with superellipsoids, we generate a map from the full point cloud for visualization purposes. \begin{figure} \centering \includegraphics[width=\linewidth]{images/rw_image} \caption{Generated map with superellipsoids. Blue point clouds represent the estimated surface of the matched shapes.} \label{fig:rw_image} \end{figure} \begin{figure} \centering \begin{subfigure}[b]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{images/combined_photo.png} \caption{Captured photos} \label{fig:glasshouse_photo} \end{subfigure} \begin{subfigure}[b]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{images/real_world_rois.png} \caption{ROI octree} \label{fig:glasshouse_rois} \end{subfigure} \caption{\textit{Left}: Captured RGB images of the glasshouse in the segment mapped in~\Cref{fig:rw_image} . \textit{Right}: The octree-based map generated in~\cite{zaenker2020viewpoint}, with red bounding boxes visualizing the matched fruit volume. The two fruits are the same as the two red fruits on the right in~\Cref{fig:rw_image}} \label{fig:old_results} \end{figure} In \Cref{fig:rw_image}, you can see the generated full TSDF map of a section of the glasshouse, with the superellipsoids matched from the fruit-only map visualized as blue point clouds. For comparison, \Cref{fig:old_results} shows the results of the same segment using the octree-based map presented in \cite{zaenker2020viewpoint}. It can be seen that our new method provides both a more accurate map and a better approximation of the fruit shapes. \section{Conclusions} \label{sec:concl} To move a step closer to autonomous crop monitoring and yield estimation, we developed a framework to accurately estimate the shape of fruits such as sweet peppers. Our system is embedded into a viewpoint planning approach and builds up a map of the fruits in form of truncated signed distance fields, on which fruits are clustered. Subsequently, the shape of clustered fruits is approximated by fitting superellipsoids to the surface points. As the evaluation with a simulated robotic arm equipped with an RGB-D camera demonstrates, our system can detect a majority of the fruits with good accuracy, and the qualitative results on real-world data show that it is applicable under realistic conditions in commercial glasshouse environments. In the future, we plan to use the estimated shapes to determine the missing parts of partially detected fruits to guide our viewpoint planner to achieve better coverage. \bibliographystyle{IEEEtran}
a1feadbe041ad8ccae397543e9a9a563b461aac1
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\subsection{Emerging result} \end{abstract} \begin{CCSXML} <ccs2012> <concept> <concept_id>10010147.10010257</concept_id> <concept_desc>Computing methodologies~Machine learning</concept_desc> <concept_significance>300</concept_significance> </concept> <concept> <concept_id>10011007.10011006.10011072</concept_id> <concept_desc>Software and its engineering~Software libraries and repositories</concept_desc> <concept_significance>500</concept_significance> </concept> <concept> <concept_id>10011007</concept_id> <concept_desc>Software and its engineering</concept_desc> <concept_significance>300</concept_significance> </concept> </ccs2012> \end{CCSXML} \ccsdesc[500]{Software and its engineering~Software libraries and repositories} \ccsdesc[300]{Computing methodologies~Machine learning} \keywords{APIs, libraries, usability, learnability, machine learning} \maketitle \section{Introduction} The success of machine learning (ML) is leading to an ever increasing demand for data scientists. However, software developers who try to fill this gap and have already delved into the necessary scientific ML background still face the challenge of learning how to correctly use the related ML APIs. The importance of API learnability and usability has been emphasized in many influential studies \cite{Robillard:IEEESOftware2009,Robillard:ESE2011,SouzaCleidsonBentolila:ICSE2009,WangGodfrey:MSR2013,ZibranEtAlWCRE2011}. Therefore, we aimed to find out whether and how the learning curve can be flattened and correct use can be fostered. Using \skl{} \cite{scikit-learn}, a widely-adopted ML library as a case study, we address the following research questions: \begin{description} \item [RQ1] Can the complexity of the API be reduced without affecting its existing users? \item [RQ2] Which deviations from established principles of good API design make learning and correct use of ML APIs hard, even for developers who have the required mathematical and software engineering skills? \item [RQ3] Can learnability and correct use be improved by a different design of the API? \item [RQ4] Given an improved API design, can an implementation be derived and maintained automatically, based on the official library? What precisely can be automated and how much human effort is still needed? \end{description} \section{API Complexity Reduction} \label{sec:api_complexity} Existing ML APIs, such as \skl{}, follow a ``one size fits all'' approach, irrespective of user expertise. We questioned this approach, assuming that novices need just a subset of the API and are hence distracted and confused by additional functionalities \cite{ZibranEtAlWCRE2011}. We consider novices to be persons who aim to develop an ML application and have the required mathematical and software engineering background, but no experience using the particular ML API. \subsection{Empirical Results} \label{sec:empirical} To verify our assumption, we aimed to quantify the amount of functionalities that novice users do not need. However, lacking a representative pool of programs written only by novices we started with a broader analysis of all usages that we could find. We did this in two steps: \begin{description} \item [API statistics] We counted the number of API elements in \skl{} version 0.24.2. In Fig. \ref{fig:scikit-statistics-bar-chart}, the dark blue bars indicate the \emph{total} total numbers of classes, functions, and parameters, whereas the red bars show the respective numbers of \emph{public} elements. \item [Usage statistics] By analyzing 92,402 programs contributed to Kaggle competitions\footnote{https://www.kaggle.com/competitions} by users of any skill level we found 41,867 that used scikit-learn. Within this pool, we counted the number of \emph{uses} of each class, function and function parameter. Based on this raw data, we computed the additional two bars shown in Fig. \ref{fig:scikit-statistics-bar-chart}. The green bars indicate the number of classes, functions and parameters actually \emph{used} in Kaggle competitions. The light blue bar indicates \emph{useful} parameters, which are set to at least two different values. We call parameters that are always set to the same value \emph{useless}, since they can be replaced by a local variable in the containing function and eliminated from the API. An example of a useless parameter is \textsl{copy\_X} (optional parameter with default \textsl{True}) in the \textsl{Lasso} model, since it is set to \textsl{True} in all 748 cases the constructor is invoked. However, the parameter is not unused since users passed the value \textsl{True} three times explicitly. \end{description} \begin{figure} \centering \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{img/api_size_classes.png} \caption{Classes} \label{fig:scikit-statistics-bar-chart-classes} \end{subfigure} \hfill \\[1.5ex] \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{img/api_size_functions.png} \caption{Functions} \label{fig:scikit-statistics-bar-chart-functions} \end{subfigure} \hfill \\[1.5ex] \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{img/api_size_parameters.png} \caption{Parameters} \label{fig:scikit-statistics-bar-chart-parameters} \end{subfigure} \vspace{-0.5em} \caption{Numbers of classes, functions, and parameters in \skl{}: Dark blue for the entire API, red for public elements, green for elements used in Kaggle competitions, light blue for parameters that are set to at least two different values. The white area shows absolute and relative reductions compared to the public API.} \vspace{-1em} \label{fig:scikit-statistics-bar-chart} \end{figure} From Fig. \ref{fig:scikit-statistics-bar-chart} we can infer the reduction of the API's complexity if users were presented just with the used classes and functions and useful parameters. This benefits novices and experts alike: It shows that even among the public elements, 56 classes (21\%) and 597 functions (47\%) are unused, while 2467 parameters (57\%) are useless. These API elements can be eliminated from the user-visible API without affecting the functionality of the analysed applications. The improvements are huge and can be a significant time-saver when learning a new API. \subsection{Plausibility Check} \label{sec:PlausibilityCheck} We wanted to be sure that the above results are not biased by the choice of Kaggle competitions as sample data, but can be generalized to other ML applications. To this end, we inspected unused classes and functions, and useless parameters, in search of reasons why elements are generally not needed for application development. \begin{description} \item [Unused classes] We found that most unused classes are indeed clearly irrelevant for application programmers, being designed just for extending the API by additional models and internal code reuse. Examples include mixins, base classes, and a few unused, exotic ML models, like \textsl{MultiTaskLasso}. \item [Unused functions] Similarly, several groups of unused functions are intended for API extensions only, such as validation functions for inputs. Some are related to sample datasets (\textsl{fetch\_california\_housing}), which are clearly not used in applications that include their own data. However, there are also unused core ML functions, often composite ones (\textsl{fit\_transform}, \textsl{fit\_predict} etc.) that exist for API consistency, and which we do not want to remove for this reason. We guess they are not called because users might call the component functions separately (e.g. \textsl{fit} or \textsl{transform}). Finally, some introspection functions (\textsl{decision\_functions}) are not used either and also deserve further investigation. \item [Unused and useless parameters] Given the sheer number of parameters, we have not yet completed categorizing them. However, our findings to date confirm the generality of the empirical results, also for parameters. \end{description} Since our plausibility check suggests that the results obtained for Kaggle can be generalized, we conclude that for \skl{}, the complexity of the API can indeed be reduced without affecting existing users (RQ1) by roughly the numbers indicated in Fig. \ref{fig:scikit-statistics-bar-chart}, by eliminating unused and useless elements from the public API. \section{API Redesign} \label{sec:api-redesign} The manual inspection done for our plausibility check revealed aspects that were not evident from the statistical data. We found that even the \emph{used and useful} part of the API is subject to design and usability problems that deserve specific attention. This motivated our research questions RQ2 and RQ3. In the following, we address these questions in turn, enumerating found usability issues (RQ2) and proposing related design improvements (RQ3). \subsection{Proliferation of Primitives} \label{sec:proliferation} One of the design principle of \skl{} is \keyword{non-proliferation of classes}, which means classes are only added for learning algorithms. All other concepts are expressed by primitive types, or types from other scientific libraries, like numpy or scipy \cite{sklearn_api}. This, however, results in long lists of parameters of primitive types, contradicting established design principles. McConnell's guideline, based on psychological research, is to use at most seven parameters \cite[p. 178]{code_complete}. Martin (\cite[p. 288]{clean_code}) suggest to keep parameter lists as short as possible and to avoid more than three parameters. While the removal of unused parameters (Sec. \ref{sec:empirical}) alleviates the problem, it does not eliminate it. This section discusses related issues and ways to address them without sacrificing the generality of the API: \begin{description} \item [Tangled concerns] \label{item:tangling} The long parameter lists of the constructors of ML models hide the important \emph{hyperparameters} between parameters that are unrelated to the core ML concern, such as debugging or performance options. For example, the constructor of the \textsl{SVC} model has 15 parameters (all of which are used) for a multitude of concerns: \textsl{kernel} is a hyperparameter, while \textsl{verbose} is for debugging, and \textsl{cache\_size} concerns performance. Such parameters can be removed from the constructors of ML models leaving only the hyperparameters, drastically increasing their visibility. If needed, attributes for non-ML concerns in the created object can anyway be set to non-default values before calling its \textsl{fit} method to start training. \item[Implicit dependencies] Flat lists of inter-dependent parameters can allow combinations of parameter values that are semantically wrong. For instance, it is non-obvious that the \textsl{degree} parameter of the SVC constructor should only be set if the \textsl{kernel} parameter is set to \textsl{\str{poly}}. The invocation \textsl{SVC(\allowbreak{}kernel=\allowbreak{}\str{linear},\allowbreak{} degree=\allowbreak{}3)} is possible but most surely an error, since the degree value will be ignored. However, \textsl{SVC(\allowbreak{}kernel=\allowbreak{}\str{poly},\allowbreak{} degree=\allowbreak{}3)} is correct. Grouping dependent parameters in one object, called a \keyword{parameter object} in \cite{refactoring}, improves understandabilty \cite{LaceraEtAl:JSS2020}, makes dependencies clear, and prevents any accidental misuse of the API. In our example, we create different variants of \textsl{Kernel} objects, with a \textsl{degree} parameter only in the \textsl{\str{poly}} variant. Via \textsl{SVC(\allowbreak{}Kernel.linear)} and \textsl{SVC(\allowbreak{}Kernel.poly(\allowbreak{}degree=\allowbreak{}3))} we can then create legal SVC configurations, but the erroneous example above will be impossible to create. \item[Magic strings] Scikit-learn often uses string parameters that only have a limited set of legal values\footnote{ In 2007, when \skl{} was initially released, Python offered no alternative. Later, the string types had to be kept for backwards compatibility.}. This has the downside that statically ensuring use of a valid value is difficult. This problem is similar to the anti-pattern of using integers to encode such limited value sets \cite{effective_java, clean_code}. The problem is worsened by the fact that \skl{} sometimes does not validate parameters. For example, the \textsl{criterion} parameter of the \textsl{DecisionTreeClassifier} should either be \textsl{\str{gini}} or \textsl{\str{entropy}}. However, the creation of an instance with the call \textsl{DecisionTreeClassifier(\allowbreak{}criterion=\allowbreak{}\str{giny})} is silently accepted but, when we later call the \textsl{fit} method on the model, the program crashes. The error message \textsl{KeyError: \str{giny}} gives us only a vague hint about the source of the error. Using instead \keyword{enums} in conjunction with \keyword{type hints}\footnote{\url{https://docs.python.org/3/library/typing.html} (added in Python 3.5)} lets static analysis tools ensure that a correct value is passed. \end{description} The proposed introduction of parameter objects and enums would increase the number of classes, contrary to the non-pro\-li\-fe\-ra\-tion of classes design of \skl{}. It remains to be investigated which design is easier to learn and use correctly. We are confident that, with a careful redesign, (1) the improved error-resilience of the redesigned API is worth the effort and (2) the increase in the size of the API will be outweighed by the usage-based reduction discussed in Sec. \ref{sec:api_complexity}. \subsection{Module Structure} \label{sec:moduleStructure} Module structure is another target for API redesign: Models for supervised learning are grouped by model category, such as Support Vector Machine (SVM) models. The task they solve is only indicated by a suffix on the class name. For example, \textsl{SVC} is an SVM model for classification, and \textsl{SVR} is one for regression. Similarly, metrics for model evaluation are grouped in \textsl{sklearn\allowbreak{}.metrics}, regardless of task, even though the sets of metrics applicable to different tasks are disjoint. However, developers are interested in fulfilling a \emph{task}, rather than exploring a particular \emph{family of algorithms}. Therefore, we suggest grouping of models and metrics by task, like in Apache Spark MlLib \cite{mllib}. This speeds up the search for models applicable to a task, or metrics suited to evaluate their performance, and makes it obvious, which models and metrics can be used interchangeably. The importance of aligning software components with tasks has already been discussed in \cite{kersten:mylar, wang:feature_location, thung:api_method_recommendation}. \section{API Wrapping} \label{sec:api-wrapping} The design improvements discussed so far should not be misunderstood as a proposal for redesigning \skl{}, a high-quality, widely used ML library. Neither do we want to reinvent the wheel, nor break the huge number of programs using \skl{}. Our vision is to wrap the existing \skl{} library into an API that implements the suggested improvements so that it is more suited for novices. However, the size of the \skl{} library prohibits manual wrapper creation and maintenance. Thus, our approach raises the two challenges, summarized in RQ4: (1) automated initial wrapper creation and (2) automated update of wrappers, whenever a version of the \skl{} library is released. \subsection{Initial Wrapper Creation} \label{sec:wrapper creation} As a basis for automation, the manually derived design improvements outlined previously need to be expressed in a machine-readable form that specifies precisely which \emph{changes} should be performed on which \emph{API elements}. \begin{table} \centering \begin{tabulary}{\linewidth}{cL} \hline Annotation & Meaning \\ \hline\hline \textsl{@remove} & Remove unused \& unnecessary API element. \\ \hline \textsl{@attribute} & Remove parameter from the constructor of a model and keep it only as a model attribute. \\ \hline \textsl{@group} & Group dependent parameters as an object. \\ \hline \textsl{@enum} & Replace string type with enum type. \\ \hline \textsl{@move} & Move class / global function to another module. \\ \hline \end{tabulary} \vspace{0.5\baselineskip} \caption{Annotations that can be set in the annotation editor and their implied effect on wrapper creation.} \vspace{-2.4em} \label{tab:annotations} \end{table} We do this by annotating elements of the \skl{} API. Each annotation type (Table \ref{tab:annotations}) corresponds to one of the improvements outlined in Sec. \ref{sec:api_complexity} and \ref{sec:api-redesign}. A user can attach these annotations to classes, functions and parameters in a web-based annotation editor\footnote{\url{https://github.com/lars-reimann/api-editor}}. To reduce the workload of annotators and guide them to relevant elements, an initial set of \textsl{@remove} annotations is created automatically from the usage data described in Sec. \ref{sec:empirical}. Based on the annotations and the original \skl{} API, the new API is inferred and corresponding \keyword{wrappers} \cite{gof} are generated. \subsection{Wrapper Update} \label{sec:wrapperUpdate} The authors of \skl{} follow a strict release policy aimed not to break existing clients. API elements scheduled for removal are deprecated two versions in advance. Renamings and moves are implemented by deprecating the existing element and adding a new one. Similarly, changes of legal parameter values are implemented by deprecating the current value and adding a new one. This addition of new elements and forwarding from old to new ones is basically a wrapping step. Thus, a lightweight evolution policy can reflect the deprecations, additions and deletions from \skl{} in our adapted API, delegating the task of updating client programs to users of our API. Additions and deletions can be identified by our code analysis (Sec. \ref{sec:empirical}). Deprecation information can be extracted automatically from the \skl{} documentation using a mix of parsing, and rudimentary natural language processing (NLP). This avoids having to repeat the initial manual annotation work in any future releases. Only a fraction of the added elements might need new annotations. \section{Related Work} \paragraph{API usability} Among the rich body of literature about API usability, other contributions that were not cited so far but have influenced our work include the empirical study of API usability problems by Piccioni et al. \cite{piccioni2013}, the evaluation of API usability using Human-Computer Interaction methods by Grill et al. \cite{grill2012}, general recommendations for API designers by Myers and Stylos \cite{myers:api_usability}, and the JavaDoc alternative by Stylos et al. \cite{myers:api_documentation_usage}, which takes usage data of an API as input to create better documentation. However, we only found one other assessment of APIs in the context of ML, namely by Király et al. \cite{kiraly2021designing}, who compiled the interfaces and design patterns underlying \skl{} and other ML APIs and derived high-level guidelines for ML API design but didn't investigate their practical implications on a concrete framework, such as \skl{}. In addition their scitype concept also makes the notion of tasks explicit, which provides a formal basis for the task-oriented restructuring that we propose in Sec. \ref{sec:moduleStructure}. \paragraph{ML for novices} Our simplified API has been developed as part of the Simple-ML project \cite{Gottschalk2019, guidance}, as a back-end for a user-friendly Domain Specific Language (DSL) for ML. The Simple-ML API and DSL are embedded into an Integrated Development Environment (IDE) for ML workflows. The entire system is tailored to the needs of data science novices, to make ML more accessible. \paragraph{Wrapper creation} Our API wrapping approach described in Sec. \ref{sec:api-wrapping} is similar to the one of Hossny et al. \cite{paas_adapters}, who use semantic annotations to hide proprietary APIs of different cloud providers behind a generic one, in order to combat vendor lock-in. Wrappers are automatically created so they can easily be kept up-to-date. \paragraph{API evolution} The vast literature about techniques to tackle the evolution of an API and automatically keep \emph{client} code up-to-date is compiled in a recent survey \cite{evolution_survey}. However, our focus is not on updating client code but on updating our generated wrappers. For this, we need to be able to detect changes in \skl{} and identify conflicts with respect to the changes implied by our annotations. An extensive review of related change detection and change merging approaches can be found in \cite{mens2002:merging}. \section{Threats to Validity} \label{sec:threats-to-validity} \paragraph{Usage data} For now, we only pulled usage data from Kaggle programs that were linked to competitions. This can skew results, since we got groups of programs that solve the same problem and, therefore, might employ similar methods. Moreover, some competitions were very popular, so we could get 1000 entries\footnote{The maximum that can be retrieved via Kaggle's REST API}, whereas others only had a handful. \paragraph{\skl{} v1.0} In the meantime, a new version of \skl{} has been released. The few contained API changes\footnote{\url{https://scikit-learn.org/stable/whats_new/v1.0.html}} slightly change the absolute numbers but not the percentages reported in Sec. \ref{sec:api_complexity}. \section{Future Plans} \label{sec:future} To eliminate possible bias (Sec. \ref{sec:threats-to-validity}), we want to extend the gathered Kaggle data with additional \skl{} usage data from GitHub repositories. Afterwards, our plausibility check (Sec. \ref{sec:PlausibilityCheck}) for parameters needs to be completed. The suggestions for API redesign (Sec. \ref{sec:api-redesign}) initially had to be entered manually in the annotation editor. We have started automating this by extracting information from the documentation of \skl{}, using a mix of parsing (for the structured parts of the documentation) and natural language processing (for the rest). Task-oriented restructuring of modules (Sec. \ref{sec:moduleStructure}) will be partially automated by checking the suffix of model names (e.g Classifier vs. Regressor). The annotation editor (Sec. \ref{sec:api-wrapping}) is fully implemented. Annotation of \skl{} is in progress and the added annotations will be used as input for wrapper generation, and as a test oracle for automated extraction of necessary design changes from the documentation. Finally, the resulting API needs to be carefully evaluated through usability studies to determine whether it really yields the conjectured improvement. \section{Conclusion} In this paper, we have presented a novel approach for easing the learning and correct use of a complex API. Unlike approaches to learnability that focused on improving the documentation of an API \cite{Robillard:ESE2011, Robillard:IEEESOftware2009}, we investigated whether API \emph{complexity} can be reduced, to avoid overwhelming application developers. Based on analysis of the API's usage in 41,867 programs, we showed that 21\% of classes, 47\% of functions, and 57\% of parameters can be eliminated, without affecting any of the analysed programs (Fig. \ref{fig:scikit-statistics-bar-chart}). Analysing code and documentation of the remaining API elements, we found a proliferation of elements of primitive types, which impedes learnability and eases API misuse. Tangling of different concerns in long parameter lists hides the essential hyperparameters. Hard to debug errors arise from implicit dependencies of parameters and hidden narrowing of parameter domains in code that behaves correctly just on a subset of the values that can be passed (Sec. \ref{sec:api-redesign}). We showed that design improvements inspired by refactorings can solve these issues. However, since we cannot refactor a third-party API, we proposed an alternative approach: semi-automated API wrapping. We showed how a layer of wrappers that implement an improved API can be built and kept up-to-date with minimal manual effort, based on analysis of the original library's source code and documentation, usage statistics, and code generation. The only ML-specific argument in our discussion is the distinction between hyperparameters and parameters for other concerns. This notion can be generalized to a distinction between domain-specific parameters and others. Hence, semi-automated API wrapping should be applicable to other domains and APIs, as a general way to reduce API complexity and improve API design. \begin{acks} We want to thank the reviewers for their very constructive comments and inspiring suggestions for future work. This work was partially funded by the German Federal Ministry of Education and Research (BMBF) under project Simple-ML (01IS18054). \end{acks} \newpage \bibliographystyle{ACM-Reference-Format}
ea0b920447c830dc8bd7ef537d6a8eed77e4ddac
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section*{Acknowledgments} This work was financed by the Baden-Württemberg Stiftung (BWS) for the ABEM project under grant MET-ID12–ABEM. \clearpage \setlength{\bibsep}{0.0pt} {\small \bibliographystyle{plainnat} \section{#1}\label{sec:#2}\vspace{-.1cm}} \newcommand{\mysubsection}[2]{\subsection{#1}\label{sec:#2}\vspace{-.1cm}} \newcommand{\mysubsubsection}[2]{\subsubsection{#1}\label{sec:#2}\vspace{-.1cm}} \definecollection{mymaths} \newcommand{\mymath}[2]{ \newcommand{#1}{\TextOrMath{$#2$\xspace}{#2}} \begin{collect}{mymaths}{}{}{}{} #1 \end{collect} } \definecolor{colorA}{HTML}{4285f4} \definecolor{colorB}{HTML}{ea4335} \definecolor{colorC}{HTML}{fbbc04} \definecolor{colorD}{HTML}{34a853} \definecolor{colorE}{HTML}{ff6d01} \definecolor{colorF}{HTML}{46bdc6} \definecolor{colorG}{HTML}{000000} \definecolor{colorH}{HTML}{777777} \definecolor{colorI}{HTML}{bdd6ff} \definecolor{colorJ}{HTML}{6a9e6f} \usepackage{pifont} \newcommand{\cmark}{\checkmark}% \newcommand{\xmark}{\scalebox{0.85}{\ding{53}}}% \newcommand\blfootnote[1]{% \begingroup \renewcommand\thefootnote{}\footnote{#1}% \addtocounter{footnote}{-1}% \endgroup }
94812e4e7526c05a078f3047bff4eb01dd2b3647
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} The atomic parity non-conservation (PNC) experiment makes a significant contribution to testing the standard model (SM) in a low energy regime. By exchanging Z bosons between bound electrons and nuclear quarks in the electroweak interaction, the PNC effect increases rapidly with nuclear charge, so the PNC measurement in heavy atoms has become one of the most promising approaches to search for physics beyond SM \cite{bouchiat1974weak,bouchiat2011atomic,sandars1987parity}. The atomic PNC signal originates from the nuclear spin-independent (NSI) and the nuclear spin-dependent (NSD) parts. The NSI part, which is the dominant contribution to PNC \cite{dzuba2012revisiting,porsev2009precision,geetha1998nuclear}, depends on the nuclear weak charge \cite{ginges2004violations,sahoo2021new}. The NSD part of the PNC provides the value of the anapole moment of a nucleus \cite{flambaum1997anapole,flambaum1984nuclear,dzuba2011calculation,dmitriev2004p}. This value puts a constraint on the PNC meson-nucleon coupling constant \cite{haxton2002nuclear,flambaum1997anapole}. All the atomic PNC experiments require high-precision calculations in atomic structure. The most accurate measurement to date has been achieved with Cs by the Wieman's group \cite{wood1997measurement} in 1997. Alkali atoms have the advantage of being with a better understood wave function for the highly accurate calculation. This experiment has reached an unprecedented 0.35$\%$ accuracy, which could be compared with the prediction of the SM \cite{dzuba2002high}. In addition, several heavier ions such as $\rm{Yb}^+$, $\rm{Ba}^+$, and $\rm{Ra}^+$, having a chain of isotopes, are also considered potential candidates for exploring the anapole moment through the PNC effect and measurements \cite{dzuba2011calculation,sahoo2011parity,sahoo2011parity2}. Another important atomic PNC measurement has been achieved with atomic thallium in 1995 by the Oxford group \cite{edwards1995precise} and the Seattle group \cite{vetter1995precise}, using the optical rotation spectroscopy. Due to the more complicated atomic structure in comparison with cesium, the thallium PNC reached 1\% \cite{vetter1995precise} experimental accuracy, but the theoretical calculation was only 3\% \cite{dzuba1987calculation}. Although the uncertainty of thallium PNC is larger, it provides alternative constraints on both the NSI and NSD parts of PNC \cite{haxton2001atomic} and plays a unique role in today's testing of SM in low energy. However, the latest atomic thallium PNC measurements were performed more than two decades ago, and they were in great disagreement with each other. The electric dipole amplitude induced by PNC ($E1_{PNC}$) is one of the PNC observables and can be detected via interference of the $E1_{PNC}$ amplitude and the magnetic dipole ($M1$) amplitude among the same fine structure states, e.g. optical rotation. In the previous atomic thallium PNC data analysis \cite{majumder1999measurement}, the ratio of the $E1_{PNC}$ to the $M1$ amplitude, $R_{PNC}=~\Im[E1_{PNC}/M1]$, had a $2.2\sigma$ discrepancy between the Oxford group \cite{edwards1995precise} with $R_{PNC}=-15.71(45)\times 10^{-8}$ and the Seattle group \cite{vetter1995precise} with $R_{PNC}=-14.71(17)\times 10^{-8}$. Although these two groups used different techniques to calibrate their measured PNC rotations, this discrepancy was still partially attributed to that their optical rotation profile analysis used a different $\chi$ value, which is the ratio of electric quadrupole ($E2$) amplitude to the $M1$ amplitude and defined by the operators $Q^{(2)}$ and $\mu^{(1)}$ \cite{majumder1999measurement}: \begin{equation} \chi\equiv\frac{\omega}{4\sqrt{3}}\frac{\langle J'\vert\vert Q^{(2)}\vert\vert J\rangle}{\langle J'\vert\vert\mu^{(1)}\vert\vert J\rangle}. \end{equation} In the last decades, atomic structure and its $\chi$ value have been further researched \cite{safronova2005excitation, porsev2012electric, tang2018relativistic, maartensson1995magnetic, garstang1964transition, warner1968transition, neuffer1977calculation, biemont1996forbidden} with the transition probabilities of forbidden lines. In 1964, \cite{garstang1964transition} used intermediate coupling theory to obtain the atomic structure. Following the astrophysical interest, the semi-empirical methods and Scaled-Thomas-Fermi wave functions were used in \cite{warner1968transition}. Additionally, \cite{neuffer1977calculation} also calculated the transition probabilities, where the valence-electron wave functions are generated as numerical solutions of the Dirac equation in a modified Tietz central potential. Then, \cite{maartensson1995magnetic} utilized a relativistic coupled-cluster approach to obtain the atomic wave functions in 1995. One year later, the energy levels and radiative transition probabilities were calculated by \cite{biemont1996forbidden} with the relativistic Hartree-Fock method, including configuration interaction terms. For the latest calculation in 2005, the energies of states in Tl are obtained using the third-order relativistic many-body perturbation theory (MBPT) and the SD all-order method \cite{safronova2005excitation}, in which single and double (SD) excitations of the Dirac-Fock (DF) wave functions are summed to all orders. The transition rates for electric-quadrupole and magnetic-dipole transitions in Tl were also calculated in the SD approximation. Besides, the recent references \cite{porsev2012electric, tang2018relativistic}, which studied those approximations in the above methods, also supported the calculation of the transition probabilities. For the Oxford group, $\chi=0.254$ was used from \cite{neuffer1977calculation}; for the Seattle group, $\chi=0.240$ was derived from their experiment, and this value was also verified subsequently by \cite{safronova2005excitation,maartensson1995magnetic}. This was one of the important causes leading to the discrepancy in $R_{PNC}$ between these two groups. The atomic thallium PNC optical rotation experiment is to detect the rotation of laser polarization \cite{wolfenden1991observation,macpherson1991precise,meekhof1993high} propagating through a thallium vapor \cite{vetter1995precise}. In such an experiment, $\chi$ plays an essential role in understanding the optical rotation lineshape to derive a reliable value of $R_{PNC}$. The total optical rotation $\phi$ is contributed by: \begin{equation} \phi(\nu)=\phi_P(\nu)+\phi_F(\nu)+\phi_B(\nu) \end{equation} where $\nu$ is the optical frequency, $\phi_P$ is the PNC optical rotation, $\phi_F$ is the Faraday rotation, and $\phi_B$ is the background rotation. The PNC optical rotation interferes with all the other effects. The PNC amplitude, $R_{PNC}$, is related to the PNC optical rotation by \cite{vetter1995precise}: \begin{equation} \label{phip} \phi_P(\nu)=-4\pi L\nu c^{-1}[n(\nu)-1]R_{PNC} \end{equation} where $n(\nu)$ is the refractive index and $L$ is the path length. The $\chi$ value, which is related to the state-mixing Faraday rotation, has great importance in calculating the Faraday rotation. To acquire an accurate PNC optical rotation, the background rotation and the Faraday rotation need to be subtracted. For the background rotation, using a dummy tube could remove the background \cite{wolfenden1991observation}; For the Faraday rotation, a zero magnetic field could eliminate the first-order Faraday rotation which is proportional to the absorption depth and the external magnetic field \cite{majumder1999measurement,edwards1995precise}. However, a small component of the high order Faraday rotation is still generated by the hyperfine-state mixing \cite{cronin1999new}. For a transition between states $|i\rangle$ and $|j\rangle$, this high order Faraday rotation is written in the following terms \cite{edwards1995precise}: \begin{equation} \label{Faraday} \phi_F(\nu)\propto\sum_{F_iF_j}[K_1(F_i,F_j)+\chi^2K_2(F_i,F_j)]L_G(\nu_{ji}-\nu) \end{equation} where the angular coefficients $K_1$ and $K_2$ are calculated from the Clebsch–Gordan coefficients and can be found in \cite{edwards1995precise}, and the $L_G$ is a line-shape function. \begin{figure}[htbp] \centering \includegraphics[width=300 pt]{structure} \caption{The partial energy level diagram of atomic thallium. $F=1\rightarrow F'=1\rightarrow F''=0$ (channel~A) and $F=0\rightarrow F'=1\rightarrow F''=0$ (channel~B) are two channels to measure the $\chi$. The $F=1\rightarrow F'=1$ is mixed with $M1$ and $E2$, and the $F=0\rightarrow F'=1$ is purely $M1$. The hyperfine splittings of each state for $^{205}$Tl ($^{203}$Tl) are listed in the figure.} \label{structure} \end{figure} In the previous experiment \cite{majumder1999measurement}, the high order electromagnetic transitions ($M1$ \& $E2$) of the $6P_{1/2}\rightarrow6P_{3/2}$ transition were measured by the absorption spectroscopy of $F=1\rightarrow1,2$ and $F=0\rightarrow1,2$ to derive the ratio, $\chi=E2/M1$, as Fig.~\ref{structure} shows in the partial energy level diagram of atomic thallium. The $\chi$ value in this early experiment was measured to be 0.2387(10)(38). The systematic uncertainty was caused by the lineshape uncertainty, which was due to the Doppler broadening and the nearby $^{203}$Tl isotopic transitions, because the individual transition profiles could not be fully resolved. Therefore, a method utilizing the Electromagnetically-Induced-Transparency (EIT) to reduce the transition linewidth and prevent one transition from being disturbed by other transitions was proposed by \cite{cronin1998studies}. In addition, the EIT method makes the isotopic measurement of the $\chi$ value possible. As discussed in \cite{dzuba1986enhancement,pollock1992atomic}, the factor of the atomic structure would be largely canceled in the ratio measurement of the relative PNC between isotopes. The isotopic PNC ratio is independent of the theoretical calculation. In comparison with a single isotope, the measurements in a chain of isotopes can reach higher precision. Some recent issues \cite{safronova2018search,antypas2019isotopic} have also exhibited the potential in Yb, which has a chain of stable isotopes. Therefore, it is not constrained by the knowledge of the atomic wave function and has a great potential for searching for new physics beyond the SM \cite{fortson1990nuclear,brown2009calculations}. The ladder-type EIT in atomic thallium could also improve the PNC measurement as \cite{cronin1998studies} demonstrated and discussed. Furthermore, it is the technique to resolve the isotope shift and can be applied to the isotopic PNC measurement ($^{205}$Tl or $^{203}$Tl) by selecting the corresponding coupling transition. Our experiment presented not only a new $\chi$ value for thallium $6P_{1/2}\rightarrow6P_{3/2}$ transition but also a development for future EIT-PNC measurements. \section{EIT for $\chi$} EIT is an optical technique referring to the suppression upon a resonant absorption using a second laser field (coupling beam). It can be utilized for sub-Doppler spectroscopy to measure $\chi$. Due to the sub-Doppler linewidth of EIT, it can resolve the overlapping Doppler-broadened isotopic transitions. Additionally, by modulating the coupling beam, the differential output of the demodulating lock-in amplifier largely suppresses the background noise by the common-mode rejection. This method significantly reduces the interference between two isotopes, $^{203}$Tl (29.5\%) and $^{205}$Tl (70.5\%). In the previous experiment \cite{majumder1999measurement}, the direct Doppler-broadened absorption spectroscopy was employed, and two different transitions were overlapped together because the linewidth was as large as $\sim400$~MHz. The EIT technique narrowed the profile linewidth down to 75~MHz, which is much smaller than the $6p_{3/2}$ state hyperfine splitting, $531(30)$~MHz \cite{shie2013frequency}. In our experiment, we used two EIT channels to perform the signal amplitude ratio measurement, from which the $\chi$ value could be derived. These two channels are composed of a common coupling transition and two different forbidden transitions. Furthermore, a high frequency fiber-coupled electro-optic modulator (f-EOM) was utilized to bridge the large frequency gap between the $6P_{1/2}$ hyperfine splitting, $21.30957(35)$~GHz \cite{chen2012absolute}, in order to reduce the possible systematic errors caused by a large frequency scanning. \subsection{Typical three-level EIT model} Considering a typical three-level atomic system, including $\vert1\rangle$ (ground state), $\vert2\rangle$ (middle state), and $\vert3\rangle$ (excited state) in a ladder-type configuration, the density-matrix equations of motion under the rotating-wave approximation can be written as \cite{joshi2003electromagnetically}: \begin{equation} \begin{split} \label{density matrix equation} \dot{\rho_{\rm{11}}}=&~2\gamma_{\rm{2}}\rho_{\rm{22}}+\imath\Omega_{\rm{1}}(\rho_{\rm{12}}-\rho_{\rm{21}}),\\ \dot{\rho_{\rm{22}}}=&-2\gamma_{\rm{2}}\rho_{\rm{22}}+2\gamma_{\rm{3}}\rho_{\rm{33}}-\imath\Omega_{\rm{1}}(\rho_{\rm{12}}-\rho_{\rm{21}})+\imath\Omega_{\rm{2}}(\rho_{\rm{23}}-\rho_{\rm{32}}),\\ \dot{\rho_{\rm{12}}}=&-(\gamma_{\rm{2}}-\imath\Delta_{\rm{1}})\rho_{\rm{12}}+\imath\Omega_{\rm{2}}\rho_{\rm{13}}+\imath\Omega_{\rm{1}}(\rho_{\rm{11}}-\rho_{\rm{22}}),\\ \dot{\rho_{\rm{13}}}=&-(\gamma_{\rm{3}}-\imath(\Delta_{\rm{1}}+\Delta_{\rm{2}}))\rho_{\rm{13}}+\imath\Omega_{\rm{2}}\rho_{\rm{12}}-\imath\Omega_{\rm{1}}\rho_{\rm{23}},\\ \dot{\rho_{\rm{23}}}=&-(\gamma_{\rm{2}}+\gamma_{\rm{3}}-\imath\Delta_{\rm{2}})\rho_{\rm{23}}-\imath\Omega_{\rm{1}}\rho_{\rm{13}}+\imath\Omega_{\rm{2}}(\rho_{\rm{22}}-\rho_{\rm{33}}).\\ \end{split} \end{equation} $2\Omega_1$, derived from the E1 dipole approximation, and $2\Omega_2$, derived from the higher order (M1+E2) transition moment, are the Rabi frequencies for the probe ($\vert1\rangle\rightarrow\vert2\rangle$) and the coupling ($\vert2\rangle\rightarrow\vert3\rangle$) transitions, respectively. $\Delta_1$ is the detuning of the probe and $\Delta_2$ is the detuning of the coupling. $\gamma_i$~'s are the decay rates for each state. Without any buffer gas, the collision time between thallium atoms is 0.49 ms, which is much longer than the 7.5~ns natural lifetime of the $7S_{1/2}$ state. The collision will also quench the population of the $6P_{3/2}$ metastable state. Thus, the broadenings of both the coupling and probe transition are equivalent to the lifetime effects. We then take the population relaxation rate ($2\gamma_i$) to be two times of the dephasing rate ($\gamma_i$). In our experiment, the relevant hyperfine states of atomic thallium are substantially separated, fig. 1, in comparison with the laser linewidths, therefore, all the off-resonant excitations are negligible. In the steady state, the time derivative is taken to be zero for all the equations above. The weak probe approximation assumes that $\Omega_{\rm{1}}$ compared to $\Omega_{\rm{2}}$ is weak in this model, and $\rho_{\rm{11}}\sim1$. The steady solution of the off-diagonal term, $\rho_{\rm{21}}$, is \cite{khan2016role,zhu1996sub}: \begin{equation} \label{rho12} \rho_{\rm{21}}=-\frac{\imath\Omega_{\rm{1}}\rho_{\rm{11}}}{\gamma_{\rm{2}}-\imath\Delta_{\rm{1}}+\frac{{\Omega_{\rm{2}}}^2}{\gamma_{\rm{3}}-\imath(\Delta_{\rm{1}}+\Delta_{\rm{2}})}}. \smallskip \end{equation} The complex susceptibility, $\eta(\omega_p)$, for the probe beam can be obtained from the polarizability and is related to the off-diagonal term of the density matrix in the probe transition, $\rho_{\rm{21}}$ \cite{gea1995electromagnetically}: \begin{equation} \begin{split} P=~&\frac{1}{2}\epsilon_0E_p[\eta(\omega_p)e^{-\imath\omega_pt}+\rm{c.c.}]\\ =~&-2\hbar\Omega_1N{E_p^{-1}}\rho_{21}e^{-\imath\omega_pt}+\rm{c.c.}\\ \end{split} \end{equation} where $N$ is the number density of atoms. Considering the Doppler broadening in the configuration of the probe-coupling counter-propagating, the Doppler-broadened complex susceptibility by integrating all over the entire velocity distribution is written as: \begin{equation} \label{eta} \eta(\Delta_1,\Delta_2)=\int_{-\infty}^{\infty}\frac{4\imath\hbar{\Omega_1}^2}{\epsilon_0{E_p}^2}\left[\gamma_{\rm{2}}-\imath\left(\Delta_{\rm{1}}+\frac{\omega_p\nu}{c}\right)+\frac{{\Omega_{\rm{2}}}^2}{\gamma_{\rm{3}}-\imath(\Delta_{\rm{1}}+\Delta_{\rm{2}})-\imath(\omega_p-\omega_c)\nu/c}\right]^{-1}N(\nu)d\nu \end{equation} $\eta(\Delta_1,\Delta_2)$ is proportional to ${\Omega_1}^2$, and its imaginary part represents the absorption. Thus, the absorption signal, $\Sigma_{ab}$, is written as: \begin{equation} \begin{split} \label{s} \Sigma_{ab}=I_p\cdot\operatorname{Im}[\eta(\Delta_1,\Delta_2)]&=I_p\bm{d}^2\cdot L(\Delta_1,\Delta_2;\Omega_2)\\ &=S\cdot L(\Delta_1,\Delta_2;\Omega_2)\\ \end{split} \end{equation} where $I_p~({E_p}^2)$ is the probe beam intensity, $\bm{d}~=2{\Omega_1}/{E_p}$ is the transition moment of $\vert1\rangle\rightarrow\vert2\rangle$, $L(\Delta_1,\Delta_2;\Omega_2)$ is the EIT profile, and $S$ is the signal amplitude that is proportional to $I_p \bm{d}^2$. The integration of Eq.~(\ref{eta}) has been analytically calculated by \cite{gea1995electromagnetically} and was used as our EIT profile fitting model with $\Omega_2=$ constant and $\Delta_2=0$. In this paper, our interest is in measuring $\bm{d}$. \subsection{EIT in thallium forbidden transition} For an $E1$-forbidden transition, considering the high order moments $M1$ and $E2$, the transition moment including all the Zeeman sublevels, such as the $6P_{1/2}\rightarrow6P_{3/2}$ of thallium, can be written as \cite{cronin1999new}: \begin{equation} \label{s2} \bm{d}^2(J,F,m,J',F',m',\theta)=\sum_{m,m'}{\vert p+\chi q\vert}^2\vert\langle J'\vert\vert\mu^{(1)}\vert\vert J\rangle\vert^2. \end{equation} Both $p(J,F,m,J',F',m',\theta)$ and $q(J,F,m,J',F',m',\theta)$ are related to the quantum numbers of the states involved in the probe transition. $\theta$ is the relative polarization angle between the coupling and the probe beams. It affects the relative transition rates through the different Zeeman sublevels of the intermediate state, $\vert2\rangle$. $\chi$ is the ratio of the $E2$ to $M1$ transition moment as we mentioned earlier. In this paper, we focus on two three-level ladder-type EIT transitions of the atomic thallium, belonging to the hyperfine manifold of $6P_{1/2}\rightarrow6P_{3/2}\rightarrow7S_{1/2}$ as Fig.~\ref{structure} shows. The two channels are $\vert\rm{a}\rangle\rightarrow\vert\rm{c}\rangle\rightarrow\vert\rm{d}\rangle (channel~A)$ and $\vert\rm{b}\rangle\rightarrow\vert\rm{c}\rangle\rightarrow\vert\rm{d}\rangle (channel~B)$. In channel~A, the probe transition ($\vert\rm{a}\rangle\rightarrow\vert\rm{c}\rangle$, $\bm{d}_{\rm{A}}$) is a mixture of $M1$ and $E2$ because $\Delta F=0$. In channel~B, the probe transition ($\vert\rm{b}\rangle\rightarrow\vert\rm{c}\rangle$, $\bm{d}_{\rm{B}}$) is $M1$ only because $\Delta F=1$, and therefore $q=0$. Using Eq.~(\ref{s2}), the complete forms of $\bm{d}_{\rm{A}}$ and $\bm{d}_{\rm{B}}$ are \cite{cronin1999new,cronin1998studies}: \begin{equation} \label{cossin} \begin{split} {\bm{d}_{\rm{A}}}^2&=\vert\langle J'\vert\vert\mu^{(1)}\vert\vert J\rangle\vert^2\cos^2\theta(1-3\chi/\sqrt{5})^2/4\\ {\bm{d}_{\rm{B}}}^2&=\vert\langle J'\vert\vert\mu^{(1)}\vert\vert J\rangle\vert^2\sin^2\theta\\ \end{split} \end{equation} where $\langle J'\vert\vert\mu^{(1)}\vert\vert J\rangle$ is the $M1$ transition moment of $6P_{1/2}\rightarrow6P_{3/2}$. The $6P_{3/2}\rightarrow7S_{1/2}$ coupling transition ($F'=1\rightarrow F''=0$) is $E1$-allowed and shared by both channels. Because the same coupling transition, the ${\Omega_{\rm{c}}}^2(={\Omega_2}^2)$, $\gamma_{\rm{d}}(=\gamma_3)$, and $\Delta_{\rm{c}}(=\Delta_2)$ are the same for both channels, and the lineshape part, $L(\Delta_1,\Delta_{\rm{c}};\Omega_{\rm{c}})$, in Eq.~(\ref{s}) can be eliminated in a differential measurement. From Eq.~(\ref{cossin}), the ratio of the absorption signals between channel~A ($S_{\rm{A}}$) and channel~B ($S_{\rm{B}}$) can be written as: \begin{equation} \label{ratio} \frac{S_{\rm{A}}}{S_{\rm{B}}}=\frac{{\bm{d}_{\rm{A}}}^2}{{\bm{d}_{\rm{B}}}^2}=(1/4)|(3\chi/\sqrt{5})-1|^2\cot^2\theta. \end{equation} By measuring the ratio of the amplitudes between channel~A and B under various relative coupling-probe polarization angles $\theta$, the $\chi$ can be extracted. Our experiment was based on the differential measurement between channel~A and channel~B. While the measurements on these two channels were performed, maintaining the experimental conditions to be the same would be crucial for a high common mode rejection rate. Thus, we have taken advantage of the high frequency f-EOM to generate two identical sidebands and to bridge the large frequency gap between the two channels. \section{Experiment} \subsection{Fiber-EOM frequency bridging} The hyperfine structure of $6P_{1/2}$ is $\sim21.3$~GHz, which is too large to cover in one continuous scan for our 1283~nm external cavity diode laser (ECDL). Furthermore, including power, pointing, and polarization, the accompanied variances became serious systematic errors in our differential measurement. Therefore, we used a f-EOM to generate two laser sidebands on the probe beam to measure the two EIT signals in a minimum time gap. The frequency difference between the two sidebands (20.74~GHz) was slightly lower than the hyperfine splitting of the ground state $6P_{1/2}$ to avoid overlapping. Fig.~\ref{carriersidebands}~(a) and (b) illustrate the relative positions of two 1283~nm laser sidebands while the sidebands scanned across channel~A and channel~B, respectively. The channel~A signal is observed when the low frequency sideband crosses the transition $6P_{1/2}(F=1)\rightarrow6P_{3/2}(F'=1)$; The channel~B signal is observed when the high frequency sideband crosses the transition $6P_{1/2}(F=0)\rightarrow6P_{3/2}(F'=1)$. The AC stark shift \cite{grimm2000optical} of the probe transition, induced by the nearby carrier component and the other sidebands, was estimated to be 78~Hz for these forbidden transitions and is negligible in comparison with the observed linewidth. With the help of two sidebands, we can successively measure the channel~A and channel~B signals within a few seconds. That is, the laser frequency itself (carrier) was only scanned 1.1~GHz instead of 21~GHz. This advantage ensured the minimized variations of the probe and the coupling during the period of acquiring these two channels. Fig.~\ref{carriersidebands}~(c) shows the carrier and sidebands observed using a reference cavity with 1.4~GHz free spectral range (FSR). The amplitude of $\pm1$ sidebands was guaranteed to be identical by the f-EOM. The residual amplitude modulation (RAM) has been minimized by careful alignment of the polarization to the input polarization maintained input fiber axis, although this high frequency (21~GHz) RAM has no effect on our measurement. The difference in the refractive indices (dispersion) between the two sidebands ($\Delta f=21$~GHz) is only $7.02\times10^{-7}$. The second-order sidebands were also observed. However, they did not affect our experiment because of being far away from any transitions. \begin{figure} \centering \includegraphics[width=320 pt]{carriersidebands} \caption{The relationship between the f-EOM modulated 1283~nm laser frequencies and two EIT transitions. (a) One of the laser sideband positions at the channel~A resonance. The orange lines are the EIT transmission windows with a 21.3~GHz frequency gap. The red line is the laser carrier, and the blue lines are the first order laser sidebands. The coupling beam is on resonance. While the low frequency sideband of the probe beam scans across the transition $6P_{1/2}(F=1)\rightarrow6P_{3/2}(F'=1)$, the channel~A signal is observed. (b) The other laser sideband position at the channel~B resonance. While the high frequency sideband of the probe beam scans across the transition $6P_{1/2}(F=0)\rightarrow6P_{3/2}(F'=1)$, the channel~B signal is observed. (c) The f-EOM modulated the 1283~nm laser to generate the carrier, the first-order sidebands, and the second-order sidebands which were monitored by a reference cavity with a FSR = 1.4~GHz while the 1283~nm laser carrier was scanning.} \label{carriersidebands} \end{figure} \subsection{Experimental setup} \begin{figure*}[ht] \centering \includegraphics[width=450 pt]{expsetup} \caption{Experimental setup. AOM: acousto-optic modulator. PPLN: periodically poled lithium niobate. BS: beam splitter. HWP: half wave plate. QD: quantum dot. ECDL: external cavity diode laser. DMLP650: 650~nm longpass dichroic mirror. PD1: photodetector for reference cavity. PD2: photodetector for detecting the coupling beam power. PD3: photodetector for detecting the probe beam power. PD4: photodetector for measuring the EIT signals. The green line is the 535~nm laser light. The red line is the 1283~nm laser light. The black dash line is the electronic signal connection.} \label{expsetup} \end{figure*} The schematic diagram of our experimental setup is shown in Fig.~\ref{expsetup}, which is composed of three parts: the coupling laser, the probe laser, and the EIT spectrometer. The coupling beam (535~nm) was from an amplified 1070~nm ECDL (Newport, TLB-6300-LN) and frequency doubled by a MgO doped periodically poled lithium niobate (HC Photonics, PPLN). The temperature of the PPLN was controlled at $103.67~^\circ$C to reach the quasi-phase matching condition. An output of 50~mW at 535~nm could be generated from a 1.3~W 1070~nm fundamental laser. The acousto-optic modulator (AOM) with a 362~MHz injection frequency was ON/OFF modulated for switching the coupling laser at 30~kHz. Part of the light after the AOM was directed to the high finesse wavemeter (HighFinesse, WSU-30) to measure the frequency in 1~MHz resolution, and this signal was used for computer feedback lock to stabilize the frequency of the coupling laser. The probe laser was a 1283~nm quantum dot ECDL \cite{chen2017sub}. It was capable of scanning over 7~GHz without mode hopping. The 5~mW output was modulated using the f-EOM, which was injected with a 10.37~GHz microwave. The microwave was generated using three frequency doubling stages from a frequency synthesizer (HP, 8648B) with an output of 1.29625~GHz. The reference cavity with FSR = 1.4~GHz was used for diagnosis. The optical isolator was essential for the QD-ECDL, which was very sensitive to optical feedback. The EIT spectrometer was arranged as a coupling-probe counter-propagation configuration with precise polarization control. The two polarizers for the coupling beam (Thorlabs, GT5-A) and the probe beam (Thorlabs, GT5-C) are Glan-Taylor calcite polarizers with $10^5$ extinction ratio. The half-wave plate (HWP) for the coupling beam was used to adjust the coupling beam polarization angle relative to the probe beam. The HWP for the probe beam was used to optimize the polarization for better efficiency of the dichroic mirror (Thorlabs, DMLP650), which was used to split or combine the coupling and the probe beams. Both beams passed through a 10~cm thallium cell at 577~$^\circ$C. In the interaction region, the probe beam diameter is $\sim$~1.5~mm, and the coupling beam diameter is $\sim$~3~mm. Due to the modulation transfer mechanism, the 30 kHz modulation was transferred to the unmodulated probe beam. The lock-in amplifier (SRS, SR830) was to demodulate the probe beam signal with 30~mV sensitivity and 30~ms time constant. Therefore, the EIT signals, which were the result of the two-photon interaction between the probe and the coupling beams, could be observed. \subsection{Single photon direct absorption spectroscopy} The single-photon direct absorption for both the probe transition $(6P_{1/2}\rightarrow6P_{3/2})$ and coupling transition $(6P_{3/2}\rightarrow7S_{1/2})$ was performed as the preparation stages before acquiring the EIT spectrum. In these experiments, we tested our laser systems and characterized several important features of our apparatus. \subsubsection{1283~nm $E1$-forbidden probe transition} \begin{figure} \centering \includegraphics[width=260 pt]{1283nmspectrum} \caption{The Tl $6P_{1/2}$ to $6P_{3/2}$ absorption signal. This spectrum was taken using the SAM technique with 9.36~GHz sidebands to bridge the large frequency gap and to avoid overlapping. The hyperfine transitions for both $^{205}$Tl and $^{203}$Tl are all indicated.} \label{1283nmspectrum} \end{figure} Figure~\ref{1283nmspectrum} shows the direct absorption spectrum of $6P_{1/2}\rightarrow6P_{3/2}$ forbidden transition using the 1283~nm QD-ECDL laser. These transitions are all $M1$-allowed except the $F=0\rightarrow F'=2$ transition, which is a much weaker $E2$-allowed transition. We utilized the sideband amplitude modulation (SAM) technique \cite{chen2019sideband} to improve the signal to noise ratio (SNR), and no intensity variation within the scanning range was found. The SAM could effectively eliminate the power fluctuation and maintain the absorption profile in the spectrum. In the meantime, it also bridged the largely separated hyperfine structure and allowed us to observe the entire spectrum by scanning the 1283~nm with only $\sim5$~GHz for a 21.3~GHz frequency gap. With a cell temperature at 620~$^\circ$C, the observed Doppler width was 344~MHz. Such a broadening made the $6P_{3/2}$ hyperfine splitting incompletely resolvable, and all the small isotopic transitions of $^{203}$Tl were buried under the strong transitions. \subsubsection{535~nm coupling transition} Figure~\ref{535nmspectrum} shows the absorption signals of the $6P_{3/2}(F=1)\rightarrow7S_{1/2}(F=0)$ transition of both $^{205}$Tl and $^{203}$Tl. These transitions start from the metastable $6P_{3/2}$ state, which is thermally populated by the high cell temperature (620~$^\circ$C). In this transition, the isotope shift is larger than the Doppler width, so the isotopic transition can be completely resolved. The Doppler-broadened linewidth is $\sim1$~GHz. The laser frequency was measured using a wavemeter with 1~MHz resolution. This coupling laser was locked to the resonance of $6P_{3/2}(F=1)\rightarrow7S_{1/2}(F=0)$ to have $\Delta_{\rm{c}}=0$ (Eq.~(\ref{rho12})) while performing the EIT spectroscopy. With $\Delta_{\rm{c}}\neq0$, the EIT profile is asymmetry and results in a systematic error in $\chi$, as the theoretical model shows. To avoid the asymmetry, we cross-checked the central frequency with our atomic beam apparatus as a secondary calibration, which has no Doppler broadening as the inset of Fig.~\ref{535nmspectrum} shows. In our atomic beam spectroscopy, the uncertainty of the absolute frequency was estimated to be 3~MHz from the SNR, and the linewidth was observed to be 110~MHz. The systematic error of this absolute frequency due to the asymmetrical profile was \textless 3~MHz. The measured transition frequencies of $6P_{3/2}\rightarrow7S_{1/2}$ using the atomic beam and a wavemeter were in good agreement with the Doppler free saturation spectroscopy \cite{shie2013frequency}. In the $\chi$ measurement, we utilized computer feedback control to stabilize the coupling laser frequency for $\Delta_{\rm{c}}=0$ by forwarding the wavemeter output. The long term stability was 1~MHz in 1~min. By choosing a different target frequency for locking, we were able to select different isotopes for the $\chi$ measurement and were allowed to measure the $\chi$ of $^{203}$Tl. \begin{figure} \centering \includegraphics[width=300 pt]{535nmspectrum} \caption{The Tl $6P_{3/2}(F=1)$ to $7S_{1/2}(F=0)$ absorption signal using amplitude modulation by an AOM. The isotope shifts are clearly distinguished. The inset is the fluorescence spectrum using the atomic beam system. The linewidth is 110~MHz.} \label{535nmspectrum} \end{figure} \section{EIT spectrum} To perform the EIT spectroscopy for $\chi$ measurement, we stabilized the coupling laser as we mentioned earlier, and we scanned the 1283~nm probe laser through the two channels with various polarization angles relative to the coupling beam. The atomic cell temperature was $577~^\circ$C. Fig.~\ref{fittingresidual} shows a typical experimental run in 20 seconds at one polarization angle, where the signal amplitude of channel~A and channel~B was approximately equal. Data binning was made for every 50 data points. The frequency axis was calibrated using a reference cavity with FSR=1.4~GHz, and the spacing of two transition signals was 569.5~MHz because of the hyperfine splitting of $6P_{1/2}$ (21.3~GHz) and the applied f-EOM sideband gap (20.74~GHz). The signal was from the output of the lock-in amplifier with a time constant of 30~ms. The background noise level was $\sim6.1$~mV. While the signal of one channel was maximum, the other channel was buried under the noise level as Fig.~\ref{3dcompare} shows. The $\chi$ measurement was mainly inferred from the amplitude of two channels varied with the polarization angle. The noise of the spectrum was the primary uncertainty source. For a single run, the uncertainty of the $\chi$ value could be estimated by the ratio of the maximum amplitude to the noise level. Figure~\ref{fittingresidual} also exemplifies the model fitting to the experimental data. The red curve is the Doppler-broadened model (Eq.~(\ref{eta})), which gives $S_{\rm{A}}$ ($S_{\rm{B}}$) as 2.7 (4.4)~V with 10\% uncertainty, $\gamma_{\rm{A}}$ ($\gamma_{\rm{B}}$) as $7.7(3)\times10^6$ ($4.3(3)\times10^7$)~sec$^{-1}$, and $\Omega_{\rm{c}}$ as $2\pi\times10(2)$~MHz. The 10\% uncertainty of the signal amplitude was the result of the background noise. The fitted value of $\gamma_{\rm{A}}$ ($\gamma_{\rm{B}}$) is not just the lifetime decay rate of the corresponding states because of the laser frequency instability and scanning jitter. Meanwhile, the strong collision quench should be taken into account. These broadenings (for $\gamma_{\rm{A, B}}$) are common for both channel~A and channel~B. Therefore, their impact on the $\chi$ value is minimized in our differential-type measurement. The coupling strength ($\Omega_{\rm{c}}$) agrees with the calculation from the $6P_{3/2}\rightarrow7S_{1/2}$ dipole transition \cite{safronova2005excitation} and the applied coupling laser intensity. \begin{figure} \centering \includegraphics[width=290 pt]{fittingresidual} \caption{The EIT spectrum of channel~A and channel~B. The blue points and error bars are the experimental results with data binning for every 50 points. The red curve is the fitted ladder-type EIT model. } \label{fittingresidual} \end{figure} Figure~\ref{3dcompare} shows the spectrum of two EIT signals with various polarization angles (0 to $2\pi$) between the probe and the coupling beams. The spacing of the two transition signals was 569.5~MHz to prevent the two EIT signals from interfering with each other. The channel~A signal was the maximum while the two polarizations were in parallel, whereas the channel~B signal was the maximum in the condition of the perpendicular polarization. \begin{figure} \centering \includegraphics[width=300 pt]{3dcompare} \caption{The channel~A and channel~B spectrum with polarization angles from 0 to $2\pi$. The spacing between channel~A and channel~B was only 0.57~GHz because of the f-EOM bridging technique. The $\pi/2$ phase shift between the two channels was observed.} \label{3dcompare} \end{figure} \begin{figure} \centering \includegraphics[width=300 pt]{cossinsquare} \caption{The fitted signal amplitudes ($S_{\rm{A}}$ and $S_{\rm{B}}$) versus the polarization angles. The black and blue points are the values of $S_{\rm{A}}$ and $S_{\rm{B}}$, respectively. Some amplitudes are too small to be above the noise level. The red line and purple line are fitting curves, corresponding to the squared sinusoidal functions with a $\phi/2$ phase difference. The error bars are the model parameter uncertainties ($S_{\rm{A,B}}$) given by the fitting in Fig.~\ref{fittingresidual}. HWP: half-wave plate. The HWP angle varies from 0 to $\pi$, which is equivalent to the polarization angles from 0 to $2\pi$.} \label{cossinsquare} \end{figure} The signal amplitudes are proportional to the probe transition moments and functions of polarization angles, Eq.~(\ref{cossin}). Thus, the amplitudes, $S_{\rm{A,B}}(\theta)$, from the fitted EIT profile were plotted in Fig.~\ref{cossinsquare} for one of the experimental runs with the polarization angle varying from 0 to $2\pi$. The polarization dependent amplitude could be expressed as: \begin{equation} \label{phi} \begin{split} S_{\rm{A}}(\theta)=&~S_{\rm{A0}}\cos^2{(\theta+\phi_{\rm{A}})}\\ S_{\rm{B}}(\theta)=&~S_{\rm{B0}}\sin^2{(\theta+\phi_{\rm{B}})},\\ \end{split} \end{equation} where $\theta/2$ is the HWP angle relative to the rotation angle gauge, $\phi_{\rm{A,B}}$ are offset angles for each channel. The amplitude of channel~A (B) is $S_{\rm{A0}}$ ($S_{\rm{B0}}$), which presents the maximum amplitude among all polarization angles. In Fig.~\ref{cossinsquare}, the deviations of each data point mainly came from the noise of the EIT spectrum as Fig.~\ref{fittingresidual} shows. In this example run, $S_{\rm{A0}}=0.61(1)$ and $S_{\rm{B0}}=5.43(4)$ were used as one data point to calculate the $S_{\rm{A0}}/S_{\rm{B0}}=(1/4)|(3\chi/\sqrt{5})-1|^2$. In the average of all experimental runs, $\phi_{\rm{A}}-\phi_{\rm{B}}=0.061(2)^\circ$ which implied that the maximum amplitude of the two signals has a $\pi/2$ phase difference in their polarization angle as the theory predicted. \section{Systematic effects and error budget} In this section, we discuss the systematic errors and estimate their contribution to the inferred $\chi$ value as Table~\ref{error} lists. These assessments include the coupling laser frequency uncertainty, the cell temperature, the laser power fluctuation, and the probe laser scanning nonlinearity. \begin{center} \begin{table}[b] \caption{\label{error}The error budget of systematic effects in $\chi$.} \centering \begin{tabular}{cccc} \br \textrm{Systematic error}& \textrm{relative uncertainty}\\ & ($10^{-5}$)\\ \mr 535nm frequency lock uncertainty & $0.8$\\ Temperature & $9.0$\\ Laser power variation & $8.8$\\ Unequal sidebands & $255.0$\\ Residual magnetic field & $9.5$\\ Laser frequency scanning speed variation & $94.1$\\ \mr Total & $272.3$\\ \br \end{tabular} \end{table} \end{center} \subsection{Light power effect} The theoretical model (Eq.~(\ref{rho12})) used in our experiment was under the \emph{weak probe approximation}, which implied that the signal amplitude was proportional to the square of the probe laser Rabi frequency ($4{\Omega_{\rm{a,b}}}^2\propto I_p$) and independent of the coupling laser power ($4{\Omega_{\rm{c}}}^2\propto I_{\rm{coupling}}$). We have examined the applicability by varying the probe and the coupling power. \begin{figure}[htbp] \centering \includegraphics[width=300 pt]{power} \caption{The channel A and channel B signals at various probe beam power. The data points are the repeating measurements with various coupling and probe power. And, the error bars of both x and y represent one standard deviation. During one measurement, the fluctuation of the probe power gave errors in the x-axis. The slopes of the linear fittings are $5.2(3)\times10^{-3}$ (red), $4.9(4)\times10^{-3}$ (blue), $1.41(3)\times10^{-2}$ (yellow), and $1.48(9)\times10^{-2}$ (green). In this figure, even with a potential 25\% coupling power variation, our measurement is still well under “weak problem approximation”. The channel A signals used the same photodetector but with 3x gain.} \label{power} \end{figure} The EIT amplitudes versus the probe powers ($\Omega_{\rm{a,b}}^2$) with different coupling powers (${\Omega_{\rm{c}}}^2$) are shown in Fig.~\ref{power}. It verifies that our experimental setting was well under the weak probe approximation, and the model was eligible. In our experiment, the typical coupling power was 50~mW and the fluctuation was 1.7\%. As the result shows, such small fluctuation was negligible in the resulting signal amplitude measurement. \subsection{Number density} The number density not only affected the amplitude of the signal but also resulted in an inhomogeneous coupling laser intensity distribution along the laser beam while the number density was sufficiently high. Because the coupling transition was $E1$-allowed with a large interaction cross-section, the absorption lowered the coupling laser power along the laser propagation. Thus, the cell was optically thick at a high temperature. This effect has not been included in our model and led to a systematic error in the measurement. There was a trade off in the high number density despite providing a larger signal. We inferred the $\chi$ value under various cell temperatures (various number densities) and found that the $\chi$ value increased significantly when the cell temperature was higher as Fig.~\ref{chitotemperature} shows. Thus, to avoid such an error in the final data taking, we set the cell at $577~^\circ$C, where the SNR was still sufficient. \begin{figure} \centering \includegraphics[width=300 pt]{chitotemperature} \caption{The $\chi$ value at different temperatures of the thallium cell. Because the coupling beam power became dimmed along its propagation while it passed through the optically thick cell at higher temperatures, it probably caused the signal ratio of channel~A to channel~B to change, and so did the $\chi$ value. The red line shows the trend of the $\chi$ value rising at higher temperatures. The error bars of $\chi$ in 1$\sigma$ uncertainty calculated (propagating) from the uncertainties of $S_{\rm{A0,B0}}$ from Fig.~\ref{cossinsquare}, then calculated using Eq.~(\ref{cossin}) through the standard error propagating procedure.} \label{chitotemperature} \end{figure} \subsection{Error budget} One of the systematic errors was the frequency of the stabilized coupling beam. Firstly, the frequency jitter uncertainty of the 535~nm coupling laser was estimated to be 1~MHz because the feedback control frequency stabilization was based on the high finesse wavemeter, which has a relative uncertainty of 1~MHz. The lineshape, $L(\Delta_1,\Delta_{\rm{c}};\Omega_{\rm{c}})$, changed by the $\Delta_{\rm{c}}$ frequency jitter, could result in signal amplitude fluctuation. The signature of such noise was that it is more pronounced on the peak of the signal but not on the signal baseline. As Fig.~\ref{fittingresidual} shows, the noise on the top of the EIT signal is as large as the background noise. We concluded that the frequency jitter was negligible since the linewidth was as large as 75~MHz. Secondly, the nonzero coupling laser detune ($\Delta_{\rm{c}}\neq0$) resulted in an asymmetrical EIT profile as we mentioned earlier. This frequency ($\Delta_{\rm{c}}$) was manually set to be on resonance ($\Delta_{\rm{c}}=0$) within a deviation (\textless~3~MHz). We simulated the EIT profile with $\Delta_{\rm{c}}=\pm3$~MHz in comparison with the experimental data. The relative deviation on the derived $\chi$ was only $0.8\times10^{-5}$. Such a small effect was thanks to the differential measurement, since both channel~A and channel~B shared the same coupling beam and therefore the same induced asymmetrical profile. The cell temperature fluctuation affected the Maxwell-Boltzmann distribution and changed the density of thallium atoms. In our experiments, the cell temperature was stabilized to be $\delta T$~\textless~$0.5~^{\circ}$C/hr, which was corresponding to a 1.3\% fluctuation in the number density and 0.03\% in the Doppler width. Because the time gap between scanning through channel~A and channel~B was only 13~secs, the relative fluctuation of the EIT profile amplitude was only $9\times10^{-5}$. The variation of the Doppler width was related to the $\gamma_{\rm{s}}'$ variation and had a small impact on the $\chi$ value. Both the intensities of the coupling and the probe beams were also the sources of uncertainty and errors. The power variation effect of the coupling beam was negligible as we discussed earlier. The power instability of the probe laser could be categorized into two parts: the fast intensity noise and the slow intensity fluctuation. The fast noise was mostly filtered out by the 30~ms time constant of the lock-in amplifier and further averaged out by the binning average. The slow intensity fluctuation was reduced using the frequency bridging and the intensity normalization. By applying the f-EOM bridging technique, the observation time interval between channel~A and channel~B signals was only 13~secs. The deviation of the laser power was 1.1\% during this interval. Thus, it was important to normalize the EIT signal with respect to the probe power, which was monitored by a detector (PD3 in Fig.~\ref{expsetup}). The residual normalization error due to the noise of the power monitor signal (0.8\%) was estimated to be $1.1\%\times0.8\%=8.8\times10^{-5}$. While the applied modulation to the EOM is a perfect sinusoidal wave, the power equality between two sidebands is guaranteed by the momentum conservation. However, certain systematic effects can violate this symmetry. Firstly, the Serrodyne modulation \cite{wong1982electro,johnson1988serrodyne,johnson2010broadband} generates the unequal sidebands by a sawtooth wave, which is an asymmetrical microwave with high order harmonics. The ratio of the rising- to falling-times determines the ratio of the two sideband powers. To achieve a pair of equal power sidebands, the high harmonics, particularly the second harmonic $2\times10.37$~GHz, were suppressed. The 10.37~GHz microwave modulation was generated from 1.296~GHz from a synthesizer (HP-8648B), then multiplied ($\times8$) using three multipliers (ZX90-2-19-S+, ZX90-2-36-S+, ZX90-2-24-S+) and filtered by one bandpass filter (VBFZ-5500-S+). Overall, the lowest (second) harmonic was suppressed by $-20$~dB. Then, it was amplified by a 10 GHz amplifier, which further cleans out the high frequency components. Finally, the f-EOM (PM-0K5-10-PFU-PFU-130) has a 10~GHz cut-off frequency. Therefore, we estimated the suppression of the second harmonic $2\times10.37$~GHz \textless~$-30$~dB, the corresponding rising- and falling-times asymmetry \textless~$0.13\%$, and the inequality between two sidebands \textless~$255.0\times10^{-5}$ \cite{johnson1988serrodyne,li2010optical}. Secondly, “time-varying” unequal sideband, that is, residual amplitude modulation (RAM) is considered \cite{whittaker1985residual,bi2019suppressing}. While the input polarization was not aligned to the axis of EOM (or PM fiber of the f-EOM), any polarization-sensitive component could result in such a RAM, which is a fast amplitude modulation with a frequency of 10.37 GHz. In the experiments, our InGaAs detector could only detect signals from DC to 100 kHz, and our lock-in amplifier time constant was 30 ms. The RAM (10.37~GHz) effect was completely averaged out. Even though, we had carefully adjusted the polarization to minimize RAM. We conclude that RAM has no effect on our measurement. As discussed in \cite{cronin1998studies,marangos1998electromagnetically,cheng2017electromagnetically}, the stray magnetic field would distort the EIT signals, $L(\Delta_1,\Delta_{\rm{c}};\Omega_{\rm{c}})$, because of the Zeeman splitting. In our experiment, the residual magnetic field was measured to be 0.2~G, and the corresponding Zeeman splittings were 93~kHz for the $6P_{1/2}(F=1)$ state and 0.56~MHz for the $6P_{3/2}(F'=1)$ state. The splittings of both states are much narrower than the width of the EIT signal which is $\sim75$~MHz. Experimentally, we increased the magnetic field up to 2~G, and no broadening or change of the lineshape was observed. A small systematic uncertainty due to the dichroism was then estimated. The differential method in calculating the $\chi$ value also reduced the impact of the Zeeman splitting of the $6P_{3/2}(F'=1)$ state (the common state). However, for the $6P_{1/2}$ state, the Zeeman splitting could not be eliminated, because channel~A from $6P_{1/2}(F=1)$ suffered the Zeeman splitting, but not channel~B from $6P_{1/2}(F=0)$. To assess such an effect from the residual magnetic field, we modeled the Zeeman splitting using two theoretical profiles to compose one EIT signal. The resulting deviation of $\chi$ was estimated to be $9.5\times10^{-5}$ in relative uncertainty. The probe laser scanning speed fluctuation caused variation of the EIT profile widths, but did not directly affect the amplitude, due to the slow scanning speed (1.1~GHz in 25~s) and 30~ms time constant of the lock-in amplifier. In our 32 experimental runs, the resulting $\gamma_{\rm{A, B}}$ for each run had a 12\% deviation according to our frequency marker (the reference cavity with 1.4~GHz FSR). As $\chi$ was derived from the amplitude ratio of channel~A to channel~B, the indirect effect of the $\gamma_{\rm{A, B}}$ variation on the amplitude ratio, $\chi$, was estimated to be $94.1\times10^{-5}$ using our theoretical model. Benefiting from the differential method in calculating the $\chi$ value, most systematic errors could be eliminated because of the same impacts on channel A and channel B. The most severe systematic uncertainties were the laser frequency scanning speed variation and the unequal sidebands (\textless~0.3\%). All the systematic errors are listed in Table~\ref{error}. The total systematic uncertainty was $272.3\times10^{-5}$. \section{Result and Conclusion} \subsection{$\chi$ value for $^{205}$Tl and $^{203}$Tl} For the final $\chi$ value measurement, we have performed 32 data taking runs. Each run was a set of EIT spectrum with the polarization angle scanning through $2\pi$. These data were taken over a period of 6 days. Each spectrum was fitted to the model to extract the relevant parameters. Then, the $\chi$ value could be inferred from each run, which shows as one data point in Fig.~\ref{expresult}. Each run gave a $\chi$ value with 8\% relative uncertainty. The final statistical error was 0.8\%, shown as central yellow $1\sigma$ area in Fig.~\ref{expresult}. The $\chi$ value of $^{205}$Tl was given as: \begin{equation} \chi_{205}=0.2550(20)(7) \end{equation} By tuning the coupling laser frequency, we were able to pick out $^{203}$Tl for the isotopic $\chi$ value measurement. The result was shown in the last 4 data points on the right side of Fig.~\ref{expresult}, which gives: \begin{equation} \chi_{203}=0.2532(73)(7) \end{equation} \begin{figure} \centering \includegraphics[width=300 pt]{expresult} \caption{The experimental results with $^{205}$Tl and $^{203}$Tl. The black points are 32 experimental runs with $^{205}$Tl. The red line is the average $\chi$ value for $^{205}$Tl. The blue points are 4 experimental runs with $^{203}$Tl. The error bars are also calculated (propagating) from the uncertainties of $S_{\rm{A0,B0}}$.} \label{expresult} \end{figure} Our result is in good agreement with one of the theoretical calculations, $\chi=0.254$ \cite{neuffer1977calculation}. The comparison of all the calculations and experiments is listed in Table~\ref{previous chi}. The source of the discrepancy is unclear. \begin{table}[t] \caption{\label{previous chi}Previous experimental and theoretical values of $\chi$ for Tl.} \centering \begin{tabular}{m{12em} m{2.5cm} m{1cm}} \br Theory & \\ \mr 1964\cite{garstang1964transition} & 0.21\\ 1968\cite{warner1968transition} & 0.219\\ 1977\cite{neuffer1977calculation} & 0.254\\ 1995\cite{maartensson1995magnetic} & 0.2401\\ 1996\cite{biemont1996forbidden} & 0.278\\ 2005\cite{safronova2005excitation} & 0.2369\\ \br Experiment & \\ \mr 1995\cite{vetter1995precise} & 0.240(2)\\ 1998\cite{cronin1998studies} & 0.22\\ 1999\cite{majumder1999measurement} & 0.2387(10)(38)\\ This experiment ($^{205}$Tl) & 0.2550(20)(7)\\ This experiment ($^{203}$Tl) & 0.2532(73)(7)\\ \br \end{tabular} \end{table} \subsection{Connection between $\chi$ and thallium PNC} As the analysis in \cite{majumder1999measurement}, a part of the $2.2\sigma$ discrepancy of the $R_{PNC}$ measurements between the Seattle group and the Oxford group can be attributed to the 6\% overestimate of the $\chi$ results. The $\chi$ value, which indirectly determines the $R_{PNC}$ in the Oxford experiment, affects the lineshape parameters such as component linewidths and optical depth. However, the Seattle group used independent Faraday rotation calibration, so their measurement is less sensitive to any newly measured $\chi$ value. With our measurement ($\chi=0.2550$), which is close to the value ($\chi=0.254$) that was used in the Oxford experiment, the discrepancy of $R_{PNC}$ between the two groups is still not resolved as \cite{majumder1999measurement}. The source of this important discrepancy remains unclear. Our measured $\chi$ value, the amplitude of electrical quadruple amplitude, from the sub-Doppler EIT profile with the frequency bridging technique disagrees with the previous experimental results. The $\chi$ value is an important ingredient in the optical rotation PNC experiments and a stringent test of the wave function calculation for atomic thallium. With our $\chi$ measurement, the PNC measurement for isotopes, which the atomic cesium lacks, provides an opportunity to measure the NSD effect. The EIT spectroscopy can also be applied to the PNC measurement as demonstrated in \cite{cronin1998studies}. Using a laser source with high intensity stability could achieve a low noise signal and avoid the trade-off of the high number density. \ack{This work was financially supported by the Ministry of Science and Technology (MOST, Taiwan) and the Center for Quantum Technology from the Featured Areas Research Center Program within the framework of the Higher Education Sprout Project by the Ministry of Education (MOE, Taiwan), Grand No. MOST-109-2112-M-007-020-MY3 and MOST-110-2634-F-007-022.} \newcommand{}{}
71037a064b3e9e019822b9ebf31e6fd2327e7d24
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Speaker embeddings are low-dimensional vectors that capture the voice characteristics of a person. Their role in speech technology is vital, especially in speaker recognition, diarization, separation, as well as in multi-speaker text-to-speech and voice conversion. Speaker embeddings are extracted with neural network architectures, such as TDNNs and ResNets \cite{snyder2018Xvectors,ecapa-tdnn,chung2018voxceleb2}. In a typical setting, the networks are trained in a supervised way, with a training set consisting of several thousands of speakers and multiple recordings per speaker. For speaker recognition applications, where the training set should contain high intrinsic and extrinsic within-class variability, the most commonly used publicly available corpora are (a) the NIST-SRE repository (distributed by LDC) \cite{cts-superset} and (b) the VoxCeleb dataset \cite{nagrani2017voxceleb, chung2018voxceleb2}. The former has been collected and updated during the last two decades and is primarily composed of telephone conversations between two speakers in a controlled setup. The latter is composed of about 7 thousand celebrities and each such recording is an excerpt of an interview available on YouTube. Its creation was based on an innovative pipeline, combining querying YouTube for videos of each celebrity, a ResNet50-based face recognizer \cite{resnet} that leverages photos of each celebrity, a SyncNet architecture \cite{chung2016out} which verifies that the voice comes from the celebrity appearing at a given frame (active speaker verification), and some minor human verification \cite{nagrani2017voxceleb}. The decision thresholds were tuned so that the precision of the search is maximized at the expense of recall. The emergence of self-supervision methods in deep learning has also been applied to training speaker embedding extractors \cite{stafylakis2019self,cai2021iterative,thienpondt2020idlab,slavivcek2021phonexia,mun2021bootstrap}. Several approaches have been examined, some of which employ an audiovisual setting \cite{cai2022incorporating,brown2022voxsrc}. It should be noted though that the whole pipeline of VoxCeleb is heavily dependent on the existence of audiovisual material, and therefore is not applicable to recordings that do not contain a video component (e.g. telephone conversations, radio broadcasts, etc.). Furthermore, the pipeline inevitably rejects potentially useful portions of the audio of the celebrity, coming from video excerpts during which the celebrity's face does not appear in the video. In this work, we explore a novel way of training speaker embedding extractors on datasets containing conversational data (i.e. recordings with more than one speaker and a single channel). Contrary to self-supervised approaches, we assume that the speaker-of-interest labels are available on a recording level. What we consider as unknown are the speech chunks of recordings the celebrities appear in. We believe that this is a realistic setup since labels can be fairly easily obtained, e.g. using queries with celebrity names to a database, similarly to VoxCeleb. Our method consists of two stages. In the first one, the task is to estimate which chunks of a VoxCeleb2 full-length (uncut) recording belong to the target celebrity. In the second stage, the extractor is trained using these chunks with standard supervised training. The first stage, which is obviously the challenging one, involves a very basic diarization algorithm in order to estimate clusters. We assume that the clusters are of high speaker purity and low speaker coverage, i.e. speakers are typically clustered in more than one cluster. To find the chunks that correspond to the target celebrity, we train from scratch a speaker embedding extractor with Cross-Entropy, Additive Angular Margin (AAM, \cite{arcface}) loss and a classification head over training celebrities. We create minibatches by randomly sampling segments from each cluster, and we feed those segments to the embedding network. The network extracts a 2D tensor containing the segment-level logits (i.e. number of training celebrities times clusters), which we aggregate across the cluster dimension using either max pooling or its soft version (the well-known log-sum-exp operator). This yields a vector of aggregated logits of size equal to the number of training celebrities which is fed to the softmax layer, and AAM loss is applied using the target celebrity as label. Once the model is trained, we keep those chunks that are classified by the network as belonging to the target celebrity. Finally, based on these chunks, we train a new extractor from scratch, showing competitive performance compared to one trained on the original VoxCeleb segments. \section{Related work} In real-world applications, obtaining labels of plentiful data for strongly supervised training is a costly and resource-demanding process. It turns out to be much easier and cheaper to acquire data points with incomplete, inexact, or inaccurate labels \cite{weak-sup} leading to \emph{weakly supervised} training. In our study, we aim at employing \emph{inexact} supervision, which generally deals with data having coarse-grained labels. The task at hand is commonly referred to as \emph{multi-instance learning} \cite{multi-instance} where labels (speaker identities) are known for input \emph{bags} (recordings). Bags contain individual \emph{instances} (audio segments), hence the name. According to a multi-instance learning taxonomy \cite{multi-instance-tax}, the presented approach falls within vocabulary-based methods of an embedded space paradigm. Despite enforcing bag classification in training, instance embeddings are of interest in test time. As summarized in \cite{multi-instance-tax}, multi-instance learning has been applied to tasks of multiple fields. In speech processing, weak supervision in the context of automatic speech recognition was explored in \cite{weaklyASR}. The authors trained a word-level acoustic model with the bag-of-words annotations. Their and our approaches are similar in terms of aggregation via log-sum-exp operation. The closest to our approach is that presented in \cite{Tanel2018, Tanelarxiv}, where the goal is speaker identification and verification. In contrast to our method, \cite{Tanel2018} requires a trained diarization model which provides audio segments for the i-vector \cite{iVector} extraction. I-vectors are used as input to a speaker classifier trained with an objective encompassing weak labels. Eventually, the classifier labels data for the final model training. Finally, there are works and datasets that deal with the problem of multi-speaker enrolment or test recordings \cite{snyder2019speaker,mclaren2016speakers}. However, the extractor is trained on fully-supervised methods and their focus is on scoring rather than on training. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{weak_sup_SV_scheme_from_svg.pdf} \vspace{-1.5em} \caption{Proposed method to weakly supervised training of a speaker embedding extractor. The $\otimes$ symbol stands for matrix multiplication.} \label{fig:architecture} \vspace{-1.5em} \end{figure} \section{Proposed method} \subsection{Assumptions} We assume that we have a set of $R$ recordings for training an embedding extractor. Moreover, we assume that we know all the celebrities appearing in each recording\footnote{We removed recordings with more than one celebrity labels, although our method can be fairly easily extended to include such cases.}. We do not know though where these celebrities appear in the recording, for how long they speak, or how many other speakers participate in the recording. We denote the set of celebrities by ${\cal J}$ and $J=|{\cal J}|$ is their number. Note that we use the term \emph{celebrities} as a reference to VoxCeleb, to describe those speakers included in the training set and the classification head of the network. \subsection{Baseline Speaker Diarization} There are several speaker diarization algorithms that can yield state-of-the-art performance, ranging from methods that combine neural approaches with probabilistic clustering (e.g. \cite{DiezInter19,Silnova2020}) to fully end-to-end neural approaches (e.g. \cite{horiguchi2020end}). A weakness of these methods is their dependence on annotated datasets in order to train. As the purpose of this paper is to minimize the need for annotation, we will employ a very baseline diarization approach, namely (a) speaker change detection, followed by (b) Bayesian Information Criterion (BIC) based agglomerative hierarchical clustering with Gaussians on MFCC features for modeling segments, followed by (c) Viterbi-based boundary refinement using (maximum-likelihood trained) Gaussian Mixture Models \cite{tranter2006overview}. No pretrained models (such as Universal Background Model) are used for diarization. The SIDEKIT software is used for diarizing the recordings \cite{broux2018s4d}. We use the default hyperparameters, which tend to overestimate the number of speakers in a recording. This is needed for our algorithm in order to avoid merging chunks of different speakers in the same cluster, and to ensure that during training, at least one sampled segment corresponds to the target celebrity of the recording (see Section \ref{sec:aggregation}). The clustering is fixed during training, i.e. we do not re-cluster the chunks while training the extractor, as some self-supervised algorithms do \cite{cai2021iterative,thienpondt2020idlab}. \subsection{Training the extractor with score-level aggregation functions} \subsubsection{Creating minibatches} Assume that the $i$th recording has been split into the set ${\cal S}^{(i)}$ of \emph{chunks} (excerpts). Division of ${\cal S}^{(i)}$ to disjoint sets ${\cal S}^{(i)}_c$ is determined by diarization, where $c \in {\cal C}^{(i)}$ and ${\cal C}^{(i)}$ is an index set of clusters. $|{\cal C}^{(i)}|= C^{(i)}$ varies with $i$. The $i$th recording is represented in a minibatch by $\left\{g(S^{(i)}_c)\right\}_{c \in {\cal C}^{(i)}}$, where $S^{(i)}_c \in {\cal S}^{(i)}_c$ and $g(\cdot)$ cuts out a fixed-length \emph{segment}. Note that every batch can comprise a different number of recordings as a result of a different number of clusters. \subsubsection{Aggregating over the cluster dimension} \label{sec:aggregation} In the forward pass, each segment is processed individually (i.e. independently of the recording it belongs to) including the statistics pooling layer, the embedding, and the dot-products of the embeddings with the linear layer of the classification head $\mathbf{H}=[{\mathbf h}_1,{\mathbf h}_2,\ldots,{\mathbf h}_{J}]$, where ${\mathbf h}_{j}$ denotes the set of weights for speaker $j$. This operation yields a 2D tensor (ignoring the batch dimension) of similarities between segments and celebrities. Tying between segments of the same recordings is implemented via an aggregation operation, which transforms the tensor into a vector of size $J$, indicating the similarity between the recording and celebrities. The segment-level similarities are defined as ${\mathbf o}_j^{(i)} = \{o_{c,j}^{(i)}\}_{c \in {\cal C}^{(i)}}$, where $o_{c,j}^{(i)}={\mathbf h}_j^\intercal {\mathbf z}^{(i)}_{c}$ and ${\mathbf z}^{(i)}_{c}$ is the embedding of the example belonging to the $c$th cluster. The recording-level similarities $\{l_{j}^{(i)}\}_{j \in {\cal J}}$ are derived by an aggregation function: \begin{equation} l_{j}^{(i)} = f({\mathbf o}_{j}^{(i)};\tau) \end{equation} as shown in Fig. \ref{fig:architecture}. We refer to these recording-level similarities as logits, since they are the ones passed to the SoftMax function \begin{equation} \label{eq:logits} p\left(j|{\cal S}^{(i)}\right)= \frac{\exp(sl^{(i)}_{j})}{\sum_{j' \in {\cal J}}\exp(sl^{(i)}_{j'})}, \end{equation} where $s$ is the scale of the AAM loss, while the target speaker logit is penalized by the margin of the AAM loss \cite{arcface}. \subsubsection{Aggregation functions} The most commonly used aggregation functions are the average and max pooling. However, both functions have certain undesired properties for our task. Average pooling would encourage the embeddings of all segments of the $i$th recording to be close to the representation ${\mathbf h}_j$ of the target celebrity of the recording. This property makes it inadequate for the task since only a fraction of the segments belongs to the target celebrity. Max pooling seems to be more adequate since it focuses only on the segment having the highest similarity with the target celebrity. However, max pooling propagates gradients only through this highest-similarity segment, ignoring all other segments of the recordings. Furthermore, max pooling might make the network hard to train in the warm-up phase, when the network is randomly initialized. Given the above, we also experiment with a soft version of max pooling, the log-sum-exp: \begin{equation} \label{eq:LSE} l^{(i)}_{j} = f_{\mbox{LSE}}\left({\mathbf o}_j^{(i)};\tau \right) = \tau \log \frac{1}{C^{(i)}}\sum_{c \in {\cal C}^{(i)}} \exp{\left(\frac{1}{\tau} o_{c,j}^{(i)}\right)}, \end{equation} where $\tau > 0$ is a temperature. Note that for $\tau\xrightarrow{} 0^{+}$ we obtain max pooling, i.e. $f_{\mbox{LSE}}\left({\mathbf o}_j^{(i)};\tau \right) \xrightarrow{} \max_{c}\left(\{o_{c,j}^{(i)}\}_{c \in {\cal C}^{(i)}}\right)$. \subsubsection{Gradients and loss function} It is interesting to derive the gradients when log-sum-exp is applied. Let $j^{*}$ be the (ground-truth) celebrity of the $i$th recording and let $L^{(i)}$ be the CE loss. By applying the chain rule, we get \begin{equation} \frac{\partial L^{(i)}}{\partial o_{c,j}^{(i)}} = p(c|j,{\cal S}^{(i)})\left[p(j|{\cal S}^{(i)}) - \delta_{j,j^{*}}\right], \end{equation} where $\delta_{j,j^{*}}$ is the Kronecker delta and \begin{equation} p(c|j,{\cal S}^{(i)}) = \frac{ \exp{\left(\frac{1}{\tau} o_{c,j}^{(i)} \right)} }{ \sum_{c' \in {\cal C}^{(i)}} \exp{\left(\frac{1}{\tau} o_{c',j}^{(i)}\right)} }. \end{equation} To derive the above, we used the fact that the gradient of $l_j^{(i)}$ w.r.t. $o_{c,j}^{(i)}$ is $p(c|j,{\cal S}^{(i)})$. As we observe, the error signal $\epsilon^{(i)}_{j,j*} = p(j|{\cal S}^{(i)}) - \delta_{j,j^{*}}$ is distributed between the clusters proportionally to $p(c|j,{\cal S}^{(i)})$. Moreover, for utterances not containing the $j$th speaker, the error is proportional to $p(j|{\cal S}^{(i)})$, meaning that the norm of the gradient is small for recordings not containing speakers similar to the $j$th celebrity. Note also that if we consider length-normalized speaker representations and embeddings, i.e. $\norm{{\mathbf h}_j} = \norm{{\mathbf z}} = 1$, then $-1 \leq f\left({\mathbf o}_j^{(i)};\tau \right) \leq +1$ for both aggregation functions we examine, making AAM loss applicable \cite{arcface}. \begin{table}[tb] \centering \caption{Comparison of VoxCeleb2 derivatives.} \vspace{-0.5em} \begin{tabular}{l c r r} \toprule \tb{Dev. set} & \textbf{Celebrities} & \textbf{Recordings} & \textbf{Hours}\\ \midrule \tb{Original} & 5,994 & 145,569 & 2,369.0 \\ \tb{Restricted} & 5,987 & 110,940 & 1,884.3 \\ \tb{Uncut} & 5,987 & 110,940 & 10,211.6 \\ \tb{Self-labeled} & 5,935 & 88,084 & 4,483.8 \\ \bottomrule \end{tabular} \label{tab:vox_comp} \vspace{-1.5em} \end{table} \subsection{Selecting chunks from the celebrities} \label{sec:segment-selection} Once training of the extractor is completed, we need to select the chunks corresponding to the target speaker. There are several methods that can be employed for this task. We implement a simple selection policy, where each chunk (as defined by the segmentation and boundary refinement algorithms of speaker diarization without the hierarchical clustering) is considered as coming from the celebrity of the recording if and only if the network classifies it as such. That is, \begin{equation} \label{eq:segment-selection} S^{(i)} \in \hat{{\cal S}}_{j^*} \,\,\,\, \mbox{iff} \,\,\, \mbox{argmax}_j\left( \{l_j^{S^{(i)}}\}_{j\in {\cal J}}\right) = j^*, \end{equation} where $S^{(i)}$ is a chunk from the $i$th recording, $\hat{{\cal S}}_j$ is the set of estimated chunks for the $j$th celebrity, and $j^*$ is the celebrity of the $i$th recording. The chunk selection stage is performed after training, so neither an aggregation function nor the AAM margin are applied. We simply classify all segments based on the logits denoted by $\{l_j^{S^{(i)}}\}_{j\in {\cal J}}$. \begin{table*}[tb] \centering \caption{Speaker verification results with models trained in strongly and weakly supervised fashion. $m$ stands for the AAM margin, $\uparrow$ means scheduling up to the value to the right of the arrow. LSE means log-sum-exp. $P_{tar} = 0.05$ for MinDCF. EER is in \%.} \vspace{-0.5em} \resizebox{\linewidth}{!}{% \begin{tabular}{l l l l l c c c c c c c} \toprule & \multirow{2}{*}{\tb{Supervision}} & \multirow{2}{*}{\tb{Data}} & \multirow{2}{*}{\tb{$m$}} & \multirow{2}{*}{\tb{Aggregation / $\tau$}} & \multirow{2}{*}{\tb{\shortstack{Speaker\\ repres.}}} & \multicolumn{2}{c}{\tb{VoxCeleb1-O}} & \multicolumn{2}{c}{\tb{VoxCeleb1-E}} & \multicolumn{2}{c}{\tb{VoxCeleb1-H}} \\ & & & & & & \tb{EER} & \tb{MinDCF} & \tb{EER} & \tb{MinDCF} & \tb{EER} & \tb{MinDCF} \\ \midrule s1 & strong & restricted & $0.1$ & -- & 1 & 1.56 & 0.111 & 1.56 & 0.100 & 2.81 & 0.164 \\ s2 & strong & restricted & $\uparrow 0.3$ & -- & 1 & 1.24 & 0.074 & 1.34 & 0.087 & 2.46 & 0.142 \\ \midrule s3 & weak & uncut & $0.1$ & max pooling / -- & 1 & 4.75 & 0.283 & 5.05 & 0.300 & 7.44 & 0.395 \\ s4 & weak & uncut & $0.1$ & LSE / $0.5$ & 1 & 6.03 & 0.381 & 6.39 & 0.391 & 9.99 & 0.529 \\ s5 & weak & uncut & $0.1$ & LSE / $0.5 \rightarrow 0.1$ & 1 & 4.53 & 0.286 & 4.86 & 0.292 & 7.31 & 0.401 \\ \midrule s6 & pseudo & self-labeled & $\uparrow 0.3$ & -- & 1 & 1.73 & 0.114 & 1.80 & 0.114 & 3.15 & 0.184 \\ s7 & pseudo & self-labeled & $\uparrow 0.3$ & -- & 2 & 1.58 & 0.103 & 1.82 & 0.118 & 3.23 & 0.184 \\ \bottomrule \end{tabular} } \label{tab:results} \vspace{-1.5em} \end{table*} \section{Experimental setup} \subsection{Speaker embedding extractor and classifier} All presented models trained in a weakly supervised fashion share the same structure: per-segment embedding extractor, an aggregation function with similarity computation, and AAM-based logit computation \cite{arcface}. The backbone of embedding extractors is based on the ResNet34 architecture \cite{resnet}, widely used in the field of speaker verification \cite{brown2022voxsrc}. 400 frames of 80-dimensional log Mel-filter bank energy (fbank) features constitute the input to the model. Individual stages of the network comprise 2D convolutional layers with 64, 128, 256, and 256 filters each. The building blocks of stages follow the pre-activation structure \cite{full-preact}. Instead of a standard batch normalization, we opt for instance normalization \cite{ulyanov-inst-norm}. The rationale behind this choice is as follows: During training, segments do not need to contain only speech due to a simple diarization. Statistics collected by batch normalization layers are in turn also affected by non-speech content, which is in contrast with the test phase. The resulting embeddings are 256-dimensional. The embedding extraction is followed by aggregation described in Section \ref{sec:aggregation}. Thanks to the favorable property of the aggregation functions -- values bounded in the interval [-1, 1] -- the output of the preceding stage can be considered as similarity scores (analogous to the cosine similarity computed in fully supervised training). Therefore, logits for the CE loss function can be computed according to margin-based methods. In our case, the margin is introduced following the AAM formulation. In all of our experiments, we use a scale $s=30$, see Eq. (\ref{eq:logits}). It is a common practice to increase the margin during training. Since we experimentally found it challenging to schedule it in weakly supervised settings, we keep it fixed at 0.1 (unless explicitly stated). The models are trained using SGD with a momentum of 0.9. To prevent from diverging in the initial stage of such challenging training, we employ a learning rate warm-up. After reaching a value of 0.2, the learning rate is scheduled according to the loss on the cross-validation set comprising 256 speakers whose recordings were extracted from the training set. \subsection{Strongly and weakly labeled datasets} For the sake of comparison, we choose an exemplary training corpus termed \emph{VoxCeleb2 Uncut dev}. It has been acquired by downloading a complete audio material of recordings present in VoxCeleb2 dev. We stress that we use only full-length audio recordings without a video content of the corresponding clips. It might seem wasteful not to use another available modality, but we target a more general goal -- utilization of weakly labeled audio-only data, which is much easier to obtain compared to strongly labeled segments. Since some video clips are no longer available, \emph{VoxCeleb2 Uncut} is restricted compared to the original VoxCeleb2 in terms of speakers and recordings. The comparison is presented in Table \ref{tab:vox_comp}. To provide a fair comparison with baselines trained in a standard supervised way, we limit the speakers and recordings of VoxCeleb2 to match the \emph{uncut} version -- \emph{VoxCeleb2 Restricted dev}. In both weakly- and strongly-supervised training, the data is sampled at 16~kHz. Online reverberation and Musan noise \cite{musan} augmentations are applied to boost robustness. \section{Experiments} The evaluation is performed on the standard sets of verification trials -- VoxCeleb1-O, E, and H. We present results in terms of equal error rate (EER [\%]) and minimum detection cost (MinDCF), with prior probability of target trials $P_{tar}=0.05$. \subsection{Strong vs. weak supervision} In the first section of Table \ref{tab:results}, we present the results of a standard supervised training with both scheduled (0.1 $\rightarrow$ 0.3) and constant (0.1) margin $m$ of AAM. We show how enforced between-speaker separability can improve performance to stress the potential of proposed weakly supervised training, which utilizes a constant margin of 0.1. As per our experimentation, however, more sophisticated treatment of margin within our framework is required. We note that the models' performance is affected by a limited size of \emph{VoxCeleb2 Restricted dev} used for training. The next set of rows of Table \ref{tab:results} clearly shows that proposed weakly supervised training is viable and already leads to reasonably well-performing models. Obviously, multi-instance learning is much harder than training with strong supervision, which is reflected by a deterioration of the results compared to the baseline. We compare two possible aggregation functions: max pooling and log-sum-exp. Despite its limitations described in Section \ref{sec:aggregation}, the max pooling is a plausible option and even outperforms log-sum-exp with a constant temperature of 0.5. We assume the worse performance yielded by $\tau=0.5$ is due to over-smoothness. On the other hand, scheduled $\tau$ changing from 0.5 to 0.1 eases training, and the aggregation gets closer to the maximum in later stages of training. We observe that a soft version of the maximum aggregation can lead to improved performance. As $\tau$ has a significant impact, it calls for further exploration. We suspect that better scheduling has the potential to boost performance. \subsection{Training with self-labeled data} Having trained models in a weakly supervised fashion, we use the best one (s5) to select chunks of the \emph{uncut} set according to~(\ref{eq:segment-selection}). The procedure from Section \ref{sec:segment-selection} provides the \emph{self-labeled} training set with parameters presented in Table \ref{tab:vox_comp}. Even though some speakers and recordings have been lost, it is 2.4 times larger than the \emph{restricted} set. We proceed with supervised training with obtained pseudo labels where aggregation function is no longer required. Table \ref{tab:results} shows that the resulting system s6 greatly outperforms the model used for labeling. At the same time, its performance gets close to that of strongly supervised models. As a result of inaccurate diarization and the chunk selection approach, the \emph{self-labeled} set contains non-speech signals or chunks with speakers without labels (e.g. interviewers). To deal with label noise, we introduce two representations per speaker in the classification head $\mathbf{H}$ \cite{Deng2020sub-arcface,thienpondt2020idlab}. This allows it to learn true speaker and interference representations for each celebrity. Although a considerable improvement can be observed on VoxCeleb1-O (s6 vs s7), the results on the other two sets do not show a similar trend. \section{Conclusions} In this paper, we presented an approach to weakly supervised training of speaker embedding extractors with mere recording-level labels. We demonstrated our method using the full-length audio recordings of VoxCeleb2 clips. We initially trained an extractor equipped with an aggregation function to estimate chunks belonging to the target celebrity. Using these chunks, we trained a model from scratch, attaining performance close to the model trained on the original VoxCeleb segments. Encouraged by the results, we plan to extend the approach by introducing alternative ways of aggregation (such as attention) and leverage recordings containing more than one celebrity. We will also explore combinations of weak and self-supervision for training the model. Finally, we will experiment with applying a second, embedding-based diarization stage (using embeddings from the first extractor) and make use of other (non-celebrity) speakers in training. \section{Acknowledgements} The work was supported by Czech Ministry of Interior project No. VJ01010108 "ROZKAZ", Czech National Science Foundation (GACR) project NEUREM3 No. 19-26934X, European Union’s Horizon 2020 project No. 833635 ROXANNE and Horizon 2020 Marie Sklodowska-Curie grant ESPERANTO, No. 101007666. Computing on IT4I supercomputer was supported by the Czech Ministry of Education, Youth and Sports from the Large Infrastructures for Research, Experimental Development and Innovations project "e-Infrastructure CZ – LM2018140". \bibliographystyle{IEEEtran}
4afef525dbfc4026323a939c0f161410577b82b8
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Migration is a megatrend of our time. In the ongoing globalization, the number of international migrants has reached unprecedented heights. International migration is a complex phenomenon that includes both \textit{voluntary migration}~\cite{ottonelli2013migration}, e.g., to enhance career opportunities, and \textit{forced migration}, e.g., caused by conflicts~\cite{yazgan2015syrian} and climate changes~\cite{abel2019climate}. While the Covid-19 pandemic has temporarily slowed migration flows, the UN's position is that ``migration is part of today's world’’~\cite{un_2020}. The UN expects the numbers to rise again and posits that well-managed migration can contribute to inclusive and sustainable development in countries of both origin and destination. Efficient and effective second-language acquisition is a vital component in sustainable international migration. The body of research literature points out language proficiency as a key to successful integration~\cite{blake2017impact,meer2019english}, not the least to support rapid entry to the labor market. International migrants are a highly diverse set of people with substantially different capacities, needs, and opportunities for learning~\cite{morrice2021you}. The history of second-language acquisition has progressed from a focus on linguistics, e.g., inspired by Chomsky's ideas about a universal grammar~\cite{chomsky2014aspects}, to a sociocognitive process, i.e., learning by combining cognitive involvement and social interaction~\cite{larsen2018looking}. The current school of thought stresses the importance of person-centered interactions. While such interactions undoubtedly offer effective learning environments, it remains unclear how they could scale to meet the needs of the migration megatrend. Digital solutions for scalable second-language acquisition are increasingly popular. As there is a high demand for language learning tools, several applications have entered the consumer market in the last decade\footnote{https://blog.vsoftconsulting.com/blog/7-of-the-best-language-learning-chatbot-apps}. Duolingo, one of the most popular applications, has hundreds of millions of global users that are incentivized to keep learning through gamification~\cite{shortt2021gamification}. While Duolingo relies primarily on decontextualized grammar-translational exercises and audiolingual drills, there are indications that already such a simplistic digital interaction between a learner and a digital solutions can support second-language acquisition~\cite{loewen2019mobile}. Chatbots are another type of language learning tools~\cite{pham2018chatbot}, available in Duolingo and other services such as Andy, Eggbun, and Babbel. While chatbots are closer to the person-related interactions recommended for second-language acquisition, we focus this study on a more advanced digital solution, i.e., conversational agents (ConvAg). State-of-the-art ConvAgs rely on generative dialog models (GDM). A GDM is a type of machine learning (ML) model that aims to produce human-like replies to user input. While many simple chatbots rely on pattern matching and string processing~\cite{hussain2019survey}, the GDMs we consider in this work are open-domain~\cite{roller2020recipes}, i.e., they shall be able to maintain a dialog on arbitrary topics. This is clearly a significantly more challenging implementation task and, as we stress in this paper, a substantially tougher challenge for any quality assurance (QA) effort. The AI engineering community needs to develop approaches for QA of GDMs, as failures can have severe repercussions. We remind the reader of Microsoft’s experimental ConvAg Tay, removed from Twitter less than 24 hours after being deployed due to posting racist, sexist, and anti-Semitic tweets~\cite{wolf2017we}. In this paper, we argue that QA of ConvAgs' GDMs must be tackled from two directions. First, the development organization must capture the often vague expectations on how a ConvAg shall perform in its operational context. Second, test engineers must develop automated test cases that verify that the expectations are met. To exacerbate the QA challenge, typical ConvAg development involves frequent retraining of the underlying GDM. ML development is highly exploratory and known to suffer from the CACE principle~\cite{sculley_hidden_2015}, i.e., ``Changing Anything Changes Everything.'' Often several models are retrained in parallel, and then the ML engineers select one for deployment -- so called \textit{model selection}. While there might be indications that one of the models is better, how can you know for sure? We need a reliable approach for benchmarking different models~\cite{hasselbring2021benchmarking}, i.e., test automation that helps us detect if any GDMs digress from acceptable behavior. The AI engineering community needs more research on QA of ML models trained for natural language processing (NLP). From the ML testing perspective, previous secondary studies show that NLP is underrepresented in the body of literature~\cite{riccio2020testing,zhang_machine_2020}. The need for NLP testing was also highlighted by Yoo in his keynote address at the DeepTest~2020 Workshop as he called for additional research~\cite{yoo2020searching}. We acknowledge that QA of GDMs forces us to see the oracle problem~\cite{barr2014oracle} in a new light. Also, compared to the comparatively well-studied topic of testing of ML models for computer vision, the discrete nature of natural language~\cite{ferrone2020symbolic} poses new challenges, as a simple negation in a sentence inverts the meaning. We present results from ongoing action research in the context of QA of GDMs for , an evolving ConvAg designed for Swedish language practice. Emely evolves as part of an innovation project in the city of Helsingborg under development of a team from the AI consultancy company NordAxon. During the summer of 2021, researchers from RISE and Lund University joined to constitute a QA action team~\cite{staron2020action}. Together, we set out to explore three research questions in the context of ConvAg QA: \begin{itemize} \item[RQ1] What are the requirements on Emely's GDM? \item[RQ2] How can test cases be designed to verify that the GDM satisfies the requirements? \item[RQ3] How can the test cases be implemented to allow test automation throughout the evolution of Emely? \end{itemize} Our pioneering paper responds to calls for additional research on ML testing for NLP. To the best of our knowledge, this is the first study to explore QA of a ConvAg development project in the field. In this paper, we present intermediate results and lessons learned from the first phase of our study. As Emely is a proprietary product, we complement our discussion with Facebook's open-source ConvAg Blenderbot~\cite{roller2020recipes}. The test infrastructure we use for GDM testing is available on GitHub~\cite{repo}, but only the Blenderbot part is available for external replication. Note that the requirements reported in this paper are specified without strict quality targets for two reasons. First, the exact threshold values for Emely are business-critical and cannot be shared publicly. Second, Emely development follows the agile practice of using test cases as requirements~\cite{bjarnason2016multi}. This practice supports integration of requirements engineering in the agile development context, i.e., exact threshold values can easily be tuned by developers updating the automated test cases. As there are no guidelines to base the quality targets on, we found an experimental manner to be the best way forward. The paper is organized as follows. First, Sec.~\ref{sec:bg} presents background and related work followed by a technical overview of Emely in Sec.~\ref{sec:case}. Second, Sec.~\ref{sec:method} describes our approach to action research and the results are discussed in Sec.~\ref{sec:res}. Third, Sec.~\ref{sec:threats} and Sec.~\ref{sec:lessons} elaborate on threats to validity and lessons learned, respectively, before we conclude the paper in Sec.~\ref{sec:conc}. \section{Background and Related Work} \label{sec:bg} This section introduces AI quality for ConvAgs. Furthermore, we present related work on NLP testing and GDM evaluation. \subsection{AI Quality and ConvAgs} \label{sec:bg-q} Expressing quality expectations on a ConvAg is far from trivial. First, ``quality'' in general is a notoriously difficult aspect to put the finger on~\cite{walkinshaw_software_2017}. Quality is not a single concept, but rather a multi-dimensional patchwork of different system aspects that influence the users' experience. Moreover, quality is inevitably subjective and largely lies in the eye of the beholder. For ConvAg quality, the user experience will vary depending on both the human conversationalist and the context, i.e., each dialog instance. Second, ConvAgs are created to mimic a human conversationalist. This is indeed a grand task, and an ideal solution would even pass the imitation game of the famous Turing test~\cite{saygin2000turing}, i.e., the ConvAg would exhibit intelligent behaviour indistinguishable from that of a human. Assessing intelligent behavior is non-trivial, thus Turing proposed the role of a human interrogator in the original paper's envisioned ``imitation game.'' Pinpointing what is needed to pass the test, i.e., specifying requirements on what the interrogator should check, is a formidable challenge. Finally, as also humans are known to fail Turing tests~\cite{warwick2015human}, we humbly accept that ConvAg QA is a daunting task that cannot be solved in a single study. In this paper, we use the following definitions from related work~\cite{borg2021aiq}: ``MLWare is a subset of AI that, fueled by data, realizes functionality through supervised and/or unsupervised learning`` and ``AI Quality is the capability of MLware to satisfy stated and implied needs under specified conditions while the underlying data satisfy the requirements specific to the application and its context.'' A fundamental aspect of the latter definition is that quality is about both stated and implied needs. As part of our study, we conduct requirements engineering (RE) to transfer an initial set of implied needs on ConvAgs to specified requirements that lay the foundation for subsequent test case design and implementation. \subsection{NLP Testing and GDM Evaluation} The software testing community has published relatively few papers on ML testing for NLP applications. Compared to ML testing for image classification and recognition, especially for automotive perception systems~\cite{borg_safely_2019}, few studies specifically target NLP~\cite{riccio2020testing,zhang2020machine}. Exceptions include a study by Kim and Yoo that explores how surprise adequacy, a test adequacy metric developed for neural network input~\cite{kim2019guiding}, generalizes from image input to the NLP context~\cite{kim2021multimodal}. The most similar work to ours is the dialog testing tool DialTest by Liu \textit{et al.}~\cite{liu2021dialtest}, which was not published when we initiated our action research study. In the NLP research community, several papers propose metrics to support evaluation of language generation. Deng \textit{et al.} presented a framework for natural language generation that covers language compression, transduction, and creation~\cite{deng2021compression}. The latter includes the dialog generation that constitutes a critical feature in ConvAgs. The authors' primary contribution is a set of metrics that corresponds to information alignment between natural language input, output, and the overall context. Based on an analysis of an established human annotation dataset, they conclude that the metrics correlate with human judgments. Yeh \textit{et al.} recently conducted a study comparing a set of 23 metrics for dialog generation on 10 datasets~\cite{yeh2021comprehensive}. They conclude that USR, GRADE, DEB, and USL-H perform the best for evaluating response generation. Several researchers argue that a combination of metrics are needed to reliably evaluate generative language models. In the context of machine translation, Yuan \textit{et al.} propose BARTScore~\cite{yuan2021bartscore}, including evaluation based on seven quality categories: 1) Informativeness, 2) Relevance, 3) Fluency, 4) Coherence, 5) Factuality, 6) Semantic Coverage, and 7) Adequacy. These categories partly overlap the categories we found relevant for Emely, but we instead propose a customized list for GDMs. \section{Case description: Emely} \label{sec:case} Emely is a ConvAg designed to help newcomers in Sweden practice Swedish, i.e., to accelerate second-language acquisition. The long-term goal is to provide a scalable approach to Swedish language practice that will help migrants enter the labor market faster~\cite{blake2017impact,meer2019english}. Emely lets users practice job interview sessions in a protected setting, i.e., interactive person-centered dialogs as recommended for effective second-language acquisition~\cite{larsen2018looking}. Fig.~\ref{fig:web} provides an impression of Emely's visual appearance \begin{figure} \centering \includegraphics[width=0.45\textwidth]{emely.png} \caption{Emely's visual appearance.} \label{fig:web} \end{figure} Fig.~\ref{fig:architecture} shows the high-level architecture of Emely. Note that Emely is a proprietary solution, thus we restrict the architecture description to a high level and quantitative information is reported in vague terms. Third-party components are depicted in gray and nationality flags show the content of the natural language data. Users practicing Swedish interact with Emely through a web UI (A). The user speaks to Emely and the spoken language is transformed to text (B). The text passes through a Toxic Filter (C) consisting of rules that identify hate speech and toxic language. If the user expresses unacceptable sentences, Emely will shortcut the information flow in Fig.~\ref{fig:architecture} already at this point, i.e., reject the input, and simply reply ``Can we please talk about something else?'' If not rejected, the Swedish text is subsequently translated to American English (D). \begin{figure*} \centering \includegraphics[width=1\textwidth]{architecture.png} \caption{High-level Emely architecture. Gray boxes indicate third-party components.} \label{fig:architecture} \end{figure*} The English text is then processed by a custom dialog manager module (E) that relies on ML classifiers trained specifically for processing the user input to Emely. These ML models have been trained using the open-source framework Rasa\footnote{https://rasa.com/}. The dialog manager controls the ongoing dialog and, among other things, can bypass the GDM to instead provide high-quality answers to certain input, such as answering the question ``What is the salary for this position?'' with ``I cannot discuss the salary with you at this stage of the process.'' The rightmost component in Fig.~\ref{fig:architecture} is the GDM (F), i.e., the component that constitutes the software under test. The GDM is based on publicly available pre-trained Blenderbot models by Facebook AI\footnote{https://huggingface.co/facebook}. Blenderbot is an open-source open-domain ConvAg with pre-trained GDMs in different sizes for conversations in English. NordAxon and the city of Helsingborg manually created an initial realistic dialog dataset of interview sessions, expanded it with transcriptions of mock interviews from YouTube, and expanded the content using GPT-3~\cite{brown2020language}. From this starting point, the dataset has gradually grown during the Emely development. NordAxon uses transfer learning to adapt generic Blenderbot models to custom GDMs for Emely. The dialog manager forwards input from the user to Emely's custom GDM and a reply in English is provided. The lower part of Fig.~\ref{fig:architecture} shows how information from the GDM is processed on the way back to the user. First, also considered part of the conversational engine, rule-based processing (G) provides a filter for the GDM output to ensure that no unacceptable content is forwarded to the user. These rules primarily rely on pattern matching and string processing, guided by hours' worth of system testing. The natural language text is then translated from American English to Swedish (H) and a third-party text to speech component (I) generates spoken language in the local Scanian dialect -- hence, the Scanian flag. Finally, Emely reads the output aloud complemented by the corresponding text. An important quality requirement is that the overall process must be fast enough to result in a realistic interview session without unreasonable delays. \section{Research Method} \label{sec:method} We are currently conducting action research, i.e., ``a disciplined process of inquiry conducted by and for those taking the action''~\cite{sagor2000guiding}. Action research is an appropriate research method in software engineering when the main goal is to support change in a development context and the researcher is a member of the team responsible for the change~\cite{wohlin2021guiding}. We describe our work according to Staron's recently published model for action research, which explicitly depicts knowledge, learning, and theory as secondary outputs from the endeavor -- such as this paper. Fig.~\ref{fig:overview} shows an overview of the research project, organized into two phases. Phase~I describes the action research cycles and Phase~II illustrates how we worked on systematic evaluation of the research output and generalization beyond Emely. To support the flow of the paper, we present details related to the method for activities A)--C) in Sec.~\ref{sec:ret}. \subsection{Phase I: Action Research Cycles} The upper part in Fig.~\ref{fig:overview} illustrates the action research cycle and its five elements: 1) Diagnosing, 2) Action Planning, 3) Action Taking, 4) Evaluating, and 5) Learning. Full cycles were iterated on a weekly basis during three months of 2021. The action research during this time involved three distinct steps, i.e., A) Requirements Elicitation, B) Test Design, and C) Test Implementation. As indicated in Fig.~\ref{fig:overview}, a literature study was a continuous activity during the work, including gray literature on ConvAgs and chatbot testing. \begin{figure*} \centering \includegraphics[width=1\textwidth]{overview.png} \caption{Overview of the action research study.} \label{fig:overview} \end{figure*} While there has been staff turnover during the project, the core action team consisted of nine members. Two researchers from RISE, two researchers from Lund University, four AI developers from NordAxon, and a product owner from the city of Helsingborg. As this project was conducted during the Covid-19 pandemic, remote work was the norm. The researchers integrated with the development team by joining NordAxon's regular virtual meetings, i.e., two regular status meetings per week covering synchronization and sprint planning. On top of that, additional meetings were organized for discussion of technical details and evaluation of results. Between the live meetings, a shared Slack workspace ensured another effective communication channel. The communication channels, combined with shared source code and ML models, provided a project context geared for rapid feedback. The iterative work enabled the evolution of three deliverables (cf. the gray Research Artifacts in Fig.~\ref{fig:overview}) customized for Emely: a Requirements Specification, a Test Suite for a selection of the requirements, and the corresponding Test Results. After three months of action research cycles, the resulting automated test cases could be executed in the Emely development environment. The action team interwove the five elements of action research with the ongoing evolution of Emely corresponding to version 0.2, 0.3, and 0.4: \begin{enumerate} \item \textit{Diagnosing} initiated weekly sprints with an exploration of the current state of the QA initiative, e.g., to what extent were the elicited requirements complete and did the implemented test cases create value? \item \textit{Action Planning} was integrated as a natural part of the sprint planing in the development project. In practice, we jointly prioritized backlog items and assigned resources for RE and test development. \item \textit{Action Taking} The interventions we did to support QA of GDMs in the organization involves RE (elicitation, analysis, specification, and validation) and test development (design and implementation). \item \textit{Evaluating} We continuously assessed the interventions from a technical perspective with the NordAxon developers. Moreover, we also validated requirements and test verdicts with the product owner on a weekly basis. \item \textit{Learning} During the cycles, the researchers in the team used retrospectives to discuss what lessons learned could be generalized to ConvAg QA beyond Emely. In this process, we collected notes that later initiated the writing of this paper during Phase~II. \end{enumerate} \subsection{Phase II: Generalizing Knowledge} The lower part of Fig.~\ref{fig:overview} shows Phase~II of the project that started from the two research artifacts developed during Phase~I. In Phase~II, the research project shifted its focus to careful analysis of the test suite, validation of the test results, generalizing results, and reporting. During Phase~II, the research team resorted to joining one weekly status meeting to discuss the progress and to ask clarification questions for the paper writing. Phase~II lasted for five months and allowed a longitudinal perspective on ConvAg QA The core activities during Phase~II related to executing the test suite for different GDMs and to validate the results. We set up an experimental environment in which we could execute the test cases on Docker images containing three incremental versions of Emely. To allow comparisons with an open-source ConvAg, we also provide test results for Blenderbot-400M-distill\footnote{https://huggingface.co/facebook/blenderbot-400M-distill} as a benchmark. The specification of the test environment is a desktop PC running MS Windows 10 equipped with an Intel Core i7-10770 CPU @ 3.80 GHz, 16 GB RAM, and an Nvidia 1080Ti graphics card. We provide a replication package for Blenderbot in the GitHub repository~\cite{repo}. Finally, in D) Results Validation, four academic researchers and two AI developers validated that the test results could be used to verify that the corresponding requirements were satisfied -- this is described in Sec.~\ref{sec:rq1res}. \subsection{Requirements Engineering and Testing} \label{sec:ret} An initial activity toward QA of a GDM is to clarify expectations. In the requirements elicitation step of Phase~I, we focused on capturing vague expectations and expressing them in text. The corresponding action research cycles consisted of five main activities. First, we initiated the work by discussing the expectations on GDMs within the action team and different constellations of the researchers. Our discussions were open, and fueled by our previous personal experiences with ConvAgs. We decided to focus this work on requirements on Emely's GDM rather than the overall system (cf. F) in Fig.~\ref{fig:architecture}). Second, we did an informal market analysis and surveyed gray literature~\cite{garousi2020benefitting} on ConvAg and chatbot quality, e.g., blog posts and technical reports. Third, we iteratively elicited, analyzed, and specified requirements. This activity was the largest in terms of effort. Fourth, we organized the requirements based on the categories proposed by Martin \textit{et al.}~\cite{chatbottesting}, i.e., 1) personality, 2) onboarding, 3) understanding, 4) answering, 5) navigation, 6) error management, and 7) intelligence. Fifth, the action team conducted a workshop to validate the requirements and prioritize for which requirements the first set of test cases should be developed. We assessed each requirement from the perspectives of: 1) NordAxon value, 2) implementation effort, and 3) perceived academic novelty. All perspectives were assessed on an ordinal scale between 1 (lowest score) and 5 (highest score). We refined the requirements after the workshop and report the results in this paper. We iteratively designed test cases (cf. B) in Fig.~\ref{fig:overview}) targeting the prioritized requirements as part of the action research cycles. Designing test cases for GDMs is non-trivial, and required both long discussions and several iterations. Moreover, the test implementation (cf. C) in Fig.~\ref{fig:overview}) was intertwined with the test design. Some test cases were straightforward to implement, others were revised several times. The results are presented in Sec.~\ref{sec:res}. \section{Results and Discussion} \label{sec:res} This section reports our results and discusses the three RQs. \subsection{RQ1: Requirements} \label{sec:resrq1} The action team developed a set of 38 requirements for Emely's GDM. During the validation workshop, one example related to the formatting of a help feature was removed as out of scope. The remaining 37 requirements, all considered valid, were further refined after the meeting and the outcome is listed in Table~\ref{tab:reqts}. The letters in the identifiers show how the requirements map to the categories proposed by Martin \textit{et al.}~\cite{chatbottesting}, i.e., Onboarding (O), Personality (P), Answering (A), Understanding (U), Intelligence (I), Error Management (E), and Performance (PF). Note that we did not specify any Emely requirements related to the Navigation category. In the context of the requirements, we define a set of key terms. \begin{description} \item[Dialog] An instance of an interview session. \item[Prompt] A single string of user input to the GDM. \item[Reply] A single string of output from the GDM. \item[Digressed dialog] A dialog that needs an intervention to refocus because it has left the main topic. \end{description} \begin{table*} \centering \caption{Requirements on Emely's dialog generating model. Scores are in the range 1--5, with 5 being the highest.} \includegraphics[width=1.0\textwidth]{table_reqts.png} \label{tab:reqts} \end{table*} Table~\ref{tab:reqts} also presents how the action team prioritized the requirements before initiating the test development. As described in Sec.~\ref{sec:method}, we assessed all requirements from three dimensions resulting in scores between 1 and 5. The rightmost columns in the table show Value, Effort, and Novelty, respectively. For Value and Effort, green color indicates a very high estimated value, and pink color shows a very high estimated implementation effort. Finally, requirements O1 and E5 were evaluated as ``N/A'' -- the action team concluded that they are infeasible targets for automated testing. Based on discussions within the action team, we decided to proceed with test design for 15 requirements as highlighted in bold font in Table~\ref{tab:reqts}. Our selection included eight of the 14 requirements that obtained the highest Value score. Three of the top Value requirements were excluded due to high Effort scores (P1, A2, and U1) whereas we decided to included I2 despite the high Effort. The remaining seven requirements were selected to increase the diversity (P2, A3, I1, U3, U4, U5, and U6). \subsection{RQ2: Test Design} \label{sec:testdesign} Our approach to GDM testing relies on randomness in the test case generation. To allow the detection of general trends, the number of test case executions are in the order of magnitude of hundreds or thousands. The approach corresponds to \textit{soak testing} as defined in ISO/IEC/IEEE 29119~\cite{iso29119_2013}. Two fundamental test parameters are 1) how many dialogs to generate and 2) how many prompts shall be provided to the GDM under test during each dialog. We found that between 20 and 50 prompts are valid and that a number of dialogs that results in roughly 1,000 prompts reliably discovers differences between GDMs. For each of the selected requirements in Table~\ref{tab:reqts}, the corresponding approach to testing followed one of five test structures: \begin{itemize} \item Question-Answer (Q-A) \item N-gram Counting (NC) \item Coherence Checks (CC) \item Toxicity Analysis (TA) \item Simple Checks (SC) \end{itemize} The Q-A structure has three main test steps: 1) provide specific information, 2) request the same information, 3) assert that the two pieces of information match. We use this for both open questions and closed yes/no questions. Furthermore, we created 15 controlled lists representing different pieces of information (for step 1) and different ways to request that information (for step 2). For open questions, we use a BERT-SQuAD model~\cite{devlin2018bert,rajpurkar2016squad} to identify what part of the reply from the GDM is the answer -- this is used for the assessment in step 3). Wang \textit{et al.} use a similar QA approach in their work on evaluating text summaries~\cite{wang2020asking}. For closed questions, step 3) uses a controlled list of strings that are treated as no, otherwise the test case defaults to yes. The other four test structures are less complex. However, all but SC also use third-party libraries. Test cases following the NC structure check that terms are not repeated in the GDM's replies, i.e., ``stuttering,'' using NLTK~\cite{bird2009natural}. Test cases of the CC structure uses a Sentence-BERT model~\cite{reimers2019sentence} to evaluate the coherence of the content during dialogs and between subsequent replies. The TA structure uses the Detoxify model~\cite{Detoxify} to assess whether the language in the replies from a GDM is acceptable. Finally, the SC structure relies on trivial Python asserts. In the remainder of this section, we present how we designed test cases for the selected requirements organized per category. For each requirement, we present a descriptive test case name, which test structure it follows in brackets, and a short description. \subsubsection{Personality and Answering} We designed three test cases to verify that the requirements related to personality and answering are satisfied. Test cases for P2 result in normalized values whereas A3 and A4 testing yield raw frequencies. \begin{itemize} \item[P2] \textbf{Toxicity} [TA]. Send prompts to the GDM and assess the replies using the Detoxify model. Detoxify returns normalized values between 0 and 1 corresponding to the following categories~\cite{Detoxify}: 1) Toxicity, 2) Severe toxicity, 3) Obscene, 4) Threat, 5) Insult, 6) Identity Attack, and 7) Sexually explicit. All seven values are used to verify the satisfaction of P2. \item[A3] \textbf{Nagging} [SC] A simple check to count the number of times during a dialog that the GDM provides the same verbatim question that it has already provided during a dialog. \item[A4] \textbf{Stuttering} [NC] Count the number of immediate N-gram repetitions in the GDM's replies. We consider bigrams to 6-grams and combine the result to a ``stuttering score'' for which higher order N-grams are penalized more. \end{itemize} \subsubsection{Intelligence} Below we list the eight test case designs we developed to verify that the selected Intelligence requirements are met. Apart from I2 and I3, the overall structure for the intelligence test cases is to present information, maintain the dialog by providing $x$ additional prompts, and then to request the previously provided information ($x$ is a tunable test parameter). Test case designs I5 and I8--I11 randomly select among handcrafted prompts, i.e., \textit{Controlled Test Data} from the file \textit{testset\_database.py} on GitHub~\cite{repo}. \begin{itemize} \item[I1] \textbf{Self consistency} [Q-A] 1) Request information about Emely. 2) Provide $x$ prompts. 3) Request the same information about Emely again. 4) Assert that the reply contains the same information as was provided by the GDM in step 1. \item[I2] \textbf{Dialog coherency} [CC] 1) Provide $x$ prompts. 2) Assess the coherence between each of the GDM's replies in relation to the overall dialog. \item[I3] \textbf{Reply coherency} [CC] 1) Provide $x$ prompts. 2) Assess the coherence between each of the GDM's replies in relation to the preceding prompt. \item[I5] \textbf{Memory assessment} [Q-A] 1) Provide specific information $a$ in a prompt (e.g., ``I studied at Shiraz University''). 2) Provide $x$ prompts. 3) Provide a prompt requesting information $a$. 4) Assert that the GDM's reply contains~$a$. \item[I8] \textbf{Diverse information} [Q-A] 1) Provide information $a$ as formulated in one out of several handcrafted prompts. 2) Provide a prompt requesting information $a$. 3) Assert that the GDM's reply contains~$a$. \item[I9] \textbf{Contextual information} [Q-A] 1) Provide one out of several handcrafted prompts containing two sentences in which the first gives context and the second adds specific information $a$. 2) Request information $a$ for the specific context. 3) Assert that the GDM's reply contains $a$. \item[I10] \textbf{Diverse questions} [Q-A] 1) Provide specific information $a$ in a prompt. 2) Provide one out of several handcrafted prompts requesting information $a$. 3) Assert that the GDM's reply contains $a$. \item[I11] \textbf{Contextual questions} [Q-A] 1) Provide specific information $a$ in a prompt. 2) Provide one out of several handcrafted prompts containing two sentences in which the first gives context and the second requests information $a$. 3) Assert that the GDM's reply contains $a$. \end{itemize} \subsubsection{Understanding} The following list reports the four test case designs we used to verify that the selected Understanding requirements are satisfied. All test case designs use the Q-A structure and share a first step of 1) providing specific information $a$ in a prompt. For each test case design, we aggregate test verdicts to depict the success rate over the fraction of introduced ``noise'' originating in fault injection. The fraction of characters and words that shall be afflicted by injected noise are tunable parameters. \begin{itemize} \item[U3] \textbf{Typo robustness} [Q-A] 2) Request information $a$ through a prompt containing randomly inserted character-level typing mistakes. 3) Assert that the GDM's reply contains information $a$. \item[U4] \textbf{Word order robustness} [Q-A] 2) Request information $a$ through a prompt containing randomly swapped words. 3) Assert that the GDM's reply contains information $a$. \item[U5] \textbf{Omitted word robustness} [Q-A] 2) Request information $a$ through a prompt containing randomly dropped words. 3) Assert that the GDM's reply contains information $a$. \item[U6] \textbf{Synonymy robustness} [Q-A]. 2) Request information $a$ through a prompt containing words randomly replaced by synonyms (using NLTK~\cite{bird2009natural}). 3) Assert that the GDM's reply contains information $a$. \end{itemize} \subsection{RQ3: Test Implementation} \label{sec:rq1res} Fig.~\ref{fig:impl} shows the dual GDM structure used in our test implementation. First, there is a generation phase with a Blenderbot GDM (A) generating prompts that are sent to the GDM under test (B). The GDM under test provides a reply to the Blenderbot, and the cycle repeats until a pre-specified number of prompts have been provided. During this phase, our test framework might randomly interrupt and replace a Blenderbot prompt with constituents of a test case using the Q-A structure, i.e., injecting prompts from the Controlled Test Data (C). We set a probability $p$ for each Q-A test case to replace a Blenderbot prompt. If information is injected, it will be requested in a subsequent prompt as described in Sec.~\ref{sec:testdesign}. The dual GDM structure increases the realism of the testing by providing the context of an ongoing dialog. We found the value of realism to outweigh the drawbacks of the evident non-determinism. \begin{figure} \centering \includegraphics[width=0.35\textwidth]{impl.png} \caption{The test implementation with dual GDMs.} \label{fig:impl} \end{figure} The right part of Fig.~\ref{fig:impl} shows how the dialog resulting from the generation phase is forwarded to the Analysis step (D). All test case verdicts come from analyzing recorded dialogs after-the-fact. Test cases following the structures NC, CC, TA, and SC can be executed on all dialogs no matter if Q-A test cases injected information or not. However, analyzing the outcome of test cases following the Q-A structure is only relevant if the corresponding information has been provided to the GDM during the dialog. If multiple test cases are configured with $p>0$, different pieces of information can be injected and requested within the same dialog. The next subsections discuss the results from executing the automated test cases. \subsubsection{Personality and Answering} Table~\ref{tab:pers_ans} shows the results from testing the Personality and Answering requirements, i.e., Toxicity, Nagging, and Stuttering. The table lists results from testing three GDMs of Emely (v02, v03, and v04) and Blenderbot (BB). The results are based on 200 dialogs driven by 50 Blenderbot prompts each, i.e., analyses of 10,000 GDM replies. To increase the variation in the dialogs, we set all probabilistic test cases to $p = 0.05$. Toxicity is a subjective measure. We argue that recall (i.e., test sensitivity) is more important than precision for toxicity testing of a GDM and thus consider an arguably low Detoxify score of greater than 0.1 as the threshold. To validate this threshold, all six authors conducted an independent (binary) assessment of 50 GDM replies representing a range of Detoxify scores. The task was to use the gut feeling to indicate replies that ``do not feel like a tactful reply by the GDM.'' We found a large individual variation, ranging from 0 to 20 toxicity-indicated replies, corresponding to a fairly low inter-rater agreement (Fleiss' kappa = 0.25). We created a ground truth by considering any reply highlighted as non-tactful by at least two independent indications as a true positive. The test results, corresponding to toxicity testing using the 0.1 threshold on the sample, represents a recall of 0.88 and a precision of 0.28. The test results for P2 - Toxicity in Table~\ref{tab:pers_ans} show i) the fraction of toxic replies (out of 10,000), ii) the 75\% percentile for Detoxify scores, and iii) their standard deviation. \begin{table}[] \caption{Test results related to Personality and Answering. Results in bold font are discussed in the text.} \label{tab:pers_ans} \begin{tabular}{lc|ccc|c} & & v02 & v03 & v04 & BB \\ \hline \multirow{3}{*}{P2 - Toxicity} & Toxic & 391/10k & 350/10k & 398/10k & 526/10k \\ & 75\% & 0.002 & 0.003 & 0.003 & 0.003 \\ & Std & 0.083 & 0.078 & 0.077 & 0.070 \\ \hline \multirow{3}{*}{A3 - Nagging} & Nag & 196/200 & 200/200 & 200/200 & 197/200 \\ & \#Nags & 670 & \textbf{1176} & \textbf{1159} & 617 \\ & Median & 2 & 3 & 2 & 2 \\ \hline \multirow{3}{*}{A4 - Stuttering} & Stut & 192/200 & 183/200 & \textbf{20/200} & 190/200 \\ & 75\% & \textbf{1.077} & 0.143 & 0.299 & 0.133 \\ & Std & \textbf{28.83} & 0.025 & 0.032 & 0.022 \\ \hline \end{tabular} \end{table} Table~\ref{tab:pers_ans} also shows the test results for A3 - Nagging. Regarding Nagging, the rows present i) the fraction of dialogs that contained a nagging question (out of 200), ii) the total number of nagging questions, and iii) the median number of nagging questions in dialogs with nagging present. We note that GDMs v03 and v04 are strikingly more likely to repeat the same verbatim question. Finally, Table~\ref{tab:pers_ans} reports the test results for A4 - Stuttering. The rows list i) the fraction of dialogs containing a non-zero stuttering score (out of 200), ii) the 75\% percentile of the stuttering scores, and iii) the standard deviation. The most extreme example of stuttering we detected was a reply by the GDM v02 that consisted of a sequence of 64(!) ``z''. In contrast, the reply with the highest stuttering score by the GDM v04 was ``It is always sunny and always sunny.'' To provide another perspective on how the requirement is met, Fig.~\ref{fig:dists} shows distributions and probability density functions for stuttering scores representing 200 dialogs for each GDM. We believe that presenting such plots in dashboards could help ML test engineers effectively detect model regression after retraining. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{dists.png} \caption{Distributions of stuttering scores (on the x-axes). Y-axes show frequencies (note the extreme scale of v02).} \label{fig:dists} \end{figure} We conclude that \textit{the test cases developed for the three selected requirements under Personality and Answering detected meaningful differences between the GDMs}. Thus, our findings show that they can be used to support selection of GDMs, e.g., as part of regression testing prior to model selection after retraining. For Toxicity, we found that the three GDM versions were all less toxic than Blenderbot. For Nagging, we found that the number of repeated verbatim GDM questions has increased in later versions. Finally, for stuttering, we detected that the GDM v02 had an issue of repeating n-grams within replies -- which was a known issue by NordAxon at that time and later resolved. The prevalence of stuttering in the GDM v04 is substantially lower compared to the other GDMs. \subsubsection{Intelligence, Understanding, and Robustness} Table~\ref{tab:int} summarizes the results from testing the Intelligence requirements. The table shows results from testing three GDM versions (v02, v03, and v04) and Blenderbot (BB) using 200 dialogs driven by 50 Blenderbot prompts each. Table~\ref{tab:int} shows three values for each requirement: i) the fraction of dialogs with failed test cases, ii) the 75\% percentile for the number of failed test cases per dialog, and iii) the standard deviation. To increase the variation in the dialogs for I2 and I3 testing, we set all probabilistic test cases to $p = 0.05$. For all other test cases, we set $p = 0.05$ for the corresponding injection and kept all others at 0. The test results for I1 show that none of the GDMs are consistent in how they convey themselves during dialogs. Instead, the GDMs frequently present contradictory information and change previously expressed facts. We observed a lower fraction of failed test cases for GDM~v03, but at the same time the number of failed test cases per dialog remains high. We consider this a normal variation in the probabilisitic testing and conclude that all GDMs are far from satisfying I1. Coherence is a subjective quality just like toxicity. To validate the utility of the sentence-BERT's Next Sentence Prediction (NSP) to measure coherence as part of the CC test structure, all authors did an independent assessment of 30 dialog snippets (containing roughly five prompts and five replies) representing a range of different I2 test verdicts. The task was to use the gut feeling to indicate replies that ``do not feel coherent given the ongoing dialog.'' The inter-rater agreement was higher than for toxicity (Fleiss' kappa = 0.46) and we created a ground truth through the majority vote among the raters (removing two ties). The I2 test results, corresponding to whether the NSP indicates that a GDM's reply is more likely to be a random sequence of words rather than a continuation of the dialog (i.e., coherent), represents a recall of 0.50 and a precision of 0.85. We find that these results show that BERT's NSP scores can be used for I2 coherence testing. Table~\ref{tab:int} shows the results from I2 testing. For each of the 10,000 replies in the 200 dialogs, NSP assessed whether it is coherent. If a dialog contains at least one incoherent reply, the dialog is recorded as failed. We find that the GDMs v03 and v04 are more coherent than v02, i.e., 79 and 71 failed dialogs compared to 122. On the other hand, the I3 validation effort clearly showed that BERT's NSP cannot be used to assess coherence in relation to a single preceding prompt. There is obviously too little information for the technique to make any reliable predictions. Thus, we do not report any results from testing I3 -- Table~\ref{tab:int} only lists ``Omitted.'' The Q-A structure is at the core of most test cases for Intelligence and Understanding. As described in Sec.~\ref{sec:testdesign}, the I5 test cases provide information to the GDM and request the same information a few prompts later. Test cases for I8--I11 use the same concept, but alters the way either information is provided or information is requested. The test cases we implemented for Understanding uses the same Q-A structure, but injects various types of noise, i.e., typos (U3), swapped word order (U4), removed words (U5), and synonym replacement (U6). Test results related to I5 also had to be carefully validated. While the results related to the memory of GDMs are less subjective than the toxicity and coherence counterparts, the possible language variation makes it difficult to programatically distinguish between correct and incorrect replies -- the so called test oracle problem~\cite{barr2014oracle}. To validate the test results, we analyzed 25 randomly selected test results from each GDM, i.e., the output from BERT-SQuAD and the test case verdict. Using human judgment as the ground truth, the test results correspond to a recall of 0.85 and a precision of 0.97. We further analyzed the relatively high false negative rate. Eleven passing test cases should instead have failed. Among these, we found two main tendencies. First, the GDMs sometimes ``trick'' the test case into a positive verdict by talking about itself, e.g., ``Where did I use to work?" followed by ``I used to work at a fast food restaurant.'' Second, GDMs frequently dodge questions by returning another question. As replies to the prompt with the closed question Q:``Am I good at working with people?'' we found both general clarification questions such as A:``What do you mean by that?'' and more complex formulations, e.g., A:``What do you mean by people skills?'' Defaulting such answers to yes, as described in Sec.~\ref{sec:testdesign}, resulted in false negatives. The recall is still sufficient to allow GDM testing, thus we present I5 test results in Table~\ref{tab:int}. The results, corresponding to I5 test case injection set to $p = 0.1$, clearly show that all GDMs display inadequate memory, i.e., between 173 and 199 dialogs with injected I5 test cases fail. Blenderbot performs the worst, and we observe only slight differences between Emely's three GDMs versions. We conclude that \textit{the test cases designed for I1, I2, and I5 are sufficiently sensitive to detect differences between different versions of GDMs}. In this process, we also found that none of the GDMs satisfy the I5 memory requirement. As the results for the fundamental memory test case were inadequate, we refrain from reporting results for the more complex Q-A test cases (I8--I11 and U3--U6) in this paper. The basic I5 test case design was troublesome enough. \begin{table}[] \caption{Test results related to Intelligence. Results in bold font are discussed in the text. Several results, e.g. everything about Understanding, are omitted after failed validation.} \label{tab:int} \begin{tabular}{lccccc} & \multicolumn{1}{c|}{} & v02 & v03 & \multicolumn{1}{c|}{v04} & BB \\ \hline \multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}I1 - Self\\ consistency\end{tabular}} & \multicolumn{1}{c|}{Failed} & 182/197 & \textbf{136/196} & \multicolumn{1}{c|}{180/198} & 161/194 \\ & \multicolumn{1}{c|}{75\%} & 3 & 5 & \multicolumn{1}{c|}{5} & 5 \\ & \multicolumn{1}{c|}{Std} & 2.606 & 3.210 & \multicolumn{1}{c|}{2.668} & 2.848 \\ \hline \multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}I2 - Dialog\\ coherence\end{tabular}} & \multicolumn{1}{c|}{Failed} & 122/200 & \textbf{79/200} & \multicolumn{1}{c|}{\textbf{71/200}} & 114/200 \\ & \multicolumn{1}{c|}{75\%} & 2 & 2 & \multicolumn{1}{c|}{1} & 2 \\ & \multicolumn{1}{c|}{Std} & 0.933 & 0.641 & \multicolumn{1}{c|}{0.499} & 0.620 \\ \hline \multicolumn{3}{l|}{I3 - Reply coherence} & \multicolumn{3}{c}{Omitted} \\ \hline \multirow{3}{*}{I5 - Memory} & \multicolumn{1}{c|}{Failed} & 179/200 & 181/200 & \multicolumn{1}{c|}{173/200} & 199/200 \\ & \multicolumn{1}{c|}{75\%} & 2 & 3 & \multicolumn{1}{c|}{2} & 3 \\ & \multicolumn{1}{c|}{Std} & 1.462 & 1.772 & \multicolumn{1}{c|}{1.378} & 1.533 \\ \hline \multicolumn{3}{l|}{I8 -- I11 (Diversity and Context)} & \multicolumn{3}{c}{Omitted} \\ \hline \multicolumn{3}{l|}{U3 -- U6 (Robustness)} & \multicolumn{3}{c}{Omitted} \\ \hline \end{tabular} \end{table} \section{Threats to Validity} \label{sec:threats} We discuss the most important threats to the validity of our action research study as proposed by Staron~\cite{staron2020action}. \textbf{Construct validity.} The concept of quality of ConvAgs is at the heart of our work. Do our requirements really capture the elusive concept of human-like dialog generation? Moreover, even if our requirements are valid, do our automated test cases properly verify that the GDM satisfies them? Our work is by no means finished or complete, but we argue that we mitigated the main threats by conducting multi-perspective requirements engineering and independent validation of test results. \textbf{Internal validity.} The only difference between the test subjects are the GDMs, i.e., no rule-based processing differs. There is considerable randomness in the test case results that could influence our causal claims, but we reduce the threat by repeated execution. \textbf{Conclusion validity.} Apart for P2 and A3, we largely discuss the fraction of dialogs that contain failed test cases. Perhaps this fairly coarse-grained approach hides detailed insights, but we complement the data with percentiles and standard deviations for test case failures on a dialog level. Furthermore, we find that interpreting inter-rater agreements using standard thresholds are valid for our purposes. \textbf{External validity.} We designed test cases particularly for the GDM in the interview-coaching Emely, thus they are certainly less applicable for other GDMs. However, while the test case implementations are customized, we believe that the specified requirements are general enough to apply to virtually any ConvAg, e.g., the general purpose Blenderbot. Generalizing further, many requirements should also apply to simpler chatbots without GDMs -- also rule-based bots shall remember information and avoid toxic language. \section{Lessons Learned} \label{sec:lessons} Action research results in valuable lessons learned. In this section, we report four important lessons that can guide others working on ConvAg QA and their embedded GDMs. First, Emely's memory appears remarkably short and this can lead to frustrated users. We believe that a GDM in isolation will never be sufficient to satisfy memory requirements. Instead, the conversational engine must likely contain dedicated knowledge representation. This would involve combining the current deep learning techniques with previous work on symbolic AI, e.g., what can be found in ConvAgs from the 90s~\cite{allen1995trains}. To mitigate frustrated users, Emely now explicitly warns the user about her poor memory when she introduces herself as a job interviewer. Second, we believe that another approach to memory testing could be better. The current test designs focus on testing that the GDM remembers information provided by the user. Instead, testing that the GDM remembers what it previously provided would be more meaningful and better complement the I1 test cases for self-consistency. However, this would require the test harness to implement knowledge representation and populate it during the ongoing dialog -- and then look for contradictions in the replies. Third, testing a GDM designed to drive interviews is more difficult than testing a mere conversationalist. As a test engineer, you want to control the situation. However, the interview-driving Emely is itself designed to drive to conversational flow. Any injected test cases by the test engineer lead to a power struggle that make the dialog less realistic. Fourth, the GDM lacks the concept of self. As an anthropomorphic (although disembodied) ConvAg, dialogs that violate everyday constructs such as ``you'' and ``me'' might deteriorate the user's perception of Emely~\cite{araujo2018living}. Our test cases triggered such behavior, e.g., Q:``Do I enjoy working with people?'' followed by the reply A:``Yes, I love working with people!'' Future versions of the ConvAg needs to be reinforced to mitigate such tendencies. \section{Conclusion and Future Work} \label{sec:conc} QA of ConvAgs that rely on GDMs requires novel approaches to AI engineering. We conducted action research in the context of Emely, an evolving solution for person-centered interactive second-language acquisition~\cite{larsen2018looking}, intended to accelerate migrants entry to the labor market~\cite{blake2017impact,meer2019english}. We elicited and specified 37 requirements on Emely's GDM that generalize to other ConvAgs (RQ1). Based on a prioritization activity within the action team, we selected 15 requirements and proposed corresponding test designs (RQ2). We implemented automated test cases that indicate to what extent subsequent versions of Emely's GDMs satisfy the requirements (RQ3). We report test results for six test cases and validate that they reflect requirements fulfillment. This action research endeavor will continue. Emely is still in early development and we will keep improving her corresponding QA. Next we will revisit and refine the requirements by introducing additional stakeholders in the requirements engineering. Furthermore, we will refactor the test infrastructure and execute test cases in an MLOps setting~\cite{borg2022agility}. Moreover, we will develop an interactive dashboard to provide NordAxon ML engineers with an actionable overview for model selection among candidate GDMs.
5befe048553cc98a8bbfc6dc331d956f18e52434
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} In the Standard Model (SM), the coupling of the electroweak (EW) gauge bosons to leptons is flavor universal, a property known as lepton flavor universality (LFU). The SM's extension is expected to violate this property, and experimental observations of such processes will be direct evidence of physics beyond the SM (BSM). Even though LHC searches have not found any direct hints for new particles, indirect searches for new physics have become an increasingly important pathway. Intriguing hints for BSM physics have accumulated over the years from the measurements of precision observables in several experiments that strongly suggest LFU violation (LFUV). Lepton anomalous magnetic moments (AMMs) for the first two generations that are very sensitive to new physics are measured in the experiments with unprecedented accuracy. There is a long-standing tension in the muon AMM $(g-2)_\mu$ measured in 2006 at Brookhaven \cite{Bennett:2006fi}. Fermilab's new measurement \cite{Abi:2021gix} is in complete agreement with the previous result, and the combined result shows a large $+4.2\sigma$ discrepancy with the SM prediction \cite{Aoyama:2020ynm}. For a recent review of BSM models addressing this anomaly, see Ref. \cite{Athron:2021iuf}. As for the electron, a recent experiment at Berkeley \cite{Parker:2018vye} has measured the fine-structure constant using Caesium atom with extreme precision, which indicates a $-2.4\sigma$ disagreement with the direct experimental measurement~\cite{Hanneke:2008tm}. A large positive deviation of $(g-2)_\mu$ but a negative deviation of $(g-2)_e$ has caused excitement in the high-energy physics community, and various new physics proposals have been made to solve these discrepancies simultaneously \cite{Giudice:2012ms, Davoudiasl:2018fbb,Crivellin:2018qmi,Liu:2018xkx,Dutta:2018fge, Han:2018znu, Crivellin:2019mvj,Endo:2019bcj, Abdullah:2019ofw, Bauer:2019gfk,Badziak:2019gaf,Hiller:2019mou,CarcamoHernandez:2019ydc,Cornella:2019uxs,Endo:2020mev,CarcamoHernandez:2020pxw,Haba:2020gkr, Bigaran:2020jil, Jana:2020pxx,Calibbi:2020emz,Chen:2020jvl,Yang:2020bmh,Hati:2020fzp,Dutta:2020scq,Botella:2020xzf,Chen:2020tfr, Dorsner:2020aaz, Arbelaez:2020rbq, Jana:2020joi,Chua:2020dya,Chun:2020uzw,Li:2020dbg,DelleRose:2020oaa,Kowalska:2020zve,Hernandez:2021tii,Bodas:2021fsy,Cao:2021lmj,Mondal:2021vou,CarcamoHernandez:2021iat,Han:2021gfu,Escribano:2021css,CarcamoHernandez:2021qhf,Chang:2021axw,Chowdhury:2021tnm,Bharadwaj:2021tgp,Borah:2021khc,Bigaran:2021kmn,PadmanabhanKovilakam:2022FN,Li:2021wzv,Biswas:2021dan,Barman:2021xeq,Chowdhury:2022jde}. Here we point out that a more recent measurement utilizing Rubidium atom at the Kastler Brossel Laboratory in Paris \cite{Morel:2020dww} shows somewhat consistent with the direct experimental measurement~\cite{Hanneke:2008tm}. Contrary to the 2018 result by Berkeley National Laboratory \cite{Parker:2018vye}, this new 2020 result \cite{Morel:2020dww} finds $\Delta a_e$ to be positive ($+1.6\sigma$), indicating a $\sim 5\sigma$ disagreement between these two experiments. Since these determinations by the two groups cannot be reconciled within the stated uncertainties, we, at first, will treat these two results as independent cases, presenting separate fits to demonstrate consistency of our model with each result. Later, however, we also perform a fit to illustrate how our model can be simultaneously consistent with the combined results of \cite{Parker:2018vye} and \cite{Morel:2020dww}, favoring a Standard Model-like value. Furthermore, LFU violating $B$-meson decays have been persistently observed in a series of experiments. Among these processes, the most prominent deviation has been observed in neutral-current transitions associated with the ratio: $R_{K^{(\ast)}}= Br\left(B\to K^{(\ast)}\mu^+\mu^- \right)/Br\left(B\to K^{(\ast)}e^+e^- \right)$, which has very small theory uncertainties since hadronic uncertainties cancel out in the above ratios, making it extremely sensitive to new physics probes. In the SM, this ratio is predicted to be unity \cite{Descotes-Genon:2015uva,Bobeth:2007dw,Bordone:2016gaq,Straub:2018kue,Isidori:2020acz} due to the LFU property. However, experiments have consistently found it to be somewhat smaller than one \cite{LHCb:2017avl,LHCb:2019hip,Belle:2019oag,BELLE:2019xld}; among them, the most precise measurement by LHCb \cite{LHCb:2021trn} alone quotes a significance of $3.1\sigma$ for $R_K$-ratio.\footnote{In addition to the clean observable $R_{K^{(\ast)}}$, several other observables are in tension with the SM predictions for example angular distributions and branching ratios of several $b\to s\mu^+\mu^-$ modes \cite{LHCb:2015svh,LHCb:2015ycz,LHCb:2016ykl,Belle:2016fev,ATLAS:2018gqc,CMS:2015bcy,CMS:2017rzx,LHCb:2020lmf,LHCb:2020gog,LHCb:2015wdu}. When all these anomalies are combined, a global fit \cite{Capdevila:2017bsm,Aebischer:2019mlg} to data suggests $> 5\sigma$ discrepancy. In this Letter, we only focus on the $R_{K^{(\ast)}}$ ratio; the rest of the observables suffer from large hadronic uncertainties, and we do not attempt to alleviate these discrepancies.} On the other hand, charged-current transitions in the $B$-meson decays indicate an enhancement of the ratio: $R_{D^{(\ast)}}= Br\left(B\to D^{(\ast)}\tau \overline \nu_\tau \right)/Br\left(B\to D^{(\ast)}\ell \overline \nu \right)$, with $\ell= e, \mu$. The ratios $R_{D^{(\ast)}}$ show deviations \cite{BaBar:2013mob,Belle:2016dyj,LHCb:2015gmp,LHCb:2017rln,Belle:2019gij} from the SM predictions \cite{Na:2015kha, Aoki:2016frl,Na:2015kha, Aoki:2016frl} with a combined significance of about $3\sigma$ \cite{HFLAV:2019otj}. Besides all this, first and foremost, it is widely accepted that the SM cannot be the fundamental theory at all energies since it fails to incorporate neutrino oscillations firmly confirmed by various experiments; for reviews see Refs.~\cite{Cai:2017jrq,Cai:2017mow}. Motivated by this crucial drawback of the SM, in this Letter, we propose a simultaneous solution to all four of the anomalies mentioned above that are directly intertwined with the neutrino mass generation mechanism. In this unified framework \cite{Julio:2022ton}, we employ two scalar leptoquarks\footnote{For a recent review on LQs, see Ref. \cite{Dorsner:2016wpm}. Moreover, for solutions to $B$-anomalies by employing leptoquarks (scalar and vector) see e.g. Refs. \cite{Tanaka:2012nw, Dorsner:2013tla, Sakaki:2013bfa, Duraisamy:2014sna, Hiller:2014yaa, Buras:2014fpa,Gripaios:2014tna, Freytsis:2015qca, Pas:2015hca, Bauer:2015knc,Fajfer:2015ycq, Deppisch:2016qqd, Li:2016vvp, Becirevic:2016yqi,Becirevic:2016oho, Sahoo:2016pet, Bhattacharya:2016mcc, Duraisamy:2016gsd, Barbieri:2016las,Crivellin:2017zlb, DAmico:2017mtc,Hiller:2017bzc, Becirevic:2017jtw, Cai:2017wry,Alok:2017sui, Sumensari:2017mud,Buttazzo:2017ixm,Crivellin:2017dsk, Guo:2017gxp,Aloni:2017ixa,Assad:2017iib, DiLuzio:2017vat,Calibbi:2017qbu,Chauhan:2017uil,Cline:2017aed,Sumensari:2017ovu, Biswas:2018jun,Muller:2018nwq,Blanke:2018sro, Schmaltz:2018nls,Azatov:2018knx, Sheng:2018vvm, Becirevic:2018afm, Hati:2018fzc, Azatov:2018kzb,Huang:2018nnq, Angelescu:2018tyl, DaRold:2018moy,Balaji:2018zna, Bansal:2018nwp,Mandal:2018kau,Iguro:2018vqb, Fornal:2018dqn, Kim:2018oih, deMedeirosVarzielas:2019lgb, Zhang:2019hth, Aydemir:2019ynb, deMedeirosVarzielas:2019okf, Cornella:2019hct,Datta:2019tuj, Popov:2019tyc, Bigaran:2019bqv, Hati:2019ufv, Coy:2019rfr, Balaji:2019kwe, Crivellin:2019dwb, Cata:2019wbu, Altmannshofer:2020axr, Cheung:2020sbq, Saad:2020ucl,Saad:2020ihm, Dev:2020qet,Crivellin:2020ukd, Crivellin:2020tsz,Gherardi:2020qhc, Babu:2020hun,Bordone:2020lnb,Crivellin:2020mjs, Crivellin:2020oup,Hati:2020cyn,Angelescu:2021lln,Marzocca:2021azj,Crivellin:2021egp,Perez:2021ddi, Crivellin:2021ejk,Zhang:2021dgl,Bordone:2021usz,Carvunis:2021dss,Marzocca:2021miv,BhupalDev:2021ipu,Allwicher:2021rtd,Wang:2021uqz,Bandyopadhyay:2021pld,Qian:2021ihf,Fischer:2021sqw,Gherardi:2021pwm,Crivellin:2021lix, London:2021lfn,Bandyopadhyay:2021kue,Husek:2021isa,Afik:2021xmi,Heeck:2022znj,Julio:2022ton,Crivellin:2022mff,Chowdhury:2022dps}.} (LQs), $\{S_1(\overline 3,1,1/3), R_2(3,2,7/6)\}$, which address the flavor anomalies and neutrino masses simultaneously. In this model, Majorana neutrino mass appears at two-loop order. Our novel proposal is minimal, and the \textit{only neutrino mass model} in the literature that resolves all of these aforementioned notable anomalies while satisfying low-energy flavor constraints and the LHC limits.\footnote{A few proposals of neutrino mass models attempted to connect neutrino mass with flavor anomalies; however, these models address these anomalies only partially; for details, see Ref. \cite{Julio:2022ton}.} Furthermore, the proposed model is fully testable since a resolution of the charged-current $B$-anomaly requires the relevant LQ to have a mass around 1 TeV (the neutral-current and $g-2$ anomalies can be explained with relatively heavier LQ). This paper is organized in the following way: we introduce the model in Sec.~\ref{sec:model} and discuss how anomalies are incorporated within this setup in Secs.~\ref{sec:observables} and \ref{sec:constraints}. After presenting our numerical results in Sec.~\ref{sec:result}, finally we conclude in Sec.~\ref{sec:conclusion}. \section{Model}\label{sec:model} In addition to the SM particle content, the proposed model consists of two scalar LQs (SLQs), $S_1(\overline 3,1,+1/3)$, $R_2(3,2,7/6)$, and another BSM multiplet $\xi_3(3,3,2/3)$. We denote their component fields by \begin{align} R_2=\left( \begin{array}{c} R^{5/3} \\ R^{2/3} \end{array} \right), \;S_1=S^{1/3},\; \xi= \left( \begin{array}{cc} \frac{\xi^{2/3}}{\sqrt{2}} & \xi^{5/3} \\ \xi^{-1/3} & -\frac{\xi^{2/3}}{\sqrt{2}} \end{array} \right). \nonumber \end{align} The couplings of LQs with the SM fermions take the following form: \begin{align} \mathcal{L}_Y^{\rm new} &= f^L_{ij} \overline u_{R i} R_2 \cdot L_{j} + f^R_{ij} \overline Q_{i} R_2\ell_{R j} \nonumber\\& + y^L_{ij} \overline{Q^c_i} \cdot L_{j} S_1 + y^R_{ij} \overline{u^c}_{R i} S_1 \ell_{R j}, \label{new-yuk} \end{align} where $Q$ and $L$ stand for, respectively, left-handed quark and lepton doublets, $u_R$ and $\ell_R$ are right-handed up-type quark and lepton, and $i,j=1-3$ are family indices. We also use ``$\cdot$'' to denote $SU(2)$ contraction so that $L\cdot Q \equiv L^\rho Q^\sigma\epsilon_{\rho\sigma}$ with $\epsilon$ being the Levi-Civita tensor and $\rho,\sigma=$ being $SU(2)$ indices. Since explanations of flavor anomalies require that these LQs couple to quark-lepton bilinears, as usual, we turn off the diquark coupling of $S_1$ LQ, which guarantees baryon number conservation. Now, expanding these Yukawa terms, we obtain \begin{align} \mathcal{L}&= \overline u_{R i}\left(f^L\right)_{ij}\ell_{L j} R^{5/3}+ \overline u_{R i}\left(-f^L\right)_{ij} \nu_{L j} R^{2/3} \nonumber \\& +\overline u_{L i} \left(f^R\right)_{ij} \ell_{R j} R^{5/3} +\overline d_{L i} \left(V^\dagger f^R\right)_{ij} \ell_{R j}R^{2/3} \nonumber \\& +\overline{u^c}_{L i} \left(y^L\right)_{ij}\ell_{L j} S^{1/3} +\overline{d^c}_{L i} \left(-V^Ty^L\right)_{ij}\nu_{L j} S^{1/3} \nonumber\\& +\overline{u^c}_{R i} \left(y^R\right)_{ij} \ell_{R j} S^{1/3},\label{up-basis} \end{align} where, $V$ represents the CKM mixing matrix, and we have chosen to work in the so-called ``up-quark mass diagonal basis". The two LQs and $\xi$ can also interact with Higgs doublet $H$ in the scalar potential $V_{sc} \supset \lambda S_1^\dagger H^T\epsilon \xi^\dagger H + \mu R^\dagger_2 \xi H$. The simultaneous presence of the Yukawa and these scalar interactions breaks the lepton number by two units, as required for generating non-zero neutrino mass; one of the diagrams is shown in Fig.~\ref{Feynman}. If the Yukawa interactions are turned off, the leptoquarks are not required to carry any lepton number; hence the scalar potential will remain lepton-number conserving. After the EW symmetry breaking, these terms induce mixing in the LQ-$\xi$ sector, yielding six physical exotic scalars, i.e., $\chi^{1/3}_a$, $\chi^{2/3}_a$, and $\chi^{5/3}_a$ with $a=1,2$. Since explaining flavor anomalies requires some $\mathcal{O}(1)$ Yukawa couplings, we are compelled, by tiny neutrino masses, to have small mixing angles. Therefore, it is a good approximation to identify gauge eigenstates $R^{2/3,5/3}$ and $S^{1/3}$ as their physical eigenstates. In the chosen basis, the neutrino mass formula takes the following form: \begin{align} {\mathcal M}_\nu = m_0I_0 \bigg\{& 2 (y^{L})^T D_u f^L + \frac{m_\tau}{m_t} D_\ell (y^{R})^Tf^L \nonumber \\ & - \frac{m_\tau}{m_t} D_\ell (f^{R})^T y^L \bigg\} + {\rm transpose}, \label{nuEQ} \end{align} where $m_0=3g^2 m_t/\sqrt 2(16\pi^2)^2$ with $g$ being the $SU(2)$ gauge coupling constant and $m_t$ being the top-quark mass. The normalized mass matrices of up-type quarks and charged leptons are $D_u=\text{diag.}\left(\frac{m_u}{m_t}, \frac{m_c}{m_t}, 1 \right)$ and $D_\ell=\text{diag.}\left(\frac{m_e}{m_\tau}, \frac{m_\mu}{m_\tau}, 1 \right)$. The loop integral $I_0$ in the asymptotic limit (i.e., when all fermion masses are zero) is given by \begin{align} I_0 = \frac{1}{4}\sin2\theta\sin2\phi\sum_{a,b=1}^2(-1)^{a+b} I(M_{a+2},M_b). \label{eq4} \end{align} Here $\theta$ and $\phi$ denote the mixing angles of LQ with charges $1/3$ and $2/3$, respectively, while \begin{align} I(M_{a+2},M_b) = &~8\left(1-\frac{3}{4}\frac{M_{a+2}}{M_b}\right) - \frac{5}{6}\pi^2 \left( 1-\frac{2}{5}\frac{M_{a+2}}{M_b} \right) \nonumber \\ & + \frac{M_b^2}{m_W^2} \left(\frac{M_{a+2}}{M_b} -1 \right)\left(2-\tfrac{1}{3}\pi^2\right) \nonumber \\ & + \left(\frac{2M_{a+2}}{M_b}-1 \right)\ln \frac{m_W^2}{M_b^2} \label{eq5} \end{align} is the loop function, derived by assuming $M_b/M_{a+2} =1+r_{ba}$ with $r_{ba}\ll 1$. Note that $M_{1,2}$ are masses for $2/3$ charged LQs and $M_{3,4}$ are for $1/3$ charged LQ. For more detailed discussion, we refer the reader to Ref.~\cite{Julio:2022ton}. \begin{figure}[th!] \centering \includegraphics[scale=0.4]{loop.pdf} \caption{A typical two-loop diagram leading to non-zero neutrino mass. For full set of diagrams, see Ref.~\cite{Julio:2022ton}. } \label{Feynman} \end{figure} \section{Correlated Observables}\label{sec:observables} \begin{table}[t!] { \footnotesize {\renewcommand{\arraystretch}{1.5}% \begin{center} \begin{tabular}{|c|c|} \hline \textbf{Process}&\textbf{Constraints}\\ \hline \hline \multirow{2}*{$\mu\to e \gamma$ \cite{MEG:2016leq}} &$|f_{\alpha e}^R f_{\alpha \mu}^{R* }|+|f_{\alpha e}^L f_{\alpha \mu}^{L* }|< 4.82\times 10^{-4}\left(\frac{M_{R_2}}{\text{TeV}}\right)^2$ \\ \cline{2-2} & $(| f_{\alpha e}^R f_{\alpha \mu}^{L* } | + | f_{\alpha e}^L f_{\alpha \mu}^{R* } |)\ \mathcal{C} <7.63\times 10^{-5}$\ \\ &\hspace{13mm}~~~~~~~$\hspace{5mm}~~~~~~~\left(\frac{M_{R_2}}{\text{TeV}} \right)^2 \left(\frac{1\ \text{GeV}}{m_q} \right) $ \\ \hline \multirow{2}*{$\tau\to e \gamma$ \cite{BaBar:2009hkt}} &$|f_{\alpha e}^R f_{\alpha \tau}^{R* }|+|f_{\alpha e}^L f_{\alpha \tau}^{L* }|< 0.32 \left(\frac{M_{R_2}}{\text{TeV}}\right)^2$ \\ \cline{2-2} & $(| f_{\alpha e}^R f_{\alpha \tau}^{L* } | + | f_{\alpha e}^L f_{\alpha \tau}^{R* } |)\ \mathcal{C} <0.85 \left(\frac{M_{R_2}}{\text{TeV}} \right)^2 \left(\frac{1\ \text{GeV}}{m_q} \right)$\ \\ \hline \multirow{2}*{$\tau\to \mu \gamma$ \cite{BaBar:2009hkt}} &$|f_{\alpha \mu}^R f_{\alpha \tau}^{R* }|+|f_{\alpha \mu}^L f_{\alpha \tau}^{L* }|< 0.37 \left(\frac{M_{R_2}}{\text{TeV}}\right)^2$ \\ \cline{2-2} & $(| f_{\alpha \mu}^R f_{\alpha \tau}^{L* } | + | f_{\alpha \mu}^L f_{\alpha \tau}^{R* } |)\ \mathcal{C} <0.98 \left(\frac{M_{R_2}}{\text{TeV}} \right)^2 \left(\frac{1\ \text{GeV}}{m_q} \right)$\ \\ \hline $\mu - e$ \cite{SINDRUMII:2006dvw} & $|\hat{f}_{ue}^R \hat{f}_{u\mu}^{R*}| \leq 8.58 \times 10^{-6} \left(\frac{M_{R_2}}{\text{TeV}}\right)^2$\\[3pt] \hline \end{tabular} \end{center}} } \caption{Constraints on Yukawa couplings from radiative decay of charged leptons. Here $\mathcal{C}=\Big(1+4 \log{\frac{m_q^2}{M_{R_2}^2}}\Big)$. The second (first) row in the ``Constraints" column shows the bound with (without) chiral enhancement. Constraints on the $S_1$ LQ couplings $y^{L,R}$ with no chiral enhancement is weaker by a factor of 3, whereas chirally enhanced contribution has the factor with $C$ replaced by $C' = \Big(7+4 \log{\frac{m_q^2}{M_{R_2}^2}}\Big)$. The contribution from $\hat{f}^R$ is suppressed as it is proportional to $m_b^2/M_{R_2}^2$ in comparison to $R_2^{5/3}$. } \label{tab:liljgamma} \end{table} This section discusses the relevant correlated observables/constraints in the proposed two-loop neutrino mass model that resolve the four anomalies. At tree-level both $S_1$ and $R_2$ LQs contribute to the $b\to c\tau\overline \nu$ transition which are favorable, whereas they do not lead to a desired contribution to the $b\to s\mu\mu$. Loop-induced contributions to $b\to s\mu\mu$ transition face several difficulties and unable to consistently solve $R_{K^{(\ast)}}$ anomalies (see e.g. Ref.~\cite{Angelescu:2021lln}). On the contrary, if $R_2$ LQ couples to the electrons, relatively small couplings are feasible to address \cite{Popov:2019tyc,Altmannshofer:2021qrr} $R_{K^{(\ast)}}$ anomalies since the relevant operator is generated at the tree-level. Moreover, each of these LQs can also simultaneously explain both the $(g-2)_\mu$ and $(g-2)_e$ anomalies via the chirally-enhanced top-quark and charm-quark contributions, respectively \cite{Dorsner:2020aaz}. To be specific, $\hat f^R_{se,be}$ (for brevity, we define $\hat{f}^R \equiv V^\dagger f^R$ and $\hat{y}^L \equiv -V^T y^L$) couplings are responsible for addressing $R_{K^{(\ast)}}$ anomalies. Incorporating the $(g-2)_\mu$ ($(g-2)_e$) anomaly requires either $f^{R,L}_{t\mu}$ or $y^{R,L}_{t\mu}$ ($f^{R,L}_{t/ce}$ or $y^{R,L}_{t/ce}$) couplings to be sizable. Furthermore, with TeV scale LQ (LQ mass below TeV is highly constrained by LHC data), explanations of $R_{D^{(\ast)}}$ anomalies typically demand $\mathcal{O}(1)$ $y^R_{c\tau}$ and $\hat y^L_{b\ell}$ ($\hat f^R_{b\tau}$ and $f^L_{c\ell}$) entries if $S_1$ ($R_2$) LQ is responsible for this charged-current processes. Consequently, the NP contribution to resolving these four anomalies while incorporating neutrino oscillation data is highly non-trivial and leads the way to various flavor violating processes that are severely constrained by the experimental data. One of the most important constraints is the lepton flavor violating (LVF) radiative decay of charged leptons $\ell_i \to \ell_j \gamma$ \cite{Lavoura:2003xp}. For instance, the $\mu \to e \gamma$ process precludes $R_2$ LQ to accommodate $\Delta a_\mu$ while resolving $R_{K^{(*)}}$. Furthermore, to avoid strong constraints from chirally enhanced $\ell_i \to \ell_j \gamma$ via the CKM rotation in the up-sector, we have chosen to work in the up-quark mass diagonal basis of Eq.~\eqref{up-basis}. Constraints on the Yukawa couplings owing to dominant LFV processes as a function of LQ mass for both non-chiral and chirally enhanced diagrams are shown in Table~\ref{tab:liljgamma} together with constraint from coherent $\mu - e$ conversion in nuclei. Similarly, $R_2$ LQ in the up-quark diagonal basis leads to various kaon decay processes~\cite{Mandal:2019gff,Ceccucci:2021gpl,Goudzovski:2022vbt} for which numerous stringent bounds are listed in Table~\ref{tab:kaon}. Moreover, the model requires $f^R_{b\tau}\sim \mathcal{O}(1)$, which modifies $Z$-boson decay to fermion pairs through one-loop radiative corrections. Then the LEP data \cite{ALEPH:2005ab} on the effective coupling leads to $|f^R_{b\tau}| \leq 1.21$ \cite{Arnan:2019olv} for LQ mass of 1.0 TeV. \vspace{3mm} \textbf{Non-standard neutrino interactions:} Both $R_2$ and $S_1$ LQs have couplings to neutrinos and quarks that can induce charged-current NSI at tree-level~\cite{Wolfenstein:1977ue, Proceedings:2019qno, Babu:2019mfe}. Using the effective dimension-6 operators for NSI introduced in Ref.~\cite{Wolfenstein:1977ue}, the effective NSI parameters in our model are given by \begin{align} \varepsilon_{\alpha\beta} \ = \ \frac{3}{4\sqrt 2 G_F} \left(\frac{f^{L\star}_{u\alpha}f^L_{u\beta}}{M_{R^{2/3}}^2} +\frac{\hat{y}^L_{d\alpha}\hat{y}^L_{d\beta}}{M_{S^{1/3}}^2} \right) \, . \label{eq:NSI} \end{align} The Yukawa coupling $\hat y^L_{d\alpha}$ is subject to strong constraint from $K^+ \to \pi^+ \nu \nu$ as shown in Table~\ref{tab:kaon}. The couplings $f^L_{u\alpha}$ ($\alpha = e, \mu$) are constrained by the non-resonant dilepton searches at LHC and the limit on $f^L_{ue}$ and $f^L_{u\mu}$ are 0.19 and 0.16 for 1 TeV LQ mass. Thus, the contribution of $\hat y^L_{d\alpha}$ and $f^L_{u\alpha}$ which leads to $\varepsilon_{\alpha \beta}$ is at sub-percent level. However, the LHC limits on the LQ Yukawa coupling in the tau sector are weaker and in principle be $\mathcal{O} (1)$ leading to $\epsilon_{\tau \tau}$ as large as 34.4 \% \cite{Babu:2019mfe}, which is within reach of long-baseline neutrino experiments, such as DUNE \cite{Chatterjee:2021wac}. \begin{table}[t] {\footnotesize \centering \begin{tabular}{|c|c|} \hline {\bf Process} & {\textbf{Constraints} \cite{Mandal:2019gff,Ceccucci:2021gpl,Goudzovski:2022vbt}} \\[3pt] \hline\hline $K_L \to e^+ e^-$ & $|\hat{f}_{de}^R \hat{f}_{se}^{R*}| \leq 2.0 \times 10^{-3} \left(\frac{M_{R_2}}{\text{TeV}}\right)^2$ \\[3pt] \hline $K_L^0 \to e^\pm \mu^\mp$ & $|\hat{f}_{d\mu}^R \hat{f}_{se}^{R*}+ \hat{f}_{s\mu}^R \hat{f}_{de}^{R*}| \leq 1.9 \times 10^{-5} \left(\frac{M_{R_2}}{\text{TeV}}\right)^2$ \\[3pt] \hline $K_L^0 \to \pi^0 e^\pm \mu^\mp$ & $|\hat{f}_{d\mu}^R \hat{f}_{se}^{R*} - f_{s\mu}^R f_{de}^{R*}| \leq 2.9 \times 10^{-4} \left(\frac{M_{R_2}}{\text{TeV}}\right)^2$ \\[3pt] \hline $K^+ \to \pi^+ e^+ e^-$ & $|\hat{f}_{de}^R \hat{f}_{s\mu}^{R*}| \leq 2.3 \times 10^{-2} \left(\frac{M_{R_2}}{\text{TeV}}\right)^2$\\[3pt] \hline $K^+ \to \pi^+ e^- \mu^+$ & $|\hat{f}_{d\mu}^R \hat{f}_{se}^{R*}|, |\hat{f}_{de}^R \hat{f}_{s\mu}^{R*}| \leq 1.9 \times 10^{-4} \left(\frac{M_{R_2}}{\text{TeV}}\right)^2$ \\[3pt] \hline $K-\Bar{K}$ & $|\hat{f}_{d\alpha}^{R*} \hat{f}_{s\alpha}^{R}| \leq 0.0266 \left(\frac{M_{R_2}}{\text{TeV}}\right)$ \\ \hline $K^+ \to \pi^+ \nu \nu$ & Re[$\hat{y}^L_{de} \hat{y}^L_{se}$] $= [-3.7, 8.3] \times 10^{-4} \left(\frac{M_{S_1}}{\text{TeV}}\right)^2$ \\[3pt] & $[\sum_{m\neq n} |\hat{y}^L_{dm} \hat{y}^{L*}_{sn}|^2]^{1/2} < 6.0 \times 10^{-4} \left(\frac{M_{S_1}}{\text{TeV}}\right)^2$ \\[3pt] \hline $ B \to K^{(*)} \nu \nu$ & $\hat{y}^L_{b\alpha} \hat{y}^L_{s\beta} = [-0.036, 0.076]\ \left(\frac{M_{S_1}}{\text{TeV}}\right)^2$,\ [$R_{K^*}^{\nu \bar{\nu}} < 2.7$]\\[3pt] % & $\hat{y}^L_{b\alpha} \hat{y}^L_{s\beta} = [-0.047, 0.087]\ \left(\frac{M_{S_1}}{\text{TeV}}\right)^2$,\ [$R_{K}^{\nu \bar{\nu}} < 3.9$]\\[3pt] \hline \end{tabular} } \caption{Constraints on the relevant LQ couplings as a function of mass from leptonic kaon and $B$ meson decays. } \label{tab:kaon} \end{table} \begin{figure}[!t] \includegraphics[width=0.387\textwidth]{Pair_production.pdf} \includegraphics[width=0.377\textwidth]{nonresonant.pdf} \caption{Upper plot: Summary of the current limits from searches for LQ pair-production at the LHC for different quark-lepton final states. The branching ratio $\beta$ varies from 0 to 1 for a specific decay channel of the LQ, while the other decay channels that are not specified compensate for the missing branching ratios. Lower plot: Upper limits on the LQ couplings $f^{R,L}$ as a function of the LQ $R_2$ mass are presented, obtained from recent non-resonant dipleton searches at the LHC. The red dashed line represents bound on $y^R_{c\tau}$ for $S_1$ LQ. } \label{fig:collider} \end{figure} \section{Constraints from Direct Searches}\label{sec:constraints} At the LHC, $S_1$ and $R_2$ LQs can be pair produced \cite{Diaz:2017lit, Dorsner:2018ynv, Dorsner:2021chv} through $gg$ and $q\bar{q}$ fusion processes or can be singly produced in association with charged leptons via $s$- and $t$- channel quark-gluon fusion processes. The single production of LQ becomes only relevant for larger Yukawa couplings to the first and second-generation quarks \cite{Buonocore:2020erb}. Thus, collider bounds from single-production are not so significant compared to QCD-driven LQ pair production for our analysis. In both ATLAS and CMS, there are dedicated searches for the LQ pair production in different modes, LQ$^\dagger$ LQ $\to q\bar{q} \ell \bar{\ell}, q\bar{q} \nu \bar{\nu}$. The collider limits on LQ mass depend on the branching ratios to different modes, as depicted in Fig.~\ref{fig:collider} (upper-plot). Apart from the LQ-pair production bound, there are bounds on the couplings and mass on the LQ from the high-$p_T$ tails of $pp\to \ell \ell$ distributions \cite{Eboli:1987vb, Faroughy:2016osc, Schmaltz:2018nls, Greljo:2017vvb, Angelescu:2018tyl, Alves:2018krf, Angelescu:2020uug, Babu:2020hun, Angelescu:2021lln}. The corresponding bounds are also shown in Fig.~\ref{fig:collider} (lower-plot). The above direct searches assume that the LQs decay promptly, which is no longer applicable for long-lived states. The colored particles arising from the $\xi$ field can generally be long-lived if their mixing with the LQs is sufficiently small, typically required to correctly incorporate the neutrino mass scale. Colored long-lived particles (CLLPs) hadronize prior to decay, forming so-called R-hadrons~\cite{Farrar:1978xj} that are bound states composed of the CLLP and light quarks, antiquarks, and gluons. Since these particles carry color charge, for TeV scale masses, they are efficiently pair-produced $pp\to \chi_a\overline \chi_a$ via pure QCD interactions. Once produced, they decay to SM fermions with decay width $\Gamma\sim y^2 m_\chi/(16\pi)$~\cite{Buchmuller:1986zs} corresponding to a vertex displacement of $d\sim 10^{-14}/y^2$ mm. Therefore, for Yukawa couplings $y\gtrsim 10^{-6.5}$, decay is prompt since the corresponding vertex displacements are smaller than typical LHC detector resolution~\cite{Diaz:2017lit}. On the other hand, for $y\lesssim 10^{-6.5}$ they become long-lived, and for $y\lesssim 10^{-9}$ these states are practically stable and decay outside the detector. Long-lived gluinos and squarks have been extensively searched for at the LHC. However, no signal above the expected background is found, which provides lower bounds on the CLLPs. Our scenario is similar to the long-lived sbottom ($Q_{em}=1/3$) and stop ($Q_{em}=2/3$) for which the current bounds at $95\%$ confidence level are $m\geq 1250$ GeV~\cite{ATLAS:2019gqq} and $m\geq 1800$ GeV~\cite{CMS:2020iwv}, respectively. \section{Results and Discussion}\label{sec:result} \begin{table}[!t] {\footnotesize \centering \begin{tabular}{|c|c|c|c|} \hline \hline {\textbf{Oscillation}} & {\textbf{$3\sigma$ range}} & \multicolumn{2}{c|}{\textbf{Fit values}}\\ \cline{3-4} {\bf parameters} & \textbf{{\tt NuFit5.1}}~\cite{Esteban:2020cvm} & TX I (NH) & TX II (IH) \\ \hline \hline $\Delta m_{21}^2 (10^{-5}~{\rm eV}^2$) & 6.82 - 8.04 & 7.41 & 7.39 \\ \hline $\Delta m_{23}^2 (10^{-3}~{\rm eV}^2) $(IH) & 2.410 - 2.574 & - & 2.53 \\ $\Delta m_{31}^2 (10^{-3}~{\rm eV}^2) $(NH) & 2.43 - 2.593 & 2.53 & - \\ \hline $\sin^2{\theta_{12}}$ & 0.269 - 0.343 & 0.316 & 0.2986 \\ \hline $\sin^2{\theta_{23}}$ (IH) & 0.410 - 0.613 & - & 0.534 \\ $\sin^2{\theta_{23}}$ (NH) & 0.408 - 0.603 & 0.506 & - \\ \hline $\sin^2{\theta_{13}} $ (IH) & 0.02055 - 0.02457 & - & 0.0227 \\ $\sin^2{\theta_{13}} $(NH) & 0.02060 - 0.02435 & 0.0218 &- \\\hline \hline \textbf{Observable} & \textbf{$1 \, \sigma$ range} & & \\ \hline \hline $C_9^{ee} = C_{10}^{ee}$ & $[-1.65, -1.13]$ \cite{Altmannshofer:2021qrr} & $-1.39$ & $-1.57$ \\ \hline \hline $(g-2)_e \, \, (10^{-14})$ & $-88 \pm 36 (48 \pm 30)$ & $-86 (48)$ & $-84 (60)$ \\ \hline $(g-2)_\mu \, \, (10^{-10})$ & $25.1 \pm 6.0$ & 22.4 & 24.2 \\ \hline \hline \end{tabular} } \caption{$3\sigma$ allowed ranges of the neutrino oscillation parameters are taken from a recent global-fit~\cite{Esteban:2020cvm}. $1\sigma$ allowed ranges of lepton $g-2$ and $C_{9}^{ee}=C_{10}^{ee}$ are also summarized. The last two columns contain the fit values of the observables for each texture. For $(g-2)_e$, the number in the parenthesis in the second column corresponds to the measurement of \cite{Morel:2020dww}, and the corresponding fitted values are given in parentheses in the third and fourth columns for TX-I and TX-II, respectively. } \label{tab:nu} \end{table} In this section, we present our numerical results and study the correlations among $R_{D^{(*)}}$, $R_{K^{(*)}}$, $\Delta a_\mu$, and $\Delta a_e$ anomalies within their $1\sigma$ measured values while consistently incorporating neutrino oscillations data. First, we demonstrate the viability of our proposed model by providing two benchmark points\footnote{In our numerical analysis, CKM matrix is expressed in terms of Wolfenstein parametrization \cite{Wolfenstein:1983yz} with $\lambda = 0.2248$, $A=0.8235$, $\rho=0.1569$. For the low scale up-type quark masses, we take $m_u (2 {\rm GeV}) = 2.16$ MeV, $m_c (m_c) = 1.27$ GeV, and $m_t (m_t) = 160$ GeV, which are then extrapolated to the LQ mass scale at 1 TeV \cite{Xing:2007fb}.} given in Eqs.~\eqref{eq:TXI} and~\eqref{eq:TXII} for two distinct textures. \noindent{\bf TX-I:} With $m_0 I_0 = 1.73\times 10^{-6}$ GeV, $M_{R_2} = 1.5$ TeV and $M_{S_1} = 1.2$ TeV: {\footnotesize \begin{align} f^R &= \begin{pmatrix} 0 & 0 & 0\\ {\bf 0.13} & 0 & -0.027 \\ {\bf 0.036} & 0.01 & 0 \end{pmatrix} \, ,\hspace{5mm} f^L = \begin{pmatrix} 0 & 0 & {\it 1.0} \\ 0 & 0 & 6.36 \times 10^{-4} \\ 0 & 0 & -5.32 \times 10^{-6} \end{pmatrix} \, , \nonumber\\[7pt] y^R &= \begin{pmatrix} 0 & 0 & 0\\ -0.3^* & 0 & \fbox{1.0} \\ 0 & 0.0025^\dagger & 0 \end{pmatrix} \, ,\hspace{5mm} y^L = \begin{pmatrix} 0 & 0 & 0\\ 0.02^* & 0 & 0\\ 0 & \fbox{1.2}^\dagger & 0 \end{pmatrix} \, . \label{eq:TXI} \end{align} } This flavor structure explains $R_D - R_{D^*}$ ( \fbox{~} ), $(g-2)_\mu$ ( $~\dagger$ ), and $(g-2)_e$ ( $\star$ ) utilizing $S_1$ LQ, and $R_K - R_{K^*}$ ({\bf bold}) from $R_2$ LQ. Non-zero elements in black are the additional entries required to explain neutrino oscillation data. The only non-zero entry that induces observable NSI is shown in {\it italics}.\\ \noindent{\bf TX-II:} With $m_0 I_0 = 3.33 \times 10^{-6}$ GeV, $M_{R_2} = 1.0$ TeV and $M_{S_1} = 1.5$ TeV: {\footnotesize \begin{align} f^R &= \begin{pmatrix} 0 & 0 & 0\\ {\bf -0.013^*} & 0 & 0 \\ {\bf -0.180} & 0 & \fbox{-0.9\ i} \end{pmatrix} \, ,\hspace{3mm} f^L = \begin{pmatrix} 0 & 0 & 0 \\ 0.3^* & 0 & \fbox{0.9} \\ 0 & 0 & 0 \end{pmatrix} \, , \nonumber\\[7pt] y^R &= \begin{pmatrix} 0 & 0 & 0\\ 0 & 0 & -1.85\times 10^{-4} \\ 0 & 1.0^\dagger & 0 \end{pmatrix} ,\hspace{1mm} y^L = 10^{-3} \begin{pmatrix} 0 & 0 & 0\\ -1.82 & 5.78\ i & 0\\ 0 & 4.40^\dagger & 0 \end{pmatrix} \, . \label{eq:TXII} \end{align} } This flavor structure, on the other hand, explains $R_D - R_{D^*}$ ( $\fbox{~}$ ), $R_K - R_{K^*} $ ({\bf bold}), and $(g-2)_e$ ( $\star$ ) by making use of $R_2$ LQ, and $(g-2)_\mu$ ( $\dagger$ ) from $S_1$ LQ. For each of these textures, fitted neutrino observables are presented in Table~\ref{tab:nu}, which is in excellent agreement with experimental data. The consistency of these benchmarks fits with the current LHC bounds are discussed later in this section. Fits presented in Eqs.~\eqref{eq:TXI} and~\eqref{eq:TXII} incorporate the $(g-2)_e$ measurement of Ref.~\cite{Parker:2018vye}. Here we clearly demonstrate how to consistently reproduce the more recent measurement of Ref.~\cite{Morel:2020dww}. Interestingly, for fit Eq.~\eqref{eq:TXI}, the coupling $y^R_{21}$ does not play any role in neutrino mass generation. Hence reducing its size by a factor of $\sim 1/2$ and flipping its sign (to be precise, the new value is $y^R_{21}=0.17$) reproduces the result of Ref.~\cite{Morel:2020dww} without affecting any other observable. On the other hand, for fit Eq.~\eqref{eq:TXII} to replicate the measurement of Ref.~\cite{Morel:2020dww}, $f^R_{21}$ needs to be reduced while keeping its product with $f^R_{31}$ same. Moreover, the couplings $f^R_{21,31}$ play an insignificant role in neutrino mass generation as it is always accompanied by electron mass (i.e., suppressed by a factor of $m_e/m_t$, see Eq.~\eqref{nuEQ}). For instance, $f^R_{21} = 0.0093$ and $f^R_{31} = 0.252$ correctly reproduce the fit values illustrated in Table \ref{tab:nu} as TX-II, while reproducing the $(g-2)_e$ result of Ref.~\cite{Morel:2020dww}. It is worth noting that our model can, in fact, be simultaneously consistent with both values of $(g-2)_e$ inferred from Cs \cite{Parker:2018vye} and Rb \cite{Morel:2020dww} experiments. To illustrate this, we need to combine the two uncorrelated values $a_{e,\rm Cs}\pm \sigma_{\rm Cs}$ and $a_{e,\rm Rb}\pm \sigma_{\rm Rb}$ of the same physical quantity $a_e$ to get the best estimate $a_e^{\rm comb.}\pm \sigma^{\rm comb.}$ via~\cite{Fabjan:2020wnt} \begin{align} &a_e^{\rm comb.}=\frac{\sum_{k} \frac{a_{e,k}}{\sigma^2_k}}{\sum_k \frac{1}{\sigma^2_k}}, \;\;\; \sigma^{\rm comb.}= \frac{1}{\sqrt{\sum_k \frac{1}{\sigma^2_k}}}, \label{comb} \end{align} where $k=\rm Cs,~Rb$. For the reader's convenience, here, we collect those values of $a_e$ inferred from the measurements of the fine-structure constant: $a_{e,\rm Cs}= 0.00115965218161(23)$~\cite{Parker:2018vye} and $a_{e,\rm Rb}=0.001159652180252(95)$~\cite{Morel:2020dww}. Using Eq.~\eqref{comb}, we obtain $a_e^{\rm comb.}=0.00115965218045(9)$. Comparing with the direct measurement, i.e., $a_e^{\rm exp.}=0.00115965218073(28)$~\cite{Hanneke:2008tm}, we find a deviation \begin{align} \Delta a_e^{\rm comb.}=a_e^{\rm exp.}-a_e^{\rm comb.}=(2.8\pm2.9)\times 10^{-13}, \label{comb-ae} \end{align} which clearly indicates that $a_e^{\rm exp.}$ is in a good agreement with the (combined) SM value. The error in Eq.~\eqref{comb-ae} is obtained by adding the errors of $a_e^{\rm comb.}$ and $a_e^{\rm exp.}$ in quadrature. Note that the combined value $\Delta a_e^{\rm comb.}$ leans toward $\Delta a_e^{\rm Rb}$ due to the much smaller uncertainty associated with the Rb experiment (hence $a_e^{\rm comb.}$ is heavily weighted by $a_e^{\rm Rb}$ in Eq.~\ref{comb}). Now, for TX-I with NH, one can turn off Yukawa coupling $y_R^{21}$ without changing the corresponding fit (see discussion above). This choice gives no new physics contribution to electron $(g-2)$, i.e., a special case corresponding to a pure SM-like scenario with $\Delta a_e=0$. Furthermore, the combined value given in Eq.~\eqref{comb-ae} can also be trivially reproduced by setting $y_R^{21}=0.095$ without affecting any other observable. On the other hand, for IH with texture TX-II, setting $f^L_{21}=0$ would lead to the texture with $(\mathcal{M}_\nu)_{11} =(\mathcal{M}_\nu)_{22} = 0$, forbidden by the oscillation data. One can however, lower the Yukawa coupling $f^R_{21}$ while keeping its product with $f^R_{31}$ fixed to obtain $C_9^{ee}=C_{10}^{ee}$ within $1\sigma$. Moreover, $f^R_{21} \gtrsim 0.0067$ is required to satisfy the bound $|f^R_{31} f^{R*}_{33}| < 0.32\ (M_{R_2}/{\rm TeV})^2$ obtained from $\tau \to e \gamma$. This choice of $f^R_{21}$ leads to $\Delta a_e \gtrsim 4.32 \times 10^{-13}$, consistent with combined measurement given in Eq.~\eqref{comb-ae}. Next we show that a slight deviation from the TX-II opens up parameter space allowing even a smaller value of $\Delta a_e$. We demonstrate the viability by the following modified texture: \\ \noindent{\bf TX-II$^{\prime}$:} With $m_0 I_0 = 4.77 \times 10^{-3}$ GeV, $M_{R_2} = 1.0$ TeV and $M_{S_1} = 1.5$ TeV: {\footnotesize \begin{align} f^R &= \begin{pmatrix} 0 & 0 & 0\\ {\bf 0.026} & 0 & 0 \\ {\bf 0.09} & 0 & \fbox{-0.9\ i} \end{pmatrix} \, ,\hspace{3mm} f^L = \begin{pmatrix} 0 & 0 & 0 \\ 0.014 & 0 & \fbox{0.9} \\ 0 & 0 & 0.005\ i \end{pmatrix} \, , \nonumber\\[7pt] y^R &= \begin{pmatrix} 0 & 0 & 0\\ 0 & 0 & 0 \\ 0 & 1.0^\dagger & -0.132\ i \end{pmatrix} ,\hspace{1mm} y^L = 10^{-3} \begin{pmatrix} 0 & 0 & 0\\ 0.02 & 0.04 & -1.21\\ 0 & 4.40^\dagger & 0 \end{pmatrix} \, . \label{eq:TXII} \end{align} } The above benchmark, which is consistent with all flavor violating constrains, reproduces the central value of the neutrino observables {\tt NuFit5.1}~\cite{Esteban:2020cvm} and returns same values for the rest of the observables as in TX-II, except for $(g-2)_e$, which is found to be $\Delta a_e = 7.7 \times 10^{-14}$. This number is also fully consistent with the combined $\Delta a_e$ given in Eq.~\eqref{comb-ae}. \begin{figure}[t!] \includegraphics[width=0.45\textwidth]{RD_final.pdf} \includegraphics[width=0.45\textwidth]{RK_final.pdf} \caption{TX-I: $1\sigma$ (green) and $2\sigma$ (yellow) allowed range for $R_{D^{(*)}}$ (top) and $R_{K^(*)}$ (bottom) in the relevant Yukawa coupling planes, with the $S_1$ ($R_2$) LQ mass fixed at $1.2$ ($1.5$) TeV. Orange band on the top figure corresponds to $1\sigma$ allowed range of $\Delta a_\mu$. } \label{fig:TXI} \end{figure} Next, we study the correlations among numerous observables associated with the benchmark scenarios, TX-I and TX-II. For TX-I, the allowed parameter space to explain $R_{D^{(*)}}$ and $R_{K^{(*)}}$ at $1\sigma$ (green shaded) and $2\sigma$ (yellow shaded) CL in the relevant Yukawa coupling planes are illustrated in Fig.~\ref{fig:TXI} by fixing $R_2$ ($S_1$) mass at 1.2 (1.5) TeV. In computing $R_{D^{(*)}}$ and $R_{K^{(*)}}$ observables, we utilized {\tt Flavio package} \cite{Straub:2018kue}. By fixing $y^R_{t\mu} = 0.0025$ (cf. Eq.~\eqref{eq:TXI}), the allowed range to incorporate $\Delta a_\mu$ at $1\sigma$ is shown in orange band that corresponds to $y^R_{t\mu} y^L_{t\mu}\sim 10^{-3}$. We also show the exclusion regions obtained from resonant ($t\bar{t}\mu\bar{\mu}$) and non-resonant ($pp \to \tau \tau, e e$) production of LQs, along with flavor constraints such as $\mu \to e \gamma$ for a fixed $f^R_{b\mu}$, and kaon decays. Here the remaining anomaly $\Delta a_e$ is determined by the product $y^R_{ce} y^L_{ce}$, and the corresponding fitted value is listed in Table~\ref{tab:nu} obtained from the fit Eq.~\eqref{eq:TXI}. \begin{figure}[t!] \includegraphics[width=0.45\textwidth]{RD_II.pdf} \includegraphics[width=0.45\textwidth]{RK_II_final.pdf} \caption{TX-II: $1\sigma$ (green) and $2\sigma$ (yellow) allowed range for $R_{D^{(*)}}$ (top) and $R_{K^(*)}$ (bottom) in the relevant Yukawa coupling planes, with the $R_2$ LQ mass fixed at $1.0$ TeV. Orange band on the bottom figure corresponds to $1\sigma$ allowed range of $\Delta a_e$. } \label{fig:TXII} \end{figure} Similarly, Fig.~\ref{fig:TXII} illustrates the TX-II scenario where $R_2$ LQ addresses $R_{D^{(*)}}$, $R_{K^{(*)}}$, and $\Delta a_e$ anomalies. Green and yellow bands correspond to $1\sigma$ and $2\sigma$ allowed ranges for $R_{D^{(*)}}$ and $R_{K^{(*)}}$, respectively, whereas orange band shows $1\sigma$ preferred value for $\Delta a_e$. In this plot, $M_{R_2} = 1$ TeV and $f^L_{ce} = 0.3$ (cf. Eq.~\eqref{eq:TXII}) are kept fixed. The exclusion regions are obtained from resonant ($t\bar{t}\tau\bar{\tau}$, $c\bar{c}e\bar{e}$) and non-resonant ($pp \to \tau \tau, e e$) production of LQs, along with flavor constraints such as $\tau \to e \gamma$ for a fixed $f^R_{b\tau}$ and $f^R_{be}$, kaon decays, and $Z$-boson decay $Z\to \tau \tau$. $\Delta a_\mu$, which is not depicted in the figure, is determined by the product $y^R_{t\mu} y^L_{t\mu}$, and the corresponding benchmark value is shown in Table~\ref{tab:nu} obtained from Eq.~\eqref{eq:TXII}. As can be seen from these plots, the valid parameter space addressing all the anomalies is very limited due to various collider and flavor violating constraints, and upcoming experiments searching for LFV \cite{MEG:2016leq, Aushev:2010bq} have the potential to rule out this scenario. On the other hand, a resolution to flavor anomalies, particularly the $R_{D^{(\ast)}}$ ratios, requires LQ masses not higher than $\mathcal{O}(1)$ TeV, making this model fully testable at future high-luminosity LHC. \textbf{LHC bounds on fits TX-I and TX-II:} For TX-I with $f^L_{u\tau}=0$ (contributing to only NSI), $R_2$ LQ primarily decays to $jj e \bar{e}$ and $c \bar{c} e \bar{e}$ \cite{ATLAS:2020dsk} with the same Yukawa coupling $f^R_{se}$ leading to branching ratio $\beta = 0.5$. Here we fix $R_2$ mass at $1.5$ TeV (corresponding to branching ratio $\beta \simeq 0.74$ to $jjee$). Moreover, once $f^L_{u\tau}\sim \mathcal{O}(1)$ is included, new modes open up, and $R_2$ primarily decays to $jj\tau \bar{\tau}$ and $jj \nu \bar{\nu}$ \cite{CMS:2018qqq}. There are no dedicated searches for $jj \tau \bar{\tau}$ and the limits from $jj \nu \bar{\nu}$ is 1.0 TeV for $\beta =1$. On the other hand, for the TX-II, $R_2$ dominantly decays to $t\bar{t}\tau \bar{\tau}$ \cite{ATLAS:2021oiz}, $b \bar{b} \tau \bar{\tau}$ \cite{ATLAS:2019qpq, ATLAS:2021jyv}, $jj\tau\bar{\tau}$, and $j j \nu {\nu}$ each with the branching ratio $\beta \simeq 0.24$. Here we fix $R_2$ mass at 1 TeV, which allows the corresponding branching ratio to be as large as $\beta \simeq 0.27$ (from $t\bar{t}\tau \bar{\tau}$). On the other hand, for TX-I, $S_1$ primarily decays to $jj\tau\bar{\tau}$, $t \bar{t} \mu \bar{\mu}$ \cite{ATLAS:2020xov}, and $b \bar{b} \nu \bar{\nu}$ \cite{CMS:2018qqq} with the branching ratios (0.26, 0.37, 0.37), respectively. The latter two provide limits on the scalar LQ to be 1.5 (1.2) TeV and 1.1 (0.8) TeV for branching fraction $\beta = 1\ (\beta = 0.5)$, which is easily satisfied for our choice of $S_1$ LQ mass of 1.2 TeV. Similarly, for the TX-II $S_1$ decays to $t \bar{t} \mu \bar{\mu}$ $100\%$ of the time with the bound of 1.5 TeV as previously mentioned. For TX-II, we fix $S_1$ LQ mass at 1.5 TeV such that current collider constraints along with all the flavor constraints are easily satisfied. The bounds from dilepton final states ($q q \to \ell \ell$) \cite{ATLAS:2020zms, ATLAS:2020yat, CMS:2021ctt} on the relevant couplings $f^R_{se}, f^R_{be}, f^R_{b\tau}$, and $f^L_{c\tau}$ for $R_2$ LQ respectively read as $(0.29, 0.44, 1.4, 1.0)$ for 1 TeV mass and $(0.43, 0.67, 1.88, 1.31)$ for 1.5 TeV mass. Similarly, for $S_1$ LQ the relevant Yukawa coupling $y^R_{c\tau}$ is constrained to be $1.39$ (1.61) for 1.2 (1.5) TeV mass. Finally, we discuss the collider bounds on the states mostly originating from $\xi$. For our fits, using the definition of $m_0$ ($\sim 6\cdot 10^{-3}$ GeV), we find $I_0\sim 2\cdot 10^{-4}$. Moreover, for all physical scalars with masses close to each other (i.e., $r_{ba}\ll 1$), utilizing Eq.~\eqref{eq4}-\eqref{eq5}, we obtain $I_0\approx 2\sin 2\theta \sin 2 \phi$. Then, assuming mixings of similar order, we obtain $\theta\sim \phi\sim 10^{-2}$. Therefore, states arising primarily from $\xi$ have Yukawa couplings of order $10^{-2}$ with the third generation fermions (couplings with the first and second generations are more suppressed), hence decay promptly. Consequently, collider bounds on these states are identical to the bounds on LQs. \section{Conclusions}\label{sec:conclusion} In this Letter, we have presented for the first time a two-loop radiative neutrino mass model consisting of two scalars LQs $S_1(\overline 3,1,1/3)$ and $R_2(3,2,7/6)$ and another BSM scalar $\xi(3,3,2/3)$ with close-knit connections with $R_{K^{(\ast)}}$, $R_{D^{(\ast)}}$, and $(g-2)_{\mu, e}$ . We have performed a detailed analysis, including all relevant flavor violating and collider constraints, and presented benchmark fits showing complete consistency with anomalies and neutrino oscillation data. Furthermore, resolving these tantalizing flavor anomalies requires LQs to have masses around the TeV scale, enabling us to test this theory at the ongoing and future colliders. Finally, it is worth mentioning that the model sets several exciting avenues for future work; the implications on electric dipole moments and their correlations with the CP-violating phases in the neutrino sector, detailed analysis on LFV decays, and a dedicated collider study. {\textbf {\textit {Acknowledgments.--}}} The work of J.J. was supported in part by the National Research and Innovation Agency of the Republic of Indonesia via Research Support Facility Program. \bibliographystyle{style}
22723b2f5a845fda562b0e95b93acb806e6b6209
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} The computational cost of direct numerical simulations can be reduced by using reduced order models. The proper orthogonal decomposition (POD) method is based on a reduced basis (snapshots) that are computed by means of a full order method (FOM). In this paper, we study the numerical approximation of incompressible flows with POD methods. We consider the Navier-Stokes equations \begin{align} \label{NS} \partial_t\boldsymbol u -\nu \Delta \boldsymbol u + (\boldsymbol u\cdot\nabla)\boldsymbol u + \nabla p &= \boldsymbol f &&\text{in }\ (0,T]\times\Omega,\nonumber\\ \nabla \cdot \boldsymbol u &=0&&\text{in }\ (0,T]\times\Omega, \end{align} in a bounded domain $\Omega \subset {\mathbb R}^d$, $d \in \{2,3\}$ with initial condition $\boldsymbol u(0)=\boldsymbol u^0$. In~\eqref{NS}, $\boldsymbol u$ is the velocity field, $p$ the kinematic pressure, $\nu>0$ the kinematic viscosity coefficient, and $\boldsymbol f$ represents the accelerations due to external body forces acting on the fluid. The Navier-Stokes equations \eqref{NS} must be complemented with boundary conditions. For simplicity, we only consider homogeneous Dirichlet boundary conditions $\boldsymbol u = \boldsymbol 0$ on $\partial \Omega$. In practical simulations one can apply some given software to compute the snapshots. It could then be the case that a different discretization is used for the discretization of the nonlinear term in the FOM method and the POD method (the last one being typically implemented by means of a hand-made code instead of an existing one). Our aim in this paper is to study the influence of the use of different discretizations for the nonlinear terms on the final error bounds of the POD method. In \cite{novo_rubino} POD stabilized methods for the Navier-Stokes equations were considered and analyzed for a case in which the snapshots are based on a non inf-sup stable method and a case in which the snapshots are based on an inf-sup stable method. In the present paper, we consider the second case. Our snapshots are based on an inf-sup stable method and, as in \cite{novo_rubino}, we add grad-div stabilization to both the FOM and the POD methods. We analyze the case in which different discretizations are applied for the nonlinear term. Adding grad-div stabilization we are able to prove error bounds for the method with constants that do not depend explicitly on inverse powers of the viscosity, although, as usual, may depend on it through the norms of the theoretical solution. In the recent preprint \cite{archiv_incon} we have found an study of the consistency of the nonlinear discretization in FOM and POD methods. In this reference no stabilization is included neither in the FOM nor in the POD method. The authors of \cite{archiv_incon} conclude that the use of different discretizations in the nonlinear term yields additional terms that prevent the POD method from recovering the FOM accuracy. In the present paper, we prove, in agreement with the results in \cite{archiv_incon}, that there are some additional terms in the error bound of the final POD method coming from the use of different discretizations in the nonlinear terms. We prove that the additional terms have the size of the $L^2$ error in the velocity and the $L^2$ error of the divergence of the velocity of the FOM method. This holds both for the methods with grad-div stabilization and also for the plain methods considered in \cite{archiv_incon}. We then conclude that there is no inconsistency in the error bounds using different discretization for the nonlinear terms in the FOM and POD methods. Following \cite{archiv_incon}, we analyzed a concrete case in which the so called divergence or skew-symmetric form of the nonlinear term (commonly used in practice) is used for the FOM method and the EMAC form, see \cite{emac}, is applied for the POD method. The error analysis for any other combination of discretizations of the nonlinear terms with analogous properties could be carried out in a similar way. The EMAC formulation was designed to conserve energy, momentum and angular momentum. Considering a continuous in time method it is easy to see, as we prove in Section 4, that the effect of grad-div stabilization in a method with EMAC form for the nonlinear term is a lost of kinetic energy. The method maintains however the conservation of the momentum and angular momentum. In practice, as stated in \cite{emac_fully}, a fully version of a method with EMAC form for the nonlinear term is applied. In \cite{emac_fully} it is proved that using Newton method for the nonlinear term is the option from which more quantities are still conserved, although the conservation of the kinetic energy is lost. In this sense, adding grad-div stabilization incurres in the same phenomena so that it seems not to be a hard problem since either kinetic energy or any other properties will be lost with the EMAC formulation in the fully discrete case. The outline of the paper is as follows. In Section 2 we introduce some notation. In Section 3 we state some preliminaries concerning the POD method. Section 4 is devoted to the error analysis in which one considers different discretizations for the nonlinear term in the FOM and POD methods. In Section 5 we present some numerical experiments. We end the paper with some conclusions. \section{Preliminaries and notation}\label{sec:PN} The following Sobolev embeddings \cite{Adams} will be used in the analysis: For $q \in [1, \infty)$, there exists a constant $C=C(\Omega, q)$ such that \begin{equation}\label{sob1} \|v\|_{L^{q'}} \le C \| v\|_{W^{s,q}}, \,\,\quad \frac{1}{q'} \ge \frac{1}{q}-\frac{s}{d}>0,\quad q<\infty, \quad v \in W^{s,q}(\Omega)^{d}. \end{equation} The following inequality can be found in \cite[Remark 3.35]{John} \begin{eqnarray}\label{diver_vol} \|\nabla \cdot \boldsymbol v\|_0\le \|\nabla \boldsymbol v \|_0,\quad \boldsymbol v\in H_0^1(\Omega)^d, \end{eqnarray} {where, here and in the sequel, we use the notation $\|\cdot\|_j$ for $\|\cdot\|_{W^{j,2}}=\|\cdot\|_{H^j}$.} Let us denote by $Q=L_0^2(\Omega)=\left\{q\in L^2(\Omega)\mid (q,1)=0\right\}$. Let $\mathcal{T}_{h}=(\tau_j^h,\phi_{j}^{h})_{j \in J_{h}}$, $h>0$ be a family of partitions of $\overline\Omega$, where $h$ denotes the maximum diameter of the elements $\tau_j^h\in \mathcal{T}_{h}$, and $\phi_j^h$ are the mappings from the reference simplex $\tau_0$ onto $\tau_j^h$. We shall assume that the partitions are shape-regular and quasi-uniform. {We define the following finite element spaces \begin{eqnarray*} Y_h^l&=& \left\{v_h\in C^0(\overline\Omega)\mid {v_h}_{\mid_K}\in {\Bbb P}_l(K),\quad \forall K\in \mathcal T_h\right\}, \ l\ge 1,\nonumber\\ {\boldsymbol Y}_h^l&=&(Y_h^l)^d,\quad {\boldsymbol X}_h^l={\boldsymbol Y}_h^l\cap H_0^1(\Omega)^d, \nonumber\\ Q_h^l&=&Y_h^l\cap L_0^2(\Omega). \end{eqnarray*} \begin{eqnarray}\label{eq:V} {\boldsymbol V}_{h,l}={\boldsymbol X}_h^l\cap \left\{ {\boldsymbol \chi}_{h} \in H_0^1(\Omega)^d \mid (q_{h}, \nabla\cdot{\boldsymbol\chi}_{h}) =0 \quad\forall q_{h} \in Q_{h}^{l-1} \right\},\quad l\geq 2. \end{eqnarray}}If the family of meshes is quasi-uniform then the following inverse inequality holds for each {$\boldsymbol v_{h} \in Y_{h}^{l}$}, see e.g., \cite[Theorem 3.2.6]{Cia78}, \begin{equation} \label{inv} \| \boldsymbol v_{h} \|_{W^{m,p}(K)} \leq c_{\mathrm{inv}} h_K^{n-m-d\left(\frac{1}{q}-\frac{1}{p}\right)} \|\boldsymbol v_{h}\|_{W^{n,q}(K)}, \end{equation} where $0\leq n \leq m \leq 1$, $1\leq q \leq p \leq \infty$, and $h_K$ is the diameter of~$K \in \mathcal T_h$. Let $l \geq 2$, we consider the MFE pair known as Hood--Taylor elements \cite{BF,hood0} $({\boldsymbol X}_h^l, Q_{h}^{l-1})$. For these elements a uniform inf-sup condition is satisfied (see \cite{BF}), that is, there exists a constant $\beta_{\rm is}>0$ independent of the mesh size $h$ such that \begin{equation}\label{lbbh} \inf_{q_{h}\in Q_{h}^{l-1}}\sup_{\boldsymbol v_{h}\in{\boldsymbol X}_h^l} \frac{(q_{h},\nabla \cdot \boldsymbol v_{h})}{\|\boldsymbol v_{h}\|_{1} \|q_{h}\|_{L^2/{\mathbb R}}} \geq \beta_{\rm{is}}. \end{equation} We will denote by $P_{Q_h}$ the $L^2$ orthogonal projection onto $Q_h^{l-1}$. The following bound holds \begin{eqnarray}\label{eq:propre} \|q-P_{Q_h}q\|_0\le C h^l \|q\|_l,\quad \forall q\in H^l(\Omega). \end{eqnarray} As a direct method, as in \cite[Section 5]{novo_rubino}, we consider a Galerkin method with grad-div stabilization and for simplicity in the analysis we consider the implicit Euler method in time. Let us fix $T>0$ and $M>0$ and take $\Delta t=T/M$. The method reads as follows: given $\boldsymbol u_h^0\approx \boldsymbol u_0$ find $(\boldsymbol u_h^n,p_h^n)\in {\boldsymbol X}_h^l\times Q_h^{l-1}$ for $n\ge 1$ such that \begin{eqnarray}\label{eq:gal_grad_div} &&\left(\frac{\boldsymbol u_h^{n}-\boldsymbol u_h^{n-1}}{\Delta t },\boldsymbol v_h\right)+\nu(\nabla \boldsymbol u_h^n,\nabla \boldsymbol v_h)+b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol v_h)-(p_h^n,\nabla \cdot \boldsymbol v_h) \nonumber\\ &&\quad+ \mu(\nabla \cdot\boldsymbol u_h^n,\nabla \cdot \boldsymbol v_h)=({\boldsymbol f^n},\boldsymbol v_h) \quad \forall \boldsymbol v_h\in {\boldsymbol X}_h^l,\\ &&(\nabla \cdot \boldsymbol u_h^n,q_h)=0 \quad \forall q_h\in Q_h^{l-1},\nonumber \end{eqnarray} where $\mu$ is the positive grad-div stabilization parameter. For the discretization of the nonlinear term we consider the following form, the so called divergence or skew-symmetric form, \begin{equation}\label{nonli_div} b_h(\boldsymbol u,\boldsymbol v,\boldsymbol w)=((\boldsymbol u\cdot \nabla \boldsymbol v),\boldsymbol w)+\frac{1}{2}((\nabla \cdot \boldsymbol u)\boldsymbol v,\boldsymbol w). \end{equation} It is well-known that considering the discrete divergence-free space $\boldsymbol X_{h,l}$ we can remove the pressure from \eqref{eq:gal_grad_div} since $\boldsymbol u_h^n\in \boldsymbol X_{h,l}$ satisfies for $n\ge 1$ \begin{eqnarray}\label{eq:gal_grad_div2} &&\left(\frac{\boldsymbol u_h^{n}-\boldsymbol u_h^{n-1}}{\Delta t },\boldsymbol v_h\right)+\nu(\nabla \boldsymbol u_h^n,\nabla \boldsymbol v_h)+b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol v_h) \nonumber\\ &&\quad+ \mu(\nabla \cdot\boldsymbol u_h^n,\nabla \cdot \boldsymbol v_h)=({\boldsymbol f^n},\boldsymbol v_h), \quad \forall \boldsymbol v_h\in {\boldsymbol X}_{h,l}. \end{eqnarray} For this method the following bound holds, see \cite{NS_grad_div} \begin{eqnarray}\label{eq:cota_grad_div} \|\boldsymbol u^n-\boldsymbol u_h^n\|_0+ \left(\mu\sum_{j=1}^M \Delta t \|\nabla \cdot (\boldsymbol u^n-\boldsymbol u_h^n)\|_0^2\right)^{1/2}\le C(\boldsymbol u,p,l+1) \left(h^{l}+\Delta t \right), \end{eqnarray} for $1\le n\le M$, where the constant $C(\boldsymbol u,p,l+1)$ depends on $\|\boldsymbol u\|_{L^\infty(H^{l+1})}$, $\left(\int_0^T\|\boldsymbol u_t\|^2_l\right)^{1/2}$, $\left(\int_0^T\|\boldsymbol u_{tt}\|^2_0\right)^{1/2}$ and $\|p\|_{L^{\infty}(H^l)}$ but does not depend explicitly on inverse powers of $\nu$. For the plain Galerkin method the following bound holds where the error constants depend explicitly on inverse powers of $\nu$ \begin{eqnarray}\label{eq:cota_sin_grad_div} \|\boldsymbol u^n-\boldsymbol u_h^n\|_0+h\|\nabla (\boldsymbol u^n-\boldsymbol u_h^n)\|_0\le C(\boldsymbol u,p,\nu^{-1},l+1) \left(h^{l+1}+\Delta t \right). \end{eqnarray} \section{Proper orthogonal decomposition}\label{sec:POD} We will consider a proper orthogonal decomposition (POD) method. As for the FOM we fix $T>0$ and $M>0$ and take $\Delta t=T/M$. We consider the following space $$ {\cal \boldsymbol U}=<\boldsymbol u_h^1,\ldots,\boldsymbol u_h^M>, $$ where $\boldsymbol u_h^j=\boldsymbol u_h(\cdot,t_j)$. Let $d_v$ be the dimension of the space $\cal \boldsymbol U$. Let $K_v$ be the correlation matrix corresponding to the snapshots $K_v=((k_{i,j}^v))\in {\mathbb R}^{M\times M}$, where $$ k_{i,j}^v=\frac{1}{M}(\boldsymbol u_h^i,\boldsymbol u_h^j), $$ and $(\cdot,\cdot)$ is the inner product in $L^2(\Omega)^d$. Following \cite{kunisch} we denote by $ \lambda_1\ge \lambda_2,\ldots\ge \lambda_{d_v}>0$ the positive eigenvalues of $K_v$ and by $\boldsymbol v_1,\ldots,\boldsymbol v_{d_v}\in {\mathbb R}^{M}$ the associated eigenvectors. Then, the (orthonormal) POD bases are given by \begin{eqnarray}\label{lachi} \boldsymbol \varphi_k=\frac{1}{\sqrt{M}}\frac{1}{\sqrt{\lambda_k}}\sum_{j=1}^{M} v_k^j \boldsymbol u_h(\cdot,t_j),\end{eqnarray} where $v_k^j$ is the $j$-th component of the eigenvector $\boldsymbol v_k$ and the following error formulas hold, see \cite[Proposition~1]{kunisch} \begin{eqnarray}\label{eq:cota_pod_0} \frac{1}{M}\sum_{j=0}^{M}\left\|\boldsymbol u_h^j-\sum_{k=1}^r(\boldsymbol u_h^j,\boldsymbol \varphi_k)\boldsymbol \varphi_k\right\|_{0}^2&\le&\sum_{k=r+1}^{d_v}\lambda_k. \end{eqnarray} We will denote by $S^v$ the stiffness matrix for the POD basis: $S^v=((s_{i,j}^v))\in {\mathbb R}^{d_v\times d_v}$, $s_{i,j}^v=(\nabla \boldsymbol \varphi_i,\nabla \boldsymbol \varphi_j)$. In that case, for any $\boldsymbol v \in {\cal \boldsymbol U}$, the following inverse inequality holds, see \cite[Lemma 2]{kunisch} \begin{equation}\label{eq:inv_S} ||\nabla \boldsymbol v ||_0\le \sqrt{\|S^v\|_2}\|\boldsymbol v\|_0. \end{equation} In the sequel we will denote by $$ {\cal \boldsymbol U}^r=<\boldsymbol \varphi_1,\boldsymbol \varphi_2,\ldots,\boldsymbol \varphi_r>, $$ and by $P_r^v$, the $L^2$-orthogonal projection onto ${\cal \boldsymbol U}^r$. \subsection{A priori bounds for the orthogonal projection onto ${\cal \boldsymbol U}^r$} In \cite[Section 3.1]{novo_rubino} some a priori bounds for the FOM and for the orthogonal projection were obtained assuming for the solution of \eqref{NS} the same regularity needed to prove \eqref{eq:cota_grad_div}. For $0\le j\le M$ the following bound holds (see \cite[(31)]{novo_rubino}) \begin{eqnarray}\label{eq:uh_infty} \|\boldsymbol u_h^j\|_\infty\le C_{\boldsymbol u,{\rm inf}}. \end{eqnarray} For $1\le j\le M$ the following bounds hold (see \cite[(39), (40), (41)]{novo_rubino}) \begin{eqnarray}\label{eq:cotaPlinf2} \|P_r^v \boldsymbol u_h^j\|_\infty&\le& C_{\rm inf},\\ \label{eq:cotanablaPlinf} \|\nabla P_r^v \boldsymbol u_h^j\|_\infty&\le& C_{1,\rm inf}, \label{eq:cotanablaPld}\\ \|\nabla P_r^v\boldsymbol u^j\|_{L^{2d/(d-1)}}&\le& C_{\rm ld}. \end{eqnarray} \section{The POD method}\label{sec:NA} We now consider the grad-div POD model. As for the full order model, for simplicity in the error analysis, we also use the implicit Euler method as time integrator. Taking an initial approximation $\boldsymbol u_r^0\in {\cal \boldsymbol U}^r$, for $n\ge 1$, find $\boldsymbol u_r^n\in {\cal \boldsymbol U}^r$ such that \begin{eqnarray}\label{eq:pod_method2} &&\left(\frac{\boldsymbol u_r^{n}-\boldsymbol u_r^{n-1}}{\Delta t},\boldsymbol \varphi\right)+\nu(\nabla \boldsymbol u_r^n,\nabla\boldsymbol \varphi)+b_{pod}(\boldsymbol u_r^n,\boldsymbol u_r^n,\boldsymbol \varphi) +\mu(\nabla \cdot\boldsymbol u_r^n,\nabla \cdot\boldsymbol \varphi)\nonumber\\ &&\quad=(\boldsymbol f^{n},\boldsymbol \varphi),\quad \forall \boldsymbol \varphi\in {\cal \boldsymbol U}^r, \end{eqnarray} where we observe that ${\cal \boldsymbol U}^r\subset \boldsymbol X_{h,l}$ so that there is no pressure approximation in \eqref{eq:pod_method2}. For the discretization of the nonlinear term we consider the EMAC form \begin{equation}\label{nonli_emac} b_{pod}(\boldsymbol u,\boldsymbol v,\boldsymbol w)=(2D(\boldsymbol u)\boldsymbol v,\boldsymbol w)+((\nabla \cdot \boldsymbol u)\boldsymbol v,\boldsymbol w), \end{equation} where the deformation tensor is $$ D(\boldsymbol u)=\frac{1}{2}\left(\nabla \boldsymbol u+(\nabla \boldsymbol u)^T\right), $$ and the second term in \eqref{nonli_emac} is added to ensure the property \begin{equation}\label{cancel} b_{pod}(\boldsymbol v,\boldsymbol v,\boldsymbol v)=0. \end{equation} The EMAC form is based on the identity \begin{equation}\label{eq:ide} (\boldsymbol u\cdot \nabla)\boldsymbol u=2D(\boldsymbol u)\boldsymbol u-\frac{1}{2}\nabla |\boldsymbol u|^2. \end{equation} From \eqref{eq:ide} it can be observed that the EMAC form of the nonlinear term implies a modification of the pressure, i.e., in a velocity-pressure formulation of a method with the EMAC form for the nonlinear term the pressure approximation converges to $p-\frac{1}{2}|\boldsymbol u|^2$ instead of to the original pressure $p$ in \eqref{NS}. Considering for simplicity the continuous in time case, i.e., the method: \begin{eqnarray*} \left(\boldsymbol u_{r,t},\boldsymbol \varphi\right)+\nu(\nabla \boldsymbol u_r,\nabla\boldsymbol \varphi)+b_{pod}(\boldsymbol u_r,\boldsymbol u_r,\boldsymbol \varphi) +\mu(\nabla \cdot\boldsymbol u_r,\nabla \cdot\boldsymbol \varphi)=(\boldsymbol f,\boldsymbol \varphi), \end{eqnarray*} taking $\boldsymbol \varphi=\boldsymbol u_r$ and assuming as in \cite{emac}, \cite{emac_fully}, $\boldsymbol f=0$ and $\nu=0$ one gets applying \eqref{cancel} \begin{eqnarray}\label{lost} \frac{d}{dt}\|\boldsymbol u_r\|_0^2=-\mu\|\nabla \cdot\boldsymbol u_r\|_0^2. \end{eqnarray} This means that the grad-div stabilization produces a lost in the kinetic energy. As stated in the introduction, considering a fully discrete method with Newton discretization for the nonlinear term one has also the effect of a lost of kinetic energy, see \cite{emac_fully}. On the other hand, it is easy to prove that the grad-div term has no negative effect in the conservation of linear and angular momentum so that both are still conserved. To prove this, one can argue as in \cite[Theorem 3.3]{Ingimarson+2021} and observe that the test functions used to achieve the conservation of linear and angular momentum have divergence zero so that the grad-div term does not affect the proof. \subsection{Error analysis of the method} Denoting by $$ \boldsymbol \eta_h^n=P_r^v\boldsymbol u_h^n-\boldsymbol u_h^n, $$ it is easy to get \begin{eqnarray}\label{eq:prov_prop2} &&\left(\frac{P_r^v \boldsymbol u^{n}_h-P_r^v \boldsymbol u^{n-1}_h}{\Delta t},\boldsymbol \varphi\right)+\nu(\nabla P_r^v \boldsymbol u^n_h,\nabla\boldsymbol \varphi)+b_h(P_r^v \boldsymbol u^n_h,P_r^v \boldsymbol u^n_h,\boldsymbol \varphi) \nonumber\\ &&\quad+\mu(\nabla \cdot P_r^v \boldsymbol u^n_h,\nabla \cdot\boldsymbol \varphi)\nonumber\\ &&=(\boldsymbol f^{n},\boldsymbol \varphi)+\nu(\nabla \boldsymbol \eta_h^n,\nabla \boldsymbol \varphi)+\mu(\nabla \cdot\boldsymbol \eta_h^n,\nabla \cdot \boldsymbol \varphi)\\ &&\quad+b_h(P_r^v\boldsymbol u^n_h,P_r^v \boldsymbol u^n_h,\boldsymbol \varphi)-b_h(\boldsymbol u^{n}_h,\boldsymbol u^{n}_h,\boldsymbol \varphi),\quad \forall \boldsymbol \varphi\in {\cal \boldsymbol U}^r.\nonumber \end{eqnarray} Subtracting \eqref{eq:prov_prop2} from \eqref{eq:pod_method2} and denoting by $$\boldsymbol e_r^n=\boldsymbol u_r^n-P_r^v\boldsymbol u_h^n$$ we get $\forall \boldsymbol \varphi\in {\cal U}^r$ \begin{eqnarray}\label{eq:er1} &&\left(\frac{\boldsymbol e_r^n-\boldsymbol e_r^{n-1}}{\Delta t },\boldsymbol \varphi\right)+\nu(\nabla \boldsymbol e_r^n,\nabla \boldsymbol \varphi)+\mu(\nabla \cdot \boldsymbol e_r^n,\nabla \cdot \boldsymbol \varphi)\\ &&=\left(b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol \varphi)-b_{pod}(\boldsymbol u_r^n,\boldsymbol u_r^n,\boldsymbol \varphi)\right)-\nu(\nabla \boldsymbol \eta_h^n,\nabla\boldsymbol \varphi)-\mu(\nabla \cdot \boldsymbol \eta_h^n,\nabla \cdot\boldsymbol \varphi).\nonumber \end{eqnarray} Taking $\boldsymbol \varphi=\boldsymbol e_r^n$ we obtain \begin{eqnarray}\label{eq:error2} &&\frac{1}{2\Delta t}\left(\|\boldsymbol e_r^n\|_0^2-\|\boldsymbol e_r^{n-1}\|_0^2\right)+\nu\|\nabla \boldsymbol e_r^n\|_0^2 +\mu\|\nabla \cdot \boldsymbol e_r^n\|_0^2\\ &&\quad\le\left(b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_r^n,\boldsymbol u_r^n,\boldsymbol e_r^n)\right)-\nu(\nabla \boldsymbol \eta_h^n,\nabla\boldsymbol e_r^n)-\mu(\nabla \cdot \boldsymbol \eta_h^n,\nabla \cdot\boldsymbol e_r^n)\nonumber\\ &&\quad =I+II+III.\nonumber \end{eqnarray} We will bound the first term on the right-hand side above. Arguing as in \cite{archiv_incon} we get \begin{eqnarray}\label{eq:incon1} |I|&\le& \left|b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_r^n,\boldsymbol u_r^n,\boldsymbol e_r^n)\right|\nonumber\\ &&\quad+\left|b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)\right|. \end{eqnarray} To bound the first term on the right-hand side of \eqref{eq:incon1} we argue as in \cite{ols_reb} (see also \cite{review}). We first observe that \begin{eqnarray}\label{52} &&b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_r^n,\boldsymbol u_r^n,\boldsymbol e_r^n)= b_{pod}(-\boldsymbol \eta_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)\nonumber\\ &&\quad+b_{pod}(P_r^v\boldsymbol u_h^n,-\boldsymbol \eta_h^n,\boldsymbol e_r^n)-b_{pod}(P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n,\boldsymbol e_r^n) \nonumber\\ &&\quad-b_{pod}(\boldsymbol e_r^n,P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol e_r^n,\boldsymbol e_r^n,\boldsymbol e_r^n). \end{eqnarray} The last term on the right-hand side of \eqref{52} vanishes due to the property \eqref{cancel}. The expression of the fourth one is $$ b_{pod}(\boldsymbol e_r^n,P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n) = ((P_r^v\boldsymbol u_h^n\cdot\nabla)\boldsymbol e_r^n,\boldsymbol e_r^n)+((\boldsymbol e_r^n\cdot \nabla )\boldsymbol e_r^n,P_r^v \boldsymbol u_h^n) + ((\nabla \cdot \boldsymbol e_r^n)\boldsymbol e_r^n,P_r^v\boldsymbol u_h^n). $$ Integration by parts reveals that the first term on the right-hand side above equals $-\frac{1}{2}((\nabla \cdot P_r^v\boldsymbol u_h^n)\boldsymbol e_r^n,\boldsymbol e_r^n)$, whilst the other two equal $-((\boldsymbol e_r^n\cdot \nabla )P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n)$, so that $$ b_{pod}(\boldsymbol e_r^n,P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n) =-\frac{1}{2}((\nabla \cdot P_r^v\boldsymbol u_h^n)\boldsymbol e_r^n,\boldsymbol e_r^n) -((\boldsymbol e_r^n\cdot \nabla )P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n). $$ Since the third term on the right-hand side of~\eqref{52} is $$ b_{pod}(P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n,\boldsymbol e_r^n)= 2((\boldsymbol e_r^n\cdot \nabla )P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n) + ((\nabla \cdot P_r^v\boldsymbol u_h^n)\boldsymbol e_r^n,\boldsymbol e_r^n), $$ we see that the last three terms on the right-hand side of~\eqref{52} add to $-((\boldsymbol e_r^n\cdot \nabla )P_r^v\boldsymbol u_h^n,\boldsymbol e_r^n)-\frac{1}{2}((\nabla \cdot P_r^v\boldsymbol u_h^n)\boldsymbol e_r^n,\boldsymbol e_r^n)$, so that~\eqref{52} can be written as \begin{eqnarray}\label{53} &&b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_r^n,\boldsymbol u_r^n,\boldsymbol e_r^n)= b_{pod}(-\boldsymbol \eta_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)\\ &&\quad+b_{pod}(P_r^v\boldsymbol u_h^n,-\boldsymbol \eta_h^n,\boldsymbol e_r^n)-\frac{1}{2}((\nabla \cdot P_r^v\boldsymbol u_h^n)\boldsymbol e_r^n,\boldsymbol e_r^n) -(D(P_r^v\boldsymbol u_h^n)\boldsymbol e_r^n,\boldsymbol e_r^n).\nonumber \end{eqnarray} For the first term on the right-hand side of \eqref{53}, applying \eqref{eq:uh_infty}, we obtain \begin{eqnarray}\label{53_uno} b_{pod}(-\boldsymbol \eta_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)\le C\|\boldsymbol \eta_h^n\|_{1}\|\boldsymbol u_h^n\|_{\infty}\|\boldsymbol e_r^n\|_0 \le CC_{\boldsymbol u,{\rm inf}}\|\boldsymbol \eta_h^n\|_{1}\|\boldsymbol e_r^n\|_0. \end{eqnarray} Applying H$\ddot{\rm o}$lder's inequality, \eqref{eq:cotanablaPld} and Sobolev embedding \eqref{sob1} we get for the second term on the right-hand side of \eqref{53} \begin{eqnarray}\label{53_dos} b_{pod}(P_r^v\boldsymbol u_h^n,-\boldsymbol \eta_h^n,\boldsymbol e_r^n) &\le& 2\|D(P_r^v\boldsymbol u_h^n)\|_{L^{2d/(d-1)}}\|\boldsymbol \eta_h^n\|_{L^{2d}}\|\boldsymbol e_r^n\|_0\nonumber\\ &&\quad+\|\nabla \cdot P_r^v\boldsymbol u_h^n\|_{L^{2d/(d-1)}}\|\boldsymbol \eta_h^n\|_{L^{2d}}\|\boldsymbol e_r^n\|_0\nonumber\\ &\le& C \|\nabla P_r^v\boldsymbol u_h^n\|_{L^{2d/(d-1)}}\|\boldsymbol \eta_h^n\|_{L^{2d}}\|\boldsymbol e_r^n\|_0\nonumber\\ &\le& C C_{\rm ld}\|\boldsymbol \eta_h^n\|_{1}\|\boldsymbol e_r^n\|_0. \end{eqnarray} Finally, for the last two terms on the right-hand side of \eqref{53}, applying \eqref{eq:cotanablaPlinf}, we get \begin{eqnarray}\label{53_tres} -\frac{1}{2}((\nabla \cdot P_r^v\boldsymbol u_h^n)\boldsymbol e_r^n,\boldsymbol e_r^n) -(D(P_r^v\boldsymbol u_h^n)\boldsymbol e_r^n,\boldsymbol e_r^n)\le C C_{1,\rm inf}\|\boldsymbol e_r^n\|_0^2. \end{eqnarray} From \eqref{53}, \eqref{53_uno}, \eqref{53_dos} and \eqref{53_tres} and Poincar\'e inequality we finally reach \begin{eqnarray}\label{eq:incon11} &&|b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_r^n,\boldsymbol u_r^n,\boldsymbol e_r^n)| \nonumber\\ &&\quad\le (1+CC_{1,\rm inf})\|\boldsymbol e_r^n\|_0^2+C( C^2_{\boldsymbol u,{\rm inf}}+C^2_{\rm ld})\|\nabla \boldsymbol \eta_h^n\|_0^2. \end{eqnarray} For the second term on the right-hand side of \eqref{eq:incon1}, we recall that \begin{align*} b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n) & = (\boldsymbol u_h^n\cdot\nabla \boldsymbol u_h^n,\boldsymbol e_r^n)+ \frac{1}{2}((\nabla \cdot \boldsymbol u_h^n)\boldsymbol u_h^n,\boldsymbol e_r^n). \\ b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n) & = (\boldsymbol u_h^n\cdot\nabla \boldsymbol u_h^n,\boldsymbol e_r^n)+ (\boldsymbol e_r^n\cdot\nabla \boldsymbol u_h^n,\boldsymbol u_h^n)+ ((\nabla \cdot \boldsymbol u_h^n)\boldsymbol u_h^n,\boldsymbol e_r^n). \end{align*} We notice that both $b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)$ and $b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)$ share the term $(\boldsymbol u_h^n\cdot\nabla \boldsymbol u_h^n,\boldsymbol e_r^n)$, and both also have the term $((\nabla \cdot \boldsymbol u_h^n)\boldsymbol u_h^n,\boldsymbol e_r^n)$ but with a factor~$1/2$ in the second one, so that we have $$ b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n) = -(\boldsymbol e_r^n\cdot\nabla \boldsymbol u_h^n,\boldsymbol u_h^n) -\frac{1}{2}((\nabla \cdot \boldsymbol u_h^n)\boldsymbol u_h^n,\boldsymbol e_r^n) $$ Now, integrating by parts the first term on the right-hand side above we have $$ b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n) = \frac{1}{2}(|\boldsymbol u_h^n|^2,\nabla \cdot \boldsymbol e_r^n) -\frac{1}{2}((\nabla \cdot \boldsymbol u_h^n)\boldsymbol u_h^n,\boldsymbol e_r^n), $$ and, since $\nabla\cdot\boldsymbol u=0$, we can write \begin{equation} \label{bosco01} b_h(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n)-b_{pod}(\boldsymbol u_h^n,\boldsymbol u_h^n,\boldsymbol e_r^n) = \frac{1}{2}(|\boldsymbol u_h^n|^2,\nabla \cdot \boldsymbol e_r^n) +\frac{1}{2}((\nabla \cdot(\boldsymbol u^n -\boldsymbol u_h^n))\boldsymbol u_h^n,\boldsymbol e_r^n), \end{equation} For the second term on the right-hand side of~\eqref{bosco01} we have \begin{eqnarray}\label{eq:2t3} \frac{1}{2}((\nabla \cdot(\boldsymbol u^n -\boldsymbol u_h^n))\boldsymbol u_h^n,\boldsymbol e_r^n) &\le&\frac{1}{2}\|\boldsymbol u_h^n\|_\infty \|\nabla \cdot (\boldsymbol u_h^n-\boldsymbol u^n)\|_0\|\boldsymbol e_r^n\|_0\\ &\le&C_{\boldsymbol u,{\rm inf}}^2\frac{\mu}{4}\|\nabla \cdot (\boldsymbol u_h^n-\boldsymbol u^n)\|_0^2+\frac{1}{4\mu}\|\boldsymbol e_r^n\|_0^2,\nonumber \end{eqnarray} For the first term on the right-hand side of~\eqref{bosco01} we obtain \begin{eqnarray}\label{36} &&\frac{1}{2}(|\boldsymbol u_h^n|^2,\nabla \cdot \boldsymbol e_r^n)|\le \frac{1}{2}(|\boldsymbol u_h^n|^2-|\boldsymbol u^n|^2,\nabla \cdot \boldsymbol e_r^n)|+ \frac{1}{2} |(|\boldsymbol u^n|^2,\nabla \cdot \boldsymbol e_r^n)|\nonumber\\ &&= \frac{1}{2}|(|\boldsymbol u_h^n|^2-|\boldsymbol u^n|^2,\nabla \cdot \boldsymbol e_r^n)|+ \frac{1}{2} |((I-P_{Q_h})|\boldsymbol u^n|^2,\nabla \cdot \boldsymbol e_r^n) |\label{ahora_si}\\ &&\le \frac{1}{2} \|\boldsymbol u^n+\boldsymbol u_h^n\|_{\infty}\|\boldsymbol u^n-\boldsymbol u_h^n\|_0\|\nabla \cdot \boldsymbol e_r^n\|_0+\frac{1}{2}\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_0\|\nabla \cdot \boldsymbol e_r^n\|_0.\nonumber \end{eqnarray} Then, applying \eqref{eq:uh_infty} \begin{eqnarray}\label{eq:2t4} &&\frac{1}{2}|(|\boldsymbol u_h^n|^2,\nabla \cdot \boldsymbol e_r^n)|\le \frac{1}{2}(\|\boldsymbol u^n\|_\infty+C_{\boldsymbol u,{\rm inf}})\|\boldsymbol u^n-\boldsymbol u_h^n\|_0\|\nabla \cdot \boldsymbol e_r^n\|_0 \nonumber\\ &&\quad+ \frac{1}{2}\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_0\|\nabla \cdot \boldsymbol e_r^n\|_0\le C\mu^{-1}(\|\boldsymbol u^n-\boldsymbol u_h^n\|_0^2+\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_0^2)\nonumber\\ &&\quad +\frac{\mu}{4}\|\nabla \cdot \boldsymbol e_r^n\|_0^2, \end{eqnarray} where the generic constat $C$ above depends on $\|\boldsymbol u\|_{L^\infty(L^\infty)}$ and $C_{\boldsymbol u,{\rm inf}}$. Inserting \eqref{eq:incon11}, \eqref{bosco01}, \eqref{eq:2t3} and \eqref{eq:2t4} into \eqref{eq:incon1} we get \begin{eqnarray*} |I|&\le& \left(1+CC_{1,\rm inf}+\frac{1}{4\mu}\right)\|\boldsymbol e_r^n\|_0^2+\frac{\mu}{4}\|\nabla \cdot \boldsymbol e_r^n\|_0^2 \nonumber\\ &&\quad+C( C^2_{\boldsymbol u,{\rm inf}}+C^2_{\rm ld})\|\nabla \boldsymbol \eta_h^n\|_0^2 +C_{\boldsymbol u,{\rm inf}}^2\frac{\mu}{4}\|\nabla \cdot (\boldsymbol u_h^n-\boldsymbol u^n)\|_0^2\nonumber\\ &&\quad + C\mu^{-1}(\|\boldsymbol u-\boldsymbol u_h\|_0^2+\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_0^2). \end{eqnarray*} Including into a generic constant $C$ the dependence on $C_{\boldsymbol u,{\rm inf}}$ and $C_{\rm ld}$ of the third and fourth terms above we may write \begin{eqnarray}\label{cotaI} |I|&\le& \left(1+CC_{1,\rm inf}+\frac{1}{4\mu}\right)\|\boldsymbol e_r^n\|_0^2+\frac{\mu}{4}\|\nabla \cdot \boldsymbol e_r^n\|_0^2 \nonumber\\ &&\quad+C\|\nabla \boldsymbol \eta_h^n\|_0^2 +C{\mu}\|\nabla \cdot (\boldsymbol u_h^n-\boldsymbol u^n)\|_0^2\nonumber\\ &&\quad + C\mu^{-1}(\|\boldsymbol u-\boldsymbol u_h\|_0^2+\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_0^2). \end{eqnarray} We also have \begin{eqnarray}\label{cotaII} |II|\le \frac{\nu}{2}\|\nabla \boldsymbol \eta_h^n\|_0^2+\frac{\nu}{2}\|\nabla \boldsymbol e_r^n\|_0^2, \end{eqnarray} and \begin{eqnarray}\label{cotaIII} |III|\le \|\nabla \cdot\boldsymbol \eta_h^n\|_0^2+\frac{\mu}{4}\|\boldsymbol e_r^n\|_0^2. \end{eqnarray} Inserting \eqref{cotaI}, \eqref{cotaII} and \eqref{cotaIII} into \eqref{eq:error2} and adding terms we get \begin{eqnarray}\label{eq:fin1} &&\|\boldsymbol e_r^n\|_0^2+\nu\sum_{j=1}^n\Delta t \|\nabla \boldsymbol e_r^j\|_0^2 +\mu\sum_{j=1}^n\Delta t\|\nabla \cdot \boldsymbol e_r^j\|_0^2\nonumber\\ &&\le \|\boldsymbol e_r^0\|_0^2+\sum_{j=1}^n\Delta t \left(1+CC_{1,\rm inf}+\frac{1}{4\mu}\right)\|\boldsymbol e_r^j\|_0^2 +C(\nu+\mu)\sum_{j=1}^n\Delta t\|\nabla \boldsymbol \eta_h^j\|_0^2\nonumber\\ &&\quad + C\mu\sum_{j=1}^n\Delta t\|\nabla\cdot (\boldsymbol u_h^j-\boldsymbol u^j)\|_0^2 + C\mu^{-1}\sum_{j=1}^n\Delta t\|\boldsymbol u_h^j-\boldsymbol u^j\|_0^2\nonumber\\ &&\quad +C\mu^{-1}\sum_{j=1}^n\Delta t \|(I-P_{Q_h})|\boldsymbol u^j|^2\|_0^2. \end{eqnarray} Assuming \begin{equation}\label{eq_Cu1} \Delta t C_u:=\Delta t(1+CC_{1,\rm inf}+\frac{1}{4\mu})\le \frac{1}{2} \end{equation} and applying Gronwall's Lemma \cite[Lemma 5.1]{hey_ran_IV} and \eqref{eq:cota_pod_0}, \eqref{eq:inv_S}, \eqref{eq:cota_grad_div} and \eqref{eq:propre} we obtain \begin{eqnarray}\label{eq:error3_b} &&\|\boldsymbol e_r^n\|_0^2+\nu\sum_{j=1}^n\Delta t \|\nabla \boldsymbol e_r^j\|_0^2+\mu\sum_{j=1}^n\Delta t\|\nabla \cdot \boldsymbol e_r^j\|_0^2\nonumber\\ &&\quad\le e^{2T C_u}\left(\|\boldsymbol e_r^0\|_0^2+CT(\nu+\mu)\|S^v\|_0\sum_{k=r+1}^{d_v}\lambda_k\right.\\ &&\quad \left. +C(1+\mu^{-1}T)C(\boldsymbol u,p,l+1)^2 \left(h^{2l}+(\Delta t)^2 \right)+C\mu^{-1}h^{2l}T\||\boldsymbol u|^2\|_{L^\infty(H^l)}\right).\nonumber \end{eqnarray} \begin{remark} Let us observe that the error terms in the last line of \eqref{eq:error3_b} arise from using different discretization for the nonlinear term in the FOM and the POD methods. We also observe that these errors are of the same size as the error of the FOM method. \end{remark} \begin{Theorem}\label{th:prin} Let $\boldsymbol u$ be the velocity in the Navier-Stokes equations \eqref{NS}, let $\boldsymbol u_r$ be the grad-div POD stabilized approximation defined in \eqref{eq:pod_method2}, assume that the solution $(\boldsymbol u,p)$ of \eqref{NS} is regular enough and condition \eqref{eq_Cu1} holds. Then, the error can be bounded as follows \begin{eqnarray}\label{eq:cota_finalSUPv} \sum_{j=1}^n\Delta t \|\boldsymbol u_r^j-\boldsymbol u^j\|_0^2&\le& 3Te^{2T C_u}\left(\|\boldsymbol e_r^0\|_0^2+CT(\nu+\mu)\|S^v\|_0\sum_{k=r+1}^{d_v}\lambda_k\right.\nonumber\\ &&\quad \left. +C(1+\mu^{-1}T)C(\boldsymbol u,p,l+1)^2 \left(h^{2l}+(\Delta t)^2 \right)\right.\nonumber\\ &&\quad\left.+C\mu^{-1}h^{2l}T\||\boldsymbol u|^2\|_{L^\infty(H^l)}\right)+3T\sum_{k=r+1}^{d_v}\lambda_k\nonumber\\ &&\quad +3T C(\boldsymbol u,p,l+1)^2 \left(h^{2l}+(\Delta t)^2 \right). \end{eqnarray} \end{Theorem} \begin{proof} Since $\sum_{j=1}^n\Delta t \|\boldsymbol e_r^j\|_0^2\le T \max_{1\le j\le n}\|\boldsymbol e_r^j\|_0^2$ and \begin{eqnarray*}\label{eq:lauso} \sum_{j=1}^n\Delta t \|\boldsymbol u_r^j-\boldsymbol u^j\|_0^2&\le& 3\left(\sum_{j=1}^n\Delta t \|\boldsymbol e_r^j\|_0^2+\sum_{j=1}^n\Delta t\|P_r^v \boldsymbol u_h^j-\boldsymbol u_h^j)\|_0^2\right.\nonumber\\ &&\quad\left.+\sum_{j=1}^n\Delta t\| \boldsymbol u_h^j-\boldsymbol u^j\|_0^2\right), \end{eqnarray*} from \eqref{eq:error3_b}, \eqref{eq:cota_pod_0} and \eqref{eq:cota_grad_div} we easily obtain \eqref{eq:cota_finalSUPv}. \end{proof} \begin{remark} We have chosen, as in \cite{archiv_incon}, to analyze the concrete case in which the divergence form is used for the FOM method and the EMAC form is applied for the POD method but the error analysis of any other combination of discretizations of the nonlinear terms with analogous properties could be carried out in a similar way. \end{remark} \begin{remark} With the POD method defined in \eqref{eq:pod_method2} we can obtain an approximation to the velocity but not to the pressure. In case an approximation to the pressure is also required one can use a supremizer pressure recovery method. This procedure is analyzed in \cite{novo_rubino}, see also \cite{schneier}. One can argue exactly as in \cite[Theorem 5.4]{novo_rubino} to get an error bound for the pressure, in which, as in Theorem \ref{th:prin}, one will have to add to the error terms in \cite[Theorem 5.4]{novo_rubino} those coming from the different discretizations used in the nonlinear terms (i.e. fourth and fifth terms on the right-hand side of \eqref{cotaI}). \end{remark} \subsection{Error analysis of the method without grad-div stabilization} In this section we consider the case analyzed in \cite{archiv_incon} in which the plain Galerkin method is used instead of the grad-div stabilized method, i.e, we take $\mu=0$ both in equations \eqref{eq:gal_grad_div2} and \eqref{eq:pod_method2}. In the following error analysis, as in \cite{archiv_incon}, one does not get error bounds independent on inverse powers of the viscosity. The analysis can be obtained with slight modifications of the analysis of the previous section. First, we notice that the last terms on each side of identity~\eqref{eq:er1} are not present. Then, applying \eqref{diver_vol} in~\eqref{36} to bound $\|\nabla \cdot \boldsymbol e_r^n\|_0$ by~$\|\nabla \boldsymbol e_r^n\|_0$, instead of~\eqref{eq:2t4} we get \begin{eqnarray}\label{eq:2t4_b} &&\frac{1}{2}|(|\boldsymbol u_h^n|^2,\nabla \cdot \boldsymbol e_r^n)|\le \frac{1}{2}(\|\boldsymbol u^n\|_\infty+C_{\boldsymbol u,{\rm inf}})\|\boldsymbol u^n-\boldsymbol u_h^n\|_0\|\nabla \cdot \boldsymbol e_r^n\|_0 \nonumber\\ &&\quad+ \frac{1}{2}\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_0\|\nabla \cdot \boldsymbol e_r^n\|_0\le C\nu^{-1}(\|\boldsymbol u^n-\boldsymbol u_h^n\|_0^2+\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_0^2)\nonumber\\ &&\quad +\frac{\nu}{4}\|\nabla \cdot \boldsymbol e_r^n\|_0^2. \end{eqnarray} Consequently, instead of \eqref{cotaI} we obtain \begin{eqnarray*} |I|&\le& \left(1+CC_{1,\rm inf}+\frac{1}{4}\right)\|\boldsymbol e_r^n\|_0^2+\frac{\nu}{4}\|\nabla \boldsymbol e_r^n\|_0^2 \nonumber\\ &&\quad+C\|\nabla \boldsymbol \eta_h^n\|_0^2 +C\|\nabla \cdot (\boldsymbol u_h^n-\boldsymbol u^n)\|_0^2\nonumber\\ &&\quad + C\nu^{-1}(\|\boldsymbol u-\boldsymbol u_h\|_0^2+\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_0^2). \end{eqnarray*} Instead of \eqref{cotaII} we can write \begin{eqnarray*} |II|\le {\nu}\|\nabla \boldsymbol \eta_h^n\|_0^2+\frac{\nu}{4}\|\nabla \boldsymbol e_r^n\|_0^2, \end{eqnarray*} to conclude the following inequality instead of~\eqref{eq:fin1}, \begin{eqnarray} \label{otra_mas} &&\|\boldsymbol e_r^n\|_0^2+\nu\sum_{j=1}^n\Delta t \|\nabla \boldsymbol e_r^j\|_0^2\nonumber\\ &&\le \|\boldsymbol e_r^0\|_0^2+\sum_{j=1}^n\Delta t \left(5/4+CC_{1,\rm inf}\right)\|\boldsymbol e_r^j\|_0^2 +C\nu\sum_{j=1}^n\Delta t\|\nabla \boldsymbol \eta_h^j\|_0^2 \\ &&\quad + C\sum_{j=1}^n\Delta t\|\nabla\cdot (\boldsymbol u_h^j-\boldsymbol u^j)\|_0^2 + C\nu^{-1}\sum_{j=1}^n\Delta t\|\boldsymbol u_h^j-\boldsymbol u^j\|_0^2\nonumber\\ &&\quad +C\nu^{-1}\sum_{j=1}^n\Delta t \|(I-P_{Q_h})|\boldsymbol u^j|^2\|_0^2.\nonumber \end{eqnarray} From the above inequality one can argue exactly as before to conclude that, if \begin{equation}\label{eq:sin_esta} \Delta t C_u:=\Delta t \left(5/4+CC_{1,\rm inf}\right)\le \frac{1}{2}, \end{equation} then, the following bound holds \begin{eqnarray}\label{eq:error3_bb} &&\|\boldsymbol e_r^n\|_0^2+\nu\sum_{j=1}^n\Delta t \|\nabla \boldsymbol e_r^j\|_0^2\le e^{2T C_u}\left(\|\boldsymbol e_r^0\|_0^2+CT\nu\|S^v\|_0\sum_{k=r+1}^{d_v}\lambda_k\right.\nonumber\\ &&\quad \left. +CT(h^{-2}+\nu^{-1})C(\boldsymbol u,p,\nu^{-1},l+1)^2 \left(h^{2l+2}+(\Delta t)^2 \right)\right.\nonumber\\ &&\quad\left.+C\nu^{-1}h^{2l}T\||\boldsymbol u|^2\|_{L^\infty(H^l)}\right), \end{eqnarray} where we have applied \eqref{diver_vol} to bound the fourth term on the right-hand side~of~\eqref{otra_mas} and the error bound of the plain Galerkin method \eqref{eq:cota_sin_grad_div}. From \eqref{eq:error3_bb} and arguing as before we conclude \begin{Theorem}\label{th:prinb} Let $\boldsymbol u$ be the velocity in the Navier-Stokes equations \eqref{NS}, let $\boldsymbol u_r$ be the grad-div POD approximation without stabilization (case $\mu=0$) and assume that the solution $(\boldsymbol u,p)$ of \eqref{NS} is regular enough. Then, assuming condition \eqref{eq:sin_esta} holds, the error can be bounded as follows \begin{eqnarray}\label{eq:cota_finalSUPvb} \sum_{j=1}^n\Delta t \|\boldsymbol u_r^j-\boldsymbol u^j\|_0^2&\le& 3Te^{2T C_u}\left(\|\boldsymbol e_r^0\|_0^2+CT\nu\|S^v\|_0\sum_{k=r+1}^{d_v}\lambda_k\right.\nonumber\\ &&\quad \left. +CT(h^{-2}+\nu^{-1})C(\boldsymbol u,p,\nu^{-1}, l+1)^2 \left(h^{2l+2}+(\Delta t)^2 \right)\right.\nonumber\\ &&\quad\left.+C\nu^{-1}h^{2l}T\||\boldsymbol u|^2\|_{L^\infty(H^l)}\right)+3T\sum_{k=r+1}^{d_v}\lambda_k\nonumber\\ &&\quad +3T C(\boldsymbol u,p,\nu^{-1},l+1)^2 \left(h^{2l+2}+(\Delta t)^2 \right). \end{eqnarray} \end{Theorem} The final error bound depends explicitly on $\nu^{-1}$ and on both the $L^2$ error of the FOM velocity approximation and the error in the divergence of the FOM approximation (that we have bounded by the $H^1$ error). \begin{remark} Alternatively, we can also bound the method without grad-div stabilization in a way that inverse constants of the viscosity do not appear explicitly in the constants. However, the error depends on the error of the plain Galerkin method \eqref{eq:cota_sin_grad_div} which in terms depend on $\nu^{-1}$. To this end, instead of \eqref{36}, we can write, integrating by parts \begin{eqnarray*} &&\frac{1}{2}(|\boldsymbol u_h^n|^2,\nabla \cdot \boldsymbol e_r^n)|\le \frac{1}{2}(|\boldsymbol u_h^n|^2-|\boldsymbol u^n|^2,\nabla \cdot \boldsymbol e_r^n)|+ \frac{1}{2} |(|\boldsymbol u^n|^2,\nabla \cdot \boldsymbol e_r^n)|\nonumber\\ &&= \frac{1}{2}|(\nabla\left(|\boldsymbol u_h^n|^2-|\boldsymbol u^n|^2\right),\boldsymbol e_r^n)|+ \frac{1}{2} |\nabla\left((I-P_{Q_h})|\boldsymbol u^n|^2\right),\boldsymbol e_r^n) |\\ &&\le C \|\boldsymbol u^n+\boldsymbol u_h^n\|_{1,\infty}\|\boldsymbol u^n-\boldsymbol u_h^n\|_1\|\boldsymbol e_r^n\|_0+\frac{1}{2}\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_1\|\boldsymbol e_r^n\|_0\nonumber\\ &&\le C \left(\|\boldsymbol u^n-\boldsymbol u_h^n\|_1^2+\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_1^2\right)+\frac{1}{2}\|\boldsymbol e_r^n\|_0^2. \end{eqnarray*} Then, applying \eqref{diver_vol}, instead of \eqref{cotaI} we get \begin{eqnarray*} |I|&\le& \left(1+CC_{1,\rm inf}\right)\|\boldsymbol e_r^n\|_0^2+C\|\nabla \boldsymbol \eta_h^n\|_0^2 +C\|\boldsymbol u_h^n-\boldsymbol u^n\|_1^2\nonumber\\ &&\quad + C\|(I-P_{Q_h})|\boldsymbol u^n|^2\|_1^2), \end{eqnarray*} and then, for $C_u=1+CC_{1,\rm inf}$ and $\Delta t C_u\le 1/2$, we conclude \begin{eqnarray*} &&\|\boldsymbol e_r^n\|_0^2+\nu\sum_{j=1}^n\Delta t \|\nabla \boldsymbol e_r^j\|_0^2\le e^{2T C_u}\left(\|\boldsymbol e_r^0\|_0^2+CT\nu\|S^v\|_0\sum_{k=r+1}^{d_v}\lambda_k\right.\\ &&\quad \left. +CTC(\boldsymbol u,p,\nu^{-1},l+1)^2 h^{-2}\left(h^{2l+2}+(\Delta t)^2 \right)\right.\\ &&\quad\left.+Ch^{2(l-1)}T\||\boldsymbol u|^2\|_{L^\infty(H^l)}\right).\nonumber \end{eqnarray*} As pointed out in \cite{review}, from the above error bound we observe that the grad-div stabilization could be suppressed when we use the EMAC form of the nonlinear term in the ROM method and we can still obtain error bounds with constants independent of inverse powers of $\nu$, apart from the dependence thought the error of the plain Galerkin method. However, the price to be paid is a lower rate of convergence. Compare the last term on the right-hand side above with \eqref{eq:cota_finalSUPv}. The rate of convergence obtained with this argument is also lower than the bound \eqref{eq:cota_finalSUPvb}. \end{remark} \section{Numerical experiments}\label{sec:num} In this section, we present numerical results for the grad-div reduced order model (ROM) \eqref{eq:pod_method2}, introduced and analyzed in the previous section. Actually, a comparison is performed by using both the skew-symmetric \eqref{nonli_div} and the EMAC \eqref{nonli_emac} form for the discretization of the nonlinear term at ROM level. The numerical experiments are performed on the benchmark problem of the 2D unsteady flow around a cylinder with circular cross-section \cite{SchaferTurek96} at Reynolds number $Re=100$ ($\nu=10^{-3}\,\rm{m^{2}/s}$). The open-source FE software FreeFEM \cite{Hecht12} has been used to run the numerical experiments, following the setup from \cite{novo_rubino}. \medskip {\em FOM and POD modes.} The numerical method used to compute the snapshots for the grad-div-ROM \eqref{eq:pod_method2} is the grad-div finite element method (FEM) \eqref{eq:gal_grad_div} described in Section \ref{sec:PN}, with the skew-symmetric form \eqref{nonli_div} of the nonlinear term. A spatial discretization using the Hood--Taylor MFE pair ${\bf P}^{2}-\mathbb{P}^1$ for velocity-pressure is considered on a relatively coarse computational grid (see \cite{novo_rubino}), for which $h = 2.76\cdot 10^{-2}\,\rm{m}$, resulting in $32\,488$ d.o.f. for velocities and $4\,151$ d.o.f. for pressure. As in \cite{novo_rubino}, for the time discretization, a semi-implicit Backward Differentiation Formula of order two (BDF2) has been applied (see \cite{AhmedRubino19} for further details), with time step $\Delta t = 2\cdot 10^{-3}\,\rm{s}$. Time integration is performed until a final time $T=7\,\rm{s}$. In the time period $[0,5]\,\rm s$, after an initial spin-up, the flow is expected to develop to full extent, including a subsequent relaxation time. Afterwards, it reaches a periodic-in-time (statistically- or quasi-steady) state. The POD modes are generated in $L^2$ by the method of snapshots with velocity centered-trajectories \cite{IliescuJohn15} by storing every FOM solution from $t=5\,\rm{s}$, when the solution had reached a periodic-in-time state, and just using one period of snapshot data. The full period length of the statistically steady state is $0.332\,\rm{s}$, thus we collect $167$ velocity snapshots to generate the POD basis ${\cal \boldsymbol U}^r$. \medskip {\em Numerical results for grad-div-ROM with different discretization of the nonlinear term.} With POD velocity modes generated, the fully discrete grad-div-ROM \eqref{eq:pod_method2} is constructed as discussed in the previous section, using the semi-implicit BDF2 time scheme as for the FOM, and run with both skew-symmetric (as for the FOM) and EMAC (different from the FOM) formulation of the nonlinear term in the stable response time interval $[5,7]\,\rm{s}$ with $\Delta t=2\cdot 10^{-3}\,\rm{s}$. The initial reduced-order velocity is given by the $L^2$-orthogonal projection $P_r^v$ of the velocity snapshot at $t=5\,\rm{s}$ on the POD velocity space ${\cal \boldsymbol U}^r$. First of all, to assess on the one hand the behavior of the proposed grad-div-ROM \eqref{eq:pod_method2} with both skew-symmetric and EMAC form of the nonlinear term, and illustrate on the other hand the theoretical convergence order predicted by the numerical analysis performed in section \ref{sec:NA}, we plot the discrete $\ell^2(L^2)$ squared errors in velocity with respect to the grad-div-FEM \eqref{eq:gal_grad_div} solution. In particular, in Figure \ref{fig:plotl2L2Err1stPer} we show the errors in the reconstructive time interval $[5,5.332]\,\rm{s}$ (used to compute the snapshots and generate the POD modes) in terms of $r$ (number of POD modes). The theoretical analysis proved that, for sufficiently small $h$ and $\Delta t$ as it is the case, the velocity error should scale as $\Lambda_r=\sum_{k=r+1}^{d_v}\lambda_k$ (see result \eqref{eq:cota_finalSUPv}), and this is recovered in Figure \ref{fig:plotl2L2Err1stPer} for both discretizations of the nonlinear term. Following the hints given by the error bound \eqref{eq:cota_finalSUPv}, for the current setup for which $S^v_2=\| S^v\|_0 = 2.17 \cdot 10^2$, we actually found that $S^v_2\Lambda_r$ is an upper bound for the velocity error. Also, we note that when using a different online discretization of the nonlinear term (EMAC) with respect to the offline phase (skew), the ROM error is barely affected, as suggested by the theoretical analysis. \begin{figure}[htb] \begin{center} \includegraphics[width=4.75in]{plotl2L2Err1stPer.pdf} \caption{Discrete $\ell^2(L^2)$ squared error in velocity with respect to grad-div-FEM \eqref{eq:gal_grad_div} computed with different online discretizations of the nonlinear term in the reconstructive time interval $[5,5.332]\,\rm{s}$.}\label{fig:plotl2L2Err1stPer} \end{center} \end{figure} In Figure \ref{fig:plotl2L2Err}, we show the errors in the stable response time interval $[5,7]\,\rm{s}$. Thus, we are actually testing the ability of the skew-symmetric and EMAC grad-div-ROMs to predict/extrapolate in time, since we are monitoring their performance over an interval six times larger than the one used to compute the snapshots and generate the POD modes. In this case (not contemplated by the analysis), we notice that the errors increase and, for $r>12$, we observe a flattening effect due to the fact that the time interval $[5,7]\,\rm{s}$ is already quite large with respect to the time period used to generate the POD basis. Thus, although we increase the number of POD modes, we do not notice so much the error decrease. In any case, for small $r$, the theoretical rate of convergence is recovered, and again very similar results are obtained for both online discretizations of the nonlinear term. \begin{figure}[htb] \begin{center} \includegraphics[width=4.75in]{plotl2L2Err.pdf} \caption{Discrete $\ell^2(L^2)$ squared error in velocity with respect to grad-div-FEM \eqref{eq:gal_grad_div} computed with different online discretizations of the nonlinear term in the whole time interval $[5,7]\,\rm{s}$.}\label{fig:plotl2L2Err} \end{center} \end{figure} To further assess the numerical accuracy of the grad-div-ROM \eqref{eq:pod_method2} with both skew-symmetric and EMAC form of the nonlinear term, the temporal evolution of the local drag and lift coefficients, and kinetic energy are monitored and compared to the FOM solutions in the stable response time interval $[5,7]\,\rm{s}$. To compute drag and lift coefficients, we used the volume integral formulation from \cite{John04paper}, where the pressure term is not necessary if the test functions are taken properly in the discrete divergence-free space ${\boldsymbol V}_{h,l}$ \eqref{eq:V} (by Stokes projection, for instance), as done in \cite{pod_da_nos,zerfas_et_al}. Numerical results for drag and lift predictions using $r=8$ velocity modes in the whole time interval $[5,7]\,\rm{s}$ are shown in Figures \ref{fig:DragCoefCompl}-\ref{fig:LiftCoefCompl}, where we display a comparison of grad-div-FEM \eqref{eq:gal_grad_div} with the skew-symmetric form of the nonlinear term, and grad-div-ROM \eqref{eq:pod_method2} with both skew-symmetric and EMAC form of the nonlinear term. From these figures, we see that both online discretizations of the nonlinear term agree reasonably well with the FOM data, although using a different formulation of the nonlinear term (EMAC) leads to a slightly inaccurate decrease of the drag coefficient as time increases. Similar conclusions can be obtained from Figure \ref{fig:LiftCoefCompl} for the lift coefficient. The good match that we observe using the same discretization for the nonlinear term as for the FOM (skew) is gradually lost using a different formulation of the nonlinear term (EMAC) in the online phase, which leads to a slightly inaccurate decrease of the lift coefficient too as time increases. \begin{figure}[htb] \begin{center} \includegraphics[width=4.75in]{DragCoefOk.pdf} \caption{Temporal evolution of drag coefficient computed with grad-div-ROM \eqref{eq:pod_method2} using $r=8$ velocity modes. Comparison with grad-div-FEM \eqref{eq:gal_grad_div} in the whole time interval $[5,7]\,\rm{s}$.}\label{fig:DragCoefCompl} \end{center} \end{figure} \begin{figure}[htb] \begin{center} \includegraphics[width=4.75in]{LiftCoefOk.pdf} \caption{Temporal evolution of lift coefficient computed with grad-div-ROM \eqref{eq:pod_method2} using $r=8$ velocity modes. Comparison with grad-div-FEM \eqref{eq:gal_grad_div} in the whole time interval $[5,7]\,\rm{s}$.}\label{fig:LiftCoefCompl} \end{center} \end{figure} In Figure \ref{fig:EkinCompl}, we show the temporal evolution of the kinetic energy using $r=8$ velocity modes for the different grad-div-ROMs compared to grad-div-FEM in the whole time interval $[5,7]\,\rm{s}$. We observe that when considering in the ROM the skew-symmetric form of the nonlinear term (as for the FOM), the kinetic energy is maintained stably around the FOM values, while a slightly inaccurate decrease of the kinetic energy is observed with a different online formulation of the nonlinear term (EMAC) in the predictive time interval $[5.332,7]\,\rm{s}$. To sum up, using the same discretization of the nonlinear term in the ROM as in the FOM seems to perform slightly better for the considered quantities of interest, providing longer time stability and accuracy, while having very little effect on global error evaluations shown above, as predicted by the numerical analysis. \begin{figure}[htb] \begin{center} \includegraphics[width=4.75in]{EkinOk.pdf} \caption{Temporal evolution of kinetic energy computed with grad-div-ROM \eqref{eq:pod_method2} using $r=8$ velocity modes. Comparison with grad-div-FEM \eqref{eq:gal_grad_div} in the whole time interval $[5,7]\,\rm{s}$.}\label{fig:EkinCompl} \end{center} \end{figure} \section{Conclusions} As a conclusion, we can say that there is no inconsistency in the error bounds using different discretization for the nonlinear terms in the FOM and POD methods. In the case in which grad-did stabilization is added to both the FOM and POD methods error bounds with constants independent of inverse powers of the viscosity can be obtained. Comparing the case in which the same discretization of the nonlinear term is used for both FOM and POD methods we have checked that there is an added term in the error that has the size of the error of the FOM method (in the $L^2$ norm of the velocity and the $L^2$ norm of the divergence of the velocity). On the other hand, in the case in which no stabilization is added neither to the FOM nor to the POD method, we have carried out two different error analysis. In the first one, the error bounds depend on inverse powers of the viscosity and on the $L^2$ error of the velocity and the $L^2$ error of the divergence of the velocity of the FOM method plus the $L^2$ error of the projection of the square modulus of the velocity onto the FEM pressure space. In the second one, we are able to prove error bounds with constants independent of inverse powers of the viscosity but with the price of having bounds that depend on the $H^1$ norm of the FEM velocity error and the $H^1$ error of the projection of the square modulus of the velocity onto the FEM pressure space. Moreover, since the bounds for the plain Galerkin method depend on inverse powers of the viscosity the dependence on $\nu^{-1}$ cannot completely be avoided also in this case. Overall, we have identified all the terms in the error bounds for different combinations of discretizations of the nonlinear term adding or not grad-div stabilization.
35f801a8b57f16152609236381bb1c032f8241e7
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Ever since the first run of the heavy-ion collision experiments, a lot of studies have been carried out describing and analyzing the data that we get from these experiments \cite{expt1, expt2,expt3}. The beam energy scan program of RHIC at BNL(Brookhaven National Laboratory) runs the collider experiments using Au-Au nuclei at collision energies from $7.7$ GeV to $200$ GeV \cite{qgp, BES1,BES2,BES3}. One of their important aims is to search for the critical point in the QCD phase diagram \cite{phase}. The matter created in these experiments has a high baryon density. On the other hand, Pb-Pb collisions are conducted at LHC at collision energies $2.76$ TeV \cite{276alice}, $5.02$ TeV \cite{502alice}, the aim of these experiments is to examine the high-temperature region of the QCD phase diagram. The distribution of particles in the initial stage is different for different collision systems and this affects the final stage particle spectra and the anisotropic flows \cite{epsv}. The primary data we get from these experiments are the transverse momentum($p_{T}$) spectra, the rapidity($y$) spectra, the pseudorapidity($\eta$) spectra, the particle-antiparticle ratios and the multiplicity fluctuations. Some phenomena e.g., the anisotropic flows can be obtained directly from these data. But some parameters are difficult to calculate directly from the experimental data. These are the impact parameter, the initial state geometry parameters, (e.g., eccentricities) event plane angles, etc. The impact parameter is the distance between the centers of the colliding nuclei on the transverse plane of the collision. In experiments, the data is always studied with respect to the centrality of the collision as we get different spectra for different centrality collisions. The high centrality collisions are those where the impact parameter is close to zero i.e., the head-on collisions. The peripheral collisions refer to the higher values of the impact parameter. The collision centrality plays an important role in determining the final particle spectra. The multiplicity distribution of different species is observed to be dependent on the centrality of the collision. In ref. \cite{BES2,BES_cen}, the multiplicity fluctuations at different centralities are studied at RHIC energies and in ref. \cite{276alice, 502alice,544alice}, the same has been studied at collision energies $2.76$ TeV, $5.02$ TeV, and $5.44$ TeV respectively. The centrality is not a property that can be attained directly from the experiments, but it can be calculated with the help of theoretical modeling by using the Glauber model\cite{Glauber} or some other similar model. The impact parameter as well as the initial geometry of the collision is difficult to determine experimentally. This is true especially for the more central collisions. That is why there are various proposals to determine the impact parameter. Apart from different simulations and algorithms, neural networks have also been proposed to determine the impact parameter from the experimental data \cite{david}. The determination of the impact parameter is related to the charged multiplicity produced during the heavy ion collision. The charged particle multiplicity has a contribution from hard and soft collision processes which in turn depend on the number of participants and also on the number of binary collisions. If $x$ is the fraction of contribution from hard processes then the charged particle multiplicity per unit pseudorapidity can be expressed as, \begin{equation} \frac{dN_{ch}}{d\eta} = n_{pp}\left[ (1-x)\frac{N_{part}}{2} + xN_{coll} \right] \label{eq:1} \end{equation} here $n_{pp}$ is the multiplicity per unit rapidity in pp collisions and $N_{coll}$ is the number of binary NN collision. The number of participant nuclei $N_{part}$ can be expressed as a function of the impact parameter \cite{Glauber, branges}. If $T_{A}(s)$ is the thickness function of nucleus $A$ i.e., the probability density function of finding nucleons in $A$, then the number of participants in $A$ at the transverse position $s$ can be found out by multiplying with the probability of binary nuclei-nuclei collision with the nucleons of the nucleus B at the same position $(b-s)$ where $b$ is the impact parameter. So, the total number of participants can be expressed as, \begin{align} N_{part}(b) =& \int T_{A}(s) (1-exp[-\sigma_{inel}^{NN}T_{B}(b-s)])ds \nonumber\\ & + \int T_{B}(b-s) (1-exp[-\sigma_{inel}^{NN}T_{A}(b)])ds \label{eq:2} \end{align} Here the total number of participating nuclei is found out by summing over the contribution from nucleus A and nucleus B. Using Eq.\ref{eq:1} and Eq.\ref{eq:2}, the impact parameter hence centrality can be estimated by fitting the multiplicity spectra. In this method, the multiplicity fitting must be done for every event to obtain its centrality. An easier way of getting the centrality is to use machine learning models. Machine learning has been invoked to determine the impact parameter from the experimental data in several papers\cite{ML1, ML2, ML3}. Using machine learning, we can automate the whole process and the impact parameter can be calculated in an efficient way. The advantage of using machine learning (ML) is that it requires less computational power as well as computational time. So, this makes the process more agile. Most of the work in this field is related to the deep neural network algorithms. The convoluted neural network has also been used to make predictions about the impact parameter \cite{pang}. The first paper to demonstrate the importance of neural network analysis for improving the accuracy of the determination of the impact parameter is ref. \cite{bass}. Using an ANN (Artificial Neural Network) or CNN (Convolutional Neural Network) they have effectively determined the impact parameter, but these networks require the tuning of hundreds of parameters. This makes the process computaionally expensive. On the other hand, different non-neuronal ML models like SVM, RandomForest, kNN etc require lesser parameters to produce results with similar accuracy as the ANN or CNN models. Thereafter many papers have explored various Machine Learning algorithms to obtain more accurate results for the impact parameter. In this study, we have analyzed various machine learning algorithms (ML) and provided a rigorous comparison on the accuracy and efficiency of these algorithms using well defined techniques of machine learning to show a critical gap in their prediction accuracy for central collisions. We have mainly focused on three properties, impact parameter, eccentricity, and participant eccentricity. We analyze the errors in the predictions and discuss the causes that lead to these errors. We find that the accuracy is less for the low impact parameters. This is an already known problem in the determination of the impact parameter. We provide a custom sampling method that shows significant improvement in accuracy over commonly used sampling methods in the ML community. We have also used a particular HIC model for training, while the data from two different HIC models have been used to make the predictions. This indicates that for a well-defined training data set, the predictions for the impact parameter using the ML model are model independent. In this study, the transverse momentum($p_{T}$) spectra are taken as features and the impact parameter, eccentricity, and participant eccentricity are taken as the target variable which the model must predict. We have used the AMPT (A Multi-Phase Transport) model to generate the transverse momentum spectra of Au-Au collision events at $200 GeV$ collision energy \cite{ampt}. The charged particle multiplicity has been studied previously using the AMPT model\cite{ampt_multi}. As the target variables are known for fitting, we use supervised machine learning algorithms. Also, the target is a continuous variable so it can have any real value, hence we use the regression algorithms. The focus of our study would be predicting the impact parameter and the eccentricity. Eccentricity is one of the parameters which gives us the initial geometrical shape of the collision region. This also affects the elliptic flow of produced particles which is one of the important observables used to study collective behavior in heavy-ion collisions. In ref. \cite{ecc2v2}, the effects of eccentricity fluctuation on the elliptic flow is studied at $\sqrt{s}=200$ GeV for Au-Au and Cu-Cu collisions. In a recent study\cite{amptecc}, the flow-harmonics are studied as a function of different components of initial anisotropy using the AMPT model. In our study, the learnings and experiences gathered by the ML models from the impact parameter prediction, is passed onto predict the eccentricity of the initial stage of the heavy-ion collision system. We have also looked at how the inclusion of the impact parameter as a feature, affects the prediction accuracy. We have made predictions of the initial state anisotropy, using the impact parameter. The initial state anisotropy is given by\cite{branges}, \begin{equation} \epsilon_{n}(b) = \frac{<r^{n}cos(n\phi -n\psi)>}{r^{n}} \label{eq:eps} \end{equation} here $r=\sqrt{x^{2}+y^{2}}$, $\psi=tan^{-1}\frac{y}{x}$, n=2 gives the eccentricity and n=3 gives the triangularity. The above eccentricities are with respect to the reaction plane. We have also trained the model to predict participant plane eccentricity which is given by\cite{ecc2v2}, \begin{equation} \epsilon_{part} = \frac{ \sqrt{\sigma_{y}^{2} - \sigma_{x}^{2}+4\sigma_{xy}^{2}} } {\sigma_{y}^{2} + \sigma_{x}^{2}} \end{equation} here $\sigma$'s are the variances of the positions of the particles, $\sigma_{x}^{2} = <x^{2}>-<x>^{2}$, $\sigma_{y}^{2} = <y^{2}>-<y>^{2}$ and $\sigma_{xy} = <xy>-<x><y>$. Here $<..>$ is the average over the transverse plane. The AMPT is a transport model which has been used extensively to model the different stages of the heavy ion collision from the initial collision dynamics to the final stage hadron dynamics. However, like all models, it has certain drawbacks. There are alternate simulations based on hydrodynamics which also give reliable outputs which match well with the data. In this study, we have taken the results from other models too. This is to test if the predictions of the ML algorithms depend crucially upon the nature of the model used. Our results show that as long as the models reflect the experimental data accurately, the ML algorithms do not distinguish between the different models. An ML algorithm trained on a specific model gives pretty accurate results when tested with the data generated by a different model. The two other heavy ion collision models used in this study are VISH2+1(Viscous Israel Stewart Hydrodynamics (2+1) dimension) \cite{vish1} and a hybrid model made of a hydro evolution model and a hadronic cascade model \cite{iEBE}. These two models are different from the AMPT model which is used to train the ML algorithms. So, the ML models train from the $p_{T}$ spectra and the impact parameter data of AMPT events and predicts impact parameters using test data of $p_{T}$ spectra from the VISH2+1 and the hybrid model. We choose the initial conditions of different models such that they generate the $p_{T}$ spectra close to the one that is obtained in the actual experiments. In this way, we are examining the efficiency of the ML algorithms in a model-independent manner. However, the model-independency is limited only to those models which generate the $p_{T}$ spectra close to the experimental $p_{T}$ spectrum. The $p_{T}$ spectra of the hydro and the hybrid model are fitted with the experimental $p_{T}$ spectra to measure the effectiveness of ML models on the experimental data. In section II, we give a brief description of the heavy-ion collision models used in this study. In section III, we talk about the ML models used in this study. We also describe the parameters used to check the accuracy of different ML models. The learning process of various algorithms as well as the tuning of the hyperparameters are given in this section. We have also used rebalancing techniques to improve the accuracy of the results. These rebalancing techniques are discussed in this section. Section IV discusses the results and the predictions made by the ML models of the eccentricity and the participant eccentricity. It also discusses the ranges of eccentricity where optimum accuracy has been observed. The efficiency of predicting the impact parameter using unknown data of different HIC models and experimental data is discussed in this section. In the end, we show how the accuracy can be improved by rebalancing the dataset. We then summarize the paper in section V. \section{Event Generation} \subsection{The AMPT model} The AMPT is a publicly available heavy-ion collision model which generates heavy-ion collision events. It is often used to understand the results obtained from experiments and it has successfully given the results which match well with the experimental observations \cite{ampt}. There are two versions of AMPT. In both, the initial condition is generated by the HIJING model \cite{hijing1,hijing2,hijing3}. Here the initial configuration of nucleons is determined by the Glauber model with a Wood-Saxon nuclear distribution. Particle production from two colliding nuclei is given in terms of two processes. In hard processes, the momentum transfer is larger and they are described by pQCD and they produce minijets. The soft processes are those where the momentum transfer is lower and described by the non-perturbative process by the formation of strings. Of the two models, in the default version, the partons recombine with their parent strings after the end of interaction in the partonic state and forms hadrons using the Lund String fragmentation model \cite{lund}. In the string melting (SM) version of AMPT, the strings are converted to their valence quarks and antiquarks. The partonic stage interactions are described by Zhang's Parton Cascade (ZPC) where the interactions are described by the Boltzmann equations \cite{zpc}. The scattering cross-section of the parton interactions is calculated using pQCD. The simplified relation between total parton elastic scattering cross-section and the medium induced screening mass is taken as, \begin{equation} \sigma \approx \frac{9\pi \alpha_{s}^{2}}{2\mu^{2}} \end{equation} where $\alpha_{s}$, the strong coupling constant and $\mu$, the screening mass, taken as 0.33 and $3fm^{-1}$ respectively for a total cross-section of $3$ mb. When the partons stop interacting, they are hadronized by a quark coalescence model. Here the nearest quark-antiquark pair is converted into a meson and the three nearest quarks or antiquarks are converted into a baryon or an antibaryon. The hadronic dynamics are described by the ART (A Relativistic Transport) model \cite{ART}. We have used both the versions of the AMPT model. In all the collision setup, we use Au-Au collision at $200$ GeV collision energy. Different centralities are considered for different purposes. The other settings are the same as the parameters taken in these references \cite{ampt_multi,ampt_settings}. \subsection{The VISH2+1 model} VISH2+1 is a publicly available code where the evolution of the system created in heavy-ion collisions is described by relativistic causal viscous hydrodynamics \cite{viscous, vish1,vish2}. The code has been tested extensively and it has successfully reproduced the results from experiments \cite{vish_expt}. The initial distribution is taken from the Glauber model in terms of energy-momentum tensor $T^{mn}$. Then it solves the local energy-momentum conservation equation $d_{m}T^{mn}=0$ where, \begin{equation} T^{mn}=eu^{m}u^{n}-p\Delta^{mn}+\pi^{mn} \end{equation} Here $\Delta^{mn}=g^{mn}-u^{m}u^{n}$, $u^{m}$ and $u^{n}$ are the velocity components, and $p$ is the pressure. $\pi^{mn}$ is the viscous shear pressure which follows the evolution equation, \begin{equation} D\pi^{mn}=\frac{1}{\tau_{\pi}}(2\eta\sigma^{mn}-\pi^{mn})-(u^{m}\pi^{nk} - u^{n}\pi^{mk})Du_{k} \end{equation} $D= u^{m}d_{m}$ and the symmetric and traceless shear tensor is given by, $\sigma^{mn}= \frac{1}{2}(\nabla^{m}u^{n}+ \nabla^{n}u^{m})-\frac{1}{3}\Delta^{mn}d_{k}u^{k}$. The pressure $p$ and the energy density $e$ are related by the equation of state(EoS), which is used to solve the hydrodynamic equations. There are three different EoS used in this study, EoS-L, SM-EOS Q, and s95p-PCE. The EOS L is based on lattice QCD data where a smooth crossover transition connects the QGP state to the chemically equilibrated hadron resonance gas(HRG) state\cite{vish_expt}. The SM-EOS Q is the smoothed version of the EOS Q where a first-order phase transition with a vacuum energy (bag constant) connects the non-interacting QGP state to the chemically equilibrated HRG state \cite{eosq}. The s95p-PCE equation of state is obtained from fits to lattice QCD data for crossover transition at high temperatures and to a partial chemical equilibrium system of the hadrons at low temperatures\cite{s95p}. In the Israel-Stewart \cite{IS1,IS2} framework, the generalized hydrodynamic equation of an energy-momentum tensor $T^{mn}$, together with viscous pressure contributions $\pi^{mn}$ is solved with a collision time scale $\tau_{\pi}$(relaxation time). The longitudinal boost-invariance is implemented and seven equations are solved, $3$ for the $T^{\tau\tau}$, $T^{\tau x}$ and $T^{\tau y}$ and $4$ for the $\pi^{mn}$'s. Here a flux-corrected transport(FCT) algorithm called SHASTA (Sharp And Smooth Transport Algorithm) \cite{SHASTA} is used to solve the hydrodynamic and kinetic equations. It has two stages. In the transport stage, the multidimensional calculations are simplified in terms of geometric interpretation which is followed by an anti-diffusive or corrective stage. This technique is also applied in codes like AZHYDRO \cite{azhydro}. The final spectra are obtained on a freeze-out hypersurface where the fluid stops interacting. The freeze-out is computed using the Cooper-Frye procedure \cite{cooper} at a decoupling temperature $T_{dec}$. Here iSpectra (iS) code is used, which is a fast Cooper-Frye particle momentum distribution technique that gives discrete momentum distribution of the desired hadron species \cite{iSS}. We get events of emitted hadrons similar to the events generated in experiments which are then used for ML model predictions. \subsection{Hybrid model} We have used the iEBE-VISHNU code package \cite{iEBE} which is a hybrid model made by combining a (2+1)-dimensional viscous hydrodynamic model and a hadronic cascade model. Instead of using the whole package, we have used the modules separately for better handling of inputs and outputs. The output of the iS particle sampler obtained at the end of hydro evolution, is used for hadronic re-scatterings. Here, the UrQMD after-burner package is used to serve this purpose. After the particalization, the hadrons are produced on the hypersurface with individual production time and location. The position and momenta along with the ids are then written in a standard OSCAR1997A format which is suitable for hadronic re-scattering\cite{oscar}. This is done using the Oscar to UrQMD converter routine. This also propagates all the hadrons backward in time so that all of them have a fixed initial time and the Boltzmann collision integral can be performed in the UrQMD model. Ultra-Relativistic Quantum Molecular Dynamics (UrQMD) is a transport model where the dynamics of the hadrons are modeled \cite{urqmd1, urqmd2}. UrQMD can generate a whole collision system starting from the nuclear collision to the hadronic spectra but here we have only used it to get the hadronic evolution. The interaction among the hadrons is evaluated using the Boltzmann equation for the distribution of all hadrons. The system evolves through binary collisions or by 2-N-body decays. $53$ baryon species and $24$ different meson species, along with their resonances, antiparticle states and isospin-projected states are considered in the UrQMD interactions. The interaction among the hadrons and their resonances in this model are described in reference \cite{urqmd2}. \section{Machine Learning Methods} \subsection{ML Algorithms and Tuning of Hyperparameters} As mentioned in the introduction, there are various ML algorithms that we have tested for this study e.g. k-NearestNeighbors, Gradient Boosting Regression, Decision Trees etc. . Details of these ML algorithms are available in ref. \cite{mlalgorithms}. The accuracy of these models has been tested using standard measures such as R-square, the Root Mean Square Error (RMSE), the Mean Squared Error (MSE), and the Mean Absolute Error (MAE). After running various ML algorithms, we find that although all the algorithms give very good predictions for the impact parameter, only three of them perform well for the eccentricity prediction. Hence, we concentrate only on these three algorithms. They are the k-NearestNeighbors(kNN), ExtraTrees Regressor(ET) , and the Random Forest Regressor(RF) model. In kNN model, the target is predicted by doing an local interpolation of the target associated with the k nearest neighbors of the training dataset\cite{knn1}. ET and RF are the kinds of ensemble method. In RF, the decision trees are made during the training and a mean of the ensemble is calculated\cite{RF1}. In ET, randomized decision trees are considered that are made of sub-samples of the training dataset\cite{etr}. We have used a 10-fold cross-validation (CV) to obtain a robust estimate of the parameters\cite{cv}. This also gives a bias-variance trade off. Since we have used these ML algorithms for studying the data from three different HIC models, we have standardized the data before processing them. In this study, we are using the $p_{T}$ spectra of charged particles as features in the dataset. The $p_{T}$ spectra is obtained for the mid-rapidity region with a rapidity window of $-0.5$ to $0.5$. All the $p_{T}$ bins have a different range of values. The difference is more significant when we compare a lower $p_{T}$ bin with a higher $p_{T}$ bin. Thus, it is important to make them standardized. This makes the model compatible with a new dataset coming from a different HIC model. Two types of scaling are used in this study, i) the Standard Scaler or Z-score normalization and ii) the Min-Max Scaler\cite{normalize}. To use both these scaling techniques, we have used python sklearn.preprocessing library \cite{sklearn}. In most of the cases discussed in this study, we observe that the Z-score method provides us an accuracy greater than the min-max scaling by $4-6\%$. So, in all the cases, we have used the Z-score standardization. After standardization, the $p_{T}$ spectra serve as the features in the dataset and the target variables are the impact parameter, the eccentricity, and the participant eccentricity. When the impact parameter is used as the target variable, only the $p_{T}$ spectra is used as feature variables. For the other targets, the predicted impact parameter is included in the dataset as a feature variable as all the other targets have a dependency on the impact parameter. In this way, all the dependent variables can be measured just by giving the $p_{T}$ spectra as inputs. A standard training and test set separation was done for model evaluation. \begin{figure} \includegraphics[width=0.6\linewidth] {learning3.pdf} \caption{The learning curve of kNN(green dots), ET (orange triangles), and RF (blue stars) model. Accuracy score as a function of the number of events are shown which attains saturation after $3000$ events for the training set (sky line), and after $6000-8000$ events for the test sets. The shaded region is the standard deviations} \label{fig:learning} \end{figure} It is important to have enough events to achieve the best accuracy without consuming too much computing resources. The learning curve of a machine learning model tells us how effectively a model is learning throughout its running time. We present the learning experience as a function of events. In Fig.\ref{fig:learning}, the learning curves of a kNN (green circles), ET (orange triangles), and RF (blue stars) model are shown where the changes in the Cross-Validation (CV) accuracy are represented with the number of event iterations. The training score curve is shown only for the kNN model (sky color circles) which shows the accuracy while fitting the training data to the model. In the training case, the accuracy comes to a saturation very early around $3000$ events. While in the cases of test data accuracy shown by the other curves saturates around $6000$ to $8000$ events. All the learning in this study are performed over $10k$ events. The shaded area represents the standard deviations in the accuracy score. In Fig.\ref{fig:b_error}, the accuracy plots for impact parameter predictions using kNN(a), ET(b), RF(c), and Linear Regression(LR)(d) models are shown. The ML models are trained using the charged particle $p_{T}$ spectra data of AMPT-SM model. Linear Regression algorithm finds a linear relationship between a dependent and one or more independent variable\cite{lr}. The prediction is performed using a test dataset containing $p_{T}$ spectra of more than $4000$ events of minimum bias Au+Au collision at $200$ GeV. The red line drawn here is the optimum accuracy line and the blue points are the predictions made by the model. The accuracies achieved are $97.11\%$, $97.03\%$, $97.05\%$ and $96.53\%$ for kNN, ET, RF, and LR model respectively. All of these accuracies are observed for a random train-test dataset split. The 10-fold cross-validation scores of these models are $97.04\%$, $97\%$, $97.01\%$, and $96.56\%$ respectively. We get accuracy of more than 95\% for the kNN, ET and RF models when the ML models are trained using the default AMPT model data, . In the case of impact parameter predictions, most of the machine learning algorithms give a fair level of accuracy without tuning any of the hyperparameters except in certain critical impact parameter regimes. \begin{figure} \includegraphics[width=0.5\linewidth] {highest_b_knn.pdf}\includegraphics[width=0.5\linewidth] {highest_b_etr.pdf} \includegraphics[width=0.5\linewidth] {highest_b_rf.pdf}\includegraphics[width=0.5\linewidth] {highest_b_lr.pdf} \caption{Impact parameter prediction using kNN(a), ET(b), RF(c) and LR(d) model with their accuracy score $97.11\%$, $97.03\%$, $97.05\%$ and $96.53\%$ for events of Au+Au system at collision energy $200$ GeV. These plots are obtained for a random train and test set split of input events.} \vspace{-10pt} \label{fig:b_error} \end{figure} It is known that the choice of parameters can affect the accuracy of a model. Hyperparameter tuning was done to fix the parameters with minimum error validation set. In Fig. \ref{param}(a), the change in the accuracy of a kNN model is shown as a function of the number of nearest neighbors hyperparameter. For every configuration, the model is trained using $12000$ events of minimum bias Au+Au collision, and the impact parameter is taken as the target variable. The highest accuracy is attained by the model when the number of nearest neighbors is $4$ or $5$. This is shown by the green curve which gives the 10-fold cross-validation score and the shaded region is the standard deviation. The training score shown by the blue line has a score of $1.00$ when the number of nearest neighbors is $1$. This is a case of overfitting. For the random forest (RF) model (see Fig. \ref{param}(b)), the choice of hyperparameter is the maximum number of levels of the tree. We find that the accuracy saturates for the hyperparameter value of $4$ or $5$. Like the RF model, we get the maximum CV score of the ET model when the max-depth hyperparameter is $4$ or $5$. Although the above-mentioned parameters are the ones that hamper the accuracy most, we fix the other hyperparameters by running the RandomSearchCV function of the sklearn library and checking the accuracy for a different combination of hyperparameters. \begin{figure} \includegraphics[width=.6\linewidth]{neighborscore.pdf} \includegraphics[width=.6\linewidth]{max_depth.pdf} \caption{Change in accuracy as a function of hyperparameters. a) kNN model with the number of nearest neighbors hyperparameter, b)Random Forest with max depth hyperparameter} \label{param} \end{figure} As discussed earlier, in Fig.\ref{fig:ecc_b1}, we see how the inclusion of the impact parameter as a feature affects the accuracy of eccentricity prediction. As is seen in earlier studies that eccentricity depends on the centrality of the collision. Here we have found that by the inclusion of the impact parameter as a feature, the accuracy increased in all the centrality ranges. \begin{figure} \includegraphics[width=0.8\linewidth] {Accuracy_b_ecc1.pdf} \caption{Effect on the eccentricity prediction accuracy by the inclusion of impact parameter as a feature for different centrality(\%), a) 0-10\%, b) 10-40\%, c) 40-80\%, d) Min. bias events. The orange bar represents accuracy with impact parameter as a feature and blue bars represent accuracy without impact parameter as a feature. } \label{fig:ecc_b1} \end{figure} The errors in ML can be reduced by determining the highly correlated features in the data. The Principal Component Analysis (PCA) is the most popular technique used for feature reduction of a large dataset\cite{Cadima}. In this work, we have tried the 'SelectFromFeature' function from the sklearn library and PCA method to reduce the colinearity and compared the outcomes to the already achieved accuracy using all the features. We have only shown the result of PCA method. In Fig. \ref{fig:pca}(a), the accuracy score of a kNN model, and in Fig.\ref{fig:pca}(b), the accuracy score of an ET model is shown as a function of the number of principal components is used. Here the accuracy is observed for the impact parameter predictions using $p_{T}$ distribution dataset of $12000$ minimum bias Au-Au collision events at $200$ GeV collision energy. The saturation in the accuracy score is achieved for the use of $7$ or more principal components in both cases. Also, using 7 components, a variance coverage of $95\%$ can be achieved in the case of impact parameter predictions. So, it is safe to use $7-8$ principal components to get a good amount of accuracy without losing any major information. We used 7-8 components for the impact parameter determination. We also found that at least $10$ features or $10$ principal components are needed to obtain an accurate result for the eccentricity and the participant eccentricity. This is expected as the data that we are using is the transverse momentum data. Since the impact parameter is known to be correlated with the transverse momentum data hence, we need a smaller number of features to obtain a high accuracy of prediction \cite{grebieszkow} for the impact parameter as compared to the eccentricity. In all the eccentricity predictions we will use PCA function to transform the features. \begin{figure} \includegraphics[width=0.6\linewidth]{pca_knn.pdf} \includegraphics[width=0.6\linewidth]{npc.pdf} \caption{a) Accuracy of a a) kNN model and b) an ET model as a function of the number of principal components used } \label{fig:pca} \end{figure} \subsection{Custom resampling for unbalanced training set} The $p_{T}$ spectra we used as a feature are comprised of imbalanced datasets. As we have considered the $p_{T}$ spectra of minimum bias events, there are a smaller number of events for lower impact parameter values. Thus, the event distribution of $p_{T}$ spectra is left-skewed. The imbalance in the data affects the prediction accuracy of the impact parameter and eccentricity in the lower b region ($b\le 1 fm$). As is well known in the literature, the impact parameter is not directly accessible to the experiments. Bass et. al \cite{bassip} have pointed out that though most of the experimental observables are dependent on the impact parameter, the different methods of impact parameter estimation are usually optimized for the larger impact parameter range. This means that the expermental results for head-on collisions pertaining to the lower impact parameter range will have higher errors due to the inaccuracy of the impact parameter calculations. Currently, efforts are being made to improve the prediction of the impact parameter in the lower impact parameter range. This is very important as there are considerable experimental results from head-on collisions which can be better analysed with an improved prediction of the impact parameter in the lower range. So our aim is to improve the accuracy of the impact parameter in the lower range by balancing the data set appropriately. There are a few sampling techniques in machine learning for rebalancing datasets e.g., SmoteR, ADASYN \cite{smote, adasyn}. These are python packages that increase(over-sampling) or decrease(under-sampling) the minority and majority data class respectively using the neighboring data. We evaluated both techniques with all possible hyperparameter combinations. The results discussed in the next section (Section IV C) indicate that we do not have a sufficient increase in the accuracy of the predictions and there is a high chance of central events being predicted as non-central ones. We then adopt a method of rebalancing the data set using class weights, where different classes are the different impact parameter regimes. The various combinations of distribution region and weights were evaluated through an exhaustive grid search. Based on test set minimum error, we selected events with impact parameter $<= 1.0 $ fm to be in category $1$ and the rest in category $2$. The weights assigned to the two classes are in the ratio $4:1$. This technique has helped us to reduce the errors further and the results are discussed in detail in the next section (subsection C). \section{Results and Discussions} \subsection{Impact parameter and eccentricity prediction} \begin{figure} \includegraphics[width=0.6\linewidth] {highest_ecc_knn.pdf} \includegraphics[width=0.6\linewidth] {highest_ecc_etr.pdf} \caption{Eccentricity prediction using kNN(a), and ET(b) model with their accuracy score $97.84\%$, and $95.47\%$ for events of Au+Au system at a collision energy $200$ GeV. These plots are obtained for a random train and test set split of input events.} \label{fig:eps_pred} \end{figure} As discussed earlier, the eccentricity is one of the key parameters in heavy-ion collisions. It gives information about initial state geometry and also affects the final state particle flows. But like the impact parameter, it is difficult to measure eccentricity directly from the experiment. Here in this study, the models which are used to get impact parameter prediction, are also used in eccentricity prediction. In fact, ET, kNN, RF are the three best-performing algorithms in the case of eccentricity prediction. Fig. \ref{fig:eps_pred} shows the prediction plot of eccentricity using the kNN(a) and ET(b) model. The accuracies obtained are $97.84\%$ and $95.47\%$ respectively. This is observed for a randomly split train-test dataset of minimum bias Au+Au events. The models are trained using $10000$ randomly selected events and the testing is performed over $2000$ events which are shown in Fig. \ref{fig:eps_pred}. The 10-fold cross-validation score is also closer to the accuracy obtained using the random train-test split dataset, $97.52\%$ for the kNN model and $95.18\%$ for the ET model. The 10-fold CV score of RF model is $91.95\%$. We get accuracy between $87\%$ to $93\%$ when the ML models are trained using the default AMPT model data. \begin{figure} \includegraphics[width=0.6\linewidth] {highest_eccpart_knn.pdf} \includegraphics[width=0.6\linewidth] {highest_eccpart_etr.pdf} \caption{Participant eccentricity prediction using kNN(a), and ET(b) model with their accuracy score $98.16\%$, and $96.21\%$ for events of Au+Au system at collision energy $200$ GeV. These plots are obtained for a random train and test set split of input events.} \label{fig:eps_part_pred} \end{figure} Fig. \ref{fig:eps_part_pred} shows the prediction plot of participant eccentricity using kNN(a) and ET(b) model. The accuracies obtained are $98.16\%$ and $96.21\%$ respectively. In this case, the 10-fold cross-validation scores are $97.58\%$ and $95.25\%$ for the kNN and ET model respectively and $93.78\%$ for the RF model. In Table-\ref{best_model_eps_3}, a comparison of accuracy for $\epsilon_{3}$(triangularity) is shown. We have used the Eq.\ref{eq:eps} to obtain the $\epsilon_{3}$. Here also kNN, ET and RF models perform better than the other ML models. All of the three have an accuracy of over $90\%$. The LGBM(Light Gradient Boosting Machine) model also has an accuracy of over $88\%$ after a 10-fold cross validation. This is a tree based machine learning model where the tree grows vertically(leaf-wise)\cite{LGBM}. \begin{table}[ht!] \begin{tabular}{|l|c|c|c|} \hline \bfseries Model & \bfseries $R^{2}$ & \bfseries MAE$\,\,\,$ & \bfseries RMSE$\,\,$ \csvreader[head to column names]{best_model_eps_3.csv}{ {\\\hline\Model & $\,\,$ \R $\,\,$&$\,\,$ \MAE $\,\,$& \RMSE }\\% specify your coloumns here \cline{1-4} \end{tabular} \caption{10-Fold cross-validation accuracy of ML models for $\epsilon_{3}$ predictions of min. bias Au-Au events at $\sqrt{s}=200$ GeV} \label{best_model_eps_3} \end{table} In the eccentricity prediction figures (ref Fig. \ref{fig:eps_part_pred}), a small range of eccentricity ($0.22-0.32$) is taken for the model fitting and predictions. It is specifically the range where the maximum prediction accuracy is obtained for all the models. One of the reasons behind this is that the distribution of eccentricity over the events is not isotropic. In Fig. \ref{fig:eps_dist}(a), the distribution of participant eccentricity is shown. Here the vertical axis represents the normalized number of events, and the horizontal axis gives the eccentricity range. The peak in the distribution is observed for eccentricities between $0.15$ to $0.25$. The distribution is thus skewed, and it means that we have an imbalanced dataset. So, the eccentricity of maximum events that are occurring fall in a particular range. Hence the model fits well in this range of eccentricity because of a larger number of fitting points. From the graph, we see that the range of eccentricity can be increased further from $0.1$ to $0.5$. In Fig. \ref{fig:eps_dist}(b), a prediction plot of participant eccentricity using the kNN model is given for a larger range. Here the events are considered which have eccentricities in the range from $0.1$ to $0.5$. So, the range has now become three times wider than the previous cases. We observe that the points are wider from the center and away from the $45^{0}$ red line compared to the points in Fig. \ref{fig:eps_part_pred}(a). We also see some points which are away and isolated from the bulk distribution. The accuracy is lowered to $78.98\%$ from its previous value of $98.16\%$. The 10-fold cross-validation score is $76\%$ in this case which is a fair amount of accuracy though it is much lower compared to the maximum accuracy. This means that the range of accuracy can be fixed according to the requirement of the problem. To accommodate a wider eccentricity range, we have to compensate with accuracy. We have also applied different ML algorithms to obtain the accuracy at different collision energies from $20$ GeV to $200$ GeV for the impact parameter, eccentricity, and the participant eccentricity predictions. For lower collision energies, the number of events required to train an ML model is higher compared to the number of events required for higher collision energies. This is because high multiplicity events are generated at higher collision energies. Thus, the event-by-event averages become stable. \begin{figure} \includegraphics[width=.6\linewidth]{eps_distribution.pdf} \includegraphics[width=.6\linewidth]{eps_part_big_range_1.pdf} \caption{a) Histogram plot of participant eccentricity distribution and b) Prediction plot of $\epsilon_{part}$ for higher $\epsilon_{part}$ range using kNN model of minimum bias Au-Au collision events at $\sqrt{s}=200$ GeV given by the AMPT model} \label{fig:eps_dist} \end{figure} In Fig. \ref{fig:ecc_b2}, we plot the error in the impact parameter prediction as a function of the impact parameter and the eccentricity distribution. The error here is the relative error(RE) which is given by $RE= \left| \frac{b_{pred}-b_{org}}{b_{org}}\right| $, where $b_{pred}$ and $b_{org}$ are the predicted and original value of impact parameter. We observe that for all eccentricity and impact parameter ranges, the error is low except for the region where the impact parameter is less than $2$fm. In the majority of the distribution, the difference in the prediction and the original impact parameter is less than $0.5$ (shown by the red points) and in some cases, it is less than $1$. But for the lower range of impact parameters($b<2fm$) and eccentricities, we find the difference becomes significantly larger. This is also because of imbalance in the data as discussed. There are comparably large errors for MC-Glauber model predictions of low impact parameters. Large discrepencies are also obtained for events of UrQMD and AMPT with higher charge particle when fitted with MC-Glauber model data which is shown in ref.\cite{discr}. In ref. \cite{alicediscr}, large errors are observed for the fitting of Glauber moel data to the ALICE data. Our results are similar to the recent results obtained from ML using other models like UrQMD where it was shown that the impact parameters are determined efficiently in all the regions except the very central and the very peripheral regions \cite{tsang2021}. This is adequately reflected in Fig.\ref{fig:ecc_b2}, where a large amount of error is found in the very central region. \begin{figure} \includegraphics[height=0.6\linewidth]{ecc_b_new.pdf} \caption{Error in the prediction of impact parameter as a function of impact parameter and eccentricity distribution. This is for $200$ GeV Au-Au collisions and the prediction is obtained using a kNN model} \label{fig:ecc_b2} \end{figure} \subsection{Results from the different HIC models} To check the model dependency, we have used the data from other HIC models and obtained the prediction of the impact parameter. The training of an ML model has been done using the AMPT model data, but the predictions are made for other heavy-ion collision models. The other HIC models used in this study are the VISH2+1 model \cite{vish1} which is a hydrodynamic evolution code and a hybrid model made of VISH2+1 and UrQMD model \cite{iEBE}. In the hybrid model, the UrQMD code is used for later-stage hadronic re-scatterings. The reason for using multiple models is because we want the test set and the training set to come from different models giving the same $p_{T}$ spectra. This would mean that as long as the $p_{T}$ spectra is the same, the ML algorithms will not know which model simulated the test data. As done in the previous cases, here also we have used the transverse momentum spectra of the AMPT model as the features and impact parameters of the corresponding AMPT events as targets for the ML model training. The AMPT events considered here are the minimum bias Au-Au events of $200$ GeV collision energy. The $p_{T}$ spectra of VISH2+1 and hybrid model are obtained at the same collision energy and at specific centralities with impact parameters ranging from $0.1$ fm to $14$ fm. The parameter settings of the VISH2+1 model in this study is similar to the parameters considered in ref. \cite{vish_expt}, with the Glauber initial condition, shear viscosity to entropy density ratio $\eta/s=0.16$ and decoupling temperature $T_{dec}=160 MeV$. The box plot is obtained for s95p-PCE equation of state. For the hybrid model, we set the $\eta/s$ to $0.08$, the equation of state used is s95p-PCE and $T_{dec}=165 MeV$. We have got $5000$ events each from both of these models at all the impact parameter ranges separately and fitted the average $p_{T}$ spectra with the experimentally obtained $p_{T}$ spectra\cite{spectra0_10, spectra40_80}. We have considered the $0.15$ to $1.4$ GeV/c $p_{T}$ range to fit with the experimental spectra and also for ML model training. In this range, VISH2+1 data fits well with the experimental data. By doing this we are ensuring that the data is similar to the experiments. In an approximate manner, we are also examining the performance of ML models in case of the use of experimental data as test data for prediction. As we do not have event-by-event experimental data at specific centralities, we have used different HIC models to generate the $p_{T}$ spectra. In this way, we are able to obtain the error distribution of the predictions given by the ML model for a large number of events at specific centralities. All the ML models considered in this study, e.g., kNN, RF, ET, and LR, perform reasonably well for impact parameter prediction for an unknown HIC model test data. In Fig. \ref{fig.error_plots}(a) and \ref{fig.error_plots}(b), we show the error plots of impact parameter predictions by the kNN model for VISH2+1 and hybrid UrQMD model respectively. These are relative errors, and the box represents the distribution of errors. The middle line inside the box represents the median error which is in the middle of the box. The top and bottom lines represent the 25th and 75th percentile of the error distribution. The green point is the mean error. In all the boxes i.e., at all the centralities, the errors are in a normal distribution. This shows a good prediction by the ML model. The end circles are the outliers which are less in number. In both the figures, we find error goes down for the higher impact parameter events. Above the impact parameter of $2$ fm, the prediction errors are very close to zero. Above $b=10$ fm, the errors stayed low continuing the previous trend. The three lines in Fig.\ref{fig.error_plots}(a) show the mean errors in impact parameter prediction for different Equations of State(EoS). The green(dashed), blue(solid), yellow(dotted) line represent the mean errors for s95p-PCE, EOS L and SM-EOS Q equations of state respectively. For all the EoS, the trend of error distribution is similar. In Fig. \ref{fig.error_plots}(a), we see that for $0.1$ and $0.5$ fm impact parameter events, the relative prediction errors are more than three times and in Fig. \ref{fig.error_plots}(b), it is more than five times compared to the real impact parameters. We have considered Au-Au collision events where most central collisions of $0-5\%$ centrality are comprised of events of impact parameter range $0$ to $3.31$ fm \cite{branges}. As has been discussed, in the case of experiments, the centrality is found out using the Glauber model. Thus, it is difficult to assign a specific impact parameter value especially in the case of the most central events. We have seen the same nature in error prediction in Fig. \ref{fig:ecc_b2} while working with only the AMPT events. In that case, training of the ML model and the testing are performed with the AMPT events. This is due to the imbalance in the dataset that we are using for the ML model training. Although we get similar nature of error distribution in all the cases, we used the Glauber initial conditions for the hydro model input. The initial condition from the Color Glass Condensate model can give different $p_{T}$ spectra. To check whether the ML models are effective in this scenario, the parameters of the hydro model should be adjusted such that the $p_{T}$ spectra obtained match well with the experimental $p_{T}$ spectra. \subsection{Results from rebalancing the data set} \begin{figure} \includegraphics[width=0.6\linewidth]{error_b_hydro_boxplot.pdf} \includegraphics[width=0.6\linewidth]{error_b_urqmd_boxplot.pdf} \caption{Error plot of impact parameter predictions by kNN model of different centrality events of a) VISH2+1 and b) UrQMD simulations. The 3 lines in (a) show the mean errors in impact parameter prediction for different EoS} \label{fig.error_plots} \end{figure} A large error [Fig. \ref{fig:ecc_b2}, \ref{fig.error_plots}] is observed in the prediction in the lower impact parameter range due to the imbalance in the impact parameter distribution in the training set. We overcome this through a custom sample weighing method as mentioned in Section III (B). As mentioned previously in Section III B, initially, we have used standard packages to rebalance the data. The results are shown in Fig.\ref{fig.rebalance}(a) for one of the methods. The others also give similar results. Although the error comes down in the lower impact parameter region compared to the errors obtained in Fig.\ref{fig:ecc_b2}, still we get enough errors that would give a wrong estimate for the low impact parameter events. Finally, we give the results of our custom rebalancing method which has been described previously in detail in Section III B in Fig. \ref{fig.rebalance}(b). With our custom method we were able to minimize the error to less than 1 as shown in Fig. \ref{fig.rebalance}(b). This error is acceptable in this impact parameter range as the prediction made in this range will always fall in the most central collision category ($0-5\%$) for the Au-Au collisions. \begin{figure} \includegraphics[width=0.6\linewidth]{error_smoter.pdf} \includegraphics[width=0.6\linewidth]{error_rebalanced.pdf} \caption{Error distribution of ET model of impact parameter predictions of Au-Au collisions at $\sqrt{s}= 200$ GeV. The training set is re-balanced using a) SmoteR method, and b) a custom method of giving weights to the input data} \label{fig.rebalance} \end{figure} It is also interesting to see how the AMPT trained models predict eccentricities when they are introduced to other HIC model data. In Fig. \ref{fig.ecc_vish}(a), we show the distribution of eccentricity with the centrality of $200$ GeV AMPT collision events. Although the color plot suggests that there is a linear relationship between the average eccentricity and impact parameter of collision events. We see that the range of eccentricity is lower for lower impact parameter values. As we go for higher impact parameter events, the range of eccentricity becomes larger. A similar observation has been shown previously in ref. \cite{ecc_b_ref}. In Fig. \ref{fig.ecc_vish}(b), we show the distribution of eccentricity predictions of VISH2+1 events for two centrality range. Here also the ML model is trained using minimum bias AMPT events. The orange dots are the prediction events of $40-80\%$ centrality and the blue dots are the prediction events of $0-10\%$ centrality. In the case of $0-10\%$ centrality range, we get eccentricity distribution in $0-0.15$ range which is also in the range of original distribution shown in Fig. \ref{fig.ecc_vish}(a). We get a larger range in eccentricity values in the higher impact parameter range, the prediction also gives us the same, are represented by the orange dots. Although this shows the model independence characteristics of the ML models, but it is only examined for the Glauber initial conditions of VISH2+1 model. We have not used the Color Glass Condensate initial conditions as it is known that it gives a larger anisotropy but it would be interesting to see how the model would perform in that case. We plan to look at these in a later work. \begin{figure} \includegraphics[width=0.48\linewidth]{eps_b_dist2d_2.pdf} \includegraphics[width=0.48\linewidth]{hydro_eccentricity_pred.pdf} \caption{a) Distribution of eccentricity with impact parameter of min. bias Au-Au collision events at $\sqrt{s}= 200$ GeV, b) Distribution of eccentricity predictions by kNN model of $0-10\%$ and $40-80\%$ centrality events of Au-Au collisions at $\sqrt{s}= 200$ GeV from the VISH2+1 model.} \label{fig.ecc_vish} \end{figure} We have shown an imbalance in the eccentricity distribution in Fig. \ref{fig:eps_dist}(a). Due to this imbalance in the distribution, we get an accuracy of more than $95\%$ in eccentricity prediction only when we consider a small range. For bigger range, the CV accuracy dropped down to $76\%$. A good amount of accuracy can also be achieved for a higher range of eccentricity distribution if the data is rebalanced in a suitable format. We have tried a similar rebalancing technique as is done for the impact parameter prediction. We took the same number of events from each of the distribution bins and trained the model. The prediction plot is shown in Fig. \ref{fig.ecc_rebalance}. We observe that the event points are much more closer to the optimum accuracy line (red line) compared to Fig. \ref{fig:eps_dist}(b) which also have the same range of eccentricity. The accuracy obtained in this case is $89.49\%$ with a cross-validation score of $91\%$. So, using these data rebalancing techniques, one can improve the performance of these ML models for the prediction of the impact parameter as well as the eccentricities. \begin{figure} \includegraphics[width=0.6\linewidth]{eps_part_big_range_balanced.pdf} \caption{Participant eccentricity predictions of Au-Au collision events at $\sqrt{s}= 200$ GeV after rebalancing the data using the custom method} \label{fig.ecc_rebalance} \end{figure} \section{Conclusions} We have trained different machine learning models to predict various initial stage parameters of a heavy-ion collision system using the AMPT model. We have used the $p_{T}$ spectra for training and testing of the ML models. We have chosen these spectra as it is one of the direct observables in heavy-ion collision experiments. We have observed their learning processes and made changes to the hyperparameters to get an optimum accuracy in the predictions. Out of the various models tested, we have chosen four models kNN, RF, ET and LR for the prediction of the impact parameter. All the models performed well in the impact parameter prediction. Most of the algorithms have shown an accuracy of more than $90\%$ in the prediction of the impact parameter. In the case of the eccentricity, and the participant eccentricity prediction, three models i.e., the kNN, ET, and RF have performed exceptionally well and has given an accuracy of more than $90\%$ after a 10-fold cross-validation. These three models along with the Decision tree and the Light gradient boosting machine have a 10-fold cross-validation score of more than $75\%$ in almost all the cases. There is a range of eccentricity ($0.2-0.32$) where the optimum accuracy is obtained for the eccentricity predictions. A greater range of eccentricity ($0.1-0.5$) has also been taken into consideration. We find that the choice of the range in eccentricity affects the prediction accuracy of the eccentricity due to the imbalance in the training data distribution. We have also performed an analysis of how the model would possibly perform in predicting the centrality class using experimental data as test data. We have considered two heavy-ion collision models, a viscous hydrodynamic model (VISH2+1) and a hybrid model (Hydro+UrQMD) which are different from the AMPT model that is used for training the machine learning models. The ML model predictions of impact parameters are obtained for the events of the VISH2+1 model and the hybrid model. The hydro and hybrid model events considered for testing are taken at specific impact parameter ranges from $0.5$ fm to $14$ fm. The ML models (kNN results shown specifically) predicted the centrality classes of these events meticulously well. Although in both cases, we have obtained higher errors for the $0.5$ fm events, the errors are very small at other impact parameters. The reason behind this is the lack of balance in the data set. When the data set is normalized, it is found that the peak of the distribution is not at the center. This indicates that the distribution of impact parameter and eccentricity over events are not isotropic. To minimize these errors, we have used various sampling methods. Though there are several standard packages that help to rebalance the data, we finally see that the accuracy is improved in the lower impact parameter region if we assign different weights to the data at different impact parameters. For the Extratrees model, rarer events are given four times the weightage as the weightage given to impact parameters with a large number of events. This has helped improving the accuracy in the lower impact parameter range. Our rebalancing technique resulted in a cross-validation accuracy of more than $90\%$ for a higher range of eccentricity distribution. This meant an overall improvement from $75\%$ accuracy before the rebalancing to an accuracy of $90\%$ after the rebalancing. Our study therefore shows a rebalanced data set will be useful in making accurate prediction close to the head on collisions. Finally in conclusion, we have shown that it is possible to use the $p_{T}$ spectra only to make accurate predictions of the initial parameters such as the impact parameter, the eccentricity and the participant eccentricity using the ML algorithms. Even though the algorithm is trained by a single model, it can make accurate predictions from the data generated by other models as long as all the models are able to generate the experimental data accurately. This means that any of the models may be used to train the data set. We have also found that the inaccuracies in the prediction are due to the imbalance in the data set. Proper rebalancing techniques can be used to rebalance the data set and this can be used to predict more accurate results in the low impact parameter regime. \begin{center} Acknowledgments \end{center} For computational infrastructure, we acknowledge the Center for Modeling, Simulation and Design (CMSD) at the University of Hyderabad, where part of the simulations was carried out. A.S is supported by INSPIRE Fellowship of the Department of Science and Technology (DST) Govt. of India, through Grant no: IF170627.
0afbadf387a6e6cfb80f51f75c2b7bd45854776b
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Let $Y$ be a marked Riemann surface structure on a closed oriented surface $S$ of genus $g$ at least two, and let $\mathrm{QD}(Y)$ be the space of the holomorphic quadratic differentials on $Y$ is a complex vector space of dimension $3g-3$. Then $\mathrm{QD}(Y)$ is identified with the space $\mathcal{P}_Y$ of all $\mathbb{C}{\rm P}^1$-structures on $Y$, and it analytically maps to the $\mathrm{PSL}_2\mathbb{C}$-character varieties $\rchi$ of $S$ via the holonomy map. Many interesting properties of this mapping have been discovered, and particularly the following holds. \begin{theorem}\Label{PoincareHolonomyVariety} By the holonomy map, $\mathcal{P}_Y \cong \mathrm{QD}(Y)$ is properly and complex analytically embedded in $\rchi$. \end{theorem} Note that, if we consider the deformation space $\mathcal{P}$ of all marked $\mathbb{C}{\rm P}^1$-structures on $S$ (without fixing a Riemann surface structure), then the holonomy map $\mathcal{P} \to \rchi$ of $\mathbb{C}{\rm P}^1$-structures is neither injective nor proper (see \cite{Hejhal-75}). The injectivity of \Cref{PoincareHolonomyVariety} was proved by Poincaré \cite{Poincare884}; the proof of the properness is due to Kapovich \cite{Kapovich-95} (see \cite{Gallo-Kapovich-Marden} for the full proof; see also \cite{Dumas18HolonomyLimit, Tanigawa99}). We call the image of $QD(Y)$ the {\sf Poincaré holonomy variety} of $Y$. The holonomy varieties are associated with the Schwarzian parametrization of $\mathbb{C}{\rm P}^1$-structures --- this parametrization is given by certain second linear ordinary differential equations on Riemann surfaces. In particular, the holonomy variety of $Y$ contains the Bers slice of $Y$. Recall that $\mathbb{C}{\rm P}^1$ is the ideal boundary of the hyperbolic three-space $\H^3$, and the automorphism group $\mathrm{PSL}_2\mathbb{C}$ of $\mathbb{C}{\rm P}^1$ is identified with the group of orientation preserving isometries of $\H^3$. Thurston gave another parametrization of $\mathbb{C}{\rm P}^1$-structures, using pleated surfaces in $\H^3$ (\cite{Kamishima-Tan-92, Kullkani-Pinkall-94}). In this paper, we first yield an analogue of \Cref{PoincareHolonomyVariety} by specific slices in the Thurston parametrization of $\mathbb{C}{\rm P}^1$-structures. (See, for example, \cite{Dumas-08} for those different parametrizations.) Given a measured lamination $L$ on a hyperbolic surface $\tau$, we obtain a pleated surface in $\H^3$ by bending the universal cover of $\tau$, the hyperbolic plane, along all lifts of $L$, and the pleated surface is equivariant via a representation $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$. (See \S \ref{sBendingDeformation} for details.) Let $\mathcal{T}$ be the space of marked hyperbolic structures on $S$, the Fricke-Teichmüller space. For a measured lamination $L$ on $S$, let $b_L\colon \mathcal{T} \to \rchi$ be the map giving the holonomy representation. The following theorem establishes some similarities between $b_L$ and the holonomy varieties. \begin{thm}[Theorem \ref{BendingTeich}]\Label{BendingTeichmullerSpaces} Let $L$ be an arbitrary measured lamination on $S$. Then, the bending map $b_L\colon \mathcal{T} \to \rchi$ is a real-analytic embedding. Moreover, $b_L$ is proper if and only if $L$ contains no periodic leaves of weight $\pi$ modulo $2\pi$. \end{thm} By Theorem \ref{BendingTeichmullerSpaces}, $b_L$ is proper except some specific measured laminations $L$. For those special laminations, in fact, we give explicit conditions, in the Fenchel-Nielsen coordinates, for a diverging sequence in $\mathcal{T}$ to have a converging $b_L$-image (\Cref{NonpropernessOfBendingTeichmullerSpaces}). The Poincaré holonomy varieties are closed complex analytic sets. Thus, we shall try to complexify the real-analytic embedding $b_L \colon \mathcal{T} \to \rchi$ in \Cref{BendingTeichmullerSpaces}. Note that the Fricke-Teichmüller space $\mathcal{T}$ is a component of the real slice of the character variety $\rchi$. Moreover, $b_L$ is {\it totally real} in the complex affine variety $\rchi$ (i.e. its tangent spaces contain no complex lines). Therefore, to obtain different complexifications for different bending laminations, it is necessary to enlarge the ambient space. Given a weighted oriented multiloop $M$ on $S$, we introduce a modification $X_M$ of the character variety $\rchi$ with respect to $M$, so that we can ``bend'' representations $\pi_1( S) \to \mathrm{PSL}_2\mathbb{C}$ even the holonomy along some loops of $M$ is elliptic or even trivial (\S \ref{sRepresentataionsFramedAlongALoop}, \S\ref{sRepresentationsFramedAlongMultiloop}). This modification is done by assigning certain framings for the loops of $M$, which determine bending axes. In addition, the modification essentially happens only in an analytic subvariety of $\rchi$ disjoint from $\mathcal{T}$, so that the map forgetting the framing induces a finite-to-one covering map from $X_M$ to $\rchi$ when specific subvarieties are removed from $X_M$ and $\rchi$. In particular, there is a canonical embedding of $\mathcal{T}$ into $X_M$. For a representation $\rho\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$, simply consider the diagonal representation $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ given by $\gamma \mapsto (\rho(\gamma), \rho(\gamma))$. Then, in the space of representations into $\mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$, we can appropriately define bending of representations $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ along the axes given by framings. We thus obtain the {\sf complexified bending map} $B_M \colon X_M \to \rchi \times \rchi$. (See \S \ref{sComplexifiedBending} for details.) Let $$\Delta^\ast = \{ (\rho_1, \rho_2) \colon \pi_1(S) \to \rchi \times \rchi \mid \rho_1 = \rho_2^\ast\}$$ the anti-holomorphic diagonal in $\rchi \times \rchi$. Let $\psi\colon \Delta^\ast \to \rchi$ be the projection map taking $(\rho, \rho^\ast)\mapsto \rho.$ \begin{thm}[Complexification]\Label{Complexification} Let $M$ be an oriented weighted multiloop on $S$. Then $B_M \colon X_M \to \rchi \times \rchi$ is a complex analytic mapping, such that \begin{itemize} \item the (Euclidean) closure of its image is a closed analytic subset in $\rchi \times \rchi$ (Corollary \ref{ImageIsAnalytic}); \item $B_M$ real-analytically embeds $\mathcal{T}$ into $\Delta^\ast$; \item $b_M \colon \mathcal{T} \to \rchi$ coincides with the restriction of $\psi \circ B_M$ to $\mathcal{T}$ (Proposition \ref{ComplexifyingTwistedDiagonal}). \end{itemize} \end{thm} (The analyticity is proven in \Cref{BendingIsAnalytic}.) Moreover, if an analytic subset is removed from the domain $X_M$ and a subvariety is removed from the target $\rchi \times \rchi$, then $B_M$ is injective and proper (\Cref{InjectivityAlomstEverywhere}, \Cref{PropernessAwayFromSubvariety}). Moreover, we show that the complexified bending map is genuinely proper in certain cases. \begin{thm}\Label{BendingCharacterVarieties} If $\ell$ is a weighted oriented non-separating loop of weight not equal to $\pi$ modulo $2\pi$, then, the bending map $B_M\colon X_{\ell} \to \rchi \times \rchi$ is a proper mapping. (\Cref{GeneuuinelyProperCase}.) \end{thm} \section{Acknowledgements} The author is supported by the Grant-in-Aid for Scientific Research (20K03610). \section{Preliminaries} \subsection{Bending deformation}\Label{sBendingDeformation} (\cite{Epstein-Marden-87}.) Thurston discovered that the boundary of the convex core of a hyperbolic-three manifold is a hyperbolic surface bent along a measured lamination (\cite{Thurston-78}). More generally, one can bend hyperbolic a surface along an arbitrarily measured lamination and obtain a holonomy representation from the surface fundamental group into $\mathrm{PSL}_2\mathbb{C}$ as follows. We shall first see being along a loop. Let $\tau$ be a hyperbolic structure on $S$, and let $\ell$ be a geodesic loop on $\tau$ with weight $w \geq 0$. The union $\tilde{\ell}$ of all lifts of $\ell$ to the universal cover $\H^2$ of $\tau$ is a set of disjoint geodesics, each with weight $w$, and it is invariant under the deck transformation. We call the union $\tilde\ell$ the {\sf total lift} of $\ell$. Put the universal cover $\H^2$ in the three-dimensional hyperbolic space $\H^3$ as a totally geodesic hyperbolic plane. Then, the deck formation of $\H^2$ isometrically extends to the action on $\H^3$, and we obtain a representation of $\rho_\tau\colon \pi_1(S) \to \mathrm{PSL}_2 \mathbb{C}$. Note that, as $S$ is oriented, the orientation of the universal cover $\H^2$ determines a normal direction of the plane. Then we can bend $\H^2$ along every geodesic $\alpha$ of $\tilde{\ell}$ by angle $w$ so that the normal direction is in the exterior. Thus we obtain a bending map $\beta\colon \H^2 \to \H^3$, which is totally geodesic on every complement of $\H^2 \setminus \tilde{\ell}$. The map $\beta$ is unique up to an orientation-preserving isometry of $\H^3$. Moreover, $\beta$ is equivariant by its holonomy representation $\rho\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$. This $\rho$ is called a bending deformation of $\rho_\tau$. If $C_1, C_2$ are components of $\H^2 \setminus \tilde\ell$ such that $C_1, C_2$ are adjacent along a geodesic $\alpha$ of $\tilde\ell$. Let $G_1$ and $G_2$ be the subgroups of $\pi_1(S)$ which preserve $C_1$ and $C_2$, respectively. If $\beta$ is normalized so that $\beta_\tau = \beta$ on $C_1$, then the restriction of $\beta$ to $G_2$ is the conjugation of the restriction of $\rho_\tau$ to $G_2$ by the elliptic isometry with the axis $\alpha$ by angle $w$. More generally, given an arbitrary measured lamination $L$ on $\tau$, we can take a sequence of weighted loops $\ell_i$ converging to $L$ as $i \to \infty$. For each $i$, let $\rho_i\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ be the bending deformation of $\rho_\tau$ along $\ell_i$. Then $\rho_i$ converges to a representation $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ as $i \to \infty$ if $\rho_i$ are appropriately normalized by $\mathrm{PSL}_2\mathbb{C}$. This limit is the bending deformation of $\rho_\tau$ along $L$, and it is unique up to conjugation by an element of $\mathrm{PSL}_2\mathbb{C}$. \subsection{Quasi-geodesics in the hyperbolic space} We first recall the definition of quasi-isometries. Let $(X, d_X), (Y, d_Y)$ be metric spaces, where $d_x, d_y$ be the distance functions. Then, for $P, Q > 0$, a mapping $f\colon X \to Y$ is a $(p, q)$-{\it quasiisometry} if, for all $x_1, x_2 \in X$, $$P^{-1} d_X(x_1, x_2) - Q < d_Y(f(x_1), f(x_2)) < P\, d_X(x_1, x_2) + Q.$$ In this section, we discuss certain conditions for a piecewise geodesic curve in $\H^3$ to be a quasi-geodesic. \subsubsection{Quasi-geodesics in $\H^3$} Let $c$ be a bi-infinite piecewise geodesic curve in $\H^3$. Let $s_i \,(j \in \mathbb{Z})$ be the maximal geodesic segments of $c$ indexed along $c$, so that $s_i$ and $s_{i +1}$ are adjacent geodesic segments for every $i \in \mathbb{Z}$ and $c = \cup_{i \in \mathbb{Z}} s_i$. \begin{lemma}\Label{AlmostGeodesicPieacewiseGeodesic} For every $\epsilon > 0$, there are $R > 0$ and $\delta > 0$, such that if $\operatorname{length} s_i > R$ for all $i \in \mathbb{Z}$ and the angle between arbitrary adjacent geodesic segment $s_i, s_{i+ 1}$ is at least $\pi - \delta$, then $c$ is a $(1 + \epsilon)$-bilipschitz embedding. \end{lemma} \begin{proof} This lemma follows from \cite[I.4.2.10]{CanaryEpsteinGreen84}. \end{proof} \begin{proposition}\Label{PiecewiseGeodesicCurve} If every $\epsilon > 0$ and $\epsilon' > 0$, there are $R > 0$ and $Q > 0$, such that if $\operatorname{length} s_i > R$ for all $i \in \mathbb{Z}$ and the angle between arbitrary every pair of adjacent geodesic segments is at least $\epsilon'$, then $c$ is an $(1 + \epsilon, Q)$-quasi-isometric embedding. \end{proposition} \proof For each $i \in \mathbb{Z}$, let $x_i$ be the common endpoint of $s_{i -1}$ and $s_i$, so that $x_i$ is a non-smooth point of $c$. Let $0 < r < R/ 2$. Let $x_i^-$ be the point on $s_{i - 1}$ such that $d(x_i^-, x_i) = r$. Let $x_i^+$ be the point on $s_i$ such that $d(x_i, x_i^+) = r$. Then, we replace two geodesic segments $[x_i^-, x_i] \cup [x_i, x_i^+]$ of $c$ with the single geodesic segment $[x_i^-, x_i^+]$. Let $c_r$ be the piecewise geodesic in $\H^3$ obtained from $c$ by applying this replacement for every $i \in \mathbb{Z}$. By basic hyperbolic geometry, the following holds. \begin{lemma}\Label{LargeTriangles} For every $\delta > 0$, if $r > 0$ is sufficiently large, then the angle at every non-smooth point of $c_r$ is more than $\pi - \delta$. \end{lemma} \begin{figure}[H] \begin{overpic}[scale=.03 ]{qwGeodesicCurve.jpg} \put(25 ,35 ){$x_i$} \put(14 , 14 ){$x_i^-$} \put( 36 , 20 ){$x_i^+$} \put( 68 , 39 ){$x_{i + 1}$} \put( 50 , 22 ){$x_{i+1}^-$} \put( 76 , 19 ){$x_{i+1}^+$} \end{overpic} \caption{} \end{figure} Then \Cref{AlmostGeodesicPieacewiseGeodesic} and \Cref{LargeTriangles} imply the proposition. \Qed{PiecewiseGeodesicCurve} \subsection{Complex analytic geometry} We recall some standard theorems about complex analytic sets. \begin{theorem}[Remmert-Stein; see for example, \cite{Fritzsche_Hans_02_HolomorphicFunactionsComplexManifolds}]\Label{RemmertStein} Let $U \subset \mathbb{C}^n$ be an open subset and let $A$ be an analytic subset in $U$. Let $Y$ be a closed analytic subset in $U \setminus A$ such that $\dim Y > \dim A$. Then the Euclidean closure of $Y$ in $U$ is an analytic subset. \end{theorem} \begin{theorem}[Removable Singularity Theorem; see for example \cite{Taylor02SeveralComplexVariables}, \S3.3.2]\Label{RemovableSingularity} Let $Y$ be an analytic set. Let $A$ be a closed subset of $Y$ contained in a proper subvariety of $Y$. Suppose that $f\colon Y \setminus A \to \mathbb{C}$ is an analytic function which is bounded in a small neighborhood of every point in $A$. Then $f$ continuously extends to an analytic function on $Y$. \end{theorem} \section{Bending Teichmüller spaces} Let $\mathcal{ML}$ be the space of measured laminations on $S$. Each pair $(\tau, L) \in \mathcal{T} \times \mathcal{ML}$ induces an equivariant pleated surface $\H^2 \to \H^3$, unique up to $\mathrm{PSL}_2\mathbb{C}$. Let $b \colon \mathcal{T} \times \mathcal{ML} \to \rchi$ be the holonomy map of the bending maps. \begin{theorem}\label{BendingTeich} Fix arbitrary $L \in \mathcal{ML}(S)$. Then the restriction $b$ to $\mathcal{T} \times \{L\}$ is a real-analytically embedding. Moreover, this embedding is proper if and only if $L$ contains no periodic leaf of weight $\pi$ modulo $2\pi$. \end{theorem} Let $b_L\colon \mathcal{T} \to \rchi$ denote the restriction of $b$ to $\mathcal{T} \times \{L\}$. \begin{proposition} $b_L$ is injective for all $L \in \mathcal{ML}$. \end{proposition} \begin{proof} Let $\tau_1, \tau_2 \in \mathcal{T}$. Suppose that $b_L \tau_1 = b_L \tau_2 \eqqcolon \rho$. Then, associated $\rho$-equivariant pleated surface $\beta_1, \beta_2\colon \H^2 \to \H^3$ coincide. Therefore, since the pleated surface determines the hyperbolic structures $\tau_1, \tau_2$, we see that $\tau_1 = \tau_2$. \end{proof} \begin{proposition} the injective map $b_L\colon \mathcal{T} \to \rchi$ is real-analytic. \end{proposition} \begin{proof}(cf. \cite{Kerckhoff85Earthquakes}.) We regard $\mathcal{T}$ as the Fricke space, i.e. the space of discrete faithful representations into $\mathrm{PSL}(2, \mathbb{R})$ up to conjugation by $\mathrm{PSL}_2\mathbb{R}$. Then, take a small open neighborhood $N$ of $\mathcal{T}$ in the smooth part of $\rchi$. If $L$ is a weighted multiloop, the bending map $b_L$ is holomorphic on $N$ as bending transforms the holonomy along a loop by some elliptic elements in a holomorphic manner. In general, pick a sequence of weighted multiloops $M_i$ converging to $L$. Then, the holomorphic maps $b_{L_i} \vert N$ converges uniformly to $b_L | N$ uniformly on compacts. Thus $b_L \vert N$ is holomorphic. Since $\mathcal{T}$ is a real-analytic submanifold of $N$ in $\rchi$, thus $b_L \vert \mathcal{T}$ is real-analytic. \end{proof} \section{Properness of the bending maps from the Teichmüller spaces} \begin{theorem}\Label{RealPropermess} Let $L \in \mathcal{ML}$. Then, the bending map $b_L\colon \mathcal{T} \to \rchi$ is proper if and only if $L$ contains no leaves of weight $\pi$ modulo $2\pi$. \end{theorem} First, we prove the sufficiency of the condition in Theorem \ref{RealPropermess}. \begin{lemma}\Label{LengthCoordinatesForL} Fix $L \in \mathcal{ML}$ such that every closed leaf of $L$ contains no leaves of weight $\pi$ modulo $2\pi$. Let $M$ be the (possibly empty) sublamination of $L$ consisting of the periodic leaves of $L$. Then, for all $\upsilon, R > 0$, there are finitely many loops $\ell_1, \dots, \ell_n$ on $S$ such that \begin{itemize} \item the lengths of $\ell_1, \dots, \ell_n$ form length coordinates of $\mathcal{T}$, and \item for each $i = 1, \dots, n$, \begin{itemize} \item the transversal measure $(L \setminus M) (\ell_i) < \upsilon$, and \item $\ell_i$ intersects at most one leaf $m$ of $M$, and the intersection number is at most two. \end{itemize} \end{itemize} \end{lemma} \begin{proof} For every $\delta > 0$, there is a {\sf pants decomposition} $P = P_\delta$ (i.e. a maximal multiloop) on $S$ consisting of \begin{itemize} \item the loops of $M$, \item loops which are disjoint form $L$, \item loops $\ell$ with $L(\ell) < \delta$ (so that $\ell$ is a good approximation of a minimal irrational sublamination of $L$). \end{itemize} By the third condition, if $Q$ is a component of $S \setminus P$, and $\alpha$ is an arc on $Q$ with endpoints on $\partial Q$, then there is an isotopy of $\alpha$ keeping its endpoints on $\partial Q$ such that $L(\alpha) < 3 \delta$. Therefore, if $\delta > 0$ is small enough, for each loop $m$ of $P$, we can take two loops $m_1, m_2$ such that \begin{itemize} \item $m_i$ intersects $m$ at a point or two, and it does not intersect any other loop of $P$, and \item $(L \setminus M) m_i < \upsilon$. \end{itemize} Then we obtain a desired set of loops by adding such two loops for all loops of $M$. (For length coordinates of $\mathcal{T}$, see \cite[Theorem 10.7]{FarbMarglit12} for example.)\end{proof} \proof[Proof of the sufficiently of \Cref{RealPropermess}] For $\epsilon > 0$, let $\ell_1, \dots, \ell_n$ be the set of loops given by \Cref{LengthCoordinatesForL}. Let $\tau_i$ be a sequence in $\mathcal{T}$ which leaves every compact. Then, for some $1 \leq k \leq n$, $\operatorname{length}_{\tau_i} \ell_k \to \infty$ as $i \to \infty$ up to a subsequence. \begin{claim} For every $\epsilon > 0$, if $\delta > 0$ is sufficiently small, then \begin{enumerate} \item if $L(\ell_k) < \delta$, then $\beta_i | \tilde{\ell}_k$ is a $( 1 + \epsilon)$-bilipschitz embedding for sufficiently large $i$, and \Label{iLoopsWithSmallTransversalMeasure} \item if $\ell_k$ intersects a loop $m$ of $M$, then $\beta_i | \tilde\ell_k$ is $(1 + \epsilon, q)$-quasi-isometric embedding for all sufficiently large $i$, where $q$ only depends on the weight of $m$. \Label{iLoopsInversctingPeriodicLeaves} \end{enumerate} \end{claim} \begin{proof} (\ref{iLoopsWithSmallTransversalMeasure}) See \cite[Lemma 5.3]{Baba-10}, which was proved based on \cite[I.4.2.10]{CanaryEpsteinGreen84}. (\ref{iLoopsInversctingPeriodicLeaves}) We straighten $\ell_k$ and $M$ on $\tau_i \in \mathcal{T}$. From \Cref{LengthCoordinatesForL}, $\ell$ intersects only one loop $m$ of $M$, and their intersection number is one or two. We thus assume that $\ell_k \cap m$ consists of two points $x_1, x_2$ --- the proof when the intersection number is one is similar. Then $x_1$ and $x_2$ decompose $\ell_k$ into 2 geodesic segments $a_1$ and $a_2$. Since $\operatorname{length}_{\tau_i} \ell_k \to \infty$, the lengths of $a_1$ and $a_2$ both goes to $\infty$ as well. Let $\tilde\ell_k$ be the geodesic in $\H^2$ obtained by lifting $\ell_k$ to the universal cover. Let $\tilde{a}_j$ be a lift of $a_j$ to $\tilde\ell_k$, and let $\tilde{x}_j$ and $\tilde{x}_{j + 1}$ be its endpoints. For every $\epsilon' > 0$, if $\upsilon > 0$, is sufficiently small, then $\beta_i(\tilde{a}_j)$ is $\epsilon'$-close to the geodesic segment $[\beta_i x_j, \beta_i x_{j + 1}]$ connecting its endpoints $\beta_i x_j$ and $\beta_i x_{j + 1}$ in the Hausdorff metric. Since every periodic leaf of $L$ has weight not equal to $\pi$ modulo $2\pi$, there is $\omega > 0$ such that, for every periodic leaf $\ell$ of $L$, the distance from the weight of $\ell$ to the nearest odd multiple of $\pi$ is at least $\omega$. Therefore, if $\delta > 0$ is sufficiently small, then the angle between $[\beta_i x_j, \beta_i x_{j + 1}]$ and $[\beta_i x_{j -1}, \beta_i x_j]$ at $x_j$ is at least $\omega/2$. Let $c_i$ be the piecewise geodesic in $\H^3$ which is a union of the geodesic segments $[\beta_i x_j, \beta_i x_{j + 1}]$ over all lifts $\tilde{a}_1, \tilde{a}_2$ of $a_1, a_2$ to $\tilde\ell_k$. Then $c_i$ is $\epsilon'$-hausdorff close to $\beta_i \tilde\ell_k$. Therefore, by \Cref{PiecewiseGeodesicCurve}, we see that $c_i$ is a $(\epsilon, 1 + q)$-quasigeodesic. \end{proof} By this claim, for large $i$, the holonomy of $b_L \tau_i$ along $\ell_k$ is hyperbolic and its translation length diverges to $\infty$ as $i \to \infty$. Thus $b_L(\tau_i)$ leaves every compact in $\rchi$. Thus we have proven the properness. \Qed{RealPropermess \section{Characterization of non-properness} In this section, we explicitly describe how $b_L\colon \mathcal{T} \to \rchi$ is non-proper when the condition in \Cref{RealPropermess} fails. Let $L$ be a measured lamination on $S$. Let $m_1, \dots, m_p$ be the periodic leaves of $L$ which have weight $\pi$ modulo $2\pi$. Then, set $M = m_1 \sqcup \dots \sqcup m_p$. Pick any pants decomposition $P$ of $S$ which contains $m_1, \dots, m_p$. Consider the Fenchel-Nielsen coordinates of $\mathcal{T}$ associated with $P$. Recall that its length coordinates take values in $\mathbb{R}_{>0}$ and its twist coordinates in $\mathbb{R}$. \begin{theorem}\Label{NonpropernessOfBendingTeichmullerSpaces} Let $\tau_i$ be a sequence $\mathcal{T}$ which leaves every compact. Then $b_L(\tau_i)$ converges in $\rchi$ if and only if \begin{itemize} \item $\operatorname{length}_{\tau_i} m_j \to 0$ for some $j \in \{1, \dots, p\}$ as $i \to \infty$ ({\it pinched}) , and \item the Fenchel-Nielsen coordinates of $\tau_i$ w.r.t. $P$ converge in their parameter spaces as $i \to \infty$, except that the length parameters of the pinched loops go to zero. \end{itemize} \end{theorem} We immediately have \begin{corollary} The image sequence $b_L (\tau_i)$ is bounded in $\rchi$ if and only if \begin{itemize} \item $\operatorname{length}_{\tau_i} m_j \to 0$ as $i \to \infty$ for, at least, one $j \in \{1, \dots, p\}$, and \item the Fenchel-Nielsen coordinates of $\tau_i$ w.r.t. $P$ are bounded in their parameter spaces as $i \to \infty$, except that the length parameters of the pinched loops (but including the twisting parameters of the pinched loops). \end{itemize} \end{corollary} \proof[Proof of Theorem \ref{NonpropernessOfBendingTeichmullerSpaces}] Let $F$ be a component of $S \setminus M$. Then $b_L (\tau_i) | F$ converges in $\rchi(F)$ if and only if $\tau_i | F \coloneqq \tau_i \vert \pi_1(F)$ converges. Let $E$ and $F$ be adjacent components of $\tilde{S} \setminus \tilde{M}$. Let $\tilde{m}$ be the component of $\tilde{M}$ separating $E$ and $F$, and let $m$ be the loop of $M$ which lifts to $\tilde{m}$. Let $\Gamma_E$ and $\Gamma_F$ be the subgroups of $\pi_1(S)$ preserving $E$ and $F$, respectively. Then $E/\Gamma_E$ and $F / \Gamma_F$ are the components of $S\setminus M$; let $S_E = E/\Gamma_E$ and $S_F = F / \Gamma_F$. \begin{proposition}\Label{FenchelNielsenForPinchedLoop} Let $\tau_i$ be a sequence of $\mathcal{T}$, such that the restriction of $\tau_i$ to $S_E$ and to $S_F$ converge in their respective Teichmüller spaces as $i \to \infty$. Pick, for each $i$, a representative $\xi_i\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ of $b_L(\tau_i) \in \rchi$ so that $\xi_i | \Gamma_E$ converges. Then, the restriction $\xi_i | \Gamma_F$ converges if and only if the Fenchel-Nielsen twisting parameter along $m$ converges as $i \to \infty$. \end{proposition} \begin{proof} For each $i$, let $\beta_i \colon \H^2 \to \H^3$ be the bending map for $(\tau_i, L)$ equivariant via $\xi_i$, so that $\beta_i$ converges on $E$. Let $M_{\tau_i}$ be the geodesic representative of $M$ on $\tau_i$, and let $\tilde{M}_{\tau_i}$ be the total lift of $M_{\tau_i}$ on $\H^2$. Let $\tilde{m}_i$ be the component of $\tilde{M}_{\tau_i}$ corresponding to $\tilde{m}$. Let $F_i, E_i$ be the region on $\tilde{\tau}_i \setminus \tilde{M}_{\tau_i}$ corresponding to $F$ and $E$, respectively. For each $i$, pick a geodesic ray $r_i$ in $F_i$ starting from $\tilde{m}_i$ such that $r_i$ is orthogonal to $\tilde{m}_i$ and that $r_i$ is does not intersect the total lift $\tilde{L}$ of $L$. Let $v$ be the unite tangent vector of $r_i$ at the base point on $\tilde{m}_i$. Since the weight of $\tilde{m}$ is $\pi$, $d \beta_i (v)$ is tangent to $\beta_i E_i$ at a point of $\tilde{m}$ (\Cref{fTangentVectorAtPiBending}, Right). First suppose that $\lim_{i \to \infty} \operatorname{length}_{\tau_i} m$ is positive. Then $\xi_i \vert \Gamma_F$ converges if and only if $\beta_i(r)$ converges, which is equivalent to saying the twisting parameter of $m$ converges in $\mathbb{R}$ as $i \to \infty$. Next suppose that $\lim_{i \to \infty} \operatorname{length}_{\tau_i} m$ is zero. Then the holonomy of $m$ converges to a parabolic element not equal to the identity. Then $\xi_i \vert \Gamma_F$ converges, if and only if $\beta_i(r)$ converges to a geodesic starting from the parabolic fixed point. This is equivalent to saying the twisting parameter of $m$ converges as $i \to \infty$ (\Cref{fTangentVectorAtPiBending}, Left). \begin{figure}[H] \begin{overpic}[scale=.0 ] {NonporperConvergence} \put(39 ,21 ){\small \textcolor{red}{$d \beta_i v$}} \put(72 ,22 ){\small \textcolor{red}{$d \beta_i v$}} \end{overpic} \caption{}\label{fTangentVectorAtPiBending} \end{figure} \end{proof} The theorem follow from \Cref{FenchelNielsenForPinchedLoop} as follows: Suppose that $b_L(\tau_i)$ converges as $i \to \infty$. Then, the hyperbolic structure on every component of $S \setminus M$ must converge. Thus, for each loop $m$ of $M$, $\operatorname{length}_{\tau_i} m$ limits to a non-negative number. By \Cref{FenchelNielsenForPinchedLoop}, as $b_L(\tau_i)$ converges, the twist parameters along each loop of $M$ converges. Since $\tau_i$ leaves every compact, at least one loop of $M$ must be pinched as $i \to \infty$. Hence the two conditions hold. To prove the other direction, suppose that the lengths of some loops of $M$ limit to zero and all the other Fenchel-Nielsen coordinates with respect to $P$ converges in the parameter space as $i \to \infty$. Let $M'$ be the sub-multiloop of $M$ consisting of the loops whose lengths go to zero. Then, for each component $F$ of $S \setminus M'$, $b_L (\tau_i) \vert \pi_1(F)$ converges as $i \to \infty$. Therefore, by \Cref{FenchelNielsenForPinchedLoop}, $b_L(\tau_i)$ converges. This completes the proof. \Qed{NonpropernessOfBendingTeichmullerSpaces} \section{Framing of representations along a loop}\Label{sRepresentataionsFramedAlongALoop} In order to complexify the bending map of the Teichmüller space along a multiloop, we modify the $\mathrm{PSL}_2\mathbb{C}$-character variety of $S$ with respect to the multiloop. For simplicity, we first discuss the modification in the case that the bending lamination is a single loop. Let $\mathcal{R}$ be the space of representations $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ without any equivalence relation; then $\mathcal{R}$ is an affine algebraic variety. Let $\ell$ be an oriented simple closed curve on $S$. Then, pick an element $\alpha_\ell \in \pi_1(S)$ which represents $\ell$. Let $\rho\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ be a homomorphism. Pick an element $\alpha = \alpha_\ell \in \pi_1(S)$ which represents $\ell$. Let $(u_\alpha, v_\alpha)$ be an ordered pair of points on $\mathbb{C}{\rm P}^1$ which are fixed by $\alpha_\ell$. We can equivariantly extends $(u, v)$ to all representatives $\gamma$ of $\ell$ in $\pi_1(S)$ so that $\gamma$ fixes $u_\gamma$ and $v_\gamma$ in $\mathbb{C}{\rm P}^1$. Such an equivariant assignment $(u_\gamma, v_\gamma)$ of ordered fixed points of $\gamma$ is called a {\sf framing} of $\rho$ along $\ell$. We denote the equivariant framing by $\langle u, v \rangle$ generated by $(u, v)$. As it is determined by the initial choice $(u, v)$, by abuse of notation, we often denote it simply by $(u, v)$. Let $$R_\ell = \bigg\{ (\rho, u, v) \in \mathcal{R} \times (\mathbb{C}{\rm P}^1)^2 \,\bigg\vert\, \rho(u) = u, \rho(v) = v, u \neq v \bigg\}.$$ Then $R_\ell$ is a closed analytic subset of $\mathcal{R} \times (\mathbb{C}{\rm P}^1 \times \mathbb{C}{\rm P}^1 \setminus D)$, where $D$ is the diagonal $\{(z, z) \mid z \in \mathbb{C}{\rm P}^1\}$. Note that if $(\rho, u, v) \in R_\ell$, then the $\rho(\ell)$ can not be a parabolic element (but can be the identity). Clearly, $\mathrm{PSL}_2\mathbb{C}$ acts on $R_\ell$ by $\gamma \cdot (\rho, u, v) = (\gamma \rho \gamma^{-1}, \gamma u, \gamma v)$. The following lemma characterize its open orbits. \begin{lemma} For $(\rho, u, v) \in R_\ell$, the $\mathrm{PSL}_2\mathbb{C}$-orbit of $(\rho, u, v)$ is open in $\mathcal{R} \times (\mathbb{C}{\rm P}^1 \times \mathbb{C}{\rm P}^1 \setminus D)$ if and only if $\Im \rho$ fixes a point on $\mathbb{C}{\rm P}^1$ and it contains at least one non-trivial parabolic element. In such a case, $\Im \rho$ consists of only parabolic elements with a common fixed point $p$, and either $u$ or $v$ coincides with $p$. \end{lemma} We now assume that the loop $\ell$ has a weight $w$ in $\mathbb{R}_{> 0}$. Suppose, first, that weight of the oriented loop $\ell$ is not equal to $\pi$ modulo $2\pi$. Fix any complex number $w \in \mathbb{C}$ with $|w| > 1$. Then, given $(u, v) \in \mathbb{C}{\rm P}^1 \times \mathbb{C}{\rm P}^1$ with $u \neq w$, there is unique $\gamma_{u, v, w} \in \mathrm{PSL}_2\mathbb{C}$ which can be conjugated, by an element of $\mathrm{PSL}_2\mathbb{C}$, to the hyperbolic element $z \mapsto w z$ such that $u$ is the repelling fixed point and $v$ is the attracting fixed point of $\gamma_{u, v, w}$. Then, $(\rho, (u, v))$ corresponds to an element $(\rho, \gamma_{u, v, w})$ of $\mathcal{R} \times \mathrm{PSL}_2\mathbb{C}$. Thus $R_\ell \to \mathcal{R} \times \mathrm{PSL}_2\mathbb{C}$ is a biholomorphic map onto its image. Since $\mathrm{PSL}_2\mathbb{C} \cong \operatorname{SO}_3(\mathbb{C}) \subset \mathbb{C}^9$, we see that $R_\ell$ is biholomorphic a closed analytic set in a complex vector space of finite dimension. Thus $R_\ell$ is stein. The theory of categorical quotients of Stein manifolds has been developed analogously to GIT-quotients affine algebraic varieties (see \cite{Snow82}). We let $X_\ell$ be the categorical quotient (Stein quotient) $R_\ell\sslash \mathrm{PSL}_2\mathbb{C}$. Next suppose that $\ell$ has weight $\pi$ modulo $2\pi$. Then, let $\gamma_{u, v}$ be the elliptic element of angle $\pi$ with the axes connecting $u$ and $v$. Let $R_\ell/ \mathbb{Z}_2$ be the quotient of $R_\ell$ by the $\mathbb{Z}_2$-action which switches the ordering of the framing, namely, given by $(\rho, u, v) \mapsto (\rho, v, u)$. Consider the map $R_\ell/\mathbb{Z}_2 \to \mathcal{R} \times \mathrm{PSL}_2\mathbb{C}$ defined by $(\rho, u, v) \mapsto (\rho, \gamma_{u, v})$. Thus $R_\ell/ \mathbb{Z}_2$ is biholomorphic to a closed analytic set in $\mathcal{R} \times \mathrm{PSL}_2\mathbb{C}$. Similarly, we let $X_\ell$ be the categorical quotient $(R_\ell / \mathbb{Z}_2) \sslash \mathrm{PSL}_2\mathbb{C}$. \subsection{Coordinate rings}\Label{sCoordinateRing} Suppose, first, that weight of the oriented loop $\ell$ is not equal to $\pi$ modulo $2\pi$. Fix any complex number $w \in \mathbb{C}$ with $|w| > 1$. Then, given $(u, v) \in \mathbb{C}{\rm P}^1 \times \mathbb{C}{\rm P}^1$ with $u \neq w$, there is unique $\gamma_{u, v, w} \in \mathrm{PSL}_2\mathbb{C}$ which can be conjugated, by an element of $\mathrm{PSL}_2\mathbb{C}$, to the hyperbolic element $z \mapsto w z$ such that $u$ is the repelling fixed point and $v$ is the attracting fixed point of $\gamma_{u, v, w}$. Suppose, next, that $\ell$ has weight $\pi$ modulo $2\pi$. Then, let $\gamma_{u, v, w}$ be the elliptic element of angle $\pi$ with the axes connecting $u$ and $v$. Given $(\rho, u, v) \in R_\ell$, let $\hat\rho = \hat\rho_{u,v,w}$ be the homomorphism from the free product $\pi_1(S) \ast \mathbb{Z}$ to $\mathrm{PSL}_2\mathbb{C}$, such that every $\gamma \in \pi_1(S)$ maps to $\rho(\gamma)$ and $1 \in \mathbb{Z}$ maps to $\gamma_{u, v, w}$. Then, we clearly have the following. \begin{lemma} $(\rho_1, u_1, v_1)$ and $(\rho_2, u_2, v_2)$ are conjugate by an element of $\mathrm{PSL}_2\mathbb{C}$ if and only if $\hat{\rho}_1$ and $\hat\rho_2$ are conjugate. \end{lemma} Let $\hat\mathcal{R}$ be the space of representations $\pi_1(S) \times \mathbb{Z} \to \mathrm{PSL}_2\mathbb{C}$. Then $\hat\mathcal{R}$ is an affine algebraic variety. Suppose that the weight of $\ell$ is not equal to $\pi$ modulo $2\pi$. By the mapping $(\rho, u, v) \mapsto \hat\rho$, the analytic set $R_\ell$ biholomorphically maps onto a closed analytic subset $\hat\mathcal{R}_\ell$ of $\hat\mathcal{R}$. Thus $\hat\mathcal{R}_\ell$ is stein. This biholomorphism is equivariant with respect to the $\mathrm{PSL}_2\mathbb{C}$-action. Thus $R_\ell \sslash \mathrm{PSL}_2\mathbb{C}$ is biholomorphic to the subvariety $ \hat\mathcal{R}_\ell \sslash \mathrm{PSL}_2\mathbb{C}$. A similar identification holds in the case when $\ell$ has weight $\pi$ modulo $2\pi$. The stein space $R_\ell / \mathbb{Z}_2$ biholomorphically maps to its image, denoted by $\hat\mathcal{R}_\ell$, in $\hat\mathcal{R}$ by the mapping $(\rho, u, v) \mapsto \hat\rho$. Then $(R_\ell / \mathbb{Z}_2) \sslash \mathrm{PSL}_2\mathbb{C}$ is biholomorphic to the stein space $\hat\mathcal{R}_\ell\sslash \mathrm{PSL}_2\mathbb{C}$. Let $\gamma \in \pi_1(S) \ast \mathbb{Z}$. Let $\operatorname{tr}^2(\gamma)$ be the function on $R_\ell$ defined by $(\rho, u, v ) \mapsto \operatorname{tr}^2 \rho(\gamma).$ Then $\operatorname{tr}^2(\gamma)$ is a $\mathrm{PSL}_2\mathbb{C}$-equivariant analytic function on $R_\ell$. Then, by \cite[Corollary 2.3]{HeusenerPorti04}, such trace square functions form coordinates of the Stein quotient. \begin{proposition}\Label{CoordinateRing} There are finitely many elements $\gamma_1, \gamma_2, \dots \gamma_N$ in $\pi_1 S \ast \mathbb{Z}$ such that the map $R_\ell \to \mathbb{C}^N$ given by $\operatorname{tr}^2(\gamma_1), \dots, \operatorname{tr}^2(\gamma_N)$ induces $R_\ell\sslash \mathrm{PSL}_2\mathbb{C}$ into $\mathbb{C}^N$. Thus $\operatorname{tr}^2(\gamma_1), \dots, \operatorname{tr}^2(\gamma_N)$ form a coordinate ring. \end{proposition} \section{Representations framed along a multi-loop} \Label{sRepresentationsFramedAlongMultiloop} In \S \ref{sRepresentataionsFramedAlongALoop}, we defined the framed character variety framed along a weighted loop. In this section, we similarly define the character variety framed along a weighted multiloop. Let $m_1, \dots m_n$ be non-isotopic essential simple closed curves on $S$, and let $M$ be their union $m_1 \sqcup m_2 \sqcup \dots \sqcup m_n.$ Recall that $\mathcal{R}$ denotes the representation variety $\{ \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}\}$. For each $i = 1, \dots, n$, pick a representative $\alpha_i \in \pi_1(S)$ of $m_i$. Then, consider the space $R_M$ of $(\rho, (u_i, v_i)_{i = 1}^n) \in R \times (\mathbb{C}{\rm P}^1)^{2n}$ such that \begin{itemize} \item $\rho \in R$ is a homomorphism $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$, and \item $u_i, v_i \in \mathbb{C}{\rm P}^1$ are different fixed points of $\rho(\alpha_i)$ for $i = 1, \dots, n$. \end{itemize} Then $R_M$ be a closed subvariety of $R \times (\mathbb{C}{\rm P}^1 \times \mathbb{C}{\rm P}^1 \setminus D)^n$. Given $(\rho, (u_i, v_i)_{i = 1}^n) \in R_M$, we can equivariantly extend $(u_i, v_i)$ to the pairs of fixed points for all representatives of $m_1, \dots, m_n$ in $\pi_1(S)$. We call this extension a {\sf framing} of $\rho$ along the multiloop $M$. Let $p$ be the number of components $m_i$ of $M$, such that the weight of $m_i$ is a multiple of $\pi$ modulo $2\pi$. Without loss of generality, we can assume $m_1, \dots, m_p$ are the loops of $M$ with weight $\pi$ modulo $2\pi$. Then, $\mathbb{Z}_2^p$ acts biholomorphically on $R_M$ by switching the ordering of the fixed points of the framing along $m_1, \dots, m_p$. Note that this $\mathbb{Z}_2^p$-action has no fixed points in $R_M$. Fix a complex number $w \in \mathbb{C}$ with $\lvert w \rvert > 0$. Let $R_M \to \mathcal{R} \times (\mathrm{PSL}_2\mathbb{C})^m$ be the mapping defined by $(\rho, (u_i, v_i)_{i = 1}^n) \mapsto (\rho, (\gamma_{u_i, v_i, w})_{i = 1}^n)$, where $\gamma_{u_i, v_i, w}$ are as in \S \ref{sCoordinateRing}. This mapping takes $R_M/ \mathbb{Z}_2^p$ onto its image $\hat{\mathcal{R}}_M$ bioholomorphically. Thus $R_M/ \mathbb{Z}_2^p$ is a closed analytic set in a finite-dimensional complex vector space. As $R_M/ \mathbb{Z}_2^p$ is stein, we can take a categorical quotient. Let $X_M$ be the quotient $(R_M/ \mathbb{Z}_2^p)\sslash \mathrm{PSL}_2\mathbb{C}$. Thus $X_M$ is a stein space. The biholomorphic map $R_M/ \mathbb{Z}_2^p \to \hat\mathcal{R}_M$ is equivariant respecting the $\mathrm{PSL}_2\mathbb{C}$-action, $X_M$ is bihomotphic to $\hat\mathcal{R}_M\sslash \mathrm{PSL}_2\mathbb{C}$. \subsection{Coordinate rings of bending varieties for multiloops} Let $g_1, g_2, \dots, g_n$ be a minimal generating set of $\mathbb{F}^n$. Given any $(\rho, (u_i, v_i)) \in \mathcal{R}_M$, consider the representation $\pi_1(S) \times \mathbb{F}^n \to \mathrm{PSL}_2\mathbb{C}$ such that \begin{itemize} \item $\gamma \in \pi_1(S)$ maps to $\rho(\gamma)$, and \item each generator $g_i$ maps to $\gamma_{u_i, v_i, w}$. \end{itemize} This correspondence defines a mapping from $R_M$ to the space $\mathcal{R}_n$ of representations from $\pi_1(S) \times \mathbb{F}^n \to \mathrm{PSL}_2\mathbb{C}$. Similarly to the case of bending along a weighted loop, by \cite[Corollary 2.3]{HeusenerPorti04}, we have \begin{proposition} There are finitely many elements $\gamma_1, \gamma_2, \dots, \gamma_N$ of $\pi_1(S)$ corresponding to simple closed curves, such that $\operatorname{tr}^2(\gamma_1), \dots \operatorname{tr}^2 (\gamma_n)$ form a coordinate ring of $X_M$. \end{proposition} \section{Bending a surface group representation into $\mathrm{PSL}_2\mathbb{C}$}\Label{sComplexifiedBending} \subsection{A complexification of $\mathrm{PSL}_2\mathbb{C}$} \begin{proposition}[see \cite{Ziller10LieGroupsRepresentationTheory} Proposition 1.39 for example]\Label{ComplexifiedLieAlgebra} The complexification of the Lie algebra $\mathfrak{psl}_2\mathbb{C}$ is isomorphic to $\mathfrak{psl}_2\mathbb{C} \oplus (\mathfrak{psl}_2\mathbb{C})^\ast$ by the mapping given by $(u, 0) \mapsto (u, I u)$ and $(0, v) \mapsto (v, -I v)$, where $(\mathfrak{psl}_2\mathbb{C})^\ast$ is the complex conjugate of $\mathfrak{psl}_2\mathbb{C}$ and $I$ is the complex multiplication of $\mathfrak{psl}_2\mathbb{C}$. \end{proposition} We regard $\mathrm{PSL}_2\mathbb{C}$ as a real Lie group, and, by \Cref{ComplexifiedLieAlgebra}, we complexify $\mathrm{PSL}_2\mathbb{C}$ by \begin{gather*} \function{c}{\mathrm{PSL}_2\mathbb{C}}{ \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}}{Y}{(Y, Y^\ast)}. \\ \end{gather*} Then $c$ is holomorphic in the first factor and anti-holomorphic in the second factor. Thus $c$ is in particular a proper real-analytic embedding of $\mathrm{PSL}(2,\mathbb{C})$ into the complex Lie group $\mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$. \subsection{Bending framed representations}\Label{sBendingFramedRepresentataions} We first consider a bending framed representation in $X_\ell$ for an oriented weighted loop $\ell$ on $S$. Let $(\rho, u, v) \in X_\ell$, where $\rho\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ and $(u, v)$ is a pair of fixed points of $\rho(\alpha)$ for some $\alpha \in \pi_1(S)$ representing of $\ell$. Let $(\rho, \rho)$ denote the diagonal representation $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ given by $\gamma \mapsto (\rho(\gamma), \rho(\gamma))$. Recall that $(u, v)$ generates a $\rho$-equivariant farming $f$ along $\ell$. That is, for every element $\gamma \in \pi_1(S)$ corresponding to $\ell$, an ordered pair $(u_\gamma, v_\gamma)$ of fixed points of $\rho(\gamma)$ is assigned. Thus, there is an oriented geodesic $g_\gamma = [u_\gamma, v_\gamma]$ in $\H^3$ from $u_\gamma$ to $v_\gamma$. We will equivariantly bend $(\rho, \rho)$ along those geodesics. First, we shall appropriately define the direction of the bending. Pick a $\rho$-equivariant piecewise smooth surface $\Sigma\colon \tilde{S} \to \H^3$. Then, as $S$ is oriented, at a smooth point $x$ of $\Sigma$, there are a normal direction of $\Sigma$ and the hyperbolic plane tangent to $\Sigma$ at $x$. Let $\tilde\ell$ be the lift of $\ell$ to the universal cover $\tilde{S}$ invariant by $\alpha \in \pi_1(S)$. Then, homotope $\Sigma$ in $\H^3$ equivariantly and almost everywhere smoothly so that, $\tilde\ell$ is immersed into the geodesic $[u, v]$ possibly except at an $\alpha$-invariant discrete set $V$ of point on $\tilde{\ell}$ (Figure \ref{fHomotopeSigma}). In addition, after the homotopy, we can see that there is at least one segment $s$ of $\tilde\ell \setminus V$ whose direction matches the direction of the oriented geodesic $[u, v]$ under the immersion. Then, the orientation of the surface near the segment determines the direction of the bending, so that the normal direction is the exterior; see Figure \ref{fBendingAndNormalDirection}. \begin{figure}[H] \begin{overpic}[scale=.0 ] {BendingNormalDirection} \end{overpic} \caption{Bending by a small angle w.r.t. the normal direction}\Label{fBendingAndNormalDirection} \end{figure} Thus, we can transform $\delta(\rho) = (\rho, \rho)\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ by equivariantly bending $\rho$ in the fast factor by the axes $(u_\gamma, v_\gamma)$ by the angel equal to the weight $w(\ell)$ of $\ell$, and $\rho$ in the second factor by $- w(\ell)$, i.e. bend in the same manner except that the bending direction is opposite (\Cref{fBendingOppositely}). The bent representation $B_\ell (\rho, u, v)$ is well-defined up to conjugation by an element of $\mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$. We remark that, if $\rho\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ is Fuchsian, then the representation of $B_\ell (\rho, u, v)$ in the first factor $\rchi$ is the complex conjugate of that in the second factor. For an oriented weighted multiloop $M$, we can quite similarly define $B_M \colon X_M \to \rchi \times \rchi$. The details are left to the reader. \begin{figure} \begin{overpic}[scale=.04, ] {HomotopeSurfaceNew} \put(49.7 , 19.8 ){\textcolor{dblue}{\small $[u, v]$}} \put(48 ,30 ){\textcolor{red}{$s$}} \put(30, 30){$\H^3$} \put( 33.5, 3.5){$\tilde\ell$} \end{overpic} \caption{A schematic of $\Sigma$ after the homotopy.}\label{fHomotopeSigma} \end{figure} Recall that, given a pleated surface $\H^2 \to \H^3$, there is an equivariant system of totally geodesics hyperbolic planes in $\H^3$ which contain the image of the strata --- those planes are called {\sf support planes}. Although there is no pleated surface anymore in the case of the bending framed representations $(\rho, u_i, v_i)$ in $X_M$, there is instead a system of supporting hyperbolic three-spaces in $\H^3 \times \H^3$ as follows. Define $\sigma \colon \tilde{S} \to \H^3 \times \H^3$ by $x \mapsto (\Sigma(x), \Sigma(x))$. Then, clearly, $\sigma$ is a $(\rho, \rho)$-equivariant piecewise smooth surface, and $\sigma$ is contained in a totally geodesic hyperbolic three-space $H$ in $\H^3 \times \H^3$. Let $m$ be a component of $M$, and let $\tilde{m}$ be a lift of $m$ to $\tilde{S}$. Let $\alpha$ be the element of $\pi_1(S)$ preserves $\tilde{m}$ such that the free homotopy class of $\alpha$ is $m$. Since $\Sigma (\tilde{m})$ is contained in a geodesic in $\H^3$ given by the framing of $\alpha$, thus $\sigma(\tilde{m})$ is contained in the geodesic in $\H^3 \times \H^3$ given by the framing of $\alpha$. Therefore, we can bend the first surface $\Sigma$ along $\tilde{M}$ with respect to the normal direction $s$ by the weight of $M$, and the second factor $\sigma$ of the opposite normal direction $- s$, and obtain a bent surface $B_M (\sigma) \colon \tilde{S} \to \H^3 \times \H^3$ (Figure \ref{fBendingOppositely}). Then, for every component $P$ of $\tilde{S} \setminus \tilde{M}$, the restriction of $B_M(\sigma)$ to $P$ is contained in a unique totally geodesic hyperbolic 3-space $H_P$ in $\H^3 \times \H^3$. Hence, we obtain an equivariant collection of supporting hyperbolic 3-spaces $H_P$. We call it a {\sf support system of} bending $\eta$ along $M$. \begin{figure}[H] \begin{overpic}[scale=.04, ] {BendingInDifferentDirections} \put(26 , 26 ){$\H^3$} \put(70 , 27 ){$\H^3$} \end{overpic} \caption{Bending in opposite directions in different factors}\label{fBendingOppositely} \end{figure} \section{On injectivity of complexified bending maps}\Label{sInjectivity} In this section, we prove the injectivity of the complexified bending map when restricted to the complement of certain subvarieties. Let $M$ be an oriented weighted multiloop on $S$. Let $X_M^p$ be the subset of $X_M$ consisting of the framed representations $(\rho, u, v)$ such that $\operatorname{tr}^2 \rho(m) = 4$ for, at least, one loop $m$ of $M$. Let $X_M^r$ be the subset consisting of the framed representations $(\rho, u, v)$ such that, for some component $F$ of $S \setminus M$, the restriction of $\rho$ to $\pi_1(F)$ is reductive. Then $X_M^p$ and $X_M^r$ are analytic subsets of $X_M^p$. We prove that the injectivity hold in the complement of those analytic subsets. \begin{theorem}\Label{InjectivityAlomstEverywhere} Let $M$ be a weighted oriented multiloop on $S$. Then, the complexified bending map $B_M\colon X_M \to \rchi \times \rchi$ is injective on $X_M \setminus (X_M^p \cup X_M^r)$. \end{theorem} We first analyze the support systems of the complexified bending in the complement of those analytic subsets. \begin{lemma}\Label{UniqueSupportSpace} Let $\eta \in X_M \setminus (X^r_M \cup X_M^p)$. Fix a representative $\xi\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ of $B_M (\eta)$. Let $P$ be a component of $\tilde{S} \setminus \tilde{M}$. Then, the support space $H_P$ is the unique totally geodesic copy of $\H^3$ in $\H^3 \times \H^3$ which contains the axes of the boundary components of $P$. \end{lemma} \begin{proof} As $\eta \notin X_M^P$, the bending axes of the boundary components of $P$ are uniquely determined by $\xi$. Let $G_P$ be the subgroup of $\pi_1(S)$ preserving $P$. Then, as $\eta | G_P$ is not reductive, there is a unique totally geodesic copy of $\H^3$ in $\H^3 \times \H^3$, containing those bending axes. \end{proof} \Cref{UniqueSupportSpace} immediately imply the following. \begin{corollary}\Label{HolonomyDeterminesSupportSystem} Suppose that $\eta_1, \eta_2 \in X_M \setminus (X_M^p \cup X_M^r)$ satisfy $B_M (\eta_1) = B_M (\eta_2) \in \rchi \times \rchi$. Let $\xi\colon \pi_1(S) \to \mathrm{PSL}_2 \mathbb{C} \times \mathrm{PSL}_2 \mathbb{C}$ be a representative of $B_M (\eta_1) = B_M (\eta_2)$. Then, the $\xi$-equivariant supporting system of $B_M$ at $\eta_1$ equivariantly coincides with that at $\eta_2$. \end{corollary} \proof[Proof of Theorem \ref{InjectivityAlomstEverywhere}] Suppose that $\eta_1, \eta_2 \in X_M \setminus (X_M^p \cup X_M^r)$ map to the same representation in $\rchi \times \rchi$ by $B_M$. Then, let $\xi\colon \pi_1 (S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ be a representative of their image. By \Cref{HolonomyDeterminesSupportSystem}, the support system of the bending of $\eta_1$ equivariantly coincides with that of $\eta_2$. Therefore $\eta_1$ and $\eta_2$ are obtained by unbending $\xi$ exactly in the same manner; hence $\eta_1 = \eta_2$. \Qed{InjectivityAlomstEverywhere} \subsection{A non-injective example}\Label{sNonInjectiveExmaple} We shall see, in an example, the non-injectivity of a complexified bending map. Let $m$ be a separating loop on $S$. Let $F$ be a connected subsurface of $S$ bounded by $m$. Let $\rho\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ be a homomorphism such that $\rho \vert \pi_1 F$ is the trivial representation. Let $(u, v)$ be a framing along the loop $m$. \begin{lemma} $B_m(\rho, u, v)$ is independent on the framing $(u, v)$. \end{lemma} \begin{proof} Pick a loop $\ell$ on $S$ which essentially intersects $m$ into points (see Figure \ref{fNoninjectiveExmaple}). Let $\gamma$ be an element of $\pi_1(S)$ corresponding to $\ell$. Then homotope $\ell$ so that $\ell$ is a composition of a loop $\ell_1$ on $S \setminus F$ and a loop $\ell_2$ on $F$. Then $B_m \eta (\gamma_\ell) = B_M \eta (\gamma_{\ell_1})$ as $\rho \vert \pi_1(F)$ is trivial. Therefore $B_m \eta$ is independent on the framing $(u, v)$. \end{proof} \begin{figure}[H] \begin{overpic}[scale=.0 ] {NoninjectiveExample} \put( 63 ,25 ){\textcolor{black}{$F$}} \put( 32 ,27 ){\textcolor{black}{$m$}} \put( 45 ,21 ){\textcolor{orange}{$\ell$}} \end{overpic} \caption{}\Label{fNoninjectiveExmaple} \end{figure} \section{On properness of complexified bending maps} In this section, we prove the properness of the complexified bending map, as for the injectivity in \S\ref{sInjectivity}, in the complement of certain proper subvarieties. Similarly to $X_M^p$, we let $\rchi_M^p$ be the subvariety of $\rchi$ consisting of representations $\xi \colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ such that, for, at least, one loop $m$ of $M$ $\xi (m)$ is parabolic in each factor of $\mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$. Similarly to $X_M^r$, we let $\rchi_M^r$ be the subvariety of $\rchi$ such that, consisting of representations $\xi \colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ such that, for at least one component $F$ of $S \setminus M$, $\xi | F$ is reducible in each factor. \begin{theorem}\Label{PropernessAwayFromSubvariety} The restriction of $B_M$ to $X_M \setminus (X_M^p \cup X_M^r)$ is a proper mapping to $(\rchi \setminus (\rchi_M^p \cup \rchi_M^r))^2$. \end{theorem} \begin{proof} Let $\eta_i \in X_M \setminus (X_M^P \cup X_M^r)$ be a sequence such that $B_M(\eta_i)$ converges to a representation in $(\rchi \setminus (\rchi_M^p \cap \rchi_M^r))^2$. It suffices to show that $\eta_i$ also converges in $X_M \setminus (X_M^P \cup X_M^r)$. Pick a representative $\xi_i\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ of $B_N(\eta_i)$ so that $\xi_i$ converges to $\xi_\infty\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$, so that its equivalence class $[\xi_\infty]$ is in $(\rchi \setminus (\rchi_M^p \cap \rchi_M^r))^2$. Let $\{H_{i, P}\}$ be the $\xi_i$-equivariant support system of bending $\eta_i$ along $M$, where $P$ varies over all connected components of $\tilde{S} \setminus \tilde{M}$. Then, the restriction of $\xi_\infty$ to each component of $S \setminus M$ is strongly irreducible. Therefore, the $\xi_i$-equivariant support system $\{H_{i, P}\}$ converges to a unique support system $\{H_P\}$ of $\xi_\infty$. We also show that the bending axes also converge. \begin{claim} The $\xi_i$-equivariant axes system for bending $\eta_i$ in $\H^3 \times \H^3$ converges to an $\xi$-equivariant axis system as $i \to \infty$. \end{claim} \begin{proof} Let $\tilde{m}$ be a component of $\tilde{M}$, and let $\alpha \in \pi_1(S)$ be the element preserving $\tilde{m}$ such that the free homotopy class $\alpha$ is $m$. Let $P, Q$ be the adjacent components of $\tilde{S} \setminus \tilde{M}$ separated by $\tilde{m}$. Then $H_{i, P} \cap H_{i, Q}$ is the bending axis $g_{i, \tilde{m}}$ for $\tilde{m}$ in $\H^3 \times \H^3$, and $m$ is the axis of $\xi_i (\alpha)$. As $\xi_i(m)$ converges to a non-parabolic element $\xi(m)$, the axis $H_{i, P} \cap H_{i, Q}$ converges to the axis of $\xi(\alpha)$. \end{proof} Let $g_{i, \tilde{m}}$ be the axis system in $\H^3 \times \H^3$ of $\xi_i\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$. Note that $\eta_i$ is obtained by unbending $\xi_i$ along the axes $g_{i, \tilde{m}}$. By unbending the limit $\xi$ in $(\rchi \setminus (\rchi_M^p \cup \rchi_M^r))^2$ along the limit axis system, we obtain the limit of $\eta_i$. As $\xi$ is in $(\rchi \setminus (\rchi_M^p \cup \rchi_M^r))^2$, thus $\lim_{i \to \infty} \eta_i$ is contained in $X_M \setminus (X_M^p \cup X_M^r)$. \end{proof} \section{Analyticity of complexified bending maps} \begin{theorem}\Label{BendingIsAnalytic} For every weighted oriented multiloop $M$ on $S$, the bending map $B_M \colon X_M \to \rchi \times \rchi$ is analytic. \end{theorem} \proof Recall that $X_M^p$ is the subset of $X_M$ consisting of representations such that at least one loop of $M$ is parabolic and that $X_M^r$ is the subset of $X_M$ consisting of representations $\eta$ such that the restriction of $\eta$ to a component of $S \setminus M$ is reductive. We have shown that the restriction of $B_M$ to $X_M \setminus X_M^p \cup X_M^r$ is injective (\Cref{InjectivityAlomstEverywhere}). We first show \Cref{BendingIsAnalytic} for almost everywhere. \begin{lemma} The restriction of $B_M$ to $X_M \setminus (X_M^p \cup X_M^r)$ is analytic. \end{lemma} \begin{proof} Recall that $R_M$ is the space of representations framed along $M$, and that $R_M \sslash \mathrm{PSL}_2\mathbb{C} = X_M$. Let $R_M^p$ be the subset of $R_M$ consisting of framed representations, such that, at least, one loop of $M$ is parabolic or the identity. For an arbitrary framed representation $(\rho, u_i, v_i)$ in $R_M \setminus (R_M^p \cup R_M^r)$, take a $\mathrm{PSL}_2\mathbb{C}$-invariant open neighborhood $U$. Then, as it is contained in $R_M^r$, the stabilizer of every representation in $U$ is discrete. Thus, if $U$ is sufficiently small, $U$ is a product of $\mathrm{PSL}_2\mathbb{C}$ and a small open disk $D$. Then, we can identify the image of $U$ in $X_M$ with $D$ and take a holomorphic section $s\colon D \to U$. Pick any component of $Q$ of $\tilde{S} \setminus \tilde{M}$. By bending representations, keeping the restrictions to $\Gamma_Q$ unchanged, we obtain a holomorphic mapping $s(D) \to (R_M^p \cup R_M^r)^2$ which is a lift of the restriction of $B_M$ to $W$. The image in $\mathcal{R} \times \mathcal{R}$ consists of strongly irreducible representations in each factor. Since the quotient map from $\mathcal{R} \times \mathcal{R}$ to $\rchi \times \rchi$ is algebraic, we have the lemma. \end{proof} By the lemma, $X_M \setminus (X_M^p \cup X_M^r) \to (\rchi \setminus \rchi^p_M \cup \rchi_M^r) \times (\rchi \setminus \rchi^p_M \cup \rchi_M^r)$ is an injective analytic mapping. Therefore, by the removable singularity theorem (\Cref{RemovableSingularity}), we have the analyticity of $B_M \colon X_M \to \rchi \times \rchi$. \Qed{BendingIsAnalytic} \section{Complexification of bending Teichmüller spaces} Recall that $\Delta^\ast$ is the twisted diagonal $\{ (\rho, \rho^\ast) \mid \rho \in \rchi )\}$ and $\psi \colon \Delta^\ast \to \rchi$ is the projection given by $(\rho, \rho^\ast ) \mapsto \rho.$ By the choice of framings, there are $2^{\sharp M}$ ways to lift $\mathcal{T}$ to $X_M$, where $\sharp M$ denote the number of the loops of $M$. As the base surface $S$ is oriented, we let $\mathcal{T}$ be the Teichmüller space of $S$ is identified with a component of the real slice of $\rchi$. For an oriented weighted $M$ on $S$, there is a unique lift of $\mathcal{T}$ to $X_M$ such that, for each loop $m$ of $M$, the ordering of the fixed points of the framing along $m$ coincides with the orientation of $M$. Let $\iota_M\colon \mathcal{T} \to X_M$ be this real-analytic embedding. \begin{proposition}\Label{ComplexifyingTwistedDiagonal} Let $M$ be a weighted oriented multiloop on $S$. Then, the restriction of $B_M$ to $\mathcal{T}$ is a real-analytic embedding into the anti-diagonal $\Delta^\ast$ of $\rchi \times \rchi$, such that the restriction of $\psi \circ B_M \circ \iota_M$ to $\mathcal{T}$ coincides with $b_M$. \end{proposition} \begin{proof} By the definition of the complexified bending map $B_M$ (\S \ref{sBendingFramedRepresentataions}), clearly $B_M$ is $b_M \times b_M^\ast$ on $\mathcal{T}$. Then the proposition is immediate. The analyticity of the was already proven in \Cref{BendingIsAnalytic}. \end{proof} \section{Proper embeddings for bending along a non-separating loop} \begin{theorem}\Label{GeneuuinelyProperCase} Let $\ell$ be an oriented non-separating loop with weight not equal to $\pi$ modulo $2\pi$. Then, the complexified bending map $B_\ell\colon X_\ell \to \rchi \times \rchi$ is proper. \end{theorem} Pick $\theta \in (0, \pi)$. Let $$\mathcal{E}_\theta = \{(\gamma, e) \in \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C} \mid e \text{ is elliptic of rotation angle $\theta$} \}.$$ Note that, for every $(\gamma, e) \in \mathcal{E}_\theta$, $\operatorname{tr}^2 e$ is a fixed constant in $(0, 4)$ only depending on $\theta$. Then $\mathrm{PSL}_2\mathbb{C}$ acts on $\mathcal{E}$ by conjugating both parameters, and let $\mathcal{E}_\theta$ be the quotient $E_\theta \sslash \mathrm{PSL}_2\mathbb{C}$ by the strong orbit equivalence. Then \begin{lemma}\Label{RankTwoFreeGroup} The analytic mapping $E_\theta \sslash \mathrm{PSL}_2\mathbb{C} \to \mathbb{C}^2$ defined by $\phi\colon (\gamma, e) \mapsto (\operatorname{tr}^2 \gamma, \operatorname{tr}^2 \gamma e)$ is a proper mapping. \end{lemma} \begin{proof} The map $\mathrm{SL}_2\mathbb{C} \times \mathrm{SL}_2\mathbb{C} \sslash \mathrm{SL}_2\mathbb{C} \to \mathbb{C}^2$ given by $(\gamma, e) \mapsto ( \operatorname{tr} \gamma, \operatorname{tr} e, \operatorname{tr} \gamma e)$ is a biholomorphic map (see for example, \cite{Goldman09FrickeSpaces}). Let $(\alpha_i, e_i)$ be a sequence in $\mathcal{E}_\theta$ which leaves every compact as $i \to \infty$. Pick any lift $(\tilde\alpha_i, \tilde{e}_i) \in \mathrm{SL}_2\mathbb{C} \times \mathrm{SL}_2\mathbb{C} \sslash \mathrm{SL}_2\mathbb{C}$ of $(\alpha_i, e_i)$. Then $(\tilde\alpha_i, \tilde{e}_i)$ also leaves every compact as $i \to \infty$. Then, as $\operatorname{tr} e$ is fixed, at least one of $\operatorname{tr} \tilde\alpha_i$ and $\operatorname{tr} \tilde\alpha_i \tilde{e}_i$ diverges to $\infty$, up to a subsequence. Since $\operatorname{tr} \tilde{e}_i$ is a fixed non-zero constant, by $\operatorname{tr} \tilde\alpha_i \tilde{e}_i + \operatorname{tr} \tilde\alpha_i \tilde{e}^{-1}_i = \operatorname{tr} \tilde\alpha_i \operatorname{tr} \tilde{e}_i$, the image $\phi (\alpha_i, e_i)$ leaves every compact in $\mathbb{C}^2$ as $i \to \infty$. \end{proof} Pick a generating set $\{\gamma_1, \dots, \gamma_n\}$ of $\pi_1(S)$ such that the free homotopy class $[\gamma_i]$ of $\gamma_i$ intersects $\ell$ exactly at once for each $i = 1, \dots, n$. Let $\eta_i = [\rho_i, u_i, v_i] \in X_\ell$ be a sequence which leaves every compact. Let $w(\ell)$ denote the weight of $\ell$, and let $e_i \in \mathrm{PSL}_2\mathbb{C}$ be the elliptic element by angle $w(\ell)$ along the geodesic from $u_i$ to $v_i$. Then we can normalize $(\rho_i, u_i, v_i)$, by an element of $\mathrm{PSL}_2\mathbb{C}$, so that $e_i \in \mathrm{PSL}_2\mathbb{C}$ is independent on $i$. Let $e$ be the independent elliptic element in $\mathrm{PSL}_2\mathbb{C}$. As $\eta_i$ leaves every compact and $\gamma_1, \dots, \gamma_n $ form a generating set of $\pi_1(S)$, then there is $k \in \{1, \dots, n\}$ such that $\rho_i (\gamma_k)$ leaves every compact. Then, since $\gamma_k$ intersect $\ell$ exactly at once, by the properness of Lemma \ref{RankTwoFreeGroup}, the image $B_\ell (\eta_i) \gamma_k$ also leaves every compact as $i \to \infty$. This immediately implies the properness of $B_\ell$. \section{Analyticity of the images of complexified bending maps} As before, let $M$ be an oriented weighted multiloop on $S$, and let $m_1, \dots, m_n$ denote the loops of $M$. Let $\tilde{M}$ be the total lift $M$. We consider the following set of assignments, which generalize a support system defined in \S \ref{sBendingFramedRepresentataions}. \begin{itemize} \item For every component $C$ of $\tilde{S} \setminus \tilde{M}$, we assign either a totally geodesic copy of $\H^3$ in $\H^3 \times \H^3$ or a point on its Furstenberg boundary $\mathbb{C}{\rm P}^1 \times \mathbb{C}{\rm P}^1$, denoted by $H_C$, and \item for every component $\tilde{m}$ of $\tilde{M}$, we assign a geodesic in $\H^3 \times \H^3$ or a point in the Furstenberg boundary, denoted by $\alpha_{\tilde{m}}$, \end{itemize} which satisfy the following conditions: If $C$ and $D$ are adjacent components of $\tilde{S} \setminus \tilde{M}$ separated by a component $\tilde{m}$ of $\tilde{M}$, then, letting $w$ be the weight of $\tilde{m}$, \begin{itemize} \item if $H_C$ and $H_D$ are both a copy of $\H^3$, then, either \begin{itemize} \item $a_{\tilde{m}}$ is a geodesic, and $H_C$ and $ H_D$ intersects $a_{\tilde{m}}$ at angle $w$, or \item $w$ is $\pi$ modulo $2\pi$, and $H_C$ and $H_D$ share an ideal point; \end{itemize} \item if $H_C$ is a copy of $\H^3$ and $H_D$ is an ideal point, then $H_D$ is contained in the ideal boundary of $H_C$, and $a_{\tilde{m}}$ is the point $H_D$; \item if $H_C$ and $H_D$ are both a point on the Furstenberg boundary, then $H_C = H_D = a_{\tilde{m}}$. \end{itemize} We the set of such assignments $\{H_C, \alpha_{\tilde{m}}\}_{C, \tilde{m}}$ a {\sf degenerate support system} If at least one component of $\tilde{M}$ corresponds to a point in the Furstenberg boundary. Similarly to a (non-degenerate) bending system, we consider equivariant systems: For a component $C$ of $\tilde{S} \setminus \tilde{M}$, let $G_C$ be the subgroup of $\pi_1(S)$ preserving $C$; similarly, for a component $\tilde{m}$ of $\tilde{M}$, let $\alpha_m$ be the element of $\pi_1(S)$ preserving $\tilde{m}$ and representing a loop of $M$ (which lifts to $\tilde{m}$). Suppose that there is a representation $\xi\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ and a bending system $\{H_C, \alpha_m\}$ such that, for every component $C$ of $\tilde{S} \setminus \tilde{M}$, $~G_C$ preserves $H_C$, and for every component $\tilde{m}$ of $\tilde{M}$, $~\alpha_{\tilde{m}}$ preserves $a_{\tilde{m}}$; then we say that the degenerate bending system $\{H_C, \alpha_m\}$ is {\sf $\xi$-equivariant}. Equivalently, we say that {\sf the representation $\xi$ is supported by the bending system} $\{H_C, \alpha_m\}$. Note that, given a $\xi$-equivariant bending system, if a loop $m$ corresponds to an ideal point, then the holonomy of $m$ must be parabolic (possibly the identity). Let $\mathsf{R}_M^d$ be the subset of $\mathcal{R} \times \mathcal{R}$ consisting of all representations $\xi\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ such that there is an $\xi$-equivariant degenerate bending system. Let $\SS$ be the set of all degenerate bending systems supporting, at least, one representation $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$. One can show that $\mathsf{R}_M^d$ is closed and invariant under $\mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$. Let $\mathsf{X}_M^d$ be the image of $\mathsf{R}_M^d$ under the GIT-quotient $\mathcal{R} \times \mathcal{R} \to \rchi \times \rchi$. \begin{proposition}\Label{dimensionOfSubvariety} $\mathsf{X}_M^d$ is an analytic subset of $\rchi \times \rchi$, and its dimension is strictly smaller than the dimension of $X_M$. \end{proposition} \begin{proof} Let $\SS_1$ be the set of degenerate bending systems $\{H_C, a_{\tilde{m}}\}$ in $\SS$ such that, for all loops $m$ of $M$, ~~$\alpha_m$ is a point in the Furstenberg boundary. More generally, for $i = 1, \dots, n$, let $\SS_i$ be the set of all degenerate bending systems such that $m_k$ corresponds to a boundary point for all $k = 1, \dots, i$. Let ${\sf R}_M^{\SS_i}$ be the set of all representations $\pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ supported by a bending system in $\SS_i$. Then, by induction on $i$, we can show that ${\sf R}_M^{\SS_i}$ is a closed analytic set by induction on $i$ using \Cref{RemmertStein}. Therefore $R_M^d$ is also a close invariant subset of $\mathcal{R} \times \mathcal{R}$. Since $\mathcal{R} \times \mathcal{R} \to \rchi \times \rchi$ is semiproper, the image $\mathsf{X}_M^d = \mathsf{X}_M^{\SS_n}$ is analytic subset of $\rchi \times \rchi$. By the degeneration of the support systems, the dimension of $\mathsf{X}_M^d$ is less than the dimension of $B_M(X_M)$. \end{proof} \begin{proposition}\Label{FrontierOfIm} The frontier of $\Im B_M$ is contained in an analytic subvariety $\mathsf{X}_M^d$ of $\rchi \times \rchi$. \end{proposition} \proof[Proof of Proposition \ref{FrontierOfIm}] Let $[\xi] \in \rchi \times \rchi$ be a point in the frontier of $\Im B_M$. Then, there is a sequence $\eta_i = [\rho_i, u_{i, j}, v_{i, j}]$ in $X_M$ leaving every compact, such that $B_M(\eta_i)$ converging to $\xi$. We can take a representative $\xi_i\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ of $B_M(\eta_i)$, so that $\xi_i$ converges to $\xi$. Since $\eta_i$ diverges and $\xi_i$ converges, at least one bending axis must leave every compact in $\H^3 \times \H^3$ up to a subsequence. Hence, the support system of $B_M$ at $(\rho_i, u_{i, j}, v_{i, j})$ converges to a degenerate bending system, if necessary, by taking a further subsequence. Thus $\xi$ is contained in $\mathsf{X}_M^d$. \Qed{FrontierOfIm} \subsection{Properness and representations supported on parabolic bending systems} To understand the analyticity of the image of the complexified bending map $B_M$, we need a certain properness of $B_M$ stronger than the properness in Theorem \ref{PropernessAwayFromSubvariety}. \begin{theorem}\Label{Properness} Let $M$ be an oriented weighted multiloop. Then, the restriction of $B_M$ to $X_M \setminus B_M^{-1} (\mathsf{X}_M^d)$ is a proper mapping to $\rchi \times \rchi \setminus \mathsf{X}_M^d$. \end{theorem} \begin{proof} Let $\eta_i \in X_M \setminus B_M^{-1} (\mathsf{X}_M^d)$ be a sequence such that $B_M(\eta_i)$ converges to a representation in $\rchi \times \rchi \setminus \mathsf{X}_M^d$. It suffices to show that $\eta_i$ also converges in $X_M \setminus B_M^{-1} (\mathsf{X}_M^d)$. For each $i = 1, 2, \dots$, pick a representative $\xi_i\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$ of $B_N(\eta_i)$ so that $\xi_i$ converges to $\xi_\infty\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C}$ as $i \to \infty$; then it equivalence class $[\xi_\infty]$ is in $\rchi \times\rchi \setminus B_M^{-1} (\mathsf{X}_M^d)$. Let $\{H_{i, C}\}_C$ be the $\xi_i$-equivariant support system for bending $\eta_i$ along $M$, where $C$ varies over all connected components of $\tilde{S} \setminus \tilde{M}$. Since the limit of $B_M(\eta_i)$ is not in the subvariety $\mathsf{X}_M^d$, the $B_M$-images of the bending axes $(u_{i, j}, v_{i, j})$ are bounded in $\H^3 \times \H^3$ for each $j$. Let $g_{i, \tilde{m}}$ be this axis system in $\H^3 \times \H^3$ of $\xi_i\colon \pi_1(S) \to \mathrm{PSL}_2\mathbb{C} \times \mathrm{PSL}_2\mathbb{C}$. Therefore, up to a subsequence, the $\xi_i$-equivariant support system $\{H_{i, C}\}_C$ converges to a (non-degenerate) support system $\{H_C\}_C$ of $\xi_\infty$. The geodesic $g_{i, \tilde{m}}$ must converge to a geodesic $g_{\tilde{m}}$ in $\H^3 \times \H^3$ as $i \to \infty$ as $i \to \infty$. Note that $\eta_i$ is obtained by unbending $\xi_i$ along the equivariant axes $g_{i, \tilde{m}}$. Similarly, by unbending, the limit $\xi$ in $\rchi \times \rchi \setminus B_M^{-1} (\mathsf{X}_M^d)$ along the limit axis system, we obtain the limit of $\eta_i$. As $\xi$ is in $\rchi \times \rchi \setminus \mathsf{X}_M^d$, thus $\lim_{i \to \infty} \eta_i$ is contained in $X_M \setminus B_M^{-1} (\mathsf{X}_M^d)$. \end{proof} \begin{corollary}\Label{ImageIsAnalytic} The image of $B_M$ is an analytic subset in $\rchi \times \rchi \setminus \mathsf{X}_M^d$. Moreover, its (Euclidean) closure in $\rchi \times \rchi$ is a closed analytic set. \end{corollary} \proof[Proof of Corollary \ref{ImageIsAnalytic}] By Theorem \ref{Properness}, $B_M$ is proper on $X_M \setminus B_M^{-1} (\mathsf{X}_M^d)$. Thus, the $B_M$-image of $X_M \setminus B_M^{-1} (\mathsf{X}_M^d)$ is a closed analytic set in $\rchi \times \rchi \setminus \mathsf{X}_M^d$. Since the dimension of $\mathsf{X}_M^d$ is strictly smaller than the dimension of the image (\Cref{dimensionOfSubvariety}), by the Stein-Remmert Theorem (\Cref{RemmertStein}), we see that the closure of the image is a closed analytic subset of $\rchi \times \rchi$. \Qed{ImageIsAnalytic}
995b73b739b48be8fe54eff1946b48c0dc6209f2
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Understanding the origin of the small, positive value of dark energy density measured at present \cite{Planck:2018vyg} is one of the most challenging open problems in fundamental physics. One could hope that splitting the problem into two parts might help in seeking for its solution, but this is not quite the case. Indeed, on the one side one should understand how to embed a positive cosmological constant, or more generally a positive background energy density, into a consistent UV complete theory of quantum gravity. On the other side, one should understand the precise details of the supersymmetry breaking mechanism, which necessarily occurs when the background energy is positive, but it can also occur more generally. Both of these problems are challenging in themselves. Effective field theories are the typical framework in which to perform such investigations. However, the presence of dynamical gravity in the setup might change the standard paradigm according to which these theories are constructed, based on a genuinely wilsonian approach. That this is indeed the case is the central idea underlying the swampland program \cite{Palti:2019pca,vanBeest:2021lhn}, which collects a number of conjectures that are supposed to encode essential features of quantum gravity. Following a purely bottom-up perspective, one should thus assume swampland conjectures as actual consistency criteria (or perhaps even principles) of quantum gravity and check whether or not they are satisfied in any given effective theory. At present, it is fair to say that not all of the swampland conjectures share the same level of rigor and accuracy. For example, the absence of global symmetries \cite{Banks:1988yz} or the weak gravity conjecture \cite{Arkani-Hamed:2006emk} are widely believed to be established facts of quantum gravity, as they have been tested extensively through the years; more recent conjectures, such that the one forbidding de Sitter vacua \cite{Obied:2018sgi} and its various refinements, are instead still under debate. Nevertheless, there is evidence that all of the swampland conjectures should be connected to one another to form some sort of web. This implies that, even if a precise statement on the fate of de Sitter vacua in quantum gravity might not yet be known, some piece of information should be present in others, possibly more established, conjectures. This line of reasoning has been followed by \cite{Cribiori:2020use,DallAgata:2021nnr}, where it is shown that, under certain assumptions, de Sitter vacua in extended supergravity are in tension with the magnetic weak gravity conjecture. The assumptions are the presence of an unbroken abelian gauge group (needed to apply the weak gravity conjecture), and a vanishing gravitino mass on the vacuum.\footnote{As in \cite{Cribiori:2020use,DallAgata:2021nnr}, here we always mean Lagrangian mass.} In those setups in which the argument of \cite{Cribiori:2020use,DallAgata:2021nnr} applies, any known version of the de Sitter conjecture seems thus to be redundant, since the fate of de Sitter critical points is already dictated by the weak gravity conjecture. This material is reviewed in section \ref{sec_WGCvsdS}. Given that the interplay between the weak gravity conjecture and a vanishing gravitino mass has an impact on the fate of de Sitter critical points, one could wonder whether some piece of information about quantum gravity is actually encoded into the gravitino mass itself. Indeed, the gravitino is the superpartner of the graviton and it is thus expected to be related to (quantum) gravity. Furthermore, in a (quasi)-flat background, similar to the one we are living in at present, the gravitino mass is a good estimation of the supersymmetry breaking scale. Whether or not quantum gravity can say something non-trivial in its respect is thus of clear phenomenological interest. This motivated \cite{Cribiori:2021gbf,Castellano:2021yye} to propose a new swampland conjecture, stating that the limit of vanishing gravitino mass corresponds to a breakdown of the effective description. This material is reviewed in section \ref{sec_gravconj}. Finally, in section \ref{sec_fincomm} we comment on possible extensions of these works and ideas. We work in Planck units. \section{Weak gravity versus de Sitter} \label{sec_WGCvsdS} In this section, we review the general argument of \cite{Cribiori:2020use,DallAgata:2021nnr} showing that de Sitter critical points of extended supergravity with vanishing gravitino mass and with an unbroken abelian factor are in tension with the weak gravity conjecture. As discussed at the end of the section, this excludes almost all known examples in the literature (notably, \cite{DallAgata:2012plb} found an unstable de Sitter vacuum with massive gravitini and thus the argument here reviewed does not apply). \subsection{A weak gravity constraint on de Sitter} \label{arg} Any effective field theory is characterised by at least two energy scales, namely an IR cutoff, $\Lambda_{IR}$, and a UV cutoff, $\Lambda_{UV}$. It natural to ask for the existence of an hierarchy between them, \begin{equation} \label{natcond} \Lambda_{IR} \ll \Lambda_{UV}, \end{equation} otherwise there would be almost no room for the theory to live in. The question is then what these two scales are. In a de Sitter space, there is a natural notion of IR cutoff given by the Hubble scale \begin{equation} \label{LIRH} \Lambda_{IR} \sim H, \end{equation} since a distance of order $1/H$ is the longest length that can be measured. The choice of $\Lambda_{UV}$ is instead more subtle. Assuming gravity to behave classically in the effective description, a natural guess would be $\Lambda_{UV} \sim M_p$. However, one of the main lessons of the swampland program is that gravity is not genuinely wilsonian and thus the UV cutoff of a given effective theory can be lowered from its naive expectation by (quantum) gravity effects. A realisation of this scenario is the magnetic weak gravity conjecture \cite{Arkani-Hamed:2006emk}, which states that in an effective theory with gravity and with an abelian gauge coupling $g$, the UV cutoff is bounded by \begin{equation} \label{mWGC} \Lambda_{UV} \lesssim g M_p. \end{equation} For an effective theory on a positive background and with an abelian gauge coupling, the condition \eqref{natcond} translates thus into \begin{equation} \label{Hg} H \ll g M_P. \end{equation} Alternatively, as explained in \cite{Cribiori:2020use}, one can arrive at the same conclusion by remaining agnostic about \eqref{natcond} and \eqref{LIRH}, but by asking that corrections to the two-derivative effective action are suppressed, thus giving $H\ll \Lambda_{UV}$, and by invoking then the weak gravity conjecture. If the weak gravity conjecture holds, the relation \eqref{Hg} is a consistency condition for any effective theory on a positive energy background and with an abelian gauge coupling. Clearly, it can be violated if the vacuum energy of the theory is such that \begin{equation} \label{Hquant} H \sim g M_p, \end{equation} with no parameter which can be arbitrarily tuned entering the relation. The point is then whether or not this situation is indeed realised in concrete examples. As shown in \cite{Cribiori:2020use,DallAgata:2021nnr}, this is realised in de Sitter critical points (regardless of stability) of extended supergravity with a vanishing gravitino mass and with an unbroken abelian gauge group. In other words, \cite{Cribiori:2020use,DallAgata:2021nnr} showed that the Hubble scale in those extended supergravity models is quantised in terms of the UV cutoff given by the magnetic weak gravity conjecture. This implies that such models are not compatible with the condition \eqref{natcond}, or equivalently they are not protected against corrections, and thus cannot be consistent effective theories.\footnote{The same argument has been used in \cite{Cribiori:2020wch} to show that pure Fayet-Iliopoulos terms in $N=1$ supergravity are in the swampland, as it was already argued by \cite{Komargodski:2009pc} enforcing the absence of global symmetries. This is yet another confirmation of the fact that swampland conjectures are related to one another. } (They can still be consistent truncations.) This can also be seen as a manifestation of the Dine-Seiberg problem \cite{Dine:1985he}, in the sense that the vacuum of the theory lies outside the region in which corrections are under control. Before reviewing the analysis of \cite{Cribiori:2020use,DallAgata:2021nnr} showing that de Sitter critical points in $N=2$ supergravity with vanishing gravitino mass are of the type \eqref{Hquant}, let us mention possible loopholes in the argument above. First, it relies on the original formulation of the weak gravity conjecture in flat space. It might happen that corrections proportional to the spacetime curvature modify \eqref{mWGC} in such a way that the argument cannot be applied anymore. However, if the curvature is large, in order that we can safely assume gravity to be classical, it is reasonable to expect that corrections due to this effect are suppressed and can be neglected in first approximation. This seems to be in line with the analysis of \cite{Huang:2006hc} (see also \cite{Antoniadis:2020xso}). Another reason of concern is related to the condition \eqref{natcond}, which might not hold in an effective theory coupled to gravity, or at least not parametrically. In other words, it might be that gravity necessarily introduces an IR/UV mixing already at the level of the cutoff scales. This idea has been recently made precise in \cite{Castellano:2021mmx} (see \cite{Cohen:1998zx} for earlier work). It is a possibility we cannot exclude and whose effects on the argument would be interesting to investigate. However, as explained in \cite{Cribiori:2020use}, one can arrive at \eqref{Hg} even without starting from \eqref{natcond}, but just by requiring consistency of the two-derivatives effective action. \subsection{The argument in $N=2$ supergravity} \label{argN=2} In this section, we review the general argument of \cite{DallAgata:2021nnr} showing that de Sitter critical points of $N=2$ supergravity with a vanishing gravitino mass (or parametrically lighter than the Hubble scale) are of the type \eqref{Hquant}, and thus cannot be used as consistent effective theories, according to the weak gravity conjecture. The argument is rather general and extends the analysis of \cite{Cribiori:2020use}. Besides asking for a vanishing gravitino mass, it requires the presence of an unbroken abelian gauge group in the vacuum, in order for the weak gravity conjecture to apply, but it covers both stable and unstable critical points. We follow the conventions of \cite{Ceresole:1995ca,Andrianopoli:1996cm}. The sigma-trace of the gravitino mass matrix in $N=2$ supergravity is \begin{equation} S^x \equiv S_{AB} {(\sigma^{x})_C}^A \epsilon^{BC} = i \mathcal{P}^x_\Lambda L^\Lambda \end{equation} and it contributes to the scalar potential with a negative sign, $- 4S^x \bar S^x$. It is the only negative definite contribution to the vacuum energy and it vanishes if (sum over $x=1,2,3$ understood) \begin{equation} | \mathcal{P}^x_\Lambda L^\Lambda|^2=0. \end{equation} Under this assumption, the complete $N=2$ scalar potential, \begin{equation} \label{VN=2el} \mathcal{V} = g_{i \bar\jmath} k^i_\Lambda k^{\bar \jmath}_\Sigma \bar L^\Lambda L^\Sigma + 4 h_{uv} k^u_\Lambda k^v_\Sigma \bar L^\Lambda L^\Sigma + (U^{\Lambda \Sigma} - 3 \bar L^\Lambda L^\Sigma) \mathcal{P}^x_\Lambda \mathcal{P}^x_\Sigma, \end{equation} reduces to \begin{equation} \begin{aligned} \label{VN=2dS1} \mathcal{V}_{dS} =-\frac12 ({\rm Im}\mathcal{N}^{-1})^{\Lambda \Sigma} (\mathcal{P}^x_\Lambda \mathcal{P}^x_\Sigma + \mathcal{P}^0_\Lambda \mathcal{P}^0_\Sigma) + 4 h_{uv} k^u_\Lambda k^v_\Sigma \bar L^\Lambda L^\Sigma , \end{aligned} \end{equation} where we used that the matrix $U^{\Lambda \Sigma}$ is defined as $U^{\Lambda \Sigma} = -\frac12 ({\rm Im}\mathcal{N}^{-1})^{\Lambda \Sigma} - \bar L^\Lambda L^\Sigma$ and we employed the special geometry relation $g_{i \bar\jmath} k^i_\Lambda k^{\bar \jmath} \bar L^\Lambda L^\Sigma = - \frac12 ({\rm Im} \mathcal{N}^{-1})^{\Lambda \Sigma}\mathcal{P}^0_\Lambda \mathcal{P}^0_\Sigma$, which can be derived from $\mathcal{P}^0_\Lambda L^\Lambda=0$. Since the last term in \eqref{VN=2dS1} is positive definite, we can write \begin{equation} \mathcal{V}_{dS} \geq -\frac 12 {\rm Im}\mathcal{N}^{\Lambda \Sigma} (\mathcal{P}^x_\Lambda \mathcal{P}^x_\Sigma + \mathcal{P}^0_\Lambda \mathcal{P}^0_\Sigma), \end{equation} and we recall that the matrix $({\rm Im} \mathcal{N}^{-1})^{\Lambda \Sigma}$ is negative definite. Now, we want to recast this expression in terms of the gravitino charge and gauge coupling, in order to apply the weak gravity conjecture. We follow a manifestly symplectic-covariant procedure, similar to that of \cite{Cribiori:2022trc}, which was performed for supersymmetric anti-de Sitter vacua. We introduce a SU(2) charge matrix \begin{equation} 2 {{\mathcal{Q}_\Lambda}_A}^B = \mathcal{P}^0_\Lambda \delta_A^B + {(\sigma_x)_A}^B \mathcal{P}_\Lambda^x, \qquad s.t. \quad {\rm Tr}\, \mathcal{Q}_\Lambda \mathcal{Q}_\Sigma = \frac12 \left(\mathcal{P}^0_\Lambda \mathcal{P}^0_\Sigma + \mathcal{P}^x_\Lambda \mathcal{P}^x_\Sigma\right). \end{equation} By employing the projectors ${{P^\parallel}^\Lambda}_\Sigma$, ${{P^\perp}^\Lambda}_\Sigma$ defined as in \cite{Cribiori:2020use}, we can split $\mathcal{Q}_\Lambda = \mathcal{Q}_\Lambda^\parallel + \mathcal{Q}_\Lambda^\perp$, where \begin{equation} \label{Qparallel} {{\mathcal{Q}_\Lambda^\parallel}_A}^B = \Theta_\Lambda {q_A}^B, \qquad s.t. \quad {\rm Tr}\, Q^\parallel_\Lambda Q^\parallel_\Sigma = \Theta_\Lambda \Theta_\Sigma {\rm Tr}(q^2). \end{equation} Here, ${q_A}^B$ is the SU(2) charge entering the gravitino covariant derivative as \begin{equation} D_\mu \psi_{\nu\,A} = \dots+ i \tilde A_\mu {q_A}^B \psi_{\nu \, B}, \end{equation} where $\tilde A_\mu = \Theta_\Lambda A^\Lambda_\mu$ is the combination of vectors $A^\Lambda_\mu$ with coefficients $\Theta_\Lambda$ which is gauging the weak gravity U$(1)$ group. By canonically normalising the kinetic term of $\tilde A_\mu$, we can then read off the gauge coupling \begin{equation} \label{gcoup} g^2 = - \Theta_\Lambda( {\rm Im} \mathcal{N}^{-1})^{\Lambda \Sigma} \Theta_\Sigma. \end{equation} The vacuum energy is thus rewritten as (using projectors' orthogonality) \begin{equation} \begin{aligned} \mathcal{V}_{dS} &\geq - ({\rm Im}\mathcal{N}^{-1})^{\Lambda \Sigma} {\rm Tr} \, \mathcal{Q}_\Lambda \mathcal{Q}_\Sigma \\ &=- ({\rm Im}\mathcal{N}^{-1})^{\Lambda \Sigma} ({\rm Tr} \, \mathcal{Q}^\parallel_\Lambda \mathcal{Q}^\parallel_\Sigma +{\rm Tr} \, \mathcal{Q}^\perp_\Lambda \mathcal{Q}^\perp_\Sigma ) \\ &\geq - ({\rm Im}\mathcal{N}^{-1})^{\Lambda \Sigma} {\rm Tr} \, \mathcal{Q}^\parallel_\Lambda \mathcal{Q}^\parallel_\Sigma . \end{aligned} \end{equation} Employing \eqref{Qparallel} and \eqref{gcoup}, we get eventually \begin{equation} \mathcal{V}_{dS} \geq g^2 {\rm Tr} (q^2) \gtrsim {\rm Tr} (q^2) \Lambda^2_{UV}, \end{equation} where in the last step we enforced the weak gravity conjecture. These vacua are of the form \eqref{Hquant} and thus cannot be consistent effective field theory descriptions. Notice that we are assuming some form of charge quantisation for the eigenvalues of ${q_A}^B$, but the precise details are not relevant for sake of the argument. The analogous proof for $N=8$ de Sitter critical points can be found in \cite{DallAgata:2021nnr}. We see that asking for massless but charged gravitini on a positive energy background leads to an inconsistency according to the weak gravitino conjecture. This fact is also in agreement with the so called Festina Lente bound \cite{Montero:2019ekk,Montero:2021otb}, which proposes that $m^2\gtrsim \sqrt 6 g q H $ for every particle of mass $m$ and charge $q$. Thus, it rules out massless charged gravitini as well, albeit from a different perspective. Nevertheless, one expects all of the swampland considerations to be related to one another. \subsubsection{Example: stable de Sitter from U$(1)_R\times$SO$(2,1)$ gauging} Historically, the first examples of stable de Sitter vacua in $N=2$ supergravity have been proposed in \cite{Fre:2002pd}. One can check \cite{Cribiori:2020use} that the vacuum energy has precisely the form \eqref{Hquant}, but the gravitino mass vanishes at the critical point. Thus, the argument of the previous section applies and shows that those vacua are in tension with the weak gravity conjecture. As an illustrative example, below we review the simplest model of \cite{Fre:2002pd} from this perspective. The model has $n_V=3$ vector multiplets and no hyper multiplet. The $3+1$ vectors are gauging an SO$(2,1)\times$U$(1)_R$ isometry of the scalar manifold $\frac{{\rm SU}(1,1)}{{\rm U}(1)}\times \frac{{\rm SO}(2,2)}{{\rm SO}(2)\times {\rm SO}(2)}$. One can start from a basis with prepotential \begin{equation} \mathcal{F} = -\frac12 \frac{X^1\left(\left(X^2\right)^2 - \left(X^3\right)^2\right)}{X^0}. \end{equation} In such a symplectic frame, the generators of SO$(2,1)$ are \begin{equation} T_0 =\scalebox{.65}{ $ \left(\begin{array}{cccccccc} &&1&&&&&\\ &&&&&&-1&\\ \frac12&&&&&-1&&\\ &&&&&&&\\ &&&&&&-\frac12&\\ &&-\frac12&&&&&\\ &-\frac12&&&-1&&&\\ &&&&&&& \end{array} \right)$}, \quad T_1 =\scalebox{.65}{ $ \left(\begin{array}{cccccccc} &&-1&&&&&\\ &&&&&&1&\\ \frac12&&&&&1&&\\ &&&&&&&\\ &&&&&&-\frac12&\\ &&-\frac12&&&&&\\ &-\frac12&&&1&&&\\ &&&&&&& \end{array} \right)$}, \quad T_2 = \scalebox{.65}{ $\left(\begin{array}{cccccccc} -1&&&&&&&\\ &-1&&&&&&\\ &&&&&&&\\ &&&&&&&\\ &&&&1&&&\\ &&&&&1&&\\ &&&&&&&\\ &&&&&&& \end{array} \right),$} \end{equation} and we collect them into $T_\Lambda = (T_0, T_1, T_2, 0)$ for later convenience. When acting on $V^M=(X^\Lambda, F_\Lambda)$, the ${(T_\Lambda)^M}_N$ mix $X^\Lambda$ with $F_\Lambda$, i.e.~they generate so called non-perturbative symmetries, corresponding to gaugings which are not purely electric. To use the standard formula of the $N=2$ scalar potential \eqref{VN=2el}, we need to rotate the sections $V^M$ with an appropriate symplectic matrix, \begin{equation} V^M\to \tilde V^M = {S^M}_N V^N, \end{equation} where \begin{equation} {S^M}_N= \scalebox{.75}{ $\left(\begin{array}{cccccccc} \frac12&&&&&1&&\\ -\frac12&&&&&1&&\\ &&1&&&&&\\ &&&\cos \delta&&&&\sin \delta\\ &-\frac12&&&1&&&\\ &-\frac12&&&-1&&&\\ &&&&&&1&\\ &&&-\sin\delta&&&&\cos \delta\\ \end{array} \right)$}. \end{equation} Here, $\delta$ is a parameter defining the embedding of the U$(1)_R$ factor into Sp$(8,\mathbb{R})$ and it is historically known as de Roo-Wagemans angle \cite{deRoo:1985jh}. In the rotated basis the prepotential does not exist, but the new $X^\Lambda$ and $F_\Lambda$ are not mixed by the action of the SO$(2,1)$ generators. From this point on, we work in such basis for the symplectic sections, omitting the tilde for convenience. We now look at the scalar potential. Given that there are no hyper multiplets in the setup, the second term in the scalar potential \eqref{VN=2el} is vanishing, but the others are not. We analyse them separately. The last term (we denote it $\mathcal{V}_F$ below) is simpler since it is associated to the U$(1)_R$ gauging corresponding to a Fayet--Iliopoulos term. Indeed, we have a constant prepotential \begin{equation} \mathcal{P}^x_\Lambda= e_F \delta^{3x} \eta_{3\Lambda}, \end{equation} with charge $e_F$, giving rise to the contribution \begin{equation} \mathcal{V}_F = e_F^2 \frac{(\cos \delta + x^1 \sin \delta )^2 + (y^1)^2\sin^2\delta }{2y^1}, \end{equation} where we set $z^i = \frac{X^i}{X^0} = x^i-i y^i$. Next, we concentrate on the first term in \eqref{VN=2el} (we denote it $\mathcal{V}_D$ below). This is non-vanishing since it corresponds to the gauging of SO$(2,1)$. The special K\"ahler prepotentials can be found with the general formula \cite{Andrianopoli:1996cm}\footnote{We are using the symplectic metric $\Omega_{MN} = \left( \begin{array}{cc} 0&-1\\ 1&0\\ \end{array} \right). $} \begin{equation} \mathcal{P}^0_\Lambda = e^K \bar V^M \Omega_{MN} {(T_\Lambda)^N}_P V^P, \end{equation} and in turn the killing vectors are computed as \begin{equation} k^i_{\Lambda} = i g^{i\bar\jmath}\partial_{\bar \jmath} \mathcal{P}^0_\Lambda. \end{equation} One can check that the consistency conditions $L^\Lambda \mathcal{P}^0_\Lambda = 0 =k^i_\Lambda L^\Lambda$ are satisfied. The contribution to the scalar potential is then \begin{equation} \mathcal{V}_D = e_D^2 \frac{(x^3)^2 + (y^2)^2}{2y^1((y^2)^2-(y^3)^2)}, \end{equation} where we inserted a charge $e_D$ to keep track of the SO(2,1) gauging. The total scalar potential is the sum of these two contributions \begin{equation} \mathcal{V} = \mathcal{V}_F + \mathcal{V}_D. \end{equation} It has a stable de Sitter vacuum at \begin{equation} x^1 = - \frac{1}{\tan \delta},\qquad y^1 =\frac{e_D}{e_F \sin \delta},\qquad x^3 = 0, \qquad y^3 =0, \end{equation} with vacuum energy \begin{equation} \label{VexdS} \mathcal{V}_{dS} = e_D e_F \sin \delta. \end{equation} Stability is explicitly verified in \cite{Fre:2002pd}. Notice that the cosmological constant is strictly positive, since on the vacuum the K\"ahler potential is $K = - \log (4y^1 (y^2)^2) = -\log \left(\frac{4e_D^2 (y^2)^2}{\mathcal{V}_{dS}}\right)$. One can check that on the vacuum a subgroup U$(1)_R\times$U$(1)$ of the original gauge group is unbroken. Therefore, we can enforce the weak gravity conjecture with respect to the U$(1)_R$ factor. Furthermore, the gravitino mass is vanishing and thus the argument of section \ref{argN=2} applies. It remains only to canonically normalise the kinetic term of the U$(1)_R$ vector and correctly identify the gauge coupling and charge. In the language of the general argument given previously, we have \begin{equation} 2 {{\mathcal{Q}^\parallel_\Lambda}_A}^B = \left(0,0,0,e_F {(\sigma^3)_A}^B\right) \equiv 2 \Theta_\Lambda {q_A}^B, \end{equation} meaning \begin{equation} {q_A}^B = {(\sigma^3)_A}^B \mathrm{q},\qquad \Theta_\Lambda = \left(0,0,0,\frac{e_F}{2\mathrm{q}}\right),\qquad {\rm Tr}\,(q^2) = 2 \mathrm{q}^2, \end{equation} where $\mathrm{q}$ is the charge. The kinetic matrix on the vacuum is (in the properly rotated symplectic frame) \begin{equation} ({\rm Im}\mathcal{N}^{-1})^{\Lambda \Sigma} = -\sin \delta\,{\rm diag} \left( \frac{e_F}{e_D},\frac{e_F}{e_D},\frac{e_F}{e_D},\frac{e_D}{e_F}\right), \end{equation} and we thus find the gauge coupling \begin{equation} 4g^2 \mathrm{q}^2 = e_D e_F \sin \delta. \end{equation} Eventually, we see that the vacuum energy \eqref{VexdS} has precisely the form \eqref{Hquant}. If the weak gravity conjecture holds, these vacua are not protected against corrections and thus are not within the controlled region of the effective description. \section{The gravitino conjecture} \label{sec_gravconj} A crucial assumption in the discussion of the previous section is that the gravitino mass is vanishing (or very light with respect to the Hubble scale). It is then natural to wonder if the limit of parametrically small or even vanishing gravitino mass can be problematic for a given effective description more in general, regardless of the background. That this is indeed the case has been conjectured in \cite{Cribiori:2021gbf,Castellano:2021yye}, and it is the topic of the present section. We stress that we will be here concerned with the limit, while the argument of the previous section involved the actual evaluation of the gravitino mass at a specific (critical) point. Even if related, the two operations are in principle different. \subsection{The statement and its motivation} The gravitino conjecture \cite{Cribiori:2021gbf,Castellano:2021yye} states that the limit of vanishing gravitino mass, $m_{3/2}$, corresponds to a breakdown of the effective field theory description \begin{equation} m_{3/2}\to 0 \qquad \Rightarrow \qquad \text{swampland}, \end{equation} as it is associated to the emergence of an infinite tower of states becoming light in the same limit. Some motivations behind this statement and based on \cite{Cribiori:2020use,DallAgata:2021nnr} have already been reviewed in the previous section. Below, we would like to recall briefly some more. Clearly, for supersymmetric anti-de Sitter vacua, the statement is equivalent to the anti-de Sitter distance conjecture \cite{Lust:2019zwm} and thus, at least in this specific case, it shares the same motivation. However, the two conjectures crucially differ on other backgrounds and indeed they lead to differ predictions. Yet another motivation can be drawn from the idea of supersymmetric protection \cite{Palti:2020qlc}, which states that the superpotential of an $N=1$ theory cannot vanish, unless the theory is related in a specific way to a parent one with more supersymmetry. If the superpotential $W$ cannot vanish, the same applies to the gravitino mass, since in $N=1$ this is given by $m_{3/2}^2 = e^K W \bar W$. Instead, if the superpotential is exactly vanishing everywhere on the moduli space, the background is supersymmetric Minkowski, but this is not excluded by the conjecture, since the latter is really a statement about the limit (in the same way as the anti-de Sitter distance conjecture does not forbid supersymmetric Minkowski backgrounds). Let us notice that unitarity alone seems not to be enough to motivate the gravitino conjecture on a positive background. Indeed, unitarity bounds for the gravitino have been studied in \cite{Deser:2001pe} and one can clearly see that there is no non-trivial unitarity bound on the gravitino mass if the cosmological constant is positive. It thus seems that the arguments reviewed in the previous section and the Festina Lente bound are capturing some more information on quantum gravity on a positive background beyond unitarity. In a quasi-flat universe, the gravitino mass is a good approximation for the supersymmetry breaking scale, \begin{equation} M_{\text{susy}}^2 \simeq m_{3/2} M_P. \end{equation} The fact that supersymmetry has not been observed so far is thus very much compatible with the gravitino conjecture, which might point towards a scenario with supersymmetry breaking at high scale. This is naturally realised in string theory through a mechanism known as brane supersymmetry breaking \cite{Sugimoto:1999tx,Antoniadis:1999xk} (see \cite{Basile:2021vxh} for a recent review in a swampland perspective), in which the supersymmetry breaking scale is the string scale. Due to this fact, the effective descriptions of these models typically requires a non-linear realisation of supersymmetry in the low energy, which is not directly captured by the framework of \cite{Cribiori:2021gbf,Castellano:2021yye}. It would be interesting to extend the gravitino conjecture also to these setups. Several examples in which the conjectures is checked explicitly can be found in \cite{Cribiori:2020use,DallAgata:2021nnr}. Furthermore, the new string construction proposed in \cite{Coudarchet:2021qwc} seem also to be compatible with it, since it is argued that supersymmetry is unavoidably (and softly) broken in the closed string sector. Below, we discuss and review some new and old examples, and we summarise various results. For concreteness, we will assume that the mass of the states becoming light is related to the gravitino mass as (in Planck units) \begin{equation} \label{m32n} m_\text{tower} \sim m_{3/2}^n, \end{equation} with $n$ some model-dependent parameter. Clearly, this assumption might not be verified in general, but in the examples considered in \cite{Cribiori:2021gbf,Castellano:2021yye} does indeed hold. Furthermore, one can try to find bounds for $n$ or relate it to the parameters entering other swampland conjectures, as done in \cite{Castellano:2021yye}. It would be also interesting to check how the logarithmic corrections systematically proposed by \cite{Blumenhagen:2019vgj} can affect the analysis and the bounds on $n$. \subsection{$N=1$ models} As it is well-known, the structure of four-dimensional $N=1$ supergravity with chiral and vector multiplets is completely fixed by three ingredients: a real gauge invariant function $G(z,\bar z)$, a holomorphic gauge kinetic function $f_{ab}(z)$, and a choice of holomorphic Killing vectors $k_a^i(z)$ generating the analytic isometries of the scalar manifold that are gauged by the vectors. Let us focus on the first ingredient, since it is closely related to the gravitino mass. Indeed, $G(z,\bar z)$ is defined as (assuming $W \neq 0$) \begin{equation} G(z,\bar z) = K + \log W \bar W, \end{equation} where $K$ and $W$ are the K\"ahler potential and superpotential respectively. This expression stems from the known fact that in supergravity, contrary to global supersymmetry, $K$ and $W$ are not functions but sections. In particular, they both vary under K\"ahler transformations. This means that they are not physical quantities: any statement regarding $K$ and $W$ separately depends crucially on a specific choice of K\"ahler frame. Instead, the only actual physical quantity to be considered is their K\"ahler invariant combination, $G(z,\bar z)$. The gravitino mass is then \begin{equation} m_{3/2}^2 = e^G \end{equation} and it is indeed K\"ahler-invariant. We can give a geometric interpretation of the gravitino conjecture. The scalar manifold of $N=1$ supergravity is restricted by supersymmetry to be K\"ahler-Hodge (while in the global case it is just K\"ahler). This is a K\"ahler manifold $\mathcal{M}$ together with a holomorphic line bundle $\mathcal{L}\to \mathcal{M}$, whose first Chern class is equal to the cohomology class of the K\"ahler form of $\mathcal{M}$, namely $c_1(\mathcal{L}) = [\mathcal{K}]$. Given a hermitean metric $h(z,\bar z)$ on the fiber, the first Chern class is $c_1(\mathcal{L}) = \frac{i}{2\pi} \bar \partial \partial \log h$. Setting it equal to the K\"ahler form $\mathcal{K} = \frac{i}{2\pi} \bar \partial \partial K$, one learns that for a K\"ahler-Hodge manifold the fiber metric is the exponential of the K\"ahler potential, $h = e^K$. The gravitino conjecture can then be geometrically rephrased as the statement that the limit of vanishing norm of a (non-vanishing) section of $\mathcal{L}$ leads to the breakdown of the effective theory. Indeed, consider a holomorphic section $W(z)$, which is in fact the superpotential of the $N=1$ theory. Its norm is defined as $W h \bar W = || W||^2$. Thanks to holomorphicity, one can write $ \frac{i}{2\pi} \bar \partial \partial \log h = \frac{i}{2\pi} \bar \partial \partial \log ||W||^2 $, identifying thus $G(z,\bar z) = K + \log W \bar W = \log ||W||^2 $. The gravitino mass is then \begin{equation} m_{3/2}^2 = e^G = || W||^2. \end{equation} The limit of vanishing gravitino mass corresponds to the limit of vanishing norm of the section $W(z)$. The gravitino conjecture implies that K\"ahler-Hodge manifolds compatible with quantum gravity are those in which this norm cannot be continuously sent to zero. Notice that special K\"ahler manifolds, parametrised by scalars of $N=2$ vector multiplets, are also K\"ahler-Hodge and thus this picture can be extended directly. One possible way in which the limit is obstructed consists in the existence of a lower positive bound for the gravitino mass. Simple models with this property are presented in section \ref{sec_modinvmod}. A possible refinement of the conjecture, inspired by the idea that domestic geometry is the natural framework underlying supergravity theories, as proposed in \cite{Cecotti:2021cvv}, consists in postulating that also the (dual) limit of infinite gravitino mass (or norm $||W||^2$) is pathological. This seems to be the case in a simple STU model reviewed in section \ref{stumodel}. In order to test explicitly the conjecture, one should identify the tower of states becoming light in the limit of vanishing gravitino mass. Given that we are working within the framework of supergravity, a natural candidate for the first light tower are Kaluza-Klein states. Even if there might be subtleties in the precise identification of this scale (see e.g.~\cite{DeLuca:2021mcj} for recent work in this direction), we will then assume that their mass is parametrically related to the volume of the internal manifold. In Calabi-Yau or orbifold compactifications, the volume ({\rm Vol}) typically appears in the K\"ahler potential as \begin{equation} K(z,\bar z) = - \alpha \log {\rm Vol} + K'(z, \bar z), \end{equation} where $\alpha$ is a model-dependent parameter, while the remaining part $K'$ will not play any role. In compactifications to four dimensions, one has that $m_{KK} \sim {\rm Vol}^{-\frac 23}$. We will also assume that the superpotential scales as \begin{equation} W \sim {\rm Vol}^{\frac \beta2}, \end{equation} with $\beta$ a second model-dependent parameter. If $m_\text{tower} \sim m_{KK}$, we thus get a relation of the type \eqref{m32n}, with \begin{equation} n = \frac{4}{3(\alpha-\beta)}. \end{equation} This behavior can now be checked in concrete examples. As noted in \cite{Cribiori:2021gbf}, for heterotic compactifications to four-dimensional Minkowski spacetime one finds $n=\frac 43$, for type IIB GKP orientifolds one has $n=\frac23$ and for Scherk-Schwarz compactifications $n=4$. As discussed in \cite{Castellano:2021yye}, for general CY$_3$ orientifolds one finds a lower bound $n\geq \frac13$, while for F-theory flux compactifications on CY$_4$ one has $n\geq \frac 14$; however, for toroidal orientifolds the range seems to be further restricted to $\frac 23 \leq n \leq 1$. \subsubsection{Modular invariant models} \label{sec_modinvmod} We would like to briefly review a class of models, not discussed in \cite{Cribiori:2021gbf,Castellano:2021yye}, in which the gravitino conjecture is satisfied by construction, since the gravitino mass admits a lower positive bound while varying over the moduli space. In these models, the interactions are fixed by asking that the action is left invariant by modular transformations acting on the scalar fields. Their construction in $N=1$ supergravity dates back to \cite{Ferrara:1989bc,Ferrara:1989qb}, while their string theory origin has been explored more in detail shortly after \cite{Font:1990nt,Font:1990gx,Cvetic:1991qm}. Recently, they have been revisited in a swampland context in \cite{Gonzalo:2018guu}. In the simplest version, there is a single chiral multiplet $T$ transforming under SL$(2,\mathbb{Z})$ as \begin{equation} T \to \frac{aT + b}{cT + d}. \end{equation} The most generic $N=1$ Lagrangian invariant under this transformation is then given by \begin{equation} G(T,\bar T) = - 3 \log (-i (T-\bar T)) + \log W \bar W, \end{equation} with \begin{equation} W(T) = \frac{H(T)}{\eta(T)^6}. \end{equation} Here, $H(T)$ is a modular invariant holomorphic function and $\eta(T)$ the Dedekind function. It can be shown that, to avoid singularities in the fundamental domain, one has to choose \begin{equation} H(T) = (j(T) - 1728)^{\frac m2} j(T)^{\frac n3} P(j(T)), \end{equation} where $m$, $n$ are positive integers, and $P$ is a polynomial in the holomorphic Klein modular invariant form $j(T)$. The origin of this superpotential is purely non-perturbative (gaugino condensation in heterotic compactifications). Therefore, the modulus $T$ which would be flat at the perturbative level is stabilised by non-perturbative corrections. The nature of these non-perturbative corrections is such that the decompactification limit, ${\rm Im} \, T \to \infty$, is prohibited, as the potential diverges in the same limit. This has to be contrasted with the standard behavior of perturbative potentials, which are typically vanishing at large distances. In other words, in these models a large distance limit is dynamically censored. This has consequences on the behavior of $m_{3/2}$ as a function of $T$: the limit of vanishing gravitino mass is prohibited and the gravitino conjecture is automatically satisfied. As an illustration, let us consider the simplest superpotential which is realised in string compactifications, \begin{equation} W = \frac{1}{\eta(T)^6}. \end{equation} The gravitino mass is \begin{equation} m_{3/2}^2 = e^G = \frac{1}{(2{\rm Im} \,T)^3 \eta(T)^6\bar \eta(\bar T)^6} \end{equation} and it can be easily checked that it is minimised at ${\rm Im} \, T=1$ at a strictly positive value. A plot is reported in the figure below. \begin{figure}[h] \begin{center} \includegraphics[scale=.6]{m32plot.pdf} \end{center} \end{figure} A natural generalisation would be to consider models with a non-trivial function $H(T)$ or with two chiral multiplets $S$ and $T$ \cite{Cvetic:1991qm}, described by $G(T,\bar T) = -\log(-i(S-\bar S))- 3 \log (-i (T-\bar T)) + \log W \bar W$, with $W =\frac{\Omega(S)H(T)}{\eta(T)^6}$. \subsection{$N=2$ STU model} \label{stumodel} The so called STU model is an instructive and yet simple example in which to test the gravitino conjecture, as done in \cite{Cribiori:2021gbf}. It can arise from heterotic string compactification on $K3\times T^2$ and we refer e.g.~to \cite{deWit:1995dmj} for more details. The four-dimensional low energy theory is $N=2$ supergravity with $n_V=3$ vector multiplets, whose scalars are coordinates of the manifold $\left(\frac{SU(1,1)}{SU(1)}\right)^3$. The prepotential is \begin{equation} \mathcal{F} = \frac{X^1 X^2 X^3}{X^0}. \end{equation} We consider the case of a U$(1)_R\subset$ SU$(2)_R$ gauging with a constant moment map, namely a Fayet--Iliopoulos term. For definiteness, we can choose it as \begin{equation} \mathcal{P}^x_\Lambda = q \delta^{3x}\eta_{0\Lambda}. \end{equation} In the presence of only Fayet--Iliopoulos terms, the $N=2$ scalar potential can be recast into an $N=1$ form \cite{Andrianopoli:1996cm}. Indeed, from \eqref{VN=2el} with $k^i_\Lambda = 0 = k^u_\Lambda$ one finds\footnote{One has to use that $U^{\Lambda \Sigma} = g^{i\bar\jmath}f^\Lambda_i f^\Sigma_{\bar \jmath} = e^K g^{i\bar\jmath}D_i X^\Lambda \bar D_{\bar \jmath}\bar X^\Sigma$, where $g_{i\bar\jmath}$ is the special K\"ahler metric.} \begin{equation} \mathcal{V} = e^K \left(g^{i\bar \jmath}D_i W \bar D_{\bar \jmath}\bar W - 3 W \bar W\right), \end{equation} where we define the would be ``superpotential'' \begin{equation} W = X^\Lambda \mathcal{P}^3_\Lambda. \end{equation} The K\"ahler potential is \begin{equation} K = -\log( S T U)= - \log {\rm Vol}, \end{equation} where $S = -2{\rm Im} z^1$, $T = -2{\rm Im} z^2$ and $U = -2{\rm Im} z^3$ and {\rm Vol} is the volume of the compact manifold. One can easily check that the scalar potential is identically vanishing and thus the model is no-scale. The gravitino mass matrix is \begin{equation} S_{AB} = \frac i2 e^{\frac K2}W \left(\begin{array}{cc} 0&1\\ 1&0\\ \end{array} \right). \end{equation} The mass of the gravitini is thus given by $m_{3/2}^2\simeq e^K W\bar W$, similarly to the $N=1$ case. Furthermore, the gauge coupling \eqref{gcoup} is \begin{equation} \label{gel} g^2 = 2 e^{K} =2 {\rm Vol}^{-1}. \end{equation} We see that the limit $m_{3/2}^2 \to 0$ is realised by ${\rm Vol} \to \infty$. Interestingly, in the same limit the gauge coupling vanishes and a global symmetry is restored \begin{equation} {\rm Vol} \to \infty\qquad \Rightarrow \qquad m_{3/2} \to 0 \quad \Leftrightarrow \quad g \to 0. \end{equation} This would be problematic, since there should be no global symmetries in quantum gravity. This is a simple example in which the gravitino conjecture is closely related to the absence of global symmetries, and it would be interesting to explore further other relations of this kind within the web of swampland conjectures. In the limit of large volume, one can identity the tower of states becoming light as Kaluza-Klein modes. Notice that the T-dual limit of vanishing volume (very large gravitino mass) would also be problematic, since in this case winding modes would become light and the supergravity approximation would not hold anymore. Correspondingly, the magnetic dual of the gauge coupling \eqref{gel} would then vanish. \section{Discussion: de Sitter and gravitino mass in extended supergravity} \label{sec_fincomm} The general argument of \cite{Cribiori:2020use,DallAgata:2021nnr}, reviewed in the section \ref{sec_WGCvsdS}, proves that de Sitter critical points of $N=2$ supergravity with vanishing gravitino mass have a cosmological constant of the order of the UV cutoff predicted by the magnetic weak gravity conjecture and thus cannot be consistent effective theories. The assumption of a vanishing gravitino mass might seem restrictive, but in \cite{Cribiori:2020use,DallAgata:2021nnr} it is found to hold true in almost all of the examples considered from the literature. In particular, in \cite{Cribiori:2020use} it is shown to occur in de Sitter critical points of minimal coupling models and cubic prepotential models with only vector multiplets, both for abelian and non-abelian gauging, while in \cite{DallAgata:2021nnr} explicit models with hyper multiplets are constructed. A model with massive gravitini in which the argument does not apply is the second de Sitter vacuum of \cite{DallAgata:2012plb}, which is unstable. A general strategy to construct de Sitter vacua with massive gravitini in $N=2$ supergravity has been proposed in \cite{Catino:2013syn}, but finding explicit models remains challenging \cite{DallAgata:2021nnr}. Notice also that the argument requires an unbroken abelian gauge group in the vacuum, but in case there are only non-abelian groups it is still possible to formulate a weaker version, as explained in detail in \cite{DallAgata:2021nnr}. In \cite{DallAgata:2021nnr}, the argument has also been formulated in $N=8$ supergravity, and it should be possible to extend it to any $2<N<8$ theory. Assuming this step to be straightforward, we could conclude that, if the gravitino mass is vanishing or parametrically light compared to the Hubble scale, the resulting de Sitter critical points (regardless of stability) of extended supergravity are in the swampland due to the weak gravity conjecture. In turn, this would mean that $N=0,1$ supersymmetry at the Lagrangian level seem to be the most promising chances to obtain a consistent effective description for de Sitter critical points, if the gravitino mass is vanishing. Notice that this is compatible with the recent conjecture of \cite{Andriot:2022way} and has a nice parallel with the scale separation analysis of \cite{Cribiori:2022trc}. In particular, minimal supersymmetry in four dimensions is peculiar since it allows for the existence of a superpotential which might not be directly related to a gauge coupling. This possibility cannot occur in $N>2$, as it is most clearly illustrated in the example of the STU model reviewed in section \ref{stumodel}. The analysis here presented was performed in four spacetime dimensions, but it would be interesting to extend it to higher dimensions. While we leave a detailed study for future work, we can provide an argument why de Sitter critical points of $d>4$, $N>0$ theories with vanishing gravitino mass suffer of the same problem discussed in section \ref{sec_WGCvsdS} and belong to the swampland, according to the weak gravity conjecture. First, one has to recall that in $d>4$ the supergravity scalar potential is always of order $\mathcal{O}(g^2)$, since it stems from a gauging procedure. Then, in any dimensions and for any number of supercharges, the structure of the scalar potential is fixed by the supersymmetric ward identity \cite{Cecotti:1984wn}, which has the schematic form \begin{equation} \mathcal{V} \sim \left(\delta (\text{spin-1/2})\right)^2 - \left(\delta (\text{spin-3/2})\right)^2. \end{equation} The precise numerical factors and indices entering this relation depend on $d$ (spacetime dimensions) and $N$ (number of supersymmetries), but crucially the relative negative sign between the two terms does not, since it corresponds to the gravitational contribution. Moreover, the second term in the relation above is precisely the gravitino mass, namely the supersymmetry transformation of the gravitino on the vacuum, with (Lorentz covariant) derivative and other maximal symmetry breaking terms turned off. Thus, if the gravitino mass is vanishing, the scalar potential is non-negative and of order $\mathcal{O}(g^2)$ for $d>4$. The argument of \cite{Cribiori:2020use,DallAgata:2021nnr} then applies, provided one shows that there is no arbitrarily tunable parameter in the expression of the vacuum energy. \acknowledgments I would like to thank G.~Dall'Agata, F.~Farakos, D.~L\"ust and M.~Scalisi for discussions. This work is supported by the Alexander von Humboldt foundation.
4b0f9a0bb1e214683bf13902f592f85326102c99
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Experimental Validation Results} \subsection{Experimental Setup} \begin{figure}[t!] \centering \includegraphics[width=\linewidth]{image/Setup_all.png} \caption{The designed and realized experimental setup for the proposed TR-based multi-user MISO scheme.} \label{fig:setup} \end{figure} To evaluate the performance of the proposed ITRDMA precoding scheme, we have implemented an experimental setup to first sound the channel and then to TR-precode the transmitted signals, as shown in Fig.~\ref{fig:setup}. The setup consists of a transmitter array with $M=8$ antennas, all connected to a solid-state Radio Frequency (RF) switch. The input of this $1\times8$ switch is connected to a power amplifier that is fed by an Arbitrary Waveform Generator (AWG) from Tektronix (specifically, the AWG-7012). This AWG was used to generate transmitted signals with a carrier frequency at $2$ GHz. The transmitter (Tx) was placed inside a reverberating cavity to create a rich multipath signal propagation channel. This cavity has an opened window facing the Receivers (i.e., Rx1 and Rx2), which are placed outside the cavity. The AWG and DSO were connected to an Ethernet network switch and controlled by a desktop computer. The AWG triggered the DSO to ensure synchronization. The sampling rate of the DSO and the AWG was $12.5$ and $10$ GHz, respectively. Two different setup configurations were used for two different sets of measurements. The first setup intended to evaluate the ITRDMA precoding scheme in a two-user MISO scenario, where two dipole antennas were connected to two low noise amplifiers, and then, to the inputs of an RF Digital Storage Oscilloscope (DSO) (specifically, the Tektronix TDS6604B). The second setup was used to evaluate the TR precoding in a mobile setting, considering a single-user MISO scenario. In particular, the receiving user Rx1 was mounted on a linear motorized bench in order to be able to move its receiving antenna without strongly modifying the channel property inside the reverberating cavity. The bench was placed parallel to the cavity's opening, resulting in a displacement range equal to $30$cm. \subsection{Spatiotemporal Focusing Capability} In the first experiment, we ran the transmission chain with a bandwidth $B=100$ MHz to focus the precoded signal on the user Rx1. We applied both the conventional TR and the proposed ITR precoding algorithms using $50$ iterations. The radiated field was probed not only on the user Rx1, but also on the user Rx2. The amplitude of the baseband received fields versus the discrete time index is demonstrated in Fig.~\ref{fig:TRVsITR}. We first clearly observe a strong time and spatial focusing with the both TR-based precoding algorithms. However, the side lobes on Rx1 and the secondary lobes on Rx2 are smaller when ITRDMA is applied. One can also see that the ITRDMA-precoded signals have slightly lower amplitude at time $t=0$. \begin{figure}[t!] \centering \includegraphics[width=1 \linewidth]{image/focus_signal.jpg} \caption{Amplitude in Volts of the baseband received field probed by the antenna of Rx1 (top figure) and the antenna of Rx2 (bottom figure), when TR and ITRDMA precoding are considered by the $8$-antenna transmitter array in order to spatiotemporally focus the transmitted signal at Rx1.} \label{fig:TRVsITR} \end{figure} To quantify the improvement of the ITRDMA-based focusing, we plot in Fig.~\ref{fig:SINRtoiter} the SIR performance of the received signal, as computed via \eqref{eq:SINR} by setting $\sigma=0$, as a function of the number of the algorithmic iterations for a $B=100$ MHz bandwidth signal. Note that the SIR of conventional TR precoding is obtained when the number of iterations with ITR equals to $0$. It can be seen that, thanks to the proposed iterative scheme, an improvement up to $6.5$ dB is obtained with ITR for $400$ iterations. Evidently, the improvement is not linear with the number of iterations. We actually observe that the SIR improves with the square root of this number, as soon as the iterations are more than $50$. We believe that those improvement and behavior strongly depend on the channel characteristics and transmission bandwidth. \begin{figure}[t!] \centering \includegraphics[width=1 \linewidth]{image/SINRiter2.jpg} \caption{The SIR performance of the proposed ITRDMA precoding algorithm with respect to the number of iterations using $B=100$ MHz. The inner plot is the same plot, but its horizontal axis is in log scale.} \label{fig:SINRtoiter} \end{figure} \subsection{The Effect of Mobility} The TR-based precoding is known to be sub-optimal, especially in the case of low-to-moderate noise levels. However, it is also known to be less sensitive to channel fluctuations and receiver mobility. Hence, one may wonder to what extent the proposed ITRDMA processing is more sensitive than conventional TR, when considering a displacement of a receiving user between its position when channel estimation was performed and its new position during the data transmission phase. We experimentally investigate this question, as follows. We consider the user Rx1 lying on the motorized bench, and a first step, the $8$ CIRs are estimated for an initial position of Rx1 at the point $x=8$ cm. Using those estimates, the ITRDMA precoder is derived. In a second step, the Rx1 is moved between the positions $x=1$ and $15$ cm with a step size of $1$ cm. For each of those positions, the same precoder was applied and the measured signal in baseband was recorded and stored. This signal's amplitude, considering $50$ algorithmic iterations for ITRDMA, is illustrated as a function of time and RX1 position in Fig.~\ref{fig:SPfocus}. As expected the maximum of the spatiotemporal focusing is obtained for the Rx1 position at $x=8$ cm, where the CIR was estimated. It is also shown that the maximum amplitude reaches a minimum when the receive antenna is moved by $5$ cm from the CIR measurement position. For TR preprocessing, it is well known that the width of the focal spot is directly given by the spatial coherence length, which is equal to half a wavelength for a diffuse field. In our experiment at $2$ GHz carrier frequency, this coherence length is $3.4$ cm. The larger value seen in this figure happens because the receiving antenna is placed outside the reverberation cavity, leading to an increase of the spatial coherence length. \begin{figure}[t!] \centering \includegraphics[width=1 \linewidth]{image/SP_focus.png} \caption{Amplitude [V] of the baseband received signal with respect to time and the position of the antenna of Rx1. The ITRDMA-precoded signals have been obtained using $50$ algorithmic iterations and the transmission bandwidth $B=100$ MHz.} \label{fig:SPfocus} \end{figure} We next investigate the effect of the user receiver displacement between the channel sounding and the data transmission phases in the SINR performance, by evaluating the expression \eqref{eq:SINR}. The Doppler effect was not taken into account. However, it is expected to have a moderate impact on the data transmission since we perform wideband processing in the time domain. The SINR curves versus the Rx1 displacement in cm for the SNR value $30$ dB are demonstrated in Fig.~\ref{fig:CH10SNR30}. We clearly observe that, for small distances, the larger the number of iterations is, the faster is the decay of the SINR with respect to the distance. Nevertheless, the ITRDMA algorithm seems to inherit the TR robustness. Indeed, once the SINR improvement due to the $50$ algorithmic iterations is lost, its behavior becomes identical to the one obtained with only $20$ iterations. Hence, by optimizing the number of iterations in our algorithm, one can get better performance with the proposed ITRDMA scheme than using conventional TR. \begin{figure}[t!] \centering \includegraphics[width=1 \linewidth]{image/SINRtoDistance.jpg} \caption{The estimated SINR at Rx1 with respect to the distance traveled by this user between the CIR estimation process and the application of the ITRDMA precoder. The performance curves were obtained for $3$ different precoders: \textit{i}) conventional TR, as well as ITRDMA with \textit{ii}) $20$ and \textit{iii}) $50$ algorithmic iterations. The transmission bandwidth and operating SNR were set to $100$ MHz and $30$ dB, respectively.} \label{fig:CH10SNR30} \end{figure} We hereinafter set as $\tau$ the time duration between the channel estimation process and the actual data transmission, ans as $v$ the speed of mobility of the user Rx1. Based on the findings in Fig.~\ref{fig:SPfocus}, one can assess the maximum speed that Rx1 can reach before its SINR performance reduces by a factor of $2$ for different CIR estimation time intervals $\tau$. Indicative results for this metric are provided in Table~I. The shown time duration values are completely compatible with our indoor applications of the ITRDMA algorithm. For outdoor applications, the ITRDMA processing has the same limitations with any precoding algorithm, where the channel needs to be estimated by the transmitter. Note that the speed values listed in Table~I are probably overestimated, because the outdoor coherence length can be larger. In this table, we have calculated the minimum speed of the user Rx1 in order to reach half of the signal strength for the corresponding time duration $\tau$. As clearly shown in the figure, a lower value of $\tau$ will result in SINR being more robust to mobility. \begin {table}[t!] \caption{The Required Speed of User Rx1 to Reach Half of the Signal Strength For Different Channel Estimation Durations.} \label{tab:speedtotau} \begin{center} \begin{tabular}{|c||c|c|c|} \hline $\tau$ (msec) & $50$ & $10$ & $1$ \\ \hline $v$ (km/h) & $2.16$ & $10.8$ & $108$ \\ \hline \end{tabular} \end{center} \end {table} \begin{figure}[t!] \centering \includegraphics[width=1 \linewidth]{image/CH1B100SNR2-10.jpg} \caption{The SINR performance versus the speed of the mobile user Rx1 lying in the motorized bench for transmission bandwidth $B=100$ MHz, time mismatch duration $\tau$=1 ms, and operating SNR equal to $2$ and $10$ dB.} \label{fig:CH1SNR210} \end{figure} Finally, in the SINR performance evaluation results in Fig.~\ref{fig:CH1SNR210}, we investigate the effect of the noise on the behavior of the different TR precoding schemes, when considering varying mobility speeds for the user Rx1. In this figure, the time duration $\tau$ between the CIR estimation and data transmission is set to $1$ ms, and we plot the SINR values of the baseband received signal when applying conventional TR, as well as ITRDMA with $20$ and $50$ iterations. Performance curves for operating SNR values equal to $2$ and $10$ dB are depicted. It is shown that, the lower the SNR is, the closer are the performances of the different TR-based precoding schemes. This is due to the fact that for high noise levels, the interference becomes lower than the noise level, and then the interference cancellation process becomes useless. For low-to-moderate user speeds, which are reasonable for indoor applications, it is demonstrated in the figure that ITRDMA outperforms conventional TR. However, for very large speeds, conventional TR, which is obtained from ITRDMA for zero iterations, is sufficient. \section{Introduction} Ultra-WideBand (UWB) signal waveforms have ushered a new era in short-range data transmissions for wireless sensor networks, by enabling both robust communications and accurate ranging capabilities \cite{zhang2009uwb}. One central issue facing UWB waveforms for low complexity devices refers to effective energy collection that is usually dispersed in rich scattering wireless environments. The Time Reversal (TR) technique appears to be a paradigm shift in exploiting rich multipath signal propagation, which is capable of focusing UWB pulses both in time and space \cite{lerosey2004time}, while shifting the signal processing complexity to the transmitter side. With TR precoding, the receivers can benefit from high levels of the intended received signals enabling, in this way, simple, low cost, and low power reception modules \cite{wang2011green,chen2013time}. Moreover, the offered temporal pulse compression and spatial focusing can partially mitigate the Inter-Symbol Interference and the Inter-User Interference (IUI), resulting from the multipath signal propagation \cite{oestges2004time}. The above characteristics render TR precoding a promising scheme for wireless communications and localization applications. Very recently, \cite{Alexandropoulos_ICASSP} demonstrated indoor cm-level localization accuracy with TR at $3.5$ GHz using up to $600$MHz bandwidth channel sounding signals. In \cite{Mokh_CSCN}, considering a leaking reverberation cavity, the authors experimentally verified the ultra-accurate spatiotemporal focusing capability of TR at $273.6$ GHz using transmission bandwidths up to $4$ GHz. In \cite{han2012time}, a TR-based Division Multiple Access (TRDMA) scheme for multi-user Multi-Input Single-Output (MISO) systems was presented. It was shown that the proposed scheme provides a cost-effective waveform design enabling energy-efficient Internet-of-Things (IoT) nodes \cite{wang2011green}. Thanks to this simple precoding strategy, base stations can support a large number of simultaneous links with moderate complexity \cite{han2014multiuser}. A theoretical analysis for the average Signal-to-Interference Ratio (SIR) of the intended and unintended receivers in a distributed TR-based transmission scheme was carried out in \cite{wang2016snr}, while an experimental evaluation has been recently presented in \cite{mokh2021indoor}. However, it is known that when operating in low Signal-to-Noise Ratio (SNR) values, the interference level can affect the TR performance. Indeed, one major issue with TRDMA is that the SIR level cannot be tuned. For instance, it has been shown that in an ideal Rayleigh channel, the averaged SIR is equal to $0$ dB. To overcome the latter problem with TR while keeping the receiver as simple as possible, the iterative TRDMA (ITRDMA) technique was proposed in \cite{montaldo2004telecommunication}, aiming to reduce the ISI and IUI. This technique belongs to the family of pre-rake processing techniques, which were originally introduced in \cite{imada2005pre}. It is noted that iterative processing is a popular approach for equalization. It has been applied for single and multi-carrier code division multiple access (CDMA) systems \cite{liu2004iterative}. Very recently, a low complexity iterative rake detector for orthogonal time-frequency space modulation has been presented in \cite{thaj2020low,thaj2020low2}. Although the ITRDMA scheme proposed in \cite{montaldo2004telecommunication} deals with ISI and IUI, it is quite difficult to implement. It requires multiple feedback between the transmitters and the receivers, which makes it non-applicable for very low duty cycle nodes. Motivated by the latter limitation, in this paper, we present an ITRDMA algorithm that is based on the iterative processing of the Channel Impulse Responses (CIRs) of the multiple users, which are acquired during the channel estimation phase. The proposed algorithm is implemented at the transmitter side as a precoder, instead of being implemented at the receiver as a post-processing step. Hence, the ITRDMA computational complexity is concentrated at the transmitter (e.g., the base station or access point) instead of the receiver, when downlink communication is considered. The performance of the proposed algorithm, in terms of ISI and IUI mitigation, is experimentally evaluated in a multi-user scenario inside a reverberating room mimicking a strongly scattering indoor environment. We specifically validate the performance using channels that have been experimentally acquired at the carrier frequency $2$ GHz using an $100$ MHz communication bandwidth. It is showcased, even for an experimental setup with mobility, that the proposed ITRDMA approach is more efficient than conventional TRDMA schemes. \section{Time Reversal for Multi-User Precoding} \label{SEC:TRDMA} In this section, we first introduce the TR precoding and then present the proposed ITR scheme for multi-user wireless systems. \subsection{System Model and Time Reversal Precoding} We consider a multi-user MISO wireless communication system comprising one base station that is equipped with $M$ antenna elements, and which wishes to communicate in the downlink direction with $N$ single-antenna users. We represent by $h_{i,m}[k]$ the baseband CIR at discrete time $k$ between the $m$-th ($m=1,2,\ldots,M$) transmitting and $i$-th ($i=1,2,\ldots,N$) receiving antennas, i.e., at the base station and the $i$-th user, respectively. The TR precoding technique utilizes the time-reversed CIR, i.e., $h^*_{i,m}[L-k]$, to focus the transmitted information-bearing electromagnetic field on the $i$-th user location. As a consequence, the signal sent by the $m$-th transmit antenna at discrete time $k$ to focus the baseband message $x_i$ on each individual receiving antenna is given by: \begin{align} s_m[k]=\sum_{i=1}^N \frac{\sum_{l=1}^L x_i[l] h_{i,m}^*[L+l-k]}{\sqrt{\sum_{m=1}^M\sum_{l=1}^L \lvert h_{i,m}[l] \rvert^2}}, \label{eq:yi} \end{align} where it is assumed that the CIR is composed of $L$ significant taps. The normalization in this expression ensures that the power emitted toward each user is the same. Using \eqref{eq:yi}, the baseband received signal at each $j$-th ($j=1,2,\ldots,N$) user at time $k$ can be expressed as follows: \begin{equation} y_j[k]= \sum_{l=1}^L \sum_{i=1}^N x_i[l] R_{j,i}[L+l-k]+n_j[k]. \label{eq:TR} \end{equation} where the expression of the correlation function $R_{j,i}[k]$ between the CIRs of users $j$ and $i$ is defined as \begin{equation} R_{j,i}[k] \triangleq \frac{\sum_{m=1}^M\sum_{k'=-\infty}^{+\infty} h_{i,m}^*[k-k'] h_{j,m}[k']}{\sqrt{\sum_{m=1}^M\sum_{l=1}^L \lvert h_{i,m}[l] \rvert^2}}, \label{eq1} \end{equation} and $n_j$ represents the zero-mean additive white Gaussian noise with standard deviation $\sigma$ at user $j$. In multipath channels, when applying TR precoding using the CIR of user $i$, the time-reversed field focuses in time and space in the location of this user \cite{fink2001acoustic}. This means that a signal peak given by the CIR's auto-correlation function $R_{i, i}[0]=\sqrt{\sum_{m'=1}^M\sum_{l=1}^L \lvert h_{i,m}[l] \rvert^2}$ appears at user $i$; at this time and location, $ML$ signals add up coherently. However, this term can be corrupted by incoherent contributions of the auto-correlation function $R_{i,j}[k]$. In fact, the contributions when $k\neq0$ but $i=j$ are due to imperfect time focusing on the targeted user/antenna. This implies that around the main focused peak, some secondary peaks are still present that generate ISI. Note that the elements of the auto-correlation function when $i \neq j$ happen due to the sides lobes. Hence, TR precoding does not perfectly focus the wave on the intended user, inducing interference to the other users. \subsection{Proposed Time-Reversal-Based Multiple Access} To reduce the levels of ISI and IUI appearing in \eqref{eq1}, we propose the ITRDMA algorithm. In contrary to the scheme presented in \cite{montaldo2004telecommunication}, our algorithm is based on the measurement of the CIRs of the multiple users. Its main principle is to iteratively remove the secondary peaks and lobes in the autocorrelation function. To this end, the time position and the antenna location of the targeted lobe are identified iteratively. In particular, a pre-processing time-reversed waveform is used to focus on that position at that time index, but with a peak that is the opposite of the complex amplitude of the lobe. Hence, if this time-reversed waveform is added to the actual CIR, thanks to the linearity, the secondary lobe will be canceled. The same procedure can be used iteratively to remove all secondary peaks and lobes from the autocorrelation function. The algorithmic steps of the proposed ITRDMA scheme are summarized as follows: \begin{enumerate} \item The transmit precoder ${s}_{i_0,m}[k]$ at the discrete time $k$ is initialized with $\tilde{h}^*_{i_0,m}[L-k]$ to focus the received signal on the user/antenna $i_0$ at the time instant (i.e., channel tap) $k=L$. The notation $\tilde h$ stands for the normalized CIR, which is computed as follows \begin{equation} \tilde h_{i,m}[k] \triangleq h_{i,m}[k]\left(\sqrt{\sum_{m=1}^M\sum_{k'=1}^{L} \lvert h_{i,m}[k'] \rvert^2}\right)^{-1}. \label{eq:Normalized_CIR} \end{equation} \item The differences $\Delta_i[k]$ $\forall$$i=1,2,\ldots,N$ between the resulting fields $f_i[k]$ on the $N$ receiving users/antennas, which are given by the autocorrelations $\tilde{R}_{i_0,i}[L-k]$ and their targeted values $\delta[L-k]\delta[i-i_0]$ (i.e., for the fields without lobes), are computed for each receiving antenna. The notation $\tilde{R}_{j,i}[k]$ with $i,j=1,2,\ldots,N$ represents the autocorrelation function using the normalized CIRs, which is given by the expression: \begin{equation} \tilde{R}_{j,i}[k] = \sum_{m=1}^M\sum_{k'=-\infty}^{+\infty} \tilde{h}_{i,m}^*[k-k'] \tilde{h}_{j,m}[k']. \label{eq:Normalized_auto} \end{equation} \item The tap index $\hat{k}$ and the antenna index $\hat{i}$ where the maximum of $\lvert \Delta_i[k] \rvert$ occurs are found. This corresponds to the highest (undesired) secondary peak in the autocorrelation function. \item The ITRDMA precoder is then updated with the time-reversed CIRs, which are shifted in time to focus on the $\hat{i}$-th user/antenna at the $\hat{k}$-th tap with a complex amplitude opposite in sign with $ \Delta_{\hat{i}}[\hat{k}]$, in order to cancel the secondary peaks on each receiving user. \item The differences $\Delta_i[k]$ $\forall$$i$ are also updated to take into account the new contributions to the precoder field. it will hold that $\Delta_{\hat{i}}[\hat{k}]=0$. \end{enumerate} The algorithmic steps of the proposed ITRDMA scheme are summarized in Algortihm~\ref{Hybrid_F}. It can be seen that the iterative Steps $6$ to $8$ remove the secondary taps via TR-based precoding. The iterations stop either when their maximum allowable number $n_{\max}$ is reached or when $\left|\Delta_{i}[k]\right|$ becomes smaller than a target value $\epsilon$. It is noted that this value can be advantageously tuned to meet a target SNR level or to tune the complexity and the processing latency at the transmitter side. Finally, at the Step $11$ of the algorithm, the TR-based precoding signals $s_{i,m}[k]$ at each time discrete index $k$ are normalized in energy. \begin{algorithm}[!t] \caption{The Proposed ITRDMA Precoding Scheme}\label{Hybrid_F} \textbf{Initialize:} Set the values for $M$, $N$, and $L$. \begin{algorithmic}[1] \For {$i_0=1,2,\ldots,N$} \State Set ${s}_{i_0,m}[k] = \tilde{h}^*_{i_0,m}[L-k]$. \State Set $\Delta_i[k] = \tilde{R}_{i_0,i}[L-k] - \delta[L-k]\delta[i_0-i]$. \State Set $n=0$. \While {$\max \lvert \Delta_i[k]\rvert>\epsilon$ and $n<n_{\max}$} \State Find $\hat{k},\hat{i} = \arg \max_{k,i} \lvert \Delta_i[k]\rvert$. \State Set ${s}_{i_0,m}[k] \leftarrow {s}_{i_0,m}[k]-\Delta_{\hat{i}}[\hat{k}] \tilde{h}^*_{\hat{i},m}[L-k+\hat{k}] $. \State Set $\Delta_i[k] \leftarrow \Delta_i[k]-\Delta_{\hat{i}}[\hat{k}] \tilde{R}_{\hat{i},i}[L-k+\hat{k}]$. \State Set $n=n+1$. \EndWhile \State Set $s_{i_0,m}[k] \leftarrow {s}_{i_0,m}[k]\left(\sqrt{\sum_{k',m}|{s}_{i_0,m}[k']|^2}\right)^{-1}$. \EndFor \end{algorithmic} \end{algorithm} \subsection{Signal-to-Interference-Plus-Noise (SINR) Performance} The complex-valued information symbols $x_i[l]$ intended for each $i$-th user are convoluted with the precoding sequences $s_{i,m}[k]$ computed from Algortihm~\ref{Hybrid_F}. As a consequence, the baseband received signal at each $j$-th user can be expressed as follows: \begin{equation} y_j[k] = \sum_{l=1}^{L}\sum_{i=1}^{N} x_j[l] w_{i,j}[k-l] +n_j[k], \end{equation} where $w_{i,j}[k]$ represents the precoding signal given by \begin{equation} w_{i,j}[k] \triangleq \sum_{l'=1}^L\sum_{m=1}^M s_{j,m}[l'] h_{i,m}[k-l']. \end{equation} In the case of TR precoding, by inspection of expression (2), it can be concluded that $w_{i,j}[k] = R_{i,j}[L-k]$. Therefore, the sequence $w_{i,j}[k]$ can be interpreted as a virtual channel that includes the TR-based precoding. This equivalent channel approach has been already use for TR in \cite{phan2013make}. By assuming that the power of the information symbols is normalized, it is easy to show that SINR of the equivalent channel at each receiving user/antenna $i$ is obtained as follows: \begin{equation} {\rm SINR}_i \triangleq \frac{|w_{i,i}[0]|^2}{I_i + \sigma^2}. \label{eq:SINR} \end{equation} where $I_i\triangleq\sum_{l=1,l\neq 0}^L |w_{i,i}[l]|^2+ \sum_{l=1}^L\sum_{j=1,j\neq i}^N |w_{j,i}[l]|^2$ represents the intereference term. \section{Conclusion} In this paper, we have presented indoor experimental results for an UWB multiple access scheme based on the TR technique. We have proposed a novel iterative algorithm to confront the effects of ISI and IUI in TR-precoded wireless communication systems. The efficiency of the presented ITRDMA scheme has been validated through real experiments in a highly scattering medium. The presented approach includes a multi-user MISO channel sounding process to estimate the CIRs, which was used to derive the precoding scheme. Then, the TR-precoded received intended signal as well as the interference were measured in baseband and used for the performance assessment. Our performance results showcased that the proposed ITRDMA algorithm is capable to reduce the interference in the received signal, and therefore increase the SINR level. We also investigated the effect of mobility of a receiving user using the same ITRDMA scheme. It was demonstrated that the proposed precoding scheme can still be more efficient than conventional TR at high SNRs, and up to moderate speed values that are reasonable for indoor wireless communications. In future works, we will investigate the performance of the ITRDMA algorithm in imperfect channel estimation settings, and will perform comparisons with other spatial precoding techniques (e.g., regularised zero-forcing). We also intend to experiment data communication considering reconfigurable intelligent surfaces \cite{alexandg_2021} for reprogrammable rich scattering conditions. \bibliographystyle{IEEEtran}
c00e7adfdac0d051f4b9d27fbe3ac76322e4afa9
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Semantic segmentation of 3D point clouds is the process of predicting a class for every point in the cloud. This is especially challenging for 3D point clouds, due to undersampling of the scene and a lack of explicit structure in the cloud. Current approaches rely on projecting the 3D point cloud to 2D images \cite{shi2020spsequencenet,duerr2020lidar} or embed it into a dense volumetric grid \cite{tchapmi2017segcloud,rethage2018fully}. These approaches are, however, suboptimal since 2D images are not a natural representation for 3D point clouds while volumetric grids can be slow and memory intensive. We propose to use the permutohedral lattice as an alternative representation to apply convolutions on a data structure that more closely resembles the input and can process full scans at interactive speeds. In this work, we consider the point clouds as being recorded continuously by a sensor like a laser scanner or a depth camera. Processing individual point clouds ignores the temporal information, rendering the agent incapable of distinguishing between moving and stationary objects or integrating evidence over time~\cite{rosu2021latticenetauro,shi2020spsequencenet,duerr2020lidar}. LatticeNet~\cite{rosu2019latticenet} is a efficient network based on the permutohedral lattice that has shown state-of-the-art results for semantic segmentation of point clouds. It has recently been extended to process temporal information~\cite{rosu2021latticenetauro}. However, the temporal fusion was performed only with simple recurrence using fully connected layers. We present TemporalLatticeNet, an extension to LatticeNet that utilizes recurrent processing by evaluating Long Short-Term Memory (LSTM)~\cite{hochreiter1997long} and Gated Recurrent Units (GRU)~\cite{cho2014properties} as modules for temporal fusion. Additionally, we propose a novel module called Abstract Flow (AFlow) which can gather temporal information by matching abstract features in lattice space. We show competitive results on the temporal SemanticKITTI dataset~\cite{behley2019semantickitti}, but with a faster processing speed than other methods. \begin{figure}[t] \centering \includegraphics[width = \linewidth]{Overview.png} \caption{We use multiple consecutive point clouds as input to our backbone network. The feature matrices of different timesteps are fused together to allow information propagation through time. The per-point semantic classes of the last point cloud in the sequence are predicted.} \label{fig:overview_arch} \end{figure} Our contributions presented in this work include: \begin{itemize} \item Extensions to the LatticeNet architecture in order to improve recurrent processing, \item Novel module inspired by optical flow methods adapted to the permutohedral lattice that improves the aggregation of temporal information, and \item Competitive results on the SemanticKITTI dataset but with faster processing speed than other methods. \end{itemize} \section{Related Work} In this section, temporal semantic segmentation will be discussed. For an overview on general semantic segmentation of point clouds without temporal information we refer to Rosu~et al.~\cite{rosu2021latticenetauro} Temporal semantic segmentation approaches can be divided in two types, depending on their input: i) methods which process sequences of clouds in a recurrent manner to predict the class labels and ii) methods that accumulate multiple clouds into one single cloud to solve the task as a single-frame segmentation. The advantage of the first type of methods is that at each time-step only the current point cloud needs to be processed as the past information has already been summarized and stored in memory. However, they require more complex architectures than the methods that na\"{\i}vely segment a large aggregated point cloud. Shi~et al.~\cite{shi2020spsequencenet} present SpSequenceNet, a U-Net based architecture for temporal semantic segmentation. Two consecutive point clouds are voxelized and given as input to a shared encoder network. Vertical connection are added between the two timesteps in order to gather temporal information before decoding the representation into class probabilities of the last point cloud. They designed two modules to combine the information from the two consecutive point clouds: the Cross-frame Global Attention~(CGA) and the Cross-frame Local Interpolation~(CLI) module. CGA is inspired by self-attention and allows the network to gather and fuse global information from the previous cloud. CLI allows to attend to local information by fusing the features from nearby points with a dynamic per-point weighting. In contrast to our approach, Shi~et al.~\cite{shi2020spsequencenet} can only process sequences of length two and they voxelize the point cloud, which leads to a loss of information and discretization artifacts. Additionally, CLI per-point weighting is calculated using distances to k-nearest neighbors in 3D space, while our approach calculates the distance in the abstract feature space using the 1-hop neighborhood of a permutohedral lattice. Duerr~et al.~\cite{duerr2020lidar} present their recurrent architecture TemporalLidarSeg that uses temporal memory alignment to predict the semantic labels of sequences of point clouds. Their sequences have the potential of unlimited length. They project the 3D point clouds onto the 2D plane and use a U-net backbone network to output per-frame feature matrices. These feature matrices are then combined with the feature matrices of the hidden state using the temporal memory unit, which uses the real-world poses of each point cloud to compute the transformation from the coordinate system of the hidden to the current state. The 2D semantic segmentation is then projected back into the 3D representation. Similar to our approach, they require the poses of the point clouds, but they additionally need the mapping from 3D to 2D and therefore don't work directly on the point cloud. Additionally, our approach uses multiple fusion points in contrast to one in their approach. Kernel Point Convolution (KPConv)~\cite{thomas2019KPConv} operates directly on the point clouds by assigning convolution weights to a set of kernel points located in Euclidean space. Points in the vicinity of these kernel points are weighted and summed together to feature vectors. The kernel function is defined as the correlation between the location of the kernel point and the distance to the points in the radius neighborhood. To be robust to varying densities, the input clouds are subsampled at every layer of the network using a grid subsampling and the radius neighborhood of the convolution is adapted. The kernel points are usually static, but can also be learned by the network itself to adapt to more challenging tasks. Due to memory limitations, their approach cannot process one full point cloud for outdoor scenes. Therefore, Thomas~et al.~ fit multiple overlapping spheres into the point cloud and evaluate them individually. The final results are generated by a voting scheme. In contrast to our method, KPConv~\cite{thomas2019KPConv} performs temporal semantic segmentation by accumulating all clouds of the sequence into one large point cloud and uses no recurrent architecture. DarkNet53Seg~\cite{behley2019semantickitti} and TangentConv~\cite{tatarchenko2018tangent} were used as the two baseline networks for the segmentation of 4D point clouds in the SemanticKITTI \cite{behley2019semantickitti} dataset. The input for these were accumulated clouds of the sequences. DarkNet53Seg~\cite{behley2019semantickitti} is an extension of SqueezeSeg \cite{wu2018squeezeseg} --- a U-Net architecture with skip connections that uses the spherical projection of LiDAR point clouds to predict a point-wise label map that is refined by a conditional random field and subsequent clustering. TangentConv~\cite{tatarchenko2018tangent} is based on the notion of tangent convolution --- a different approach to construct convolutional networks on surfaces that assumes that the data is sampled from locally Euclidean surfaces. The input points are projected onto local tangent planes which are used as 2D grids for convolutions. Based on this input, Tatarchenko~et al.~\cite{tatarchenko2018tangent} design a U-type network with skip connections. In contrast to our approach, both DarkNet53Seg and TangentConv were designed to output dense per-point predictions for single point clouds and contain no recurrent connections. \section{Fundamentals} We use bold upper-case characters to denote matrices and bold lower-case characters to denote vectors. We denote with point $p$ a single element from the point cloud and with vertex $v$ an element from the permutohedral lattice. The points of a cloud are defined as a tuple $p=\left( \mathbf{g}_p, \mathbf{f}_p \right)$, with $\mathbf{g}_p\in\mathbb{R}^{ d }$ denoting the coordinates of the point and $\mathbf{f}_p \in \mathbb{R}^{ f_d }$ representing the features stored at point $p$ (normals, reflectance, etc.). The full point cloud containing $m$ points is denoted by $P=\left( \mathbf{G}, \mathbf{F} \right)$ with $\mathbf{G}\in\mathbb{R}^{ m \times d }$ denoting the positions matrix and $\mathbf{F}\in\mathbb{R}^{ m \times f_d }$ the feature matrix. The vertices of the $d$-dimensional permutohedral lattice \cite{adams2010fast, rosu2019latticenet} are defined as a tuple $v=\left( \mathbf{c}_v, \mathbf{x}_v \right)$, with $\mathbf{c}_v\in\mathbb{Z}^{ (d+1) }$ denoting the coordinates of the vertex and $\mathbf{x}_v \in \mathbb{R}^{ v_d }$ representing the values stored at vertex $v$. A full lattice contains $k$ vertices and is denoted with $V=\left( \mathbf{C}, \mathbf{X} \right)$, with $\mathbf{C}\in\mathbb{Z}^{ k \times (d+1) }$ representing the coordinate matrix and $\mathbf{X}\in\mathbb{R}^{ k \times v_d }$ the value matrix. For $d=3$ the input space is tessellated into uniform tetrahedra. We denote the set of neighbors of vertex $v$ with $N(v)$. The vertices of the permutohedral lattice are stored in a sparse manner using a hash map. Hence, we only allocate the simplices that contain the 3D surface of interest. Tetrahedras scale linearly in the number of vertices and not quadratically like cubical voxels. This allows for fast interpolation of data from the point cloud to the lattice and backwards. For further details we refer to Rosu~et al.~\cite{rosu2019latticenet}. \section{Architecture} Our recurrent neural network (RNN) TemporalLatticeNet is an extension of LatticeNet\cite{rosu2019latticenet}. LatticeNet is extended with recurrent connections at multiple resolutions on which temporal information is allowed to flow~(\reffig{fig:rnn__architecture}). \subsection{Method} \label{sec:method} Input to our network is a sequence of clouds $P = \left(P_0, P_1, ..., P_{n-1}\right)$, where $P_i=\left( \mathbf{G}, \mathbf{F} \right)$ with $n \in \mathbb{N}^+$ and $0 \leq i < n$. We refer to $n$ as the sequence length. The network outputs the likelihood for each possible class for every point $p \in P_n$ (\reffig{fig:overview_arch}). We assume that the points have been transformed in a common reference frame. The positions $\mathbf{G}$ are scaled by a factor $\pmb{\sigma} \in \mathbb{R}^d$ as $\mathbf{G}_s = \mathbf{G}/\pmb{\sigma}$ which controls the influence area of the permutohedral lattice. If not otherwise stated, we refer to $\mathbf{G}_s$ as $\mathbf{G}$. The matrix $\mathbf{F}$ denoting the per-point features contains the reflectance value from the LiDAR scanner or is set to zeros in the case of a sensor which doesn't output reflectance. We insert recurrent connections at various points of the LatticeNet architecture~(\reffig{fig:rnn__architecture}) where the states of two lattices $V^{(t-1)}$ and $V^{(t)}$ have to be fused. We refer to the feature matrix of each lattice as $\mathbf{X}^{(t-1)}$ and $\mathbf{X}^{(t)}$, respectively, as state of the network. To compute the hidden state $\mathbf{H}^{(t)}$, we fuse the previous hidden state $\mathbf{H}^{(t-1)}$ together with the current state of the network $\mathbf{X}^{(t)}$. For this, a correspondence between the coordinate matrices $\mathbf{C}$ of both lattices has to be known, because they define the order in which the feature vectors $\mathbf{x}_v \in \mathbf{X}$ are saved. This correspondence is achieved by transforming the point clouds into a common frame and using its hash map. By keeping the hash map the same for the whole sequence, the Distribute operation of LatticeNet maps 3D points to the same coordinate vectors $\mathbf{c}$ across timesteps and allows comparing the feature vectors $\mathbf{x}$ with each other. Vertices corresponding to previously unknown areas in the input are inserted at the end of the matrices $\mathbf{C}$ and $\mathbf{X}$ (\reffig{fig:temporal_fuse}). \bgroup \newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}} \begin{figure}[] \resizebox{0.48\textwidth}{!}{ \begin{tikzpicture} \colorlet{featout}{ph-green!80} \colorlet{feat1}{ph-orange!80} \colorlet{feat2}{ph-blue!80} \colorlet{feat3}{ph-green!80} \colorlet{feat3}{ph-yellow} \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} \setlength\tabcolsep{0pt} \setlength\arrayrulewidth{1pt} \node[] at (0,0) { \resizebox{1cm}{!}{ \begin{tabular}{|@{\rule[-0.2cm]{0pt}{0.5cm}}*{2}{M{0.5cm} |}} \hline \cellcolor{featout} & \cellcolor{featout} \\ \hline \cellcolor{featout} & \cellcolor{featout} \\ \hline \cellcolor{featout} & \cellcolor{featout} \\ \hline \cellcolor{featout} & \cellcolor{featout} \\ \hline \cellcolor{featout} & \cellcolor{featout} \\ \hline \cellcolor{featout} & \cellcolor{featout} \\ \hline \end{tabular} }; \node[] at (2.5,0) { \resizebox{1cm}{!}{ \begin{tabular}{|@{\rule[-0.2cm]{0pt}{0.5cm}}*{2}{M{0.5cm} |}} \hline \cellcolor{feat1} & \cellcolor{feat1} \\ \hline \cellcolor{feat1} & \cellcolor{feat1} \\ \hline \cellcolor{feat1} & \cellcolor{feat1} \\ \hline \cellcolor{feat1} & \cellcolor{feat1} \\ \hline 0 & 0 \\ \hline 0 & 0 \\ \hline \end{tabular} }; \node[] at (4.7,0) { \resizebox{1cm}{!}{ \begin{tabular}{|@{\rule[-0.2cm]{0pt}{0.5cm}}*{2}{M{0.5cm} |}} \hline \cellcolor{feat2} & \cellcolor{feat2} \\ \hline 0 & 0 \\ \hline 0 & 0 \\ \hline \cellcolor{feat2} & \cellcolor{feat2} \\ \hline \cellcolor{feat3} & \cellcolor{feat3} \\ \hline \cellcolor{feat3} & \cellcolor{feat3} \\ \hline \end{tabular} }; \node[] at (0.0, -1.55) { $\mathbf{H^{(t)}}$ }; \node[] at (2.5, -1.55) { $\mathbf{H^{(t-1)}}$ }; \node[] at (4.7, -1.55) { $\mathbf{X^{(t)}}$ }; \node[] at (7.4, 1.5) { }; \node[overlay,anchor=west] at (0.4,0) { $ = Fuse \left( \rule{0cm}{1.5cm} \rule{5.5cm}{0cm} \right) \rule{0cm}{1.6cm} $ }; \node[overlay,anchor=west] at (2.9, -0.85) { \bigg\} pad }; \node[overlay, anchor=west] at (5.1, -0.85) { \bigg\} new vertices }; \node[overlay, text width=3cm, anchor=west] at (5.1, 0.45) { \bigg\} unoccupied }; \node[overlay, text width=3cm, anchor=west] at (3.9, -1.2) { \Large , }; \node[text width=3.5cm, anchor=west] at (0.0, -2.2) { \scriptsize \crule[ph-green!80]{7pt} = fused results\\ \crule[ph-orange!80]{7pt} = non-zero entries\\ }; \node[overlay, text width=3.5cm, anchor=west] at (4.0, -2.2) { \scriptsize \crule[ph-blue!80]{7pt} = entries already allocated\\ \crule[ph-yellow]{7pt} = newly allocated entries\\ }; \end{tikzpicture} \caption{Temporal fusion: The feature matrix from the previous time-step $\mathbf{H}^{(t-1)}$ is zero-padded in order to account for the new vertices that were allocated at the current time-step $\mathbf{X}^{(t)}$. The feature matrices are afterwards fused by the chosen recurrent layer. } \label{fig:temporal_fuse} \end{figure} \egroup \subsection{Position of the Recurrence} \label{sec:pos_recurrence} Our RNN is a many-to-one deep RNN whose recurrent layers are positioned at different layers of the network. Four promising positions for the recurrent connections were chosen: Early Fusion, Middle Fusion, Bottleneck Fusion, and Late Fusion as shown in \reffig{fig:rnn__architecture}. \bgroup \newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}} \def55pt{40pt} \def12pt{10pt} \def18pt{25pt} \def13pt{20pt} \begin{figure}[] \hspace*{0.07\linewidth} \begin{tikzpicture} \scriptsize \def55pt{55pt} \def12pt{12pt} \def18pt{18pt} \def3pt{3pt} \def5pt{5pt} \def13pt{13pt} \def60{60} \def60{60} \def60{60} \def60{60} \colorlet{inputColor}{ph-orange!80} \colorlet{distributeColor}{ph-blue!70} \colorlet{level1DownColor}{ph-blue!70} \colorlet{level2DownColor}{ph-green!70} \colorlet{bottleneckColor}{ph-yellow!80} \colorlet{level2UpColor}{ph-green!80} \colorlet{level1UpColor}{ph-blue!70} \colorlet{sliceColor}{ph-blue!70} \colorlet{linearColor}{ph-orange!80} \colorlet{concatColor}{ph-orange!80} \colorlet{temporalFusionColor}{ph-purple!60} \def\footnotesize{\footnotesize} \contourlength{0.05em} \contournumber{20} \node[] at (3.4,-3.9) { \begin{tikzpicture}[>={Stealth[inset=2pt,length=4.5pt,angle'=28,round]}, scale=0.95, every node/.style={scale=0.95}] \node[rectangle,fill=inputColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (input) at (0,+5pt) {\footnotesize \textbf{Input t}}; \node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (distribute) at (0,-18pt) {\footnotesize \textbf{Distribute}}; \node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (pointnet) at (0,-18pt*2) {\footnotesize \textbf{PointNet}}; \node[rectangle,fill=temporalFusionColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionEarly) at (0,-18pt*3) {\footnotesize \textbf{Temp. Fusion}}; \node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d1c1) at (0,-18pt*4) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d1c2) at (0,-18pt*5) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=temporalFusionColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionMiddle) at (0,-18pt*6) {\footnotesize \textbf{Temp. Fusion}}; \node[rectangle,fill=level2DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (downsample1) at (0+13pt,-18pt*7-3pt) {\footnotesize \textbf{Downsample}}; \node[rectangle,fill=level2DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d2c1) at (0+13pt,-18pt*8-3pt) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (downsample2) at (4+13pt*2,-18pt*9-3pt*2) {\footnotesize \textbf{Downsample}}; \node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (bottleneck1) at (4+13pt*2,-18pt*10-3pt*2) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=temporalFusionColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionBottleNeck) at (4+13pt*2,-18pt*11-3pt*2) {\footnotesize \textbf{Temp. Fusion}}; \node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (upsample1) at (4+13pt*2,-18pt*12-3pt*2) {\footnotesize \textbf{Upsample}}; \node[rectangle,fill=level2UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (u1c1) at (0+13pt,-18pt*13-3pt*3-5pt) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=level2UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (upsample2) at (0+13pt,-18pt*14-3pt*3-5pt) {\footnotesize \textbf{Upsample}}; \node[rectangle,fill=temporalFusionColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionLate) at (0,-18pt*15 -3pt*4-5pt*2) {\footnotesize \textbf{Temp. Fusion}}; \node[rectangle,fill=level1UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (u2c1) at (0,-18pt*16-3pt*4-5pt*2) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=sliceColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (deform-slice) at (0,-18pt*17-3pt*4-5pt*2) {\footnotesize \textbf{DeformSlice}}; \node[rectangle,fill=linearColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (linear) at (0,-18pt*18-3pt*4-5pt*2) {\footnotesize \textbf{Linear}}; \def\ShiftXConcat{-55pt/2 + 13pt/2} \def\ShiftYConcat{18pt/2-12pt/2+3pt/2+5pt/2} \path [draw=black,postaction={on each segment={custom arrow2=black}}, transform canvas={shift={(\ShiftXConcat ,0)}}] (temporalFusionMiddle) to (temporalFusionLate); \path [draw=black,postaction={on each segment={mid arrow=black}}, transform canvas={shift={(\ShiftXConcat ,0)}}] (d2c1) to (u1c1); \node[circle,fill=concatColor, text=white, inner sep=0pt, minimum size=10pt] (concat2) at ([xshift=\ShiftXConcat,yshift=\ShiftYConcat]temporalFusionLate.north) {\footnotesize $\bm{\mathsf{C}}$}; \node[circle,fill=concatColor, text=white, inner sep=0pt, minimum size=10pt] (concat1) at ([xshift=\ShiftXConcat,yshift=\ShiftYConcat]u1c1.north) {\footnotesize $\bm{\mathsf{C}}$ }; \draw[->] (upsample2) |- (concat2); \draw[->] (upsample1) |- (concat1); \draw[->] ($(input.south) +(-10pt,0pt) $) -- ($(distribute.north) +(-10pt,0pt) $) node[midway,xshift=2.2pt] (p-middle) {} node[pos=0.5, right] {P} ; \draw[->] ($(input.south) +(10pt,0pt) $) -- ($(distribute.north) +(10pt,0pt) $) node[pos=0.5, right] {V}; \draw[->] (distribute) -- (pointnet); \draw[->] (pointnet) -- (temporalFusionEarly); \draw[->] (temporalFusionEarly) -- (d1c1); \draw[->] (d1c1) -- (d1c2); \draw[->] (d1c2) -- (temporalFusionMiddle); \draw[->] (downsample1) -- (d2c1); \draw[->] (downsample2) -- (bottleneck1); \draw[->] (bottleneck1) -- (temporalFusionBottleNeck); \draw[->] (temporalFusionBottleNeck) -- (upsample1); \draw[->] (u1c1) -- (upsample2); \draw[->] (temporalFusionLate) -- (u2c1); \draw[->] (u2c1) -- (deform-slice); \draw[->] (deform-slice) -- (linear); \path[draw=black,postaction={on each segment={custom arrow={black} }} ] (p-middle) -- ++(-1,0) |- (deform-slice); \draw[->] ($ (temporalFusionMiddle.south) + (13pt,0) $) -- (downsample1); \draw[->] ($ (d2c1.south) + (4+13pt,0) $) -- (downsample2); \node[rectangle, text=black, inner sep=0pt, minimum width=55pt, minimum height=12pt, align = center] (explaintemporalFusionEarly) at (75+13pt*0,-18pt*3) {\footnotesize Early Fusion}; \node[rectangle, text=black, inner sep=0pt, minimum width=55pt, minimum height=12pt, align = center] (explaintemporalFusionMiddle) at (75+13pt*0,-18pt*6) {\footnotesize Middle Fusion}; \node[rectangle, text=black, inner sep=0pt, minimum width=55pt+10, minimum height=12pt, align = center] (explaintemporalFusionBottleNeck) at (80+13pt*0,-18pt*11-3pt*2) {\footnotesize Bottleneck\\Fusion}; \node[rectangle,text=black, inner sep=0pt, minimum width=55pt, minimum height=12pt, align = center] (explaintemporalFusionLate) at (75+13pt*0,-18pt*15 -3pt*4-5pt*2) {\footnotesize Late Fusion}; \end{tikzpicture} }; \node[] at (0,-3.9) { \begin{tikzpicture}[>={Stealth[inset=2pt,length=4.5pt,angle'=28,round]}, scale=0.95, every node/.style={scale=0.95}] \scriptsize \node[rectangle,fill=inputColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (input) at (0,+5pt) {\footnotesize \textbf{Input t-1}}; \node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (distribute) at (0,-18pt) {\footnotesize \textbf{Distribute}}; \node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (pointnet) at (0,-18pt*2) {\footnotesize \textbf{PointNet}}; \node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionEarly) at (0,-18pt*3) {\footnotesize \textbf{Temp. Fusion}}; \node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d1c1) at (0,-18pt*4) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d1c2) at (0,-18pt*5) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionMiddle) at (0,-18pt*6) {\footnotesize \textbf{Temp. Fusion}}; \node[rectangle,fill=level2DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (downsample1) at (0+13pt,-18pt*7-3pt) {\footnotesize \textbf{Downsample}}; \node[rectangle,fill=level2DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d2c1) at (0+13pt,-18pt*8-3pt) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (downsample2) at (0+13pt*2,-18pt*9-3pt*2) {\footnotesize \textbf{Downsample}}; \node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (bottleneck1) at (0+13pt*2,-18pt*10-3pt*2) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionBottleNeck) at (0+13pt*2,-18pt*11-3pt*2) {\footnotesize \textbf{Temp. Fusion}}; \node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (upsample1) at (0+13pt*2,-18pt*12-3pt*2) {\footnotesize \textbf{Upsample}}; \node[rectangle,fill=level2UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (u1c1) at (0+13pt,-18pt*13-3pt*3-5pt) {\footnotesize \textbf{ResNet Block}}; \node[rectangle,fill=level2UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (upsample2) at (0+13pt,-18pt*14-3pt*3-5pt) {\footnotesize \textbf{Upsample}}; \node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionLate) at (0,-18pt*15 -3pt*4-5pt*2) {\footnotesize \textbf{Temp. Fusion}}; \node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (u2c1) at (0,-18pt*16-3pt*4-5pt*2) {\footnotesize ResNet Block}; \node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (deform-slice) at (0,-18pt*17-3pt*4-5pt*2) {\footnotesize DeformSlice}; \node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (linear) at (0,-18pt*18-3pt*4-5pt*2) {\footnotesize Linear}; \def\ShiftXConcat{-55pt/2 + 13pt/2} \def\ShiftYConcat{18pt/2-12pt/2+3pt/2+5pt/2} \path [draw=black,postaction={on each segment={custom arrow2=black}}, transform canvas={shift={(\ShiftXConcat ,0)}}] (d1c2) to ($ (temporalFusionLate) + (0,0.25) $); \path [draw=black,postaction={on each segment={mid arrow=black}}, transform canvas={shift={(\ShiftXConcat ,0)}}] (d2c1) to (u1c1); \node[circle,fill=concatColor, text=white, inner sep=0pt, minimum size=10pt] (concat2) at ([xshift=\ShiftXConcat,yshift=\ShiftYConcat]temporalFusionLate.north) {\footnotesize $\bm{\mathsf{C}}$}; \node[circle,fill=concatColor, text=white, inner sep=0pt, minimum size=10pt] (concat1) at ([xshift=\ShiftXConcat,yshift=\ShiftYConcat]u1c1.north) {\footnotesize $\bm{\mathsf{C}}$ }; \draw[->] (upsample2) |- (concat2); \draw[->] (upsample1) |- (concat1); \draw[->] ($(input.south) +(-10pt,0pt) $) -- ($(distribute.north) +(-10pt,0pt) $) node[midway,xshift=2.2pt] (p-middle) {} node[pos=0.5, right] {P} ; \draw[->] ($(input.south) +(10pt,0pt) $) -- ($(distribute.north) +(10pt,0pt) $) node[pos=0.5, right] {V}; \draw[->] (distribute) -- (pointnet); \draw[->] (pointnet) -- (d1c1); \draw[->] (d1c1) -- (d1c2); \draw[->] (downsample1) -- (d2c1); \draw[->] (downsample2) -- (bottleneck1); \draw[->] (bottleneck1) -- (upsample1); \draw[->] (u1c1) -- (upsample2); \draw[->] ($ (d1c2.south) + (13pt,0) $) -- (downsample1); \draw[->] ($ (d2c1.south) + (13pt,0) $) -- (downsample2); \fill[fill = white] ($ (pointnet.south) + (0.1,-0.6) $) rectangle ++($ (2.2,0.6) $); \draw[overlay,->, -{Stealth[scale=1.0]} , color = moving-car,line width=0.4mm] ($ (pointnet.south) + (0,-0.4) $) -- ($ (pointnet.south) - (-2.2,0.4) $); \fill[draw = white, fill = white] ($ (d1c2.south) + (1,-0.6) $) rectangle ++($ (1.3,0.6) $); \draw[overlay,->, -{Stealth[scale=1.0]} , color = moving-car,line width=0.4mm] ($ (d1c2.south) + (0.48,-0.4) $) -- ($ (d1c2.south) - (-2.2,0.4) $); \fill[draw = white, fill = white] ($ (temporalFusionBottleNeck.south) + (0.1,0.0) $) rectangle ++($ (2.3,0.4) $); \draw[overlay,->, -{Stealth[scale=1.0]}, color = moving-car,line width=0.4mm] ($ (temporalFusionBottleNeck.south) + (0.0,0.2) $) -- ($ (temporalFusionBottleNeck.south) - (-2.3,-0.2) $); \fill[draw = white, fill = white] ($ (concat2.south) + (0.1,-0.5) $) rectangle ++($ (2.8,0.5) $); \draw[overlay,->, -{Stealth[scale=1.0]}, color = moving-car,line width=0.4mm] ($ (concat2.south) + (0.0,-0.0) $) |- ($ (concat2.south) - (-2.8,0.22) $); \end{tikzpicture} }; \end{tikzpicture} \caption{Recurrent architecture: The features from previous time-steps are fused in the current time-step at multiple levels of the network. This allows the network to distinguish dynamic and static objects. Our addition to the LatticeNet architecture are the temporal connections ({\color{moving-car}$\pmb{\rightarrow}$}) and the temporal fusion blocks (\crule[ph-purple!60]{8pt}).} \label{fig:rnn__architecture} \end{figure} \egroup \subsection{Recurrent Layers} \label{sec:recurrence} In this section, multiple different recurrent layers are presented and discussed that can be used to fuse $\mathbf{H}^{(t-1)}$ and $\mathbf{X}^{(t)}$. For the last point cloud $P_t$ of the sequence, the previous hidden state $\mathbf{H}^{(n-1)}$ is used to generate the network's prediction. For $t=0$, no computation is performed with $\mathbf{H}^{(0)} = \mathbf{X}^{(0)}$. In order to fuse $\mathbf{H}^{(t-1)}$ and $\mathbf{X}^{(t)}$, they need the same shape and therefore $\mathbf{H}^{(t-1)}$ is padded with zeros (\reffig{fig:temporal_fuse}). \textbf{Long short-term memory (LSTM): } LSTMs \cite{hochreiter1997long} are often used to counteract the problem of vanishing or exploding gradients in sequence learning and show good results for these problems \cite{chung2014empirical}. Therefore we chose them as one recurrent module for our network. \textbf{Gated recurrent units (GRU): } As an extension to LSTMs, GRUs were introduced by Cho~et al.~\cite{cho2014learning}. They only use an input and a hidden gate and no cell state like LSTMs and are therefore possibly better suited for our task. The performance of GRUs is comparable to LSTMs, while having a lower memory consumption \cite{chung2014empirical}. \textbf{Abstract Flow (AFlow): } \begin{figure}[t] \centering \vspace*{3mm} \includegraphics[width = 0.9\linewidth]{FlowModule.png} \caption Abstract Flow module: Features from the one-hop neighborhood of the previous timestep $\mathbf{H}^{(t-1)}$ are compared with the center feature $\mathbf{x}_v$ at the current time. A weighted sum is computed based on the distance. The result is concatenated with $\mathbf{x}_v$ and fused using an MLP. A direction can also be established in lattice space between the center feature and the most similar feature from the previous time-step which gives a coarse notion of the movement in the 3D scene as indicated by the arrow. Please note that this figure depicts a 2D example. } \label{fig:cli_module} \end{figure} This module is inspired by the CLI module presented by Shi~et al.~\cite{shi2020spsequencenet} that aims at combining local information and capturing temporal information between two point clouds. Our AFlow module can be seen as a convolution with an adaptive convolution kernel. This resembles the ideas presented in Pixel-Adaptive Convolution\cite{su2019pixel}. Therefore, AFlow is designed to extract partial differences between $\mathbf{X}^{(t)}$ and $\mathbf{H}^{(t-1)}$. First, the nearest neighbors $N(v)$ of each lattice vertex $v$ with $v \in V^{(t)}$ in the lattice from the previous timestep $V^{(t-1)}$ are found (\reffig{fig:cli_module}). They are used to generate a new local feature vector to fuse temporal information and at the same time summarize the surrounding area from the previous timestep. The neighbors $N(v)$ for each lattice vertex are given by the one-hop neighborhood. The neighboring feature vectors from $V^{(t-1)}$ are denoted with $N_{\mathbf{H}}(v)$. For $d=3$, the number of neighbors is given by $|N_{\mathbf{H}}(v)| = 8$. The feature vectors of the vertices in $N_{\mathbf{H}}(v)$ are weighted according to their distance to the feature vector $\mathbf{x}_v$ in $\mathbf{X}^{(t)}$. The weight is calculated as \begin{equation} \forall i \in N_{\mathbf{H}}(v): w_{i} = (\alpha - min(dist(\mathbf{x}_v, \mathbf{h}_i), \alpha))\cdot \beta, \end{equation} where $\alpha$ and $\beta$ are learnable parameters that are initialized with $\alpha, \beta = 0.1$. Parameter $\alpha$ impacts the maximum distance a neighbor can have from the feature vector we are evaluating at the moment, while $\beta$ controls the maximum value of the resulting feature. We denote with $dist$ the Euclidean distance between the feature vectors $\mathbf{x}_v$ and $\mathbf{h}_i$ . The AFlow feature matrix $\mathbf{L}$ has the same dimensionality as $\mathbf{X}^{(t)}$. Its feature vectors $\mathbf{l}_v$ are calculated as \begin{equation} \mathbf{l}_v = \sum_{i=1}^{8} \mathbf{h}_i \cdot w_{i}. \end{equation} $\mathbf{L}$ is then concatenated with $\mathbf{X}^{(t)}$ along the channels dimension and passed through a linear layer followed by a non-linearity to obtain the new feature matrix $\mathbf{H}^{(t)}$. The weights calculated in AFlow measure the similarity between features at different timesteps. Similar features that move through time correspond to moving objects in 3D space. We visualize in~\reffig{fig:cli_module} the design of the module and the direction between the center feature and the most similar feature at the previous timestep. Further experiments with the directionality are discussed in \refsec{sec:quali_res}. \subsection{Network Architectures} \label{sec:arch_architecture} The recurrent layers and the recurrence positions can be combined arbitrarily. To distinguish the different architectures, the following notation is used: The four recurrence layers are separated by a hyphen, e.g. GRU-GRU-AFlow-GRU refers to a network that has a GRU for the early, middle and late fusion and an AFlow module for the bottleneck fusion. \section{Experiments} We evaluate our network architectures by calculating the mean Intersection-over-Union (mIoU) on the SemanticKITTI \cite{behley2019semantickitti} dataset. It provides 3D LiDAR-scans from real urban environments and semantic per-point annotations for moving and non-moving classes. We additionally evaluate the impact of the per-point feature matrix $\mathbf{F}$ onto the network: The two possibilities are an empty feature matrix, which forces the network to predict based only on the point positions, and an $\mathbf{F}$ filled with the points' reflectance values. \subsection{Implementation} \label{sec:eval_impl} All lattice operators with forward and backward passes are implemented on the GPU \cite{rosu2019latticenet} and exposed to PyTorch~\cite{paszke2017automatic}. All convolutions are pre-activated using a ReLU unit \cite{he2016identity,huang2017densely}. For the lattice scale $\pmb{\sigma} = 0.6$ was used and the batch size was chosen as 1. The models were trained using the Adam optimizer \cite{kingma2014adam, adamw} with a learning rate of $0.001$ and a weight decay of \num{e-4}. The learning rate was reduced by a cosine annealing scheduler \cite{sgdr}. The number of epochs between two restarts was chosen as three since less frequent restarts tended to cause over-fitting. \subsection{SemanticKITTI Dataset} \label{sec:experiments} The SemanticKITTI \cite{behley2019semantickitti} dataset contains semantically annotated LiDAR scans from the KITTI dataset \cite{Geiger2013IJRR}. The annotations are done for a total of 19 different classes in the single scan task and 25 different classes for the multiple scans task. The scans vary in size from 82K to 129K points with a total of 4,549 million points annotated. In addition to the x, y, and z coordinates, the reflectance value for each point is given. We process each scan entirely without any cropping. The training data is augmented with random rotations around the height-axis, mirroring, translation around the other two axes, and random per-point noise. \subsection{Generating Predictions} The hyperparameters sequence length $n$ and cloud scope $s, \text{with } s \in \mathbb{N}$, have to be chosen for the dataset. The sequence length $n$ defines the cardinality of the input for the network and was chosen as $3 \leq n \leq 5$. We observed that $n < 3$ doesn't allow the network to aggregate enough information, while $n > 5$ leads to memory and time constraints. A sequence length of $n = 4$ worked best for our models. For SemanticKITTI $s = 3$ was chosen, which means that between clouds in the sequence $P$ two clouds in the dataset are skipped. We've found that using directly consecutive clouds ($s = 1$) can negatively impact the segmentation results since the input clouds are too similar and therefore choose for all our experiments a cloud scope $s=3$. It is to be noted that during training we need to keep all input clouds in memory in order to perform back-propagation through time, while during inference we evaluate only the cloud at the current time-step since the features from previous time-step are already stored in memory. This recursive formulation yields inference speed that is similar to the original LatticeNet architecture which operated on a single-scan. \subsection{Quantitative Results} \label{sec:quant_res} \bgroup \def\checkmark{\tikz\fill[scale=0.2](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;} \newcolumntype{Q}{C{2cm}} \begin{table} \vspace*{1mm} \caption{Results on SemanticKITTI for different versions of our own architecture. The network with the best result is used in \reftab{tab:semanticKitti_comparison} for comparisons.} \centering \begin{tabularx}{\columnwidth}{L{4cm}c|Q} \toprule Approach & mIoU &with reflectance\\ \midrule LSTM-LSTM-AFlow-LSTM & 46.7 & \checkmark \\ GRU-GRU-AFlow-AFlow & 46.9 & \checkmark \\ GRU-GRU-AFlow-GRU & \textbf{47.1} & \checkmark\\ GRU-GRU-/-GRU & 44.1 & \checkmark\\ \midrule GRU-GRU-AFlow-GRU & 42.8 & x\\ LatticeNet-MLP~\cite{rosu2021latticenetauro} & 45.2 & x\\ \bottomrule \end{tabularx} \label{tab:semanticKitti_comparison_inside} \end{table} \egroup \bgroup \newcolumntype{Q}{C{0.19cm}} \begin{table*} \scriptsize \vspace*{1mm} \caption{State-of-the-art results on SemanticKITTI in comparison to our best performing network.\protect\footnotemark} \centering \begin{tabularx}{\textwidth}{L{2.2cm}c|QQQQQQQQQQQQQQQQQQQQQQQQQ} \toprule Approach & \begin{sideways}mIoU\end{sideways} & \begin{sideways}car\end{sideways} & \begin{sideways}truck\end{sideways} & \begin{sideways}other-vehicle\end{sideways} & \begin{sideways}person\end{sideways} & \begin{sideways}bicyclist\end{sideways} & \begin{sideways}motorcyclist\end{sideways} & \begin{sideways}road\end{sideways} & \begin{sideways}parking\end{sideways} & \begin{sideways}sidewalk\end{sideways} & \begin{sideways}other-ground\end{sideways} & \begin{sideways}building\end{sideways} & \begin{sideways}fence\end{sideways} & \begin{sideways}vegetation\end{sideways} & \begin{sideways}trunk\end{sideways} & \begin{sideways}terrain\end{sideways} & \begin{sideways}pole\end{sideways}& \begin{sideways}traffic sign\end{sideways}& \begin{sideways}moving-car\end{sideways}& \begin{sideways}moving-bicyclist\end{sideways}& \begin{sideways}moving-person\end{sideways}& \begin{sideways}moving-motorcyclist\end{sideways}& \begin{sideways}moving-other-vehicle\end{sideways}& \begin{sideways}moving-truck\end{sideways}\\ \midrule TangentConv\cite{tatarchenko2018tangent} & 34.1 & 84.9 &2.0 &18.2 &21.1 &18.5 &1.6 &83.9 &38.3 &64.0 &15.3 &85.8 &49.1 &79.5 &43.2 &56.7 &36.4 &31.2 &40.3 &1.1 &6.4 &1.9 &\textbf{30.1} &\textbf{42.2} \\ DarkNet53Seg\cite{behley2019semantickitti} & 41.6 & 84.1 &30.4 &32.9 &20.2 &20.7 &7.5 &91.6 &\textbf{64.9}&75.3 &\textbf{27.5} &85.2 &56.5 &78.4 &50.7 &64.8 &38.1 &53.3 &61.5 &14.1 &15.2 &0.2 &28.9 &37.8 \\ SpSequenceNet\cite{shi2020spsequencenet} & 43.1 & 88.5 &24.0 &26.2 &29.2 &22.7 &6.3 &90.1 &57.6 &73.9 &27.1 &91.2 &\textbf{66.8} &84.0 &66.0 &65.7 &50.8 &48.7 &53.2 &41.2 &26.2 &36.2 &2.3 &0.1 \\ KPConv\cite{thomas2019KPConv} & \textbf{51.2} & \textbf{93.7}& 44.9& \textbf{47.2}& \textbf{42.5}& \textbf{38.6}& \textbf{21.6}& 86.5& 58.4& 70.5& 26.7& 90.8& 64.5& \textbf{84.6}& \textbf{70.3}& 66.0& 57.0& 53.9& \textbf{69.4}& \textbf{67.4}& \textbf{67.5}& 47.2& 4.7& 5.8 \\ TemporalLidarSeg\cite{duerr2020lidar} & 47.0 & 92.1 &\textbf{47.7}&40.9 &39.2 &35.0 &14.4 &\textbf{91.8}&59.6 &\textbf{75.8} &23.2 &89.8 &63.8 &82.3 &62.5 &64.7 &52.6 &\textbf{60.4} &68.2 &42.8 &40.4 &12.9 &12.4 &2.1 \\ LatticeNet-MLP\cite{rosu2021latticenetauro} & 45.2 & 91.1& 16.8& 25.0& 29.7& 23.1& 6.8& 89.7& 60.5& 72.5& 26.9& \textbf{91.9}& 64.7& 82.9& 65.0& 63.7& 54.7& 47.1& 54.8& 44.6& 49.9& \textbf{64.3}& 0.6& 3.5 \\ \midrule Ours & 47.1 & 91.6& 35.4& 36.1& 26.9& 23.0& 9.4& 91.5& 59.3& 75.3& \textbf{27.5}& 89.6& 65.3& \textbf{84.6}& 66.7& \textbf{70.4}& \textbf{57.2}& \textbf{60.4}& 59.7& 41.7& 9.4& 48.8& 5.9& 0.0 \\ \bottomrule \end{tabularx} \label{tab:semanticKitti_comparison} \end{table*} \egroup We evaluated five different variants of our architectures on the test set of SemanticKITTI and report their resulting mIoU in \reftab{tab:semanticKitti_comparison_inside}. We observe that the AFlow module resulted in an improved mIoU of 3.0 points, compared to the base-network that only utilizes GRUs. Adding another AFlow layer at the late fusion instead of an GRU resulted in slightly worse results, which can be explained by the lower feature dimension and therefore a lack of comparability in feature space. Without using the reflectance as input, the result deteriorated significantly. The reason for this might be that the reflectance is a very useful feature for distinguishing similar feature vectors. This applies to the other recurrent blocks as well, albeit not as severely. Additionally, we evaluate the performance of the original LatticeNet~\cite{rosu2019latticenet} on temporal data. For this experiment, we accumulated all clouds of a sequence and used this cloud as input. The results were worse than all comparable temporal networks. To compare our network's results to the state-of-the-art on SemanticKITTI, we chose the best performing network GRU-GRU-AFlow-GRU. The IoU for all 25 classes are presented in \reftab{tab:semanticKitti_comparison}. We improved performance in relation to our previously published architecture LatticeNet-MLP~\cite{rosu2019latticenet}. Our best network has outstanding performance in the segmentation of the classes ‘vegetation’, ‘terrain’, ‘pole’, and ‘traffic sign’. An explanation for the results on ‘traffic sign’ and ‘pole’ is that they are only represented by a small number of points and having multiple clouds can help with a better segmentation quality. Our network's performance is comparable to TemporalLidarSeg~\cite{duerr2020lidar}, but is outperformed by KPConv~\cite{thomas2019KPConv} with a mIoU that is smaller by $4.1$ points. It is to be noted that KPConv~\cite{thomas2019KPConv} cannot process the whole cloud due to memory constraints, but has to rely on fitting multiple spheres into the cloud to ensure that each point is tested multiple times. The final result is then determined by a voting scheme, in contrast to our approach that processes the whole cloud at once with a single prediction. TemporalLidarSeg~\cite{duerr2020lidar}, on the other hand, relies on the spherical projection of the 3D cloud to perform 2D operations, while our approach is able to utilize the 3D cloud without any projection. \bgroup \newcolumntype{M}{L{4cm}} \newcolumntype{Q}{R{1.0cm}} \newcolumntype{P}{L{1.0cm}} \begin{table} \footnotesize \caption{Average time used by the forward pass and the maximum memory used during training. } \centering \begin{tabularx}{\columnwidth}{M|QP} \toprule & \multicolumn{2}{c}{SemanticKITTI} \\ & \multicolumn{1}{r}{$\left[\SI{}{\milli\second}\right]$} & \multicolumn{1}{l}{$\left[\SI{}{\giga\byte}\right]$}\\ \midrule LSTM-LSTM-AFlow-LSTM & 151\ph&\ph20 \\ GRU-GRU-AFlow-GRU & 154\ph&\ph20 \\ GRU-GRU-AFlow-AFlow & 159\ph&\ph22 \\ GRU-GRU-/-GRU & 140\ph&\ph18 \\ \midrule KPConv\cite{thomas2019KPConv} & 225\ph&\ph15 \\ SpSequenceNet\cite{shi2020spsequencenet} & 477\ph&\ph3 \\ \bottomrule \end{tabularx} \label{tab:perf-results} \end{table} \egroup We present the performance results in \reftab{tab:perf-results}. The measurements were taken on a NVIDIA GeForce RTX 3090 and the inference time was measured on the validation set. Each AFlow module increases the inference time and memory consumption, caused by the high number of weights in the AFlow module and the distance calculation per vertex. We are able to segment the cloud faster than KPConv\cite{thomas2019KPConv}, because we are able to reuse feature matrices from previous segmentations due to our recurrent architecture. \subsection{Qualitative Results} \label{sec:quali_res} \bgroup \newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}} \begin{figure}[t] \centering \vspace*{3mm} \includegraphics[width = \linewidth]{Comparison.png} \caption{In comparison to SpSequenceNet, we are able to better segment stationary~(\crule[car]{8pt}) and moving cars~(\crule[moving-car]{8pt}) in small streets with a high number of cars in the vicinity. SpSequenceNet \cite{shi2020spsequencenet} was the best network that provided pretrained models and was therefore chosen as the comparison. In this example, it is able to better distinguish the road~(\crule[road]{8pt}) from a sidewalk~(\crule[parking]{8pt}). Unlabeled~(\crule[unlabeled]{8pt}) points are ignored during training. } \label{fig:comparison_images} \end{figure} \egroup We present a visual comparison of the segmentation quality of our method with SpSequenceNet in \reffig{fig:comparison_images}. \bgroup \newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}} \begin{figure} \centering \includegraphics[width = \linewidth]{CLI.png} \caption{Visualization of the AFlow module on the segmentation: Birds-eye view of a car at two different time-steps. The correspondence between the car in the previous timestep~(\crule[ph-dark-blue!80]{8pt}) and the current timestep~(\crule[ph-dark-red]{8pt}) is made by the module and therefore the car is correctly segmented as moving-car.} \label{fig:cli} \end{figure} \egroup In order to analyze the effects of the AFlow model, we mapped the previously mentioned directionality to 3D space in order to show a coarse direction of movement of the 3D objects. Lattice vertices are approximated in 3D by the average of the 3D points that contribute to them. In~\reffig{fig:cli}, we show one car at two different timesteps. For each lattice vertex in 3D, we draw an arrow showing the direction of the most similar feature from the current time towards the previous timestep. We see that for a car driving towards the left, the directionality from AFlow corresponds to the inverse of the driving direction. \bgroup \newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}} \begin{figure} \centering \begin{subfigure}[b]{\linewidth} \includegraphics[width=\linewidth]{Failure_GT.png} \vspace*{-6mm} \caption{Ground truth segmentation.} \label{fig:gt_failure} \end{subfigure} \vspace*{3mm} \begin{subfigure}[b]{\linewidth} \includegraphics[width=\linewidth]{Failure.png} \vspace*{-6mm} \caption{Predicted segmentation.} \label{fig:failure} \end{subfigure} \caption{Failure case: The prediction fails for the car on the left side, because it is predicted as car~(\crule[car]{8pt}) instead of moving-car~(\crule[moving-car]{8pt}). The reason for this is that the car is waiting at the crossroads for many timesteps.} \label{fig:failure_prediction} \end{figure} \egroup A failure case of our architecture is moving objects that are waiting/standing still for a duration that exceeds our temporal scope. An example of a car that is waiting at a crossroad is presented in \reffig{fig:failure}. This shouldn't result in problems for an autonomous agent that takes actions based on this segmentation, because the object actually is standing still and is correctly classified as moving once it starts driving again. \section{Conclusion} \footnotetext{We only compare to already published approaches.} We presented an extension to the original LatticeNet~\cite{rosu2019latticenet} for temporal semantic segmentation. We evaluate different recurrence modules and propose a novel Abstract Flow module that better integrates temporal information. On the SemanticKITTI dataset we achieve comparative results with other baselines while running faster and being able to process the full point cloud at once. \addtolength{\textheight}{-12cm} \section*{Acknowledgment} This work has been funded by the German Federal Ministry of Education and Research (BMBF) in the project ”Kompetenzzentrum: Aufbau des Deutschen Rettungsrobotik-Zentrums” (A-DRZ). \clearpage \bibliographystyle{IEEEtran}
a6c2e2dfcbfb8b79a961513b95c32823bb3d3b81
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:level1} Ptychography is a coherent diffractive imaging (CDI) method that has found use in light, x-ray and scanning transmission electron microscopies (STEM). The method combines whole diffraction patterns from spatially overlapping regions to reconstruct the structure of a specimen for arbitrarily large fields of view \cite{rodenburg2008ptychography}, with many advantages over other imaging methods \cite{humphry2012ptychographic,lozano2018low,jiang2018electron,zhou2020low}. The development of new hardware \cite{mcmullan2016direct, tate2016high} and reconstruction algorithms \cite{thibault2008high, maiden2009improved} has led to ptychography becoming a mature electron microscopy technique \cite{jiang2018electron}. Current research to further improve this technique is driven by the desire to investigate thick samples \cite{van2012method,maiden2012ptychographic,van2013general,tsai2016x,jiang2018breaking} as well as to lower the required electron dose \cite{pelz2017bayesian, song2019atomic, schloz2020overcoming, chen2020mixed}. In order to lower the electron dose used, researchers have tried to vary various experimental parameters while preserving information redundancy through overlapping probes. One approach involves a defocused probe rastered across the specimen, with a less dense scan pattern. This uses therefore a lower dose than focused probe ptychography, but introduces additional complications for the reconstruction algorithm due to an increased need to account for partial spatial coherence in the illuminating probe \cite{chen2020mixed}. Another approach is simply to scan faster - by lowering the probe dwell time per probe position, an overall decrease in dose can be realized. However, this comes with its own limitations, as the physical limits of the electron source, microscope, and camera all must be considered. Finally, a third approach is the optimization of the scan pattern, deviating from a raster grid in favour of a generally more efficient pattern \cite{huang2014optimization}. This approach can, however, only yield a limited improvement in reconstruction quality as it is not capable of taking into account the structure of the specimen in the scan pattern. In this paper we present an approach particularly tailored for electron ptychography that enables reduction of the electron dose through adaptive scanning. It is based upon the idea that, at atomic resolution, ptychography requires an increased information redundancy through overlapping illuminating beams only at regions that contain atomic structure of the scanned specimen. We present here an algorithm that scans only the regions with the highest information content in order to strongly improve the ptychographic reconstruction quality while keeping the total number of scan positions, and therefore the total dose, low. The scan positions are predicted sequentially during the experiment and the only information required for the prediction process is the diffraction data acquired at previous scan positions. The scan position prediction model of the algorithm is a mixture of deep learning models, and the model training is performed with both supervised and reinforcement learning. The synergy of deep learning and reinforcement learning has already shown strong performance in various dynamic decision making problems, such as playing Atari games \cite{mnih2013playing}, or Go \cite{silver2016mastering}, as well as tasks in robotics \cite{levine2016end, andrychowicz2020learning} and visual recognition \cite{sharma2015action, ba2014multiple, mnih2014recurrent}. The success of this approach, despite the complexity of the problems that they had to overcome, can be attributed to their algorithms' ability of learning independently from data. Similarly, the proposed algorithm here solves a sequential decision making problem by learning from a large amount of simulated or, if available, experimental ptychographic data consisting of hundreds to thousands of diffraction patterns. Here, the focus of the learning is specifically designed to maximize the dynamic range in the reconstruction for each individual scan position. The algorithm then transfers the learned behaviour it developed offline to a realistic experimental environment. Our approach is conceptually related to the subfield of computer vision that focuses on identifying relevant regions of images or video sequences for the purpose of classification or recognition. However, there are fundamental differences not only in the purpose, but also in the solution strategy for our application in contrast to computer vision tasks. Differences include a lack of direct access to images (updated real space information is only accessible through a highly optimized reconstruction algorithm), non-optimal parameter settings of the reconstruction algorithm and experimental uncertainties such as imprecise scan positioning of the microscope or contamination of the specimen requiring pre-processing of the reconstructed image, and the necessity of a much larger number of measurements requiring methods that improve the performance of the sequential decision making process. Work in adaptive scanning for x-ray fluorescence imaging \cite{betterton2020reinforcement} and for scanning probe microscopy \cite{vasudevan2020autonomous} has recently been reported. The work in \cite{betterton2020reinforcement} uses RL to determine the exposure time on a per pixel basis sequentially for multiple apertures that vary in their respective resolution. It is therefore more closely related to previous work in scanning electron microscopy that divides the measurement into a low-dose raster scan and a subsequent high-dose adaptive scan \cite{dahmen2016feature}. The latter work in \cite{vasudevan2020autonomous} uses Gaussian processes based Bayesian optimization to sequentially explore the image space with the scanning probe. However, it has been reported that this model suffers in performance as it lacks prior knowledge of the domain structure, which can be compensated by including a deep learning model with domain specific knowledge. Our proposed algorithm is the first application of adaptive scanning to ptychography, and is further unique in that the scan pattern is predicted using prior knowledge about the sample in the form of a pre-trained deep RL network, thereby improving performance. Our research forms a basis for a new avenue of automated and autonomous microscopy \cite{kalinin2021automated}. With the ever-increasing data storage capacities, implementations of data infrastructures and data sharing platforms \cite{o2016materials, draxl2018nomad, draxl2019nomad,dillen2019zenodo}, access to ptychographic data will be further facilitated and data-driven adaptive scanning schemes can be applied to a vast number of ptychographic experiments. We demonstrate the performance of our algorithm using experimentally acquired data. Our analysis shows that the algorithm can sufficiently learn information about the structure of a material from data in order to optimize the scan behaviour of the microscope in a real experiment. For low dose experiments, we show that adaptive scanning can improve the ptychographic reconstruction quality by up to $25.75\%$ and the resolution by up to $31.59\%$ compared to a non-adaptive (random) scan method. Adaptive scanning allows for the retrieval of the material's structure in this low dose regime and even improves the resolution of the reconstruction when compared to the reconstruction obtained using the conventional high dose raster grid scan approach. \section{Methods} \subsection{Image formation in ptychography} \label{sec:ptycho} Single slice ptychography can be expressed by a multiplicative approximation that describes the interaction of a wavefunction $\psi^{in}_p(\textbf{r})$ of an incoming beam with the transmission function $t(\textbf{r})$ of a specimen. For each measurement $p$, the beam is shifted by $\textbf{R}_p$ and a diffraction pattern is acquired with the intensity $I_p$ that is expressed by: \begin{equation} \label{eq:intensity} \begin{split} I_p = |\Psi^{ex}_p(\textbf{k})|^2 = |\mathcal{F} \left[ \psi^{in}_p(\textbf{r}-\textbf{R}_p) t(\textbf{r}) \right]|^2, \end{split} \end{equation} where $\mathcal{F}$ is the Fourier propagator, $\textbf{r}$ the real space coordinate, $\textbf{k}$ the reciprocal space coordinate and $\Psi^{ex}_p(\textbf{k})$ the exit wavefunction at the detector. According to the strong phase object approximation, the transmission function can be defined as $t(\textbf{r}) = e^{i \sigma V(\textbf{r})}$, with the interaction constant $\sigma$ and the complex quantity $V(\textbf{r})$, where the real part $V_{re}(\textbf{r})$ corresponds to the local projected electrostatic potential and the imaginary part $V_{im}(\textbf{r})$ accounts for absorption or scattering outside the range of scattering angles and energy losses recorded by the detector. Throughout the remainder of this paper, the variable $\sigma$ is absorbed into $V(\textbf{r})$. X-ray and optical ptychography is mathematically described similarly with the only difference that the transmission function $t(\textbf{r})$ is related to the complex refractive index of the specimen. Figure \ref{fig:scheme} illustrates the experimental configuration of conventional ptychography. \begin{figure \includegraphics[width=0.9\linewidth]{figs/PtychoExperiment2.png} \centering \caption{Experimental setup in ptychography. At the scan position $\textbf{R}_p$ of the scan sequence, the beam illuminates a sample, where the incident electron wave $\psi^{in}_p(\textbf{r}-\textbf{R}_p)$ interacts with the transmission function $t(\textbf{r})$. The wave exiting the sample is propagated by a Fourier transform to the detector located in the far field and the intensity $I_p = |\Psi^{ex}_p(\textbf{k})|^2$ is recorded.} \label{fig:scheme} \end{figure} The potential of the specimen is recovered from data of experimentally acquired diffraction patterns $J_p$ using a reconstruction algorithm. Here, we apply a gradient based algorithm \cite{schloz2020overcoming} with a gradient decent optimization and the potential is retrieved by iteratively minimizing the loss function: \begin{equation} \label{eq:ptycho} \mathcal{L}(V) = \frac{1}{P}\sum^P_{p=1} \Vert I_p(V) - J_p\Vert^2_2 . \end{equation} Although the approach described in this paper is compatible with multisclice ptychography, in light of the application to a 2D material we constrain ourselves to single-slice ptychography. \subsection{Generation of scan sequences} \label{sec:rnn} \noindent We consider a recurrent neural network (RNN) \cite{rumelhart1986learning, elman1990finding, werbos1988generalization} for the generation of scan sequences. Its network architecture is designed to model temporal sequences with recurring input information. Memory cells combine the current input information $X_t$ with the hidden state $H_t$ and map it to the next hidden state $H_{t+1}$. These hidden states represent the memory gathered from all the previous time steps. At every time step $t$, an output is generated on the basis of the current hidden state. In the implementation shown here, the output corresponds to a sub-sequence of scan positions, given by a vector of 2D coordinates $\vec{\textbf{R}}_{P_t}$. In principle, the output can be reduced to a single scan position $\textbf{R}_{p_t}$, but we do not for to practical reasons that will be discussed later. The sub-sequence is predicted via a fully connected layer (FC) that is parameterized by the layer weights $\theta_H$: \begin{equation} \label{eq:H2R} \vec{\textbf{R}}_{P_t} = \text{FC}_{\theta_H}(H_t). \end{equation} At the predicted scan positions $\vec{\textbf{R}}_{P_t}$, diffraction patterns $\boldsymbol{J}_{P_t}$ are acquired by the microscope and from these diffraction patterns a potential $V_t(\textbf{r})$ is reconstructed minimizing Eq. (\ref{eq:ptycho}). The intermediate reconstruction $V_t(\textbf{r})$ combined with its corresponding sub-sequence of scan positions $\vec{\textbf{R}}_{P_t}$ can then be used for the input information $X_t$ of the RNN. However, the bandwidth of the information given in $V_t(\textbf{r})$ and $\vec{\textbf{R}}_{P_t}$ differs strongly and thus pre-processing is required before the two components can be concatenated and mapped to $X_t$. For the processed location information $\textbf{L}_t$ based on the sub-sequence $\vec{\textbf{R}}_{P_t}$, a FC that is parameterized by the weights $\theta_R$ is used: \begin{equation} \label{eq:R2L} \textbf{L}_t = \text{FC}_{\theta_R}(\vec{\textbf{R}}_{P_t}). \end{equation} For the processed structure information $\textbf{C}_t$ based on the reconstructed potential $V_t(\textbf{r})$, a compressed representation $z_t$ is generated by using the encoder part of a convolutional autoencoder \cite{masci2011stacked}. This processing step is described in more detail in appendix \ref{sec:auto}. The compressed representation $z_t$ is then fed into a FC that is parameterized by the weights $\theta_z$: \begin{equation} \label{eq:V2z} \textbf{C}_t = \text{FC}_{\theta_z}(z_t). \end{equation} The processed location information $\textbf{L}_t$ is subsequently concatenated with the processed structure information $\textbf{C}_t$ and mapped to the input information $X_t$ with a FC that is parameterized by the weights $\theta_{LC}$. The whole process of predicting sub-sequences of scan positions and acquiring the corresponding diffraction patterns is repeated until a ptychographic dataset of desired size is reached. In practice and even after a reduction through adaptive scanning, several hundreds to thousands of diffraction patterns are required for effective ptychography. Covering this range of scan positions with a strong prediction performance requires efficient training of a large RNN. Backpropagation through time (BPTT) is typically used to generate the required gradients to update the network weights $\theta = \{ \theta_H,\theta_{\text{GRU}},\theta_{LC},\theta_R, \theta_z \}$ of the RNN. Its foundation on the chain-rule, with terms being multiplied by themselves as many times as the length of the network, can result in problems with training efficiency. For even the most basic RNN architectures, BPTT fails for relatively short sequences due to the so-called $\textit{vanishing}$ or $\textit{exploding}$ gradient problem \cite{bengio1994learning}. To circumvent this issue a more complex RNN architecture was proposed by Hochreiter et al. \cite{hochreiter1997long}. The Long-Short-Term-Memory (LSTM) network uses a more complex mapping between the input information and hidden state to the output, which allows a more efficient training using the BPTT method for larger networks. The gated recurrent units (GRU) network, which is a computationally faster, simplified version of the LSTM network, is used in this paper \cite{chung2014empirical}. A very large network would, nevertheless, be difficult to train using BPTT and also greatly increase acquisition time in adaptive scanning due to, e.g., a more frequent data transfer and generation of intermediate reconstructions $V_t(\textbf{r})$. Therefore, a sub-sequence of scan positions $\vec{\textbf{R}}_{P_t}$ is preferred over a single scan position $\textbf{R}_{p_t}$ as the RNN output. Figure \ref{fig:network} shows the prediction process modeled by the RNN in full detail. \begin{figure \includegraphics[width=1.0\linewidth]{figs/GRU_network5.png} \centering \caption{Schematic of the forward propagation process of the RNN model. The RNN consists of GRU units that use the hidden state $H_t$ from the previous time step and the hybrid input information $X_t$ to create a new hidden state $H_{t+1}$. The hybrid input is the concatenation of the pre-processed information from the sub-sequence of scan positions $\vec{\textbf{R}}_{P_t}$ and the corresponding compressed representation of the partial reconstruction $z_t$. The output of the GRU cell is used to predict the positions of the next sub-sequence $\vec{\textbf{R}}_{P_{t+1}}$ and is also used as the input for the next GRU cell. The process is repeated until the full length of the scan sequence, consisting of $T$ sub-sequences, is reached.} \label{fig:network} \end{figure} \subsection{Training through reinforcement learning} \label{sec:rl} A RNN, such as the one described in the previous section, can be combined with RL to provide a formalism for modelling behaviour to solve decision making problems. In RL, a learning agent interacts with an environment, while trying to maximize a reward signal. This is generally formalized as a Markov decision process (MDP) described by a 5-tuple: $ \langle \mathcal{S},\mathcal{A},\rho,r,\gamma \rangle $. At each time-step $t$ the agent has complete knowledge of the environment by observing the state $s_t \in \mathcal{S}$ and makes an optimal decision by selecting an action $ a_t \in \mathcal{A}$. Based on $s_t$ and $a_t$, the next state $s_{t+1}$ is generated according to a transition function $\rho: \mathcal{S} \times \mathcal{A} \times \mathcal{S} \rightarrow [0,1]$. The agent additionally receives a feedback through a scalar reward function $r: \mathcal{S} \times \mathcal{A} \rightarrow \mathbb{R}$. This reward $r$ contributes to the total reward computed at the end of the sequence, $G=\sum^T_{t=0} \gamma^{t} r(a_t,s_t) $, also known as the return. The discount factor $\gamma \in [0,1]$ controls the emphasis of long-term rewards versus short-term rewards. In the case of adaptive scanning in ptychography, complete knowledge of the specimen structure is not known and the previous described formalism, where observations are equivalent to states, is not quite applicable. A partially observable Markov decision process (POMDP) generalizes the MDP to a 7-tuple: $ \langle \mathcal{S},\mathcal{A},\rho,r, \mathcal{O}, \omega, \gamma \rangle$ by considering the observation $o_t \in \mathcal{O}$ to contain only partial or incomplete information about the state $s_t$, and which is generated according to a observation function $\omega: \mathcal{A} \times \mathcal{S} \times \mathcal{O} \rightarrow [0,1]$. Therefore, $o_t$ can not sufficiently represent the state $s_t$ and instead the entire history of observations and actions up to the current time $h_t= \{ o_1, a_1, ..., o_{t-1},a_{t-1},o_t \}$ is used as basis for optimal or near-optimal decision making. A stochastic policy $\pi_{\theta}(a_t|h_t)$ maps the history of past interactions $h_t$ to action probabilities. Given a continuous action space, the policy can be represented by a two-dimensional Gaussian probability distribution: \begin{equation} \label{eq:policy} \pi_{\theta}(a_t|h_t) = \mathcal{N}(\boldsymbol{\mu}_{\theta}(h_t), \Sigma), \end{equation} with its mean vector $\boldsymbol{\mu}_{\theta}(h_t)$ corresponding to $\textbf{R}_{p_t}$, where the history $h_t$ is summarized in the hidden state $H_t$ of the RNN and the covariance matrix $\Sigma$ with fixed variances $\sigma_x^2 \in [0,1]$ and $\sigma_y^2 \in [0,1]$. In this POMDP formalism, however, a single action $a_t$ is drawn from the probability distribution $\pi_{\theta}(a_t|h_t)$, which corresponds to a single agent interacting with the environment. This is incompatible with scan control in ptychography where we seek to predict multiple scan positions at each time step. A partially observable stochastic game (POSG) extends the POMDP formalism to a 8-tuple, $ \langle M, \mathcal{S},\{\mathcal{A}^m\}_{m\in M},\rho,\{r^m\}_{m\in M}, \{\mathcal{O}^m\}_{m\in M}, \omega, \gamma \rangle$, with multiple agents $M$, each selecting an action $a^m_t$ and making an observation $o^m_t$ given the state $s_t$. Thus, joint actions $\boldsymbol{a}_t = \langle a^1_t, ..., a^m_t \rangle$ from the joint action space $\boldsymbol{\mathcal{A}} = \mathcal{A}_1 \times ... \times \mathcal{A}_M $ are executed and joint observations $\boldsymbol{o}_t = \langle o^1_t, ..., o^m_t \rangle$ from the joint observation space $\boldsymbol{\mathcal{O}} = \mathcal{O}_1 \times ... \times \mathcal{O}_M $ are received from the environment at each time step. In this case, the transition function is given by $\rho: \mathcal{S} \times \boldsymbol{\mathcal{A}} \times \mathcal{S} \rightarrow [0,1]$, the observation function is given by $\omega: \boldsymbol{\mathcal{A}} \times \mathcal{S} \times \boldsymbol{\mathcal{O}} \rightarrow [0,1]$ and each agent receives its immediate reward defined by the reward function $r^m: \mathcal{S} \times \boldsymbol{\mathcal{A}} \rightarrow \mathbb{R}$. Here, we consider the individual agent to have access to the actions and observations of all other agents, which allows the optimization of its individual policy $\pi_{\theta^m}(a^m_t|\boldsymbol{h}_t)$ using the joint history of observations and actions $\boldsymbol{h}_t= \{ \boldsymbol{o}_1, \boldsymbol{a}_1, ..., \boldsymbol{o}_{t-1},\boldsymbol{a}_{t-1},\boldsymbol{o}_t \}$. The joint policy of all agents is then defined as $\boldsymbol{\pi}_{\boldsymbol{\theta}}(\boldsymbol{a}_t| \boldsymbol{h}_t) = \prod_{m=1}^{M} \pi_{\theta^m}(a^m_t|\boldsymbol{h}_t)$, with $\boldsymbol{\theta}=\{ \theta^m \}_{m \in M}$. The goal of RL is now to learn a joint policy that maximizes the expected total reward for each agent $m$ with respect to its parameters $\theta^m$: \begin{equation} \label{eq:objectiveRL} \begin{split} \mathcal{J}^m(\boldsymbol{\theta}) = \mathbb{E}_{\boldsymbol{\pi}_{\boldsymbol{\theta}}(\boldsymbol{\tau})} \left[ G^m \right] \approx \frac{1}{N} \sum^N_{n=1} G^m_n, \end{split} \end{equation} where the expected total reward can be approximated by Monte Carlo sampling with $N$ samples. In this paper, improvement of the policy is achieved by updating the policy parameters $\theta^m = \{ \theta^m_H,\theta_{\text{GRU}},\theta_{LC},\theta_R, \theta_z \} $ with 'REINFORCE' \cite{williams1992simple}, a policy gradient method: \begin{equation} \label{eq:gradientRL} \begin{split} \nabla_{\theta^m} \mathcal{J}^m(\boldsymbol{\theta}) = \mathbb{E}_{\boldsymbol{\pi}_{\boldsymbol{\theta}}(\boldsymbol{\tau})} \left[ \nabla_{\theta^m} \text{log} \boldsymbol{\pi}_{\boldsymbol{\theta}}(\boldsymbol{\tau}) G^m \right] \\ \approx \frac{1}{N} \sum^N_{n=1} \sum^T_{t=0} \nabla_{\theta^m} \text{log} \pi_{\theta^m}(a^m_{n,t}|\boldsymbol{h}_{n,t}) & G^m_n. \end{split} \end{equation} The derivation of $\nabla_{\theta^m} \mathcal{J}^m(\boldsymbol{\theta})$ is given in the appendix \ref{app:REINFORCE}. \subsection{Learning to adaptively scan in ptychography} While policy gradient methods are the preferred choice to solve reinforcement learning problems in which the action spaces are continuous \cite{liu2020improved}, they come with significant problems. Like any gradient based method, policy gradient solutions mainly converge to local, not global, optima \cite{sutton2000policy}. In this paper, we reduce the effect of this problem during training by splitting the training of the RNN into supervised learning and RL. The first training step initializes the policy parameters such that the scan pattern follows a conventional grid pattern, thereby avoiding relatively poor local optima during subsequent policy gradient steps. This training step is explained in more detail in the appendix \ref{sec:policyinitialization}. In the second training step, the pre-trained policy is fine tuned through RL, resulting in a scan pattern that has been adapted to the structure of the material. A high variance of gradient estimates is another problem that particularly strongly affects the Monte Carlo policy gradient method \cite{wu2018variance, liu2020improved, feriani2021single}. Due to this, the sampling efficiency is relatively low, which causes a slow convergence to a solution. This makes deep RL applied to ptychography challenging as the image reconstruction itself requires iterative processing (see section \ref{sec:ptycho}). The high variance can be in part attributed to the difficulty of assigning credit from the overall performance to an individual agent's action. This credit assignment problem is limited to a temporal problem in the single agent RL case \cite{agogino2004unifying}. In this case, methods for variance reduction to better assign credit to individual actions are for instance reward-to-go \cite{di2012policy} or using a baseline \cite{sutton2000policy, wu2018variance}. In RL involving multiple cooperating agents with a shared reward function $r^1(\boldsymbol{a}_t|s_t)=r^2(\boldsymbol{a}_t|s_t)=...=r^m(\boldsymbol{a}_t|s_t)$, the challenge to overcome the credit assignment problem further increases due to the necessity of now identifying the contribution of each agent's action to the total reward. This challenge can be tackled with difference reward \cite{wolpert2002optimal, tumer2007distributed, colby2014approximating, castellini2020difference}, which replaces the shared reward with a shaped reward that is formed by comparing the global reward with a reward that an agent would receive when performing a default action. Following the idea of a difference reward in spirit, we introduce a way to estimate the reward function in order to tackle the credit assignment problem for adaptive scanning in ptychography. The reward function should naturally correspond to the quality of the ptychographic reconstruction. We have found empirically that a high reconstruction quality correlates positively with a high dynamic range in the phase. Therefore, the reward function could intuitively be formalized by $r^m(\boldsymbol{a}_t|s_t)=P^{-1} \sum_{\textbf{r}\in \text{FOV}} V(\textbf{r})$, where $P$ is the total number of scan positions. This formulation, however, does not solve the credit assignment problem and results in an insufficient training performance, as shown in Figure \ref{fig:voronoi}a). To estimate the reward for the actions of each individual agent, we use a tessellation method that partitions the atomic potential into small segments. A Voronoi diagram \cite{okabe2016spatial}, where each position corresponds to a seed for one Voronoi cell, enables assignment of only a part of the total phase to each position. More precisely, the Voronoi diagram formed by the predicted scan positions is overlaid with the corresponding ptychographic reconstruction at the end of the prediction process and the summed phase within each Voronoi cell is the reward for that cell's seed position. The reward function can be expressed by $r^m(\boldsymbol{a}_t|s_t)= P^{-1} \sum_{\textbf{r}\in \text{Cell}^m} V(\textbf{r}) $. Figure \ref{fig:voronoi}b) shows a Voronoi diagram generated by predicted scan positions. \begin{figure \includegraphics[width=1.00\linewidth]{figs/Reward4.pdf} \centering \caption{a) Learning curves of RL with multiple agents that use a shared reward or shaped reward, illustrated in orange and blue, respectively. b) A Voronoi diagram is used to assign a unique reward to each scan position of the predicted sequence. The scan positions are shown as red dots, where the first 50 positions are distributed on the right side within the dark blue area. For visualization purpose, the ground truth reconstruction is included in the diagram.} \label{fig:voronoi} \end{figure} \subsection{Experiment and model design} \label{seq:settings} For the experimental investigation, we acquired multiple ptychographic datasets from a monolayer molybdenum disulfide (MoS$_2$) specimen with a NION HERMES microscope. The microscope was operated with a $60$~kV acceleration voltage, a convergence angle of $33$~mrad and diffraction patterns with a pixel size of $0.84$~mrad were acquired using a Dectris ELA direct electron detector mounted at the electron energy loss spectroscopy (EELS) camera port. Distortions induced by the EEL spectrometer were corrected with in-house developed software. For the ptychographic dataset acquisition, a conventional grid scan with a scanning step size of $0.02$~nm was used. From the experimentally acquired datasets we created $175$ smaller datasets, each with 10,000 diffraction patterns. The diffraction patterns were binned by a factor of $2$ to $64 \times 64$ pixels. The adaptive scanning algorithm was then trained on the smaller datasets with the goal of predicting optimal scan sequences of $250$ to $500$ probe positions, out of the possible 10,000, which corresponds to a dose reduction by a factor of $40$ to $20$. Each sub-sequence contains 50 to 100 positions, where the first sub-sequence follows a quasi-random Halton sequence. The ptychographic reconstructions were performed with an optimized version of ROP \cite{schloz2020overcoming} that allows simultaneous reconstruction from a batch of different datasets, which was required for efficient model training. A gradient descent step size $\alpha_{\text{ROP}}$ of $5.25\ensuremath{\text{\textsc{e}}}2$ was chosen and the potential was retrieved at iteration 5. The reconstructed potential was $200\times 200$ pixels with a pixel size of $0.0154$~nm, for a field of view of $2 \times 2$~nm. For the generation of the reward function, Voronoi diagrams were generated with the Jump Flooding Algorithm \cite{rong2006jump} and for the implementation of the network models, PyTorch \cite{NEURIPS2019_9015} was used. For the compression of structure information, we used a convolutional autoencoder consisting of $6$ convolutional layers with kernels of dimension $3$, a stride of $1$ and channels that ranged from $16$ to $512$ for the encoder and decoder part, respectively. The input of the autoencoder had a dimension of $512$ with a pixel size of $0.0064$~nm and thus a scaling and an interpolation was required before the potential generated by ROP could be compressed. In addition, the value of the potential $V_i$ at each pixel $i$ was transformed to zero mean and unit variance. For the prediction of the scan sequences, pre-training and fine-tuning was performed with a RNN model composed of $2$ stacked GRU layers with hidden states $H_t$ of size $2048$, the Adam optimizer \cite{kingma2014adam} with a learning rate $\alpha_{\text{RNN}}$ of $1\ensuremath{\text{\textsc{e}-}}5$ and a batch size of $24$. For the fine-tuning, a policy with variances of $\sigma_x^2 = \sigma_y^2 = 0.0125^2$ was chosen and a myopic behavior was enforced by setting the discount factor for the return, $G$, to $\gamma = 0$. All settings used for training the adaptive scanning algorithm are summarized in Table \ref{tab:settings}. \section{Results} \subsection{Adaptive scanning on experimental MoS$_2$ data} Figure \ref{fig:result} shows the result of adaptive scanning on experimentally acquired MoS$_2$ data and compares it to the result of a random scanning and the conventional grid scanning procedure. The data used for the comparison was not part of the training data for the adaptive scanning model. While the full data set consisting of 10,000 diffraction patterns has been used to obtain a ground truth reconstruction, only $250$ diffraction patterns have been used for the adaptive scanning as well as the random scanning reconstruction. Figure \ref{fig:result}a) shows the ptychographic reconstruction when using a random scanning procedure. The structure of the material is not clearly resolved and large parts of the field of view are not covered by the scanning procedure. Figure \ref{fig:result}c) shows the reconstruction when the scan positions are predicted by the adaptive scanning algorithm. The structure of the MoS$_2$ material is now much better resolved and is closer to the ground truth reconstruction of the full data grid scanning procedure, shown in Figure \ref{fig:result}e). Figure \ref{fig:result}b), d) and f) show the diffractograms of the corresponding reconstructions and the circled diffraction spots show that the highest resolution of $1.08$~\AA{} is achieved by the adaptive scanning procedure, while the lowest resolution of $3.25$~\AA{} is obtained by the random scanning procedure. Further examples of reconstructions and their corresponding scan sequences are shown in Figure \ref{fig:result_examples}. \begin{figure} \includegraphics[width=1.0\linewidth]{figs/AdapPaperResults.png} \centering \caption{Ptychographic reconstructions of a MoS$_2$ data set with different scanning procedures. a) Reconstruction from $250$ diffraction patterns of the data set that correspond to scan positions which follow a random sequence and c) an adaptively predicted sequence. e) Reconstruction of the full data set with 10,000 diffraction patterns acquired with the conventional grid scan. b), d) and f) Corresponding diffractograms of the reconstructions. The real-space distance of the circled diffraction spots is labeled.} \label{fig:result} \end{figure} The results suggest that probe delocalization due to scattering plays an important role as to why an improved ptychographic reconstruction can be achieved by distributing the scan positions predominantly on the atoms of the specimen. When the beam is positioned on an atom, it scatters to higher angles and thus experiences spatial delocalization. It therefore also probes a larger range in real space, i.e. the scattering includes the local environment of the atom the beam hits. This implies that similar results could be achieved by using RL with a reward function that specifically emphasizes the scattered electrons in the recorded diffraction patterns, which is an interesting area for future research. The final point of our investigation into adaptive scanning in ptychography evaluates the performance of the method for various prediction settings. We compare the structural similarity index measure (SSIM) \cite{wang2004image} between the reconstruction obtained from the reduced data and the ground truth reconstruction obtained from the full data to quantify the improvement when using adaptive scanning. Here, SSIM$_a$ and SSIM$_r$ are the SSIM using a reconstruction of reduced data that is obtained with the adaptive scanning and the random scanning procedure, respectively. Table \ref{tab:Realizations} shows the relative reconstruction quality improvement $Q_{\text{SSIM}} = ( \text{SSIM}_a - \text{SSIM}_r ) / (\text{SSIM}_r)$ for different experimental settings averaged over $25$ data sets. Additionally, the relative resolution improvement $Q_{\text{res}}$ averaged over the same datasets is given. In the case of $250$ scan positions, which corresponds to a dose reduction by a factor of $40$ with respect to the original data, tests were performed for multiple sub-sequences, i.e. predictions. The quality improvement ranges from $16.71\%$ to $25.75\%$ and the resolution improvement ranges from $9.74\%$ to $27.57\%$ for a number of $2$ to $5$ sub-sequences (corresponding to 1 to 4 predictions), respectively. Further tests were performed using a larger number of total scan positions and 5 sub-sequences. However, while the relative resolution slightly improves for an increasing amount of scan positions, the difference in quality between the reconstruction generated with the positions of the adaptive scan and the random scan decreases with the total number of positions used, as can be expected, since the random sampling covers the sampled area in an increasingly complete manner. It should be noted that for all tests which used adaptive scanning with $5$ sub-sequences, a higher resolution of the reconstruction compared to that of the reconstruction of the full data set was achieved. These results indicate that the reconstruction quality and resolution improves with the frequency by which the positions are predicted, and that low dose experiments benefit the most from the adaptive scanning scheme. \begin{table} \centering \caption{Performance of adaptive scanning for various experimental settings that differ in the number of scan positions and the total number of sub-sequences. For each setting, the oversampling ratio $N_\text{k}/N_\text{u}$, which is calculated following \cite{schloz2020overcoming}, and the electron dose is given.} \label{tab:Realizations} \begin{tabular}{ c c c c | c | c } \hline \hline \# Pos. & $N_\text{k}/N_\text{u}$ & Dose ($\mathrm{e^-}$/\AA$^{-2}$) & \# Sub-seq. & Q$_{\text{SSIM}}$ & Q$_{\text{res}}$ \\ \hline $250$ & $8.21$ & $1.34 \text{\ensuremath{\text{\textsc{e}}}5 }$ & $2$ & 16.71\% &$9.74\%$\\ & & & $3$ & 22.89\% &$15.06\%$\\ & & & $4$ & 24.96\% &$19.79\%$ \\ & & & $5$ & $25.75\%$ & $27.57\%$\\ \hline $335$ & $10.83$ & $1.79 \text{\ensuremath{\text{\textsc{e}}}5 }$ & $5$ & $12.53\%$ & $28.71\% $ \\ \hline $420$ & $13.43$ & $2.25 \text{\ensuremath{\text{\textsc{e}}}5 }$ & $5$ & $12.29\% $ & $29.23\% $\\ \hline $500$ & $15.86$ & $2.68 \text{\ensuremath{\text{\textsc{e}}}5 }$ & $5$ & $8.16\% $ & $31.59\% $ \\ \hline \hline \end{tabular} \end{table} \section{Conclusion} In this paper we present a method for electron ptychography that reduces the electron dose through adaptive scanning. It is based on the idea that ptychography requires only an increased information redundancy through overlapping illuminating beams at regions of the sample that contain atomic structure. The prediction algorithm is a mixture of deep learning models being trained using supervised and reinforcement learning. We show an improved reconstruction quality and resolution when using an adaptive scanning approach on experimentally acquired monolayer MoS$_2$ datasets in comparison to another dose reduction scanning approach. In a low dose experiment the adaptive scanning procedure could improve on average the reconstruction quality by up to $27.75\%$ and the resolution by up to $31.59\%$. The resolution achieved by adaptive scanning was also higher than that of the reconstruction from the full data set, but without the same homogeneous reconstruction quality throughout the entire field of view. These improvements show that adaptive scanning for ptychography is a useful technique to lower the dose needed for the analysis of sensitive samples. In addition to that, the proposed algorithm can be taken as a blueprint for a broad range of scanning based microscopy methods and thus paves the way for future research in machine learning supported, automated and autonomous microscopy. \begin{acknowledgments} \noindent M.S., T.C.P. and W.V.d.B. acknowledge financial support from the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) Grant No. BR 5095/2-1. M.S., J.M. and C.T.K acknowledge support from the DFG - Project-ID 182087777 - SFB 951. M.S. and C.T.K. acknowledge financial support from the DFG - Project-ID 414984028 - SFB 1404. We thank Prof. Sang Ho Oh and Dr. Jinsol Seo (Korea Institute of Energy Technology, Naju, Korea), as well as Dr. Bumsu Park (CEMES, Toulouse, France) for providing the MoS$_2$ sample. M.S. would like to thank Jayesh K. Gupta (Microsoft, Stanford, USA) for his helpful suggestion about the description of the POSG formalism. \end{acknowledgments}
9ac5d587f29caad8524d467f440175a98787fb7b
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Solid-state superconducting circuit studies the interaction between artificial atoms and quantized electromagnetic fields in the microwave frequency domain \cite{RevModPhys93/025005}. This architecture has emerged as one of the leading platforms for realizing quantum computation and simulation \cite{Arute2019,PhysRevLett127/180501}. Commonly, superconducting qubits are used for encoding quantum information, with superconducting resonators acting as date buses. However, the efficient generation, manipulation, and transmission of nontrivial quantum states in a linear resonator are also crucial to different kinds of quantum information tasks \cite{Gu2017}. The quantum states of a harmonic oscillator are extraordinarily rich, but are hard to access due to the infinitely equally spaced energy levels. This difficulty can be overcome by interposing a nonlinear artificial atom, and various quantum states in a resonator can be synthesized via the deliberate use of classical control signals, such as Fock state \cite{Hofheinz2008} and Schr\"{o}dinger cat state \cite{Ofek2016}. In recent years, the Josephson-photonics circuit of a dc voltage-biased Josephson junction in series with a microwave resonator has emerged as an alternative tool for efficient on-chip generation of coherent microwave photons \cite{M1,M2,M3,M4,M5,M6,M7,M8,M9,M10}. It relies on the exceptionally strong nonlinearity of light-charge interaction, and eliminates the need for any microwave drives\cite{D1,D2,D3,D4,Kubala2020}. The Josephson junction acts as a highly nonlinear driving element; that is, the inelastic Cooper pair tunneling across a junction can convert different numbers of photons from an easily controlled bias voltage source into a microwave cavity \cite{PhysRevLett247001,PhysRevLett247002}. By modulating the charge tunneling effect via a specifically tailored electromagnetic environment, the nonclassical microwave light can be generated \cite{non1,non2,non3,non4,non5,Dambach2019}. The resulting quantum electrodynamics of this simple circuit has been demonstrated to realize Josephson junction lasers \cite{L1,Cassidy2017,L2}, single-photon sources \cite{S0,S1,S2,S3}, multi-photon sources \cite{mul1,mul2,mul3}, and near quantum-limited amplifiers \cite{Jebari2018}. In parallel, a significant development in this field is to connect Josephson junctions with multiple resonators for various quantum technological applications, such as the implementations of entangled quantum microwaves \cite{Dambach2017} and microwave single-photon detectors \cite{SD}. While the simplest case is one voltage-biased junction in series with two cavities of incommensurate frequencies. When the bias voltage is tuned to match the energy required to simultaneously produce one photon in each cavity for a single Cooper pair traversing the circuit, the system can be effectively reduced as a nondegenerate parametric amplifier \cite{F1,F2,F3}. It allows the continuous emission of correlated photon pairs. Recent experiments have observed the amplitude squeezing \cite{squeeze} and entanglement \cite{entangle} of these output microwave beams. Especially, when the cavities possess the impedance of 4.1 k$\Omega$, there is no matrix element for a transition between the one and two photon states \cite{PhysRevLett247002,S2}. So, the two cavities can be regarded as two-level systems, leading to an antibunched photon-pair source \cite{F1}. However, the fabrication of coplanar waveguide resonators with such high impedances is highly challenging as the standard cavity designs only yields characteristic impedances of the order of 100 $\Omega$. To go beyond this limitation, we propose a more practical way to realize photon-pair blockade by regulating the anticorrelated behavior of the charge transport via a two-level charge qubit. In our scheme, we study the Josephson-photonics device of a voltage-biased Josephson junction in series with a charge qubit and two nondegenerate microwave resonators. The nonlinear qubit-resonator coupling can be sculpted via the phase difference across the junction. For each tunneling Cooper pair, the suitably set bias voltage enables the excitation of charge qubit and the creation of one photon in each resonator concurrently. Since the charge qubit is an ideal anharmonic element with two quantum energy levels, the anticorrelations of the tunneling Cooper pairs can be created, preventing the simultaneous tunnel events. Combined with the dissipation, we show that the two resonators can release their energies in the form of antibunched photon pairs in a controllable manner. Compared with the previous work \cite{F1}, the present one constitutes a significant step forward; that is, the photon-pair source can be achieved with the standard coplanar waveguide resonator designs, eliminating the need for ultrahigh cavity impedance that is not accessible in current experiment. Our work offers an appealing method for generating a bright nonclassical source of antibunched pairs of two strongly correlated photons, required at the core of quantum computing and quantum communication protocols \cite{P0,P1,P2,P3}. \begin{figure}[tbh] \centering \includegraphics[width=\linewidth]{fig1.eps} \caption{Schematic diagram of the proposed experimental setup that consists of a dc-SQUID coupled to a charge qubit and two nondegenerate $LC$ resonators. A dc bias voltage $V$ is applied across all the elements, and a flow of Cooper pairs across the circuit can pump both the qubit and the two LC$ resonators. In addition, each resonator is coupled to a transmission line with the coupling strength $\kappa$, which is used for collecting the emitted photons.} \label{fig.1} \end{figure} \section{Model} As shown in Figure 1, we investigate the Josephson-photonics circuit of a voltage-biased dc superconducting quantum interference device (dc-SQUID) in series with a charge qubit and two nondegenerate $LC$ resonators. We focus on the situation that the bias voltage $V$ is smaller than the gap voltage, and no quasi-particle excitation can be produced in the superconducting electrodes. So, the quantum transport of Cooper pairs through the circuit will supply energies to both the charge qubit and the two $LC$ resonators. The model Hamiltonian describing the entire setup takes the form (see Appendix) \begin{eqnarray}\label{1} H_{T} &=&E_{c}(n_{q}-n_{g})^{2}-E_{Jq}\cos \phi _{q}+\sum_{j=1,2}[\frac q_{j}^{2}}{2C_{j}}+(\frac{\hbar }{2e})^{2}\frac{\phi _{j}^{2}}{2L_{j}}] \nonumber \\ &&\quad -E_{J}\cos \phi _{J}-2en_{J}(V-V_{q}-V_{R1}-V_{R2}). \end{eqnarray} The first two terms denote the part of charge qubit, the third term describes the part of two $LC$ resonators, and the last two terms represent the part of dc-SQUID, where $V_{q}=-\hbar\dot{\phi}_{q}/2e$ is the voltage drop at the qubit, and $V_{Rj}=-\hbar\dot{\phi}_{j}/2e$ is the voltage drop at the $j$-th resonator. To exclude the Cooper pair number $n_{J}$, we perform a unitary transformation $U(t)=\exp [i(\omega _{J}t+\phi _{q}+\phi _{1}+\phi _{2})n_{J}]$ on the full Hamiltonian, where $\omega _{J}=2eV/\hbar $ is the Josephson frequency. Then, we can obtain \begin{eqnarray} \tilde{H}_{T} &=&U^{^{\dag }}(t)H_{T}U(t)+i\hbar \frac{dU^{^{\dag }}(t)}{dt U(t) \nonumber \\ &=&E_{c}(\tilde{n}_{q}-n_{g})^{2}-E_{Jq}\cos \eta _{q}+\sum_{j=1,2}[\frac \tilde{q}_{j}^{2}}{2C_{j}}+(\frac{\hbar }{2e})^{2}\frac{\phi _{j}^{2}}{2L_{j }] \nonumber \\ &&\quad -E_{J}\cos (\omega _{J}t+\phi _{q}+\phi _{1}+\phi _{2}), \end{eqnarray where $\tilde{n}_{q}=n_{q}+n_{J}$, $\tilde{q}_{j}=q_{j}+2en_{J}$ are the transformed number and charge operators, arising from the charge fluctuations regard to the flow of Cooper pairs through the dc-SQUID. As described by the last term in $\tilde{H}_{T},$ the nonlinear coupling between the charge qubit and the two cavities is established via the phase difference across the junctions of dc-SQUID. When the charge qubit is operated at the degeneracy point with $n_{g}=1/2$, we can quantize the excitations in the two resonators and qubit, and the Hamiltonian of the whole circuit will yield (hereafter let \hbar =1$) \begin{equation} H=\frac{1}{2}\delta \sigma _{z}+\sum_{j=1,2}\omega _{j}a_{j}^{\dag }a_{j}-E_{J}\cos [\omega _{J}t+\phi _{q}+\sum_{j=1,2}2\lambda _{j}(a_{j}^{\dag }+a_{j})]. \end{equation Note that the charge qubit has been reduced as a two-level system containing an excited state $|e\rangle $ and a ground state $|g\rangle $ under the basis of charge states \cite{Bouchiat1998,Makhlin1999,Nakamura1999,Jos}, i.e., $\sigma _{z}=|e\rangle \langle e|-|g\rangle \langle g|$ is the Pauli matrix, and $\delta =E_{Jq}$ is the energy splitting. $a_{j}^{\dag }$ ($a_{j}$) is the photon creation (annihilation) operator of the $j$th resonator ($[a_{j},a_{j}^{\dag }]=1$), and $\omega _{j}=1/\sqrt{L_{j}C_{j}}$ is the corresponding resonance frequency. The parameter $\lambda _{j}=\sqrt \pi Z_{j}/R_{K}}$ quantifies the amplitude of the cavity's zero-point displacement, and characterizes the coupling between the oscillator and the tunnel junction ($Z_{j}=\sqrt{L_{j}/C_{j}}$ is the characteristic impedance, and $R_{K}=h/e^{2}$ is the resistance quantum). \section{Photon-pair blockade} \subsection{Anticorrelations of the charge transport} In this section, we will illustrate the procedure for the realization of photon-pair blockade in the aforementioned two-mode superconducting circuit. The central idea is to create anticorrelations of the charge transport, which gives rise to the desired antibunching of the photon pairs leaking out of the two microwave resonators. To this end, we start to derive the effective Hamiltonian of the system, which helps to uncover the mechanism of our scheme. In the interaction picture with respect to the frame rotating $\exp (-iH_{0}t)$, where $H_{0} \frac{1}{2}\delta \sigma _{z}+\omega _{1}a_{1}^{\dag }a_{1}+\omega _{2}a_{2}^{\dag }a_{2}$ is the free Hamiltonian, we can obtain \begin{equation} H_{I}=-\frac{E_{J}}{4}e^{i\omega _{J}t}\left( \sigma _{+}e^{i\delta t}-\sigma _{-}e^{-i\delta t}-\sigma _{z}\right) D\left[ \alpha _{1}(t)\right] \times D\left[ \alpha _{2}(t)\right] +h.c., \end{equation where we have exploited the formula $e^{i\phi _{q}}=(\sigma _{+}-\sigma _{-}-\sigma _{z})/2$, and $\sigma _{+}=|e\rangle \langle g|$, $\sigma _{-}=|g\rangle \langle e|$ are the spin-ladder operators. In addition, $ \left[ \alpha _{j}(t)\right] $ is the cavity displacement operator with the time-dependent amplitude $\alpha _{j}(t)$, which is defined in terms of the photon creation and annihilation operators as \begin{equation} D\left[ \alpha _{j}(t)\right] =e^{[\alpha _{j}(t)a_{j}^{\dag }-\alpha _{j}^{\ast }(t)a_{j}]},\alpha _{j}(t)=2i\lambda _{j}e^{i\omega _{j}t}. \end{equation It is now clearly seen that the tunneling of Cooper pairs through a voltage-biased Josephson junction can not only displace the cavity fields, but also flip the qubit state. To formulate the desired coupling, we express $D\left[ \alpha _{j}(t)\right] $ directly in the Fock-state basis \cite{basis} \begin{equation} D\left[ \alpha _{j}(t)\right] =\sum_{n=0}^{\infty }(\sum\limits_{l=0}^{\infty }\beta _{n}^{n+l}(\lambda _{j})|n+l\rangle \langle n|e^{il\omega _{j}t}+\sum\limits_{l^{\prime }=1}^{\infty }\beta _{n}^{n+l^{\prime }}(\lambda _{j})|n\rangle \langle n+l^{\prime }|e^{-il^{\prime }\omega _{j}t}) \end{equation with \begin{equation} \beta _{n}^{n+l}(\lambda _{j})=\sqrt{\frac{n!}{(n+l)!}}\left( 2i\lambda _{j}\right) ^{l}e^{-2\lambda ^{2}}L_{n}^{(l)}(4\lambda _{j}^{2}). \end{equation Here $\beta _{n}^{n+l}(\lambda _{j})$ is a generalized Frank-Condon factor that describes an $l$-photon transition rate, and $L_{n}^{(l)}(4\lambda _{j}^{2})$ is a Laguerre polynomial. To go a further step, we should tune the bias voltage $V$ to meet the resonance condition $\omega _{J}=\delta +\omega _{1}+\omega _{2}$, i.e., the energy provided by the voltage source upon the transfer of a Cooper pair matches the sum of the excitation energy of qubit and the photon energies of the two oscillators. In this case, we can retain the resonant terms, but discard those fast oscillating terms under the rotating-wave approximation provided that the condition $\delta ,\omega _{j},|\omega _{1}-\omega _{2}|\gg \frac{E_{J}}{4}|\beta _{n}^{n+l}(\lambda _{1})\beta _{m}^{m+l^{\prime }}(\lambda _{2})|$ is satisfied. Thus, with all the other possibilities strongly suppressed, the effective Hamiltonian is derived as \begin{equation} H_{eff}=\sum\limits_{n,m=0}^{\infty }H_{nm} \end{equation with \begin{equation} H_{n,m}=g_{eff}^{n,m}|n,m,g\rangle \langle n+1,m+1,e|+h.c., \end{equation where $g_{eff}^{n,m}=\frac{E_{J}}{4}\beta _{n}^{n+1}(\lambda _{1})\beta _{m}^{m+1}(\lambda _{2})$ is the effective coupling strength, and |n,m,g\rangle $ is the tensor product of $|n\rangle \otimes |m\rangle \otimes |g\rangle $. \begin{figure}[th] \centering \includegraphics[width=9cm]{fig2.eps} \caption{(Color online) Time evolution of the state populations $P_{00g}$ and $P_{11e}$. The blue solid and red dashed curves are simulated with the original Hamiltonian $H_{\mathrm{I}}$, while the black dotted and green dash-dotted curves are achieved with the effective Hamiltonian $H_{\mathrm eff}}$. The relevant parameters are chosen as $\protect\omega _{1}/2\protec \pi =9$ GHz, $\protect\omega _{2}/2\protect\pi =7$ GHz, $\protect\delta / \protect\pi =5$ GHz, $E_{J}/2\protect\pi =0.5$ GHz, and $\protect\lambda _{1}=\protect\lambda _{2}=0.2$. } \label{fig.2} \end{figure} The effective Hamiltonian $H_{eff}$ elucidates the process of energy conversion of Josephson frequency to qubit excitation and photon production in the two resonators. Note that each subunit $H_{n,m}$ can induce a coherent quantum transition from the state $|n,m,g\rangle $ to |n+1,m+1,e\rangle $; that is, each Cooper pair can tunnel to simultaneously populate the qubit and add one photon in each cavity. Since the charge qubit is a two-level system, its excitation will greatly inhibit the whole system's transitions to higher occupations. Thus, the anticorrelations of the charge transport are created: a former Cooper-pair tunneling event acts back onto the next one; that is, a second Cooper pair can not pass through the circuit until the flip of the qubit state. This is the key point to induce antibunching in the photon emission. If the system is initially prepared in the ground state |0,0,g\rangle$, the Hamiltonian H_{0,0}$ will dominate the dynamics, enabling a Rabi oscillation |0,0,g\rangle \longleftrightarrow |1,1,e\rangle $. Obviously, the absorption of one photon in each cavity is accompanied with a excitation in the charge qubit. Since the charge qubit is treated as a two-level system, its excitation will inhibit further photon absorption, which is the mechanism involved in photon blockade \cite{PhysRevLett.118.133604,PhysRevA.97.013851}. Consequently, the photon-pair blockade can be realized in this two-cavity system, which offers a source of antibunched pairs of two strongly correlated photons. It is also pointed out here that the charge qubit has finite nonlinearity in practice, and many other higher excited states exist. So, the excitation of these states is accompanied with the higher photon number excitations, which will degrade the photon blockade. However, the charge qubit is operated in the regime in which the charging energy $E_{c}$ is much larger than the Josephson coupling energy $E_{Jq}$ \cite{Bouchiat1998,Makhlin1999,Nakamura1999,Jos}. The third energy level has a eigenfrequency about $6E_{c}$, which is far greater than the transition frequency $E_{Jq}$ of the lowest two energy levels. So, the higher-order qubit excitations are greatly inhibited, which has negligible effect on the photon blockade. Compared with the previous proposal \cite{F1}, our scheme can be implemented with the standard coplanar waveguide resonator designs, greatly lowering the requirement for ultrahigh cavity impedance that is not accessible in current experiment. To check the validity of the approximation, we now investigate the dynamics of the system by numerically solving the Schr\"{o}dinger equation with both the full Hamiltonian $H_{I}$ and the effective Hamiltonian $H_{eff}$. With the system initialized in the ground state |0,0,g\rangle$, the time evolution of populations $P_{00g}$ in the state $|0,0,g\rangle $ and $P_{11e} $ in the state $|1,1,e\rangle $ is shown in Figure 2. The perfect Rabi oscillations |0,0,g\rangle \longleftrightarrow |1,1,e\rangle $ are observed with both of these two Hamiltonians $H_{I}$ and $H_{eff}$, implying that our approximation is valid. \subsection{Antibunched photon pair emission} As a trigger of quantum emission of antibunched photon pairs, dissipation has to be taken into account. When the system-environment coupling is considered in the Born-Markov approximation, the time evolution of density matric $\rho $ of the whole system is now governed by the master equation \begin{equation} \frac{d\rho }{dt}=-i[H_{eff},\rho ]+\sum_{j=1,2}\frac{\kappa }{2 D[a_{j}]\rho +\frac{\gamma }{2}D[\sigma _{-}]\rho , \end{equation where $D[o]\rho =2o\rho o^{\dag }-o^{\dag }o\rho -\rho o^{\dag }o$ is the standard Lindblad operator for a given operator $o$, and $\kappa $ ($\gamma ) denotes the energy damping rate of cavities (qubit). In the presence of dissipation, a pair of two strongly correlated photons will be transferred outside of the two cavities for each tunneling Cooper pair. We now detail the underlying principle of the fundamental dynamics of this photon-pair emission below. \begin{figure}[tbh] \centering \includegraphics[width=14.5cm]{fig3.eps} \caption{(Color online) Steady-state photon correlation functions versus \protect\kappa \protect\tau $: [a], [b] for the stand second-order correlation functions $g_{11}^{(2)}(\protect\tau )$, $g_{22}^{(2)}(\protec \tau )$; [c] for the cross-correlation function $g_{12}^{(2)}(\protect\tau ) ; [d] for the generalized second-order correlation functions g_{12,12}^{(2)}(\protect\tau )$. The cavity damping rate is chosen as \protect\kappa $/2$\protect\pi $ = 0.1 GHz, and the other parameters are chosen to be the same as those in Figure 2.} \label{fig.3} \end{figure} Specifically, we prepare the system initially in the ground state, and the tunneling of a Cooper pair will draw energy quanta from the bias voltage, inducing the coherent transition $|0,0,g\rangle \longrightarrow |1,1,e\rangle $. Due to the energy upper limit of the two-level charge qubit, the system populated in the state $|1,1,e\rangle $ can not be excited to higher energy levels. This indicates that a second Cooper pair can't pass through the circuit only after the spontaneously emission of the charge qubit. So, to guarantee the desired antibunching, it is crucial to meet the condition $\kappa \gg \gamma $, i.e., the coherence time of charge qubit is much longer than that of cavities. In this situation, the two cavities will take the lead to emit two correlated photons within the lifetime $1/\kappa , stemming from the spontaneous emission of $|1,1,e\rangle $ state via the photonic dissipation. Then, the wavefunction of the system is collapsed into the state $|0,0,e\rangle $ but without Rabi flopping. Only after a quantum jump $|0,0,e\rangle \longrightarrow |0,0,g\rangle $ of the qubit state within a relative longer lifetime $1/\gamma $, a second Cooper pair can tunnel to restart the coherent transition $|0,0,g\rangle \longrightarrow |1,1,e\rangle $ for the next emission of a photon pair. This is the mechanism for generating antibunched photon pairs. On the other hand, it is worth noting here that we also can not make an arbitrary small $\gamma$. For $\gamma\rightarrow0$, the system seems to behave as a completely antibunched photon-pair source. However, it will take a very long time to flip the state of charge qubit $|0,0,e\rangle \longrightarrow |0,0,g\rangle$ and reconstruct the state $|1,1,e\rangle $ for the two cavities to emit a next correlated photon pair. This will result in an extremely low emission rate. Therefore, there is a tradeoff between the emission rate and the nonclassical property of the radiation field, which can be balanced by tuning the ratio $\gamma/\kappa$. \begin{figure}[tbh] \centering \includegraphics[width=10cm]{fig4.eps} \caption{(Color online) The photon-pair emission rate $S$ versus $\protec \gamma/\protect\kappa$. The relevant parameters are chosen to be the same as those in Figure 3.} \label{fig.4} \end{figure} To describe the quantum statistics of the photon emission, we further study the following time-delay correlation functions \begin{equation} g_{pq}^{(2)}(\tau )=\frac{\langle a_{p}^{\dag }(0)a_{q}^{\dag }(\tau )a_{q}(\tau )a_{p}(0)\rangle }{\langle (a_{p}^{\dag }a_{p})(0)\rangle \langle (a_{q}^{\dag }a_{q})(\tau )\rangle } \end{equation with $p=1,2$ and $q=1,2$. For $p=q$, $g_{pq}^{(2)}(\tau )$ is just the standard second-order correlation function that can quantify the photon correlation emitted by a single cavity. While for $p\neq q$, it represents the cross-correlation between the photons emitted by different cavities. Besides, we should also introduce the generalized second-order correlation function \begin{equation} g_{12,12}^{(2)}(\tau )=\frac{\langle a_{1}^{\dag }(0)a_{2}^{\dag }(0)a_{1}^{\dag }(\tau )a_{2}^{\dag }(\tau )a_{1}(\tau )a_{2}(\tau )a_{1}(0)a_{2}(0)\rangle }{\langle (a_{1}^{\dag }a_{2}^{\dag }a_{1}a_{2})(0)\rangle \langle (a_{1}^{\dag }a_{2}^{\dag }a_{1}a_{2})(\tau )\rangle }, \end{equation where the joint two-photon emission event by the two cavities is considered as a single entity \cite{Munoz2014,PhysRevA103/053710}. Here, $g_{12,12}^{(2)}(\tau )$ can capture the fundamental dynamics of photon-pair emission, and characterize the quantum statistics of photon pairs. In Figure 3, we plot the different steady-state correlation functions by numerically solving the master equation (10). For $\kappa\gg\gamma$, the zero-delay second-order correlation functions $g_{11}^{(2)}(0)\rightarrow0$ and $g_{22}^{(2)}(0)\rightarrow0$ are observed in Figures 3(a) and 3(b), exhibiting distinct antibunching effects. So, each cavity behaves as an excellent single-photon emitter. As seen in Figure 3(c), the zero-delay cross-correlation function yields $g_{12}^{(2)}(0)\gg 1$. This indicates that a pair of strongly correlated photons are emitted simultaneously by the two cavities. Moreover, the generalized zero-delay second-order correlation function $g_{12,12}^{(2)}(0)\ll1$ in Figure 3(d) manifests clearly that the two cavities release their energies in the form of antibunched photon pairs. In addition, as expected before, the changes of the different zero-delay correlation functions indicate that our device approaches a perfect photon-pair emitter with the decrease of $\gamma$. Finally, we investigate the emission rate of our photon-pair source. It is defined a \begin{equation} S=\kappa \overline{n}, \end{equation where $\overline{n}$ is the average photon numbers of the two cavities. The emission rate $S$ versus $\gamma /\kappa $ is displayed in Figure 4. Under the premise of $\kappa \gg \gamma $, we can observe that a tunable emission rate can be achieved, i.e., $S$ gradually increases with the increase of $\gamma . Hence, the emission rate can be experimentally controlled by changing the distance between the cavity and the transmission line to adjust the value of $\kappa $ \cite{S2}. With the currently available parameters $\omega _{1}/2\pi =9$ GHz, $\omega _{2}/2\pi =7$ GHz, $\delta /2\pi =5$ GHz, $E_{J}/2\pi =0.5$ GHz, $\lambda _{1}=\lambda _{2}=0.2$, we can obtain an emission rate of the order of MHz. \section{Conclusion} In conclusion, we have proposed a practical approach to generate antibunched photon pairs in a Josephson-photonics circuit of a dc voltage-biased Josephson junction coupled to both a superconducting charge qubit and two nondegenerate microwave cavities. Under an appropriate bias voltage, each Cooper pair can tunnel inelastically to cause the excitation of charge qubit and the creation of one photon in each cavity. We demonstrate that the charge transport can be controlled via the two-level charge qubit, preventing the simultaneous Cooper pair tunneling events. As a result, the photon-pair blockade can be realized, i.e., the presence of a qubit excitation will impede further photon absorption. Together with the photonic dissipation, the two cavities can emit antibunched pairs of two strongly correlated photons with a tunable emission rate. Moreover, the generation of such a nonclassical microwave source is compatible with current experimental architectures, and may stimulate a variety of applications in the field of quantum information science. \section*{acknowledgments} This work was supported by the National Natural Science Foundation of China (Grant Nos. 11704306 and 12074307), the Fundamental Research Funds for the Central Universities (Grant No. 11913291000022), and the Doctoral Scientific Research Foundation of Hubei University of Automotive Technology (Grant No. BK202113).
30bdbf208d83041979feab2b093cfc0761128235
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Dark matter is an effective paradigm to explain the various observations in galactic rotation curve, cosmic large scale structures, and the gravitational lensing of clusters \cite{grc1,lss1,lensing1,lensing2}. Studies of the primordial nucleosynthesis \cite{nucl} and the power spectrum of cosmic microwave background (CMB) \cite{Planck2018} also provide strong evidence that there is abundant missing matter whose present total amount is about five times that of visible matter described by the standard model of particle physics (SM). As for the physical essence of dark matter, however, it still remains obscure. All experiments so far have not identified whether dark matter interacts with SM particles except gravity \cite{detect1,detect2,detect3}. In this paper, we ponder on a new kind of vector dark matter~\cite{WGB1,WGB2} from the Weyl scaling invariant theory of gravity~\cite{Wu:2015wwa, Wu:2017urh}. Weyl symmetry with various forms has wide applications in cosmological physics~\cite{Weyl1,Weyl3,Weyl4,Weyl5,Weyl6}. It can naturally introduce a local scaling symmetry associated with a gauge boson (called Weyl gauge boson or WGB), which acquires a mass from the symmetry breaking. The consideration of Weyl gravity is also motivated by the reasonableness of introducing a quadratic scalar curvature term $R^2$ into theory~\cite{R2Weyl2,R2Weyl3,R2Weyl4}. It can provide a successful inflationary mechanism with observational conformity, albeit it has a different form under the Weyl geometry \cite{R2Weyl1,R2Weyl5,R2Weyl6,R2Weyl7}. Our previous study has discussed Weyl $R^2$ inflation \cite{R2Weyl4} and briefly the production of dark matter. However, the intrinsic connection between the inflaton and WGB has not been fully explored. The purposes of this paper are twofold. First, we use the latest cosmological observations to update the preferred parameter space for Weyl $R^2$ inflation. Second, we identify the viable dark matter mass range by considering all the production channels. There are several contributions for the production of WGB. If dark matter is already massive during inflation, there will be an important non-perturbative production mechanism~\cite{Parker1,Parker2,Ford,Lyth,gpdm,nonthermal,vdm1,pgdm1,pgdm2,vdm2, Chung:2018ayg, Kolb:2020fwh} that is due to the quantum fluctuations in rapidly expanding background~\cite{Ema:2016dny, Ema:2016hlw, Li:2020xwr, Li:2019ves, Herring:2020cah, Babichev:2018mtd, Hashiba:2018tbu, Ling:2021zlj}. Other important contributions are also present after inflation, such as producing from inflaton decay or the annihilation from particles in thermal bath after reheating~\cite{Garny:2015sjg, Tang:2016vch, pgdm3, Garny:2017kha, Chen:2017kvz, Bernal:2018qlk, Aoki:2022dzd, Clery:2021bwz, Frangipane:2021rtf, Redi:2021ipn, Barman:2021qds, Mambrini:2021zpp, Haque:2021mab, Clery:2022wib}. The previous study \cite{R2Weyl4} has only estimated the annihilation channel through scalars, but not taken into account the gravitational annihilation, non-perturbative production and the decay process. Our goal here is to figure out how these production mechanisms determine the relic abundance of WGB as dark matter, and identify the possible mass ranges. The paper is organized as follows. In Sec.~II, we introduce the formalism of Weyl $R^2$ gravity with inflaton and massive WGB. Then in Sec.~III, we discuss the constraints on the Weyl $R^2$ inflation from the latest observations. Later in Sec.~IV, we focus on the WGB as dark matter. We first discuss the equation of motion and quantization of the Weyl gauge field in a cosmological background, and elaborate the method to calculate the energy density of WGB produced from the inflationary fluctuations. Then based on the inflation and reheating process, we compute the production rate and final relic abundance of WGB from all possible channels, and show the constraints on the mass and reheating temperature in detail. Finally, we summarize and give our conclusion. \section{Formalism and model} We use the following conventions in this paper: the metric $\eta_{\mu\nu}=(-1,+1,+1,+1)$, and natural unit $\hbar=c=1$, $M_P\equiv1/\sqrt{8\pi G}=2.435\times10^{18}~\mathrm{GeV}=1$. The complete Lagrangian that is motivated by gauge theory of gravity can be found in Refs.~\cite{Wu:2015wwa, Wu:2017urh, Wu:2021ign, Wu:2021ucc}. For the interest of dark matter production and inflation, we can use the metric formalism and illustrate by starting with the following simplest global scaling-invariant Lagrangian $\mathcal{L}$ with linear and quadratic scalar curvature \begin{equation} \frac{\mathcal L}{\sqrt{-g}}= \frac{1}{2}\phi^2 R+\frac{\beta}{12} R^2-\frac{\lambda}{2} \partial^\mu\phi \partial_\mu\phi , \label{L0} \end{equation} where $g$ is the determinant of metric tensor $g_{\mu\nu}$, Ricci scalar $R$ are defined as usual and $\lambda$ is a nonzero real number. A scalar field $\phi$ is introduced here to maintain the global scaling symmetry with the following transformation rules, \begin{equation} \begin{aligned} \mathrm{metric}:~&g_{\mu\nu}\rightarrow g'_{\mu\nu}=f^2g_{\mu\nu},\\ \mathrm{scalar}:~&\phi\rightarrow \phi'=f^{-1}\phi,\\ \mathrm{Ricci~scalar}:~&R\rightarrow R'=f^{-2}R, \label{CT} \end{aligned} \end{equation} where $f$ is a constant scale factor. Note that one can introduce a scalar potential $\phi^4$ without spoiling the symmetry, but for our purpose in this paper, such a term is not necessary and we neglect here. For the global scaling transformation, the Christoffel connection \begin{equation} \Gamma^\rho_{\mu\nu}=\frac{1}{2}g^{\rho\sigma}(\partial_\mu g_{\sigma\nu}+\partial_\nu g_{\mu\sigma}-\partial_\sigma g_{\mu\nu}), \label{Gamma} \end{equation} is invariant. When we extend the global symmetry into the local one, namely $f\rightarrow f(x)$, the connection and $\mathcal{L}$ would not be invariant. To make the theory locally scaling invariant, we construct the following connection \begin{equation} \hat{\Gamma}^\rho_{\mu\nu}=\Gamma^\rho_{\mu\nu}+(W_\mu g^\rho_\nu+W_\nu g^\rho_\mu-W^\rho g_{\mu\nu}), \label{WeylGamma} \end{equation} by introducing a vector $W_\mu\equiv g_W w_\mu$, called Weyl gauge field ($g_W$ is the gauge coupling), with the following transformation rule, \begin{equation} W_\mu\rightarrow W'_\mu=W_\mu-\partial_\mu \ln f(x). \label{CTW} \end{equation} $\hat{\Gamma}^\rho_{\mu\nu}$ can be also obtained by replacing $\partial_\mu g_{\rho \sigma}\rightarrow (\partial_\mu +2 W_\mu)g_{\rho \sigma}$ in Eq.~\ref{Gamma}. Then the corresponding Ricci scalar $\hat{R}$ should be defined through $\hat{\Gamma}^\rho_{\mu\nu}$ and Lagrangian in Eq.~(\ref{L0}) is modified to a new form \begin{equation} \frac{\mathcal L}{\sqrt{-g}}=\frac{1}{2}\phi^2\hat R+\frac{\beta}{12}\hat R^2-\frac{\lambda}{2} D^\mu\phi D_\mu\phi-\frac{1}{4g_W^2}F_{\mu\nu}F^{\mu\nu}, \label{L1} \end{equation} where the derivative in the kinetic term of $\phi$ has been replaced to the covariant form, $D_\mu=\partial_\mu-W_\mu$, and the invariant field strength of $W_\mu$ is defined as $F_{\mu\nu}\equiv\partial_\mu W_\nu-\partial_\nu W_\mu$. This model is also discussed in \cite{R2Weyl2,R2Weyl3,R2Weyl4}. To make the theoretical formalism more transparent for analyzing inflation and dark matter, we shall utilize the equivalence between $f(R)$ theory and the scalar-tensor theory~\cite{fR1,fR2}. We define \begin{equation} F(\hat R)=\frac{1}{2}\phi^2\hat R+\frac{\beta}{12}\hat R^2, \end{equation} and introduce an auxiliary scalar field $\chi$. Then Eq.~(\ref{L1}) can be written as an equivalent form \begin{equation} \begin{aligned} \frac{\mathcal L}{\sqrt{-g}}=&\frac{1}{2}[F'(\chi^2)(\hat R-\chi^2)+F(\chi^2)]-\frac{\lambda}{2}D^\mu\phi D_\mu\phi-\frac{1}{4g_W^2}F_{\mu\nu}F^{\mu\nu} \\ =&\frac{1}{2}\left(\phi^2+\frac{\beta}{3}\chi^2\right)\hat R-\frac{1}{12}\beta\chi^4-\frac{\lambda}{2}D^\mu\phi D_\mu\phi-\frac{1}{4g_W^2}F_{\mu\nu}F^{\mu\nu}, \label{L2} \end{aligned} \end{equation} where $F'(\chi^2)\equiv \left|\frac{\partial F(\hat R)}{\partial \hat R}\right|_{\hat R=\chi^2}$. The equivalence relation $\chi^2=\hat R$ can be easily derived by using the equation of motion from $\delta\mathcal L/\delta\chi=0$. Note that the local scaling symmetry of Eq.~(\ref{L2}) allows us to choose convenient $f(x)$ in Eq.~(\ref{CT}) and (\ref{CTW}) to fix the gauge and simplify the Lagrangian. To compare with the Einstein gravity, we adopt $f(x)=\sqrt{\phi^2+\frac{\beta}{3}\chi^2}$ and get $\frac{1}{2}(\phi^2+\frac{\beta}{3}\chi^2)\hat R=\frac{1}{2}\hat R$, or equivalently, $\phi^2+\frac{\beta}{3}\chi^2=1$. Putting things together, we can obtain the following Lagrangian \begin{equation} \begin{aligned} \frac{\mathcal L}{\sqrt{-g}}=&\frac{1}{2}R-\frac{\lambda}{2}D^\mu\phi D_\mu\phi-\frac{3}{4\beta}(1-\phi^2)^2-\frac{1}{4g_W^2}F_{\mu\nu}F^{\mu\nu}-3W^\mu W_\mu\\ =&\frac{1}{2}R-\frac{3\lambda}{6+\lambda\phi^2}\partial^\mu\phi\partial_\mu\phi-\frac{3}{4\beta}(1-\phi^2)^2-\frac{1}{4g_W^2}F_{\mu\nu}F^{\mu\nu}\\ &-\frac{1}{2}(6+\lambda\phi^2)\left[W_\mu-\frac{1}{2}\partial_\mu\ln|6+\lambda\phi^2|\right]^2. \label{L3} \end{aligned} \end{equation} where we have used the relation between $\hat{R}$ and $R$, \begin{equation} \hat R=R-6W_\mu W^\mu-\frac{6}{\sqrt{-g}}\partial_\mu(\sqrt{-g}W^\mu), \label{WeylR} \end{equation} and neglect the surface term at infinite due to the total derivative term above. We define a new field variable $\Phi$, \begin{equation} \Phi\equiv \pm \begin{cases} \sqrt 6 \ln\left[\sqrt{\frac{+\lambda\phi^2}{6}}+\sqrt{\frac{+\lambda\phi^2+6}{6}}\right]~\mathrm{for}~ \lambda>0,\\ \sqrt 6 \ln\left[\sqrt{\frac{-\lambda\phi^2}{6}}+\sqrt{\frac{-\lambda\phi^2-6}{6}}\right]~\mathrm{for}~ \lambda<0, \end{cases} \end{equation} to get the canonical kinetic term, and make transformation for Weyl gauge field \begin{equation} \tilde W_\mu\equiv W_\mu-\frac{1}{2}\partial_\mu\ln|6+\lambda\phi^2|\equiv g_W\tilde w_\mu. \end{equation} Then the Lagrangian of Weyl $R^2$ model can be rewritten as a simple form \begin{equation} \frac{\mathcal L}{\sqrt{-g}}=\frac{1}{2}R-\frac{1}{2}\partial^\mu\Phi\partial_\mu\Phi-\frac{1}{4g_W^2}\tilde F_{\mu\nu}\tilde F^{\mu\nu}-\frac{1}{2}m^2(\Phi)\tilde W^\mu\tilde W_\mu-V(\Phi), \label{L4} \end{equation} where we have defined the mass term \begin{equation} m^2(\Phi)= \begin{cases} +6\cosh^2\left(\frac{\Phi}{\sqrt{6}}\right) ~\mathrm{for}~ \lambda>0,\\ -6\sinh^2\left(\frac{\Phi}{\sqrt{6}}\right) ~\mathrm{for}~ \lambda<0,\\ \end{cases} \label{m2} \end{equation} and scalar potential \begin{equation} V(\Phi)= \begin{cases} \frac{3}{4\beta}\left[1-\frac{6}{\lambda}\sinh^2\left(\frac{\Phi}{\sqrt{6}}\right)\right]^2 ~\mathrm{for}~ \lambda>0,\\ \frac{3}{4\beta}\left[1+\frac{6}{\lambda}\cosh^2\left(\frac{\Phi}{\sqrt{6}}\right)\right]^2 ~\mathrm{for}~ \lambda<0. \end{cases} \label{V} \end{equation} Now it is clear that this theory can be reformulated as the Einstein gravity with a massive Weyl gauge boson $\tilde W_\mu$ (WGB) and a self-interacting scalar $\Phi$. In the following sections, we shall show that $\Phi$ can be the inflaton field while $\tilde W_\mu$ is a dark matter candidate due to the $Z_2$ symmetry, $\tilde W_\mu\rightarrow - \tilde W_\mu$. \section{Inflation in Weyl $R^2$ Gravity} Now we concentrate on the inflationary mechanism in this model. The physics of $R^2$ term has been extensively studied as the well-known Starobinsky model \cite{Staro1,Staro2,Staro3,Staro4,Staro5,Staro6,Staro7,Staro8}. It was proposed originally to solve the cosmological initial singularity problem, and later demonstrated to be an elegant mechanism to give rise to an inflationary universe. In this section, we shall show the predictions in our model are different from those in Starobinsky model. \begin{figure} \centering \includegraphics[width=0.75\textwidth]{Vphi} \caption{The inflationary potentials of the Weyl $R^2$ model with $\lambda=10^2,10^3,10^4$. It is a hilltop-like potential whose typical vacumm expectation value is larger than the Planck scale.} \label{Vphi} \end{figure} The potential $V(\Phi)$ in Fig.~\ref{Vphi} for a hilltop-like shape regardless of the sign of $\lambda$. The parameter $\beta$ decides the height of the hilltop, and $\lambda$ determines the position of valley. Fig.~\ref{Vphi} shows the potentials with $\beta=1.56\times10^{10}$ in Planck unit and several values of $\lambda>0$ ($\lambda<0$ is similar because $\cosh^2x=1+\sinh^2x$). At the potential minimum $\Phi$ can outstrip the Planck scale when $|\lambda|$ is not too small. It is a general picture that for large $|\lambda|$ the potential can be flat and lead to an inflationary universe when $\Phi$ slow-rolls on the hilltop, until it falls into the valley. \begin{figure} \centering \includegraphics[width=0.75\textwidth]{r_ns} \caption{The predictions of spectral index $n_s$ and tensor-to-scalar ratio $r$ for the Weyl $R^2$ model with $\lambda$ from 300 to 3000, and e-folding number $N=50,60$, in comparison with the recent constraints shown by the BICEP/$Keck$ Collaboration \cite{BICEP}. } \label{r_ns} \end{figure} To compare with the latest observational constraints by BICEP/$Keck$ Collaboration \cite{BICEP}, we calculate the spectral index $n_s$ and tensor-to-scalar ratio $r$ for the primordial perturbations. These values are related to the slow-roll parameters $\epsilon$ and $\eta$ through \begin{equation} \begin{aligned} &\epsilon=\frac{1}{2}\left[\frac{V'(\Phi)}{V}\right]^2,~\eta=\frac{V''(\Phi)}{V},~n_s=1-6\epsilon+2\eta,~r=16\epsilon. \end{aligned} \end{equation} We numerically compute $n_s$ and $r$ for this model with $\lambda$ from 300 to 3000, and show the results in Fig.~\ref{r_ns}, where $N$ is defined as the e-folding number of the inflationary multiples from the horizon scale as large as the present one to the end of inflation \cite{efolds}, $N\equiv\ln(a_e/a_i)\sim(50,60)$. The figure indicates that, as $\lambda$ increases, $n_s$ and $r$ will approach fixed values predicted in Starobinsky model for every e-folds number $N$. The physical reasons has been explained in detail in Ref.~\cite{R2Weyl4} in which the authors show the equivalence between this model and Starobinsky inflation as $|\lambda|\rightarrow +\infty$. There is another noteworthy point in Fig.~\ref{r_ns}, the typical tensor-to-scalar ratio in this model is greater than $\mathcal O(10^{-3})$, which implies that the Weyl $R^2$ model may be tested by the next generation experiment of CMB B-mode polarization \cite{CMB-S4}. Current observation can give constraints on $\lambda\gtrsim 500$ for $N=50$ and $\lambda \gtrsim 250$ for $N=60$. On the other hand, the observation of CMB perturbation also provide a constraint on the Hubble parameter during inflation (denoted by $H_{\mathrm{inf}}$) and the mass of inflaton $m_\Phi$ in this model. It is known that the amplitude of scalar spectra $\Delta^2_s\sim V/24\pi^2\epsilon$, and the observation of CMB has confirmed that $\Delta^2_s\sim 2.1\times10^{-9}$. Thus this result constrains the parameter $\beta$ in Eq.~(\ref{V}), which determines the height of the potential $V$ at the hilltop. In this way, we find the Hubble parameter during inflation can be limited to $H_{\mathrm{inf}}\sim\sqrt{V/3}\sim10^{13}~\mathrm{GeV}$. Similarly, the mass of inflaton is also constrained to $m_\Phi\sim2\times10^{13}~\mathrm{GeV}$ defined at the minimum of the scalar potential. \section{Weyl gauge boson as dark matter} Now we discuss the physics of Weyl gauge boson. As we have shown, the Lagrangian has $Z_2$ symmetry, $\tilde W_\mu\rightarrow - \tilde W_\mu$, which enables the stability of $\tilde W_\mu $. The mass term $-\frac{1}{2}m^2\tilde W^\mu\tilde W_\mu$ in Eq.~(\ref{L4}), however, shows that negative sign would appear for $\lambda<0$. This does not necessarily mean an inconsistent theory because one could introduce another scalar field $\psi$ with $D_\mu \psi D^\mu \psi$ that can contribute to the mass of $\tilde W_\mu$ when $\psi \neq 0$ at its potential minimum. For illustration, we shall only focus on the $\lambda >0$ case in the rest of this paper. Since the magnitude of $\Phi$ is evolving in the inflation and subsequent reheating process, the mass term in Eq.~(\ref{m2}) is also changing in this period, until $\Phi$ completely stops at its potential minimum $\Phi_0$. We can expand the mass term at $\Phi=\Phi_0$ as \begin{equation} \begin{aligned} m^2=&6\cosh^2\left(\frac{\varphi+\Phi_0}{\sqrt{6}}\right)\\ =&6\cosh^2\left(\frac{\Phi_0}{\sqrt6}\right)+\sqrt6\sinh\left(\frac{2\Phi_0}{\sqrt6}\right)\varphi+\cosh^2\left(\frac{\Phi_0}{\sqrt6}\right)\varphi^2+\mathcal O(\varphi^3). \label{m2expand} \end{aligned} \end{equation} It implies that the term $-\frac{1}{2}m^2\tilde W^\mu\tilde W_\mu$ not only describes the mass of WGB, but also $\varphi-\tilde W$ interactions that may lead to the decay or annihilation of inflaton into WGB after inflation. The eventual mass of WGB is determined by the parameters $\lambda$ and $g_W$ \begin{equation} m_W=\sqrt{6}|g_W|\cosh[\Phi_0(\lambda)/\sqrt6]. \label{mW} \end{equation} The couplings between $\varphi$ and WGB also depend on these two parameters and can be read from above. In the rest of this section, we shall discuss the production mechanism for WGB as a dark matter candidate in detail by including all of the above couplings and interactions. \subsection{Weyl gauge field in a cosmological background} The production of vector dark matter includes both contributions from perturbative scattering and non-perturbative mechanism from vacuum fluctuations due to the quantum effect in curved background~\cite{vdm1,pgdm1, pgdm2, vdm2}. Let us concentrate on the part of WGB in Eq.~(\ref{L4}) \begin{equation} S=\int d^4x\sqrt{-g}\left[-\frac{1}{4g_W^2}\tilde F_{\mu\nu}\tilde F^{\mu\nu}-\frac{1}{2}m^2\tilde W^\mu\tilde W_\mu\right]. \label{SW} \end{equation} The metric is set to the FLRW form \begin{equation} g_{\mu\nu}dx^\mu dx^\mu=a^2(\tau)(-d\tau^2+d\vec x^2), \end{equation} where $a$ is the scale factor of the universe, and $\tau$ is the conformal time, which has the following relation with the physical time $d\tau=dt/a$. We can rewrite Eq.~(\ref{SW}) in components \begin{equation} S=\int d^3xd\tau\frac{1}{2}\left(|\vec{\tilde w}'-\nabla\tilde w_0|^2-|\nabla\times\vec{\tilde w}|^2+a^2\tilde m^2\tilde w_0^2-a^2\tilde m^2|\vec{\tilde w}|^2\right), \label{SWcomp} \end{equation} where $'\equiv\frac{\partial}{\partial\tau}$, $\tilde m\equiv|g_W|m(\Phi)$, and $\vec{\tilde w}$ denotes the spatial components. It is obvious that $\tilde w_0$ in Eq.~(\ref{SWcomp}) has no kinetic term, which is commonly known as that only three of the four components of massive vectors are independent and physical modes. Hence, we can decouple the part of $W_0$ from Eq.~(\ref{SWcomp}) with Fourier transform, and only retain the physical modes, including two transverse modes and a longitudinal mode \begin{equation} \vec{\tilde w}(\tau,\vec k)\equiv\sum_{j=\pm,L}\vec\epsilon_j(\vec k)W_j(\tau,\vec k), \end{equation} where $\vec\epsilon_j(\vec k)$ is the orthonormal polarization vector. Their actions are derived as follows \begin{equation} S_\pm=\int\frac{d^3kd\tau}{(2\pi)^3}\frac{1}{2}\left(|W_\pm'|^2-(k^2+a^2\tilde m^2)|W_\pm|^2\right), \label{SWT} \end{equation} \begin{equation} S_L=\int\frac{d^3kd\tau}{(2\pi)^3}\frac{1}{2}\left(\frac{a^2\tilde m^2}{k^2+a^2\tilde m^2}|W_L'|^2-a^2\tilde m^2|W_L|^2\right), \label{SWL} \end{equation} where $k$ is the magnitude of comoving momentum $\vec k$, and $\vec k\cdot\vec{\tilde w}=kW_L$ is used in the derivation. For the sake of simplicity, we redefine a new field $\mathcal W_L$ for the longitudinal mode \begin{equation} \mathcal W_L\equiv\frac{a\tilde m}{\sqrt{k^2+a^2\tilde m^2}}W_L. \end{equation} Then the equation of motion for each physical mode can be written as oscillator equations \begin{equation} W_\pm''+\omega_\pm^2W_\pm=0, \label{oEqWT} \end{equation} \begin{equation} \mathcal W_L''+\omega_L^2\mathcal W_L=0, \label{oEqWL} \end{equation} with frequency variables \begin{equation} \omega_\pm^2=k^2+a^2\tilde m^2, \label{w2WT} \end{equation} \begin{equation} \begin{aligned} &\omega_L^2=k^2+a^2\tilde m^2-\frac{k^2}{k^2+a^2\tilde m^2}\frac{a''}{a}+3\frac{k^2\tilde m^2a'^2}{(k^2+a^2\tilde m^2)^2}\\ &-\frac{k^2}{k^2+a^2\tilde m^2}\frac{\tilde m''}{\tilde m}+3\frac{k^2a^2\tilde m'^2}{(k^2+a^2\tilde m^2)^2}-\frac{a'}{a}\frac{\tilde m'}{\tilde m}\frac{2k^2(k^2-2a^2\tilde m^2)}{(k^2+a^2\tilde m^2)^2}. \label{w2WL} \end{aligned} \end{equation} The mode functions of WGB can be determined by solving Eq.~(\ref{oEqWT}) and (\ref{oEqWL}). Next, we show the relation between the energy density and the mode functions. The energy-momentum tensor of field in a curved background is \begin{equation} T_{\mu\nu}=\frac{-2}{\sqrt{-g}}\frac{\delta(\sqrt{-g}S)}{\delta g^{\mu\nu}}, \label{Tuv} \end{equation} and the energy density is defined as the vacuum expectation of $T_{00}$ \begin{equation} \rho=\langle 0|T_{00}|0\rangle. \end{equation} Therefore, to calculate the energy density of Weyl gauge field, we need to define the vacuum state $|0\rangle$ of the theory. In other words, a quantized theory is required. The first step of quantization is to give the Heisenberg representation for Weyl gauge field \begin{equation} \begin{aligned} \hat W_\pm(\tau,\vec x)=\int\frac{d^3k}{(2\pi)^{3/2}}&\left[\hat a_{\vec k}\vec\epsilon_\pm(\vec k)W_\pm(\tau,\vec k) e^{i\vec k\cdot\vec x}+\hat a_{\vec k}^\dag\vec\epsilon_\pm^*(\vec k)W_\pm^*(\tau,\vec k)e^{-i\vec k\cdot\vec x}\right],\\ \hat{\mathcal W}_L(\tau,\vec x)=\int\frac{d^3k}{(2\pi)^{3/2}}&\left[\hat b_{\vec k}\vec\epsilon_L(\vec k)\mathcal W_L(\tau,\vec k) e^{i\vec k\cdot\vec x}+\hat b_{\vec k}^\dag\vec\epsilon_L^*(\vec k)\mathcal W_L^*(\tau,\vec k)e^{-i\vec k\cdot\vec x}\right]. \label{Fmode} \end{aligned} \end{equation} Then the quantization demands that the ladder operators should satisfy the following commutative relations \begin{equation} \left[\hat a_{\vec k},\hat a_{\vec k}^\dag\right]=\delta_{jj'}\delta(\vec k-\vec k'),~\left[\hat b_{\vec k},\hat b_{\vec k}^\dag\right]=\delta(\vec k-\vec k'), \label{ladder} \end{equation} where $j$ is the index that refers to the two components of transverse mode. The commutative relations can also be represented as a canonical form \begin{equation} \begin{aligned} \left[\hat W_\pm(\tau,\vec x),\hat W_\pm'(\tau,\vec y)\right]=&i\delta(\vec x-\vec y),\\ \left[\hat{\mathcal W}_L(\tau,\vec x),\hat{\mathcal W}_L'(\tau,\vec y)\right]=&i\delta(\vec x-\vec y), \end{aligned} \end{equation} which imply the following normalization condition \begin{equation} W_\pm W_\pm'^*-W_\pm^*W_\pm'=\mathcal W_L\mathcal W_L'^*-\mathcal W_L^*\mathcal W_L'=i. \end{equation} Now we can define the vacuum $|0\rangle$ as a state that complies with $\hat a_{\vec k}|0\rangle=\hat b_{\vec k}|0\rangle=0$. Then the non-perturbative production of particles from vacuum can be calculated by $\rho=\langle 0|T_{00}|0\rangle$, described by the time-dependent mode functions. Finally, with Eq.~(\ref{SWT}), (\ref{SWL}), and (\ref{Tuv})-(\ref{ladder}), the energy density of Weyl gauge field in a cosmological background is obtained as \begin{equation} \rho_\pm=\int\frac{k^2dk}{4\pi^2a^4}\left[|W'_\pm|^2+(k^2+a^2\tilde m^2)|W_\pm|^2-\omega_\pm\right], \label{rhoT} \end{equation} \begin{equation} \begin{aligned} \rho_L=\int\frac{k^2dk}{4\pi^2a^4}\bigg[&|\mathcal W'_L|^2+(k^2+a^2\tilde m^2)|\mathcal W_L|^2+\bigg(\frac{(\frac{a'}{a}+\frac{\tilde m'}{\tilde m})k^2}{k^2+a^2\tilde m^2}\bigg)^2|\mathcal W_L|^2\\ &-\frac{(\frac{a'}{a}+\frac{\tilde m'}{\tilde m})k^2}{k^2+a^2\tilde m^2}(\mathcal W'_L\mathcal W^*_L+\mathcal W'^*_L\mathcal W_L)-\omega_L\bigg], \label{rhoL} \end{aligned} \end{equation} where the zero-point energy at flat spacetime has been subtracted by the term $-\omega$. The total energy density is the sum of two transverse modes and one longitudinal mode, $\rho_{tot}=2\rho_\pm+\rho_L$. Next we numerically solve the equations of motion (\ref{oEqWT}), (\ref{oEqWL}) in the inflationary background and calculate the energy density of WGB. Directly solving these equations might be inaccurate in some cases. For instance, when $\rho$ is many orders of magnitude smaller than the zero-point energy, the numerical calculation of $\rho$ will meet the situation that subtracting two very close numbers, which will make the numerical result unstable. Fortunately, this intractable case usually has an adiabatic vacuum, which means the vacuum evolves slowly. Then, a strategy called adiabatic approximation can be used to deal with the problems~\cite{reh1}. In the adiabatic approximation, the mode functions can be written as the following form \begin{equation} \begin{aligned} &W_\pm(\tau)=\mathcal A_\pm^k(\tau) v_\pm^k(\tau)+\mathcal B_\pm^k(\tau) v_\pm^{k*}(\tau),\\ &\mathcal W_L(\tau)=\mathcal A_L^k(\tau) v_L^k(\tau)+\mathcal B_L^k(\tau) v_L^{k*}(\tau),\\ &v_{\pm(L)}^k=\frac{1}{\sqrt{2\omega_{\pm(L)}}}\exp\left[-i\int^\tau\omega_{\pm(L)}d\tau\right], \label{WABv} \end{aligned} \end{equation} where $\mathcal A^k(\tau)$ and $\mathcal B^k(\tau)$ are some functions for the $k$-mode, and satisfy the normalization condition \begin{equation} |\mathcal A^k|^2-|\mathcal B^k|^2=1. \end{equation} Substituting Eq.~(\ref{WABv}) into Eq.~(\ref{Fmode}), we can redefine a new set of ladder operators by the Bogolyubov transformation \begin{equation} \tilde{a}_{\vec k}=\hat a_{\vec k}\mathcal A^k+\hat a^\dag_{\vec k}\mathcal B^{k*},~ \tilde{b}_{\vec k}=\hat b_{\vec k}\mathcal A^k+\hat b^\dag_{\vec k}\mathcal B^{k*}, \end{equation} which satisfy the similar commutative relations as Eq.~(\ref{ladder}) \begin{equation} \left[\tilde a_{\vec k},\tilde a_{\vec k}^\dag\right]=\delta_{jj'}\delta(\vec k-\vec k'),~\left[\tilde b_{\vec k},\tilde b_{\vec k}^\dag\right]=\delta(\vec k-\vec k'). \label{ladder2} \end{equation} Then the energy density of the Weyl gauge field can be written as \begin{equation} \rho_{\pm/L}=\int\frac{k^2dk}{2\pi^2a^4}|\mathcal B^k_{\pm/L}|^2\omega_{\pm/L}. \label{rhoB} \end{equation} Comparing to Eq.~(\ref{rhoT}) and (\ref{rhoL}), it can be seen the zero-point energy has disappeared in this expression, which means the aforementioned numerical problem is alleviated with the adiabatic approximation. In addition, the function $\mathcal B^k$ obeys \begin{equation} \mathcal A' v=\frac{\omega_k'}{2\omega_k}v^*\mathcal B,~\mathcal B' v^*=\frac{\omega_k'}{2\omega_k}v\mathcal A, \end{equation} which are identical to Eq.~(\ref{oEqWT}) and (\ref{oEqWL}). Finally, it is essential to note that the adiabatic approximation can only be used to the case with positive $\omega^2$. This is the prerequisite for the existence of adiabatic vacuum. For the transverse mode Eq.~(\ref{w2WT}), this condition is completely satisfied. But for the longitudinal mode Eq.~(\ref{w2WL}), the tachyonic situation ($\omega_L^2<0$) is possible, and it is common in the case of $\tilde m\ll H_{\mathrm{inf}}$. Consequently, if the tachyonic situation appears in the longitudinal mode, it would violate the adiabatic condition. Then the mode functions and energy density can only be solved with original formulas (Eq.~(\ref{oEqWL}) and (\ref{rhoL})). \subsection{Production of Weyl gauge boson} Now we are in a position to apply the above formalism in the cosmological background of inflation. It can be seen from Eq.~(\ref{oEqWT})-(\ref{w2WL}) that, to solve the mode functions we also need the evolution of scale factor $a$ over conformal time $\tau$, which is determined by the inflation and reheating in our model. \subsubsection{Inflation and reheating} The evolution of cosmic scale $a$ is described by the Friedmann equation \begin{equation} \mathcal H^2\equiv(\frac{a'}{a})^2=\frac{a^2\rho}{3M_P^2}, \label{Feq} \end{equation} where $'\equiv\frac{\partial}{\partial\tau}$. To solve this equation, we need to discuss how the matter energy density evolving in our model. To be more specific, we need reheating process to transfer the energy of the inflaton $\Phi$ into other relativistic particles, for example through decay into SM particles \cite{reh1,reh2,reh3,reh4,reh5}. Here, instead we first consider a new scalar $\psi$ which couples to the inflaton and SM particles simultaneously. Then in this way, the inflaton can first decay into $\psi$ before eventually transfer its energy to the SM particles. To maintain the scaling symmetry, we illustrate with the following toy model, \begin{equation} \begin{aligned} \mathcal L_{\mathrm{reh}}=&-g_\psi^2\phi^2\psi^2-\frac{1}{2}D^\mu \psi D_\mu \psi +\mathcal L(\psi, SM)\\ =&-\frac{6g_\psi^2}{\lambda}\sinh^2\left(\frac{\Phi}{\sqrt 6}\right)\psi^2-\frac{1}{2}D^\mu \psi D_\mu \psi+\mathcal L(\psi, SM)\\ \sim&-\frac{g_\psi^2}{\lambda}\Phi^2\psi^2-\frac{1}{2}D^\mu \psi D_\mu \psi+\mathcal L(\psi, SM), \label{reh} \end{aligned} \end{equation} where $\mathcal L(\psi,SM)$ denotes the coupling between $\psi$ and SM particles, which we do not specify here. Here we have neglected higher order interactions in the last step. We reiterate that the definition $\Phi\equiv\varphi+\Phi_0$ has been introduced in the previous section. Then the first term in Eq.~(\ref{reh}) can be expanded as \begin{equation} \begin{aligned} -\frac{g_\psi^2}{\lambda}\Phi^2\psi^2&=-\frac{g_\psi^2}{\lambda}(\varphi+\Phi_0)^2\psi^2\\ &=-\frac{g_\psi^2}{\lambda}\Phi_0^2\psi^2-2\frac{g_\psi^2}{\lambda}\Phi_0\varphi\psi^2-\frac{g_\psi^2}{\lambda}\varphi^2\psi^2. \label{Lphichi} \end{aligned} \end{equation} From left are the mass term of $\psi$, the three-scalar vertex, and the four-scalar vertex. The feasibility of $\varphi$'s decay into $\psi$ requires the mass of $\psi$ must be less than the half that of $\varphi$. Note that the mass of inflaton is limited to $m_\Phi\sim2\times10^{13}~\mathrm{GeV}$ in our model, thus it is clear that $m_\psi\equiv g_\psi\Phi_0/\sqrt{\lambda}<10^{13}~\mathrm{GeV}$. With a typical VEV $\Phi_0\sim10M_P$, the coupling is limited to $g_\psi/\sqrt{\lambda}\lesssim4\times10^{-7}$, which gives an upper limit to the reheating temperature $T_r$. Note that the major factor determining $T_r$ is the $\varphi\rightarrow\psi\psi$ decay process caused by the three-scalar vertex in Eq.~(\ref{Lphichi}), then the probability of inflaton decay is easily derived as \begin{equation} \Gamma(\varphi\rightarrow\psi\psi)=\frac{4g_\psi^4\Phi_0^2}{8\pi\lambda^2}\frac{\sqrt{(m_\Phi/2)^2-m_\psi^2}}{m_\Phi^2}=\frac{g_\psi^2m_\psi^2}{2\pi\lambda}\frac{\sqrt{(m_\Phi/2)^2-m_\psi^2}}{m_\Phi^2}\lesssim10^{-20}M_P. \label{decayX} \end{equation} As a consequence, the reheating temperature is estimated as $T_r\sim0.4\sqrt{\Gamma M_P}\lesssim10^8~\mathrm{GeV}$, which is far less than the inflation energy scale. With a specific reheating mechanism, the evolution of inflaton field obeys the following equation \begin{equation} \Phi''+2\mathcal H\Phi'+a^2\frac{\partial V}{\partial\Phi}+a\Gamma\Phi'=0. \label{phieq} \end{equation} Then we can write down the energy density of the inflaton \begin{equation} \rho_\Phi=\frac{\Phi'^2}{2a^2}+V(\Phi), \label{rhophi} \end{equation} and the evolving equation for $\psi$ and SM particles as radiation \begin{equation} \rho_r'+4\mathcal{H}\rho_r-\frac{\Gamma\Phi'^2}{a}=0. \label{rhor} \end{equation} Note that the total energy density in the Friedmann equation is the sum of $\rho_\Phi$ and $\rho_r$. So combining Eq.~(\ref{Feq}) with (\ref{phieq})-(\ref{rhor}) and (\ref{V}), we can obtain a numerical solution of $a(\tau)$, which describes the evolution of cosmic scale within the period of inflation, reheating, and the ensuing radiation-dominated epoch. \subsubsection{Non-perturbative production} We take $\Gamma(\varphi\rightarrow\psi\psi)=10^{-20}M_P$ as an example in this subsection, which is the maximum rate allowed in the toy model we constructed above. We shall keep in mind that generally the reheating temperature is free as long as it satisfies the bound from BBN and energy density limit after inflation. We solve the numerical result of $a(\tau)$, and substitute it into Eq.~(\ref{oEqWT})-(\ref{w2WL}), the mode functions for each eventual mass $m_W$ (defined as Eq.~(\ref{mW}) or $\tilde m|_{\Phi=\Phi_0}$) and co-moving momentum $k$ can be derived with an initial condition. Because all the $k$-modes we are interested in once had the wavelength much smaller than the horizon scale in the far past of the inflation, it is then expected the term $k^2$ is dominant in Eq.~(\ref{w2WT}) and (\ref{w2WL}) under the limit of $\tau\rightarrow-\infty$. Therefore, the solution to the equation of harmonic oscillator is suggested to be an initial condition for both the transverse mode and the longitudinal mode, that is the well-known Bunch-Davies vacuum state \cite{BDvacuum} \begin{equation} \lim_{\tau\rightarrow-\infty}W_\pm(\mathrm{or}~\mathcal W_L)=\frac{1}{\sqrt{2k}}e^{-ik\tau}. \label{inicon} \end{equation} With this initial condition, we illustrate with the eventual mass $m_W=10^{10}~\mathrm{GeV}$ in Fig.~\ref{f_and_w2}, where $f_k$ is defined as a function that is proportional to the energy density Eq.~(\ref{rhoT}) and (\ref{rhoL}) \begin{equation} \begin{aligned} f_{k,\pm}\equiv&\left[|W'_\pm|^2+(k^2+a^2\tilde m^2)|W_\pm|^2\right]/2\omega_\pm-\frac{1}{2}=|\mathcal B^k_{\pm}|^2,\\ f_{k,L}\equiv&\bigg[|\mathcal W'_L|^2+(k^2+a^2\tilde m^2)|\mathcal W_L|^2+\bigg(\frac{(\frac{a'}{a}+\frac{\tilde m'}{\tilde m})k^2}{k^2+a^2\tilde m^2}\bigg)^2|\mathcal W_L|^2\\ &-\frac{(\frac{a'}{a}+\frac{\tilde m'}{\tilde m})k^2}{k^2+a^2\tilde m^2}(\mathcal W'_L\mathcal W^*_L+\mathcal W'^*_L\mathcal W_L)\bigg]/2\omega_L-\frac{1}{2}=|\mathcal B^k_{L}|^2, \label{fk} \end{aligned} \end{equation} and $a_\mathrm{end}$ denotes the scale factor when the inflation ends (defined as the moment that the slow-roll parameter $\epsilon=1$). Moreover, $k_s$ denotes the dominate mode of production, which is approximately equal to the product of $m_W$ and the scale factor $a$ for the moment that the Hubble parameter $H=m_W$ (if $m_W>H_{\mathrm{inf}}$, the dominant mode is about $k\sim a_\mathrm{end}H_{\mathrm{inf}}$). \begin{figure} \centering \includegraphics[width=0.75\textwidth]{f_and_w2} \caption{Evolution of $|f_k|$ and $\omega^2$ for the transverse mode (red line, solved by the adiabatic approximation) and longitudinal mode (blue line, solved directly in Eq.~(\ref{oEqWL})) with $m_W=10^{10}~\mathrm{GeV}$, $\Gamma=10^{-20}M_P$, and $k=0.5,1,2~k_s$ ($k_s$ denotes the dominate mode of production). It depicts an increasing abundance of dark matters in the co-moving volume until the Hubble parameter becomes lower than the mass of WGB. Moreover, the existence of tachyonic enhancement makes the creation of the longitudinal mode far more productive than the transverse mode.} \label{f_and_w2} \end{figure} There are two interesting aspects in Fig.~\ref{f_and_w2}. Firstly, the production of the longitudinal mode is more abundantly than the transverse one, which has been shown by \cite{vdm1, pgdm2}. This behavior can be understood as follows. When $a\ll a_\mathrm{end}\lesssim k/m_W$, the frequency $\omega_\pm$ of the transverse mode is almost constant, which leads to a non-increasing mode function as plane wave. However, for the longitudinal mode, we can show that $\omega_L^2\sim k^2-a''/a$ with $a\ll a_\mathrm{end}\lesssim k/m_W$, here we ignore the impact of changing mass for convenience. Since the universe is approximately regarded as the de Sitter space during the inflationary epoch, that is $a\sim-1/H_{\mathrm{inf}}\tau$, we have $\omega_L^2\sim k^2-2a^2H_{\mathrm{inf}}^2$, which decreases as the universe expands. Substituting it into Eq.~(\ref{oEqWL}), then we obtain an increasing mode function \begin{equation} \mathcal W_L|_{a\ll k/m_W}\sim\frac{e^{-ik\tau}}{\sqrt{2k}}\left(1+\frac{iaH_{\mathrm{inf}}}{k}\right). \label{WLinf} \end{equation} It indicates that when $a\ll k/H_{\mathrm{inf}}$, the mode function of the longitudinal mode is also a plane wave like the transverse one. But once the scale factor becomes large enough to make the negative $\omega_L^2$ emerge, the imaginary part of Eq.~(\ref{WLinf}) will surge exponentially. This situation is usually called the tachyonic enhancement, which leads to the high yield of the longitudinal mode compared to the transverse one. The second noticeable aspect is that the function $f_k$ for the dominant mode $k_s$ gradually approaches a stationary value after the Hubble parameter $H$ becoming smaller than $m_W$. This is because the term $a^2m_W^2$ in Eq.~(\ref{w2WT}) and (\ref{w2WL}) turns into a leading term after that moment, which leads to a steady solution with $f_k\propto\rho a^3\sim\mathrm{constant}$ (see \cite{vdm2}). And the particles become non-relativistic due to the expansion of the universe. We can choose an arbitrary moment that satisfies $H\ll m_W$ to evaluate the spectrum of $f_k(k)$ around the dominant mode $k_s$, and calculate the integral (\ref{rhoT}), (\ref{rhoL}) or (\ref{rhoB}) to obtain the energy density $\rho$ of WGB at that moment. In practice, we consider a moment that is later than the end of reheating as the conserved quantity $\rho/s$ can be defined for the WGB, where $s=\frac{2\pi^2}{45}g_{*S}(T)T^3$ is the total entropy density for the reheated particles, and $g_{*S}(T)$ denotes the effective number of degrees of freedom in entropy with temperature $T$. This quantity measures the relic abundance of non-perturbative produced particles. \begin{figure} \centering \includegraphics[width=0.75\textwidth]{abundance} \caption{(Left) The relation between the relic abundance and the mass of non-perturbative produced WGB. The feasible mass of WGB should be restricted to the range that $\rho/s\leq\rho_0/s_0$. (Right) The maximal abundance decreases proportionately with the total decay rate of inflaton. It shows that if $\Gamma<10^{-30}M_P$ or $T_r<10^3~\mathrm{GeV}$, the non-perturbative produced WGB would only be part of dark matter.} \label{abundance} \end{figure} Fig.~\ref{abundance} shows how relic abundance varies with $m_W$ and decay constant $\Gamma$, where $m_W$ is determined by the parameters $\lambda$ and $g_W$, and the parameter $\beta$ has been fixed according to the constraint of observation on $H_{\mathrm{inf}}$ discussed in Sec.~II. We can see that there are three cases in the relationship between $\rho/s$ and $m_W$, which are summarized as \begin{equation} \begin{aligned} \rho/s\propto \begin{cases} \sqrt{m_W},~&\mathrm{for}~m_W<H_{\mathrm{reh}},\\ \mathrm{almost~constant},~&\mathrm{for}~H_{\mathrm{reh}}<m_W<H_{\mathrm{inf}},\\ \mathrm{exponential~decrease},~&\mathrm{for}~m_W>H_{\mathrm{inf}}, \end{cases} \label{ab_m} \end{aligned} \end{equation} where $H_{\mathrm{reh}}$ is the Hubble parameter at the end of reheating. For the current universe, $T_0=2.73~\mathrm{K}= 9.65\times10^{-32}M_P$, $g_{*S0}=3.91$, and the present energy density for the dark matters is $\rho_0=2.73\times10^{-121}M_P^4$, then we can derive $\rho_0/s_0=1.8\times10^{-28}M_P$. This observational result gives a constraint to the mass of WGB. It can be clearly identified in Fig.~\ref{abundance} that the relic abundance for the WGB produced in a non-perturbative pattern will be larger than that of dark matters in the current universe if the mass of WGB is in the interval of $3\times10^{-13}~\mathrm{GeV}$ to $\sim5\times10^{13}~\mathrm{GeV}$ (The upper limit is in the range of $10^{13}\mathrm{-}10^{14}~\mathrm{GeV}$, which is slightly dependent on the decay rate $\Gamma$). Therefore, the observation constrains two possible ranges of mass, $m_W\lesssim 3\times10^{-13}~\mathrm{GeV}$ or $m_W\gtrsim 5\times10^{13}~\mathrm{GeV}$, such that the relic density is not larger than the observation value. When $m_W<3\times10^{-13}~\mathrm{GeV}$, according to the $\varphi-\tilde W$ interaction discussed in Sec.~II, there will be other production channels for WGB through the perturbative decay $\varphi\rightarrow\tilde W\tilde W$ and the annihilation $\varphi\varphi\rightarrow\tilde W\tilde W$. Since the contribution of decay is much larger than that of annihilation in our case, we only consider the decay. Based on Eq.~(\ref{m2expand}) and (\ref{mW}), the decay rate of $\varphi\rightarrow\tilde W\tilde W$ can be easily calculated as \begin{equation} \begin{aligned} \Gamma(\varphi\rightarrow\tilde W\tilde W)&=\frac{3\sinh^2(2\Phi_0/\sqrt{6})g_W^4}{\pi}\frac{\sqrt{(m_\Phi/2)^2-m_W^2}}{m_\Phi^2}\left(3+\frac{m_\Phi^4}{4m_W^4}-\frac{m_\Phi^2}{m_W^2}\right)\\ &\sim\frac{3m_\Phi^3}{288\pi}\frac{\sinh^2(2\Phi_0/\sqrt{6})}{\cosh^4(\Phi_0/\sqrt{6})},~\mathrm{when}~m_W\ll m_\Phi. \label{decayW} \end{aligned} \end{equation} Note that the mass of inflaton is around $m_\Phi\sim 2\times10^{13}~\mathrm{GeV}\sim10^{-5}M_P$ in this model, and the typical field value $\Phi_0\sim 10M_P$, thus the decay rate can be estimated as $\Gamma(\varphi\rightarrow\tilde W\tilde W)\sim10^{-17}M_P$. Comparing to Eq.~(\ref{decayX}), the decay rate of $\varphi\rightarrow\tilde W\tilde W$ is far larger than that of $\varphi\rightarrow\psi\psi$. This situation will lead to an inadequate reheating to SM, and result in additional dark radiation in our universe. In such a case, we would need other reheating mechanism that can transfer most of energy in inflaton field into other particles, and subsequently SM particles. For the large mass range $m_W\gtrsim5\times10^{13}~\mathrm{GeV}$, there is a $-\psi^2 W^\mu W_\mu$ term due to the covariant derivative $D_\mu=\partial_\mu-W_\mu$ in Eq.~(\ref{reh}). This implies that the annihilation $\psi\psi\rightarrow \tilde W\tilde W$ is allowed in the large mass case. However, if the reheating temperature is too low, then the annihilation rate will be negligible, because the number density $n$ of $\psi$ with enough energy to participate in the production of WGB is exponentially reduced with decreasing temperature $T$, $n\propto\exp(-E/T)$. Therefore, with a low-temperature reheating mechanism, the non-perturbative production can reasonably provide enough abundance for WGB as dark matter with the mass $m_W\sim5\times10^{13}~\mathrm{GeV}$. Another visible aspect in Fig.~\ref{abundance} is that the decay rate $\Gamma$ strongly affects the non-perturbative production. Note that $\Gamma$ denotes the total rate of all decay channels of inflaton, including decay to SM particles and to dark matters. Hence if $m_W<m_\Phi/2$, the $\varphi\rightarrow\tilde W\tilde W$ channel is open, and the total decay rate is never lower than $\Gamma(\varphi\rightarrow\tilde W\tilde W)$. Then if $m_W>m_\Phi/2$, the total decay rate is equivalent to $\Gamma(\varphi\rightarrow\psi\psi)$ as the reheating rate. It is apparent on the right of Fig.~\ref{abundance} that the maximal abundance of non-perturbative produced WGB decreases proportionately with $\Gamma$, and if $\Gamma<10^{-30}M_P$, the non-perturbative pattern is unable to produce sufficient WGB as dark matter. Since we have shown $\Gamma(\varphi\rightarrow\tilde W\tilde W)\sim10^{-17}M_P$ in this model (for $m_W<m_\Phi/2$), the $\Gamma<10^{-30}M_P$ case only appears when $m_W>m_\Phi/2$, which corresponds to the reheating temperature $T_r\sim0.4\sqrt{\Gamma M_P}<10^3~\mathrm{GeV}$. As a result, for this range of $T_r$, only heavy WGB can be a dark matter candidate, but with insufficient abundance. \subsubsection{High-temperature reheating} The preceding discussions consider a low-temperature reheating mechanism that is constructed for simplicity. In this section, we investigate the production of WGB with a high-temperature of reheating. Let us focus on the small mass range first. The perturbative pattern of production is primarily the decay of inflaton $\varphi\rightarrow\tilde W\tilde W$. The annihilation $\psi\psi\rightarrow \tilde W\tilde W$ is also present ($\psi$ denotes an arbitrary scalar in the thermal equilibrium after reheating), but it is negligible, because the coupling of this process is too small according to the relation $g_W\propto m_W$ under our definition. Hence we only need to consider the decay. In previous sections, we have derived that the decay rate of $\varphi\rightarrow\tilde W\tilde W$ is $\Gamma_W\sim10^{-17}M_P$. If this decay rate is far larger than that to the SM particles, $\Gamma_W\gg\Gamma_{SM}$, the WGB can contribute as dark radiation. Therefore, the upper limit of abundance of dark radiation constrains the lower limit of $\Gamma_{SM}$ or $T_r$. Substituting $\Gamma=\Gamma_W+\Gamma_{SM}$ into Eq.~(\ref{phieq}), and combining it with the equation \begin{equation} \rho_{SM/W}'+4\mathcal{H}\rho_{SM/W}-\frac{\Gamma_{SM/W}\Phi'^2}{a}=0, \label{rhoSMW} \end{equation} we can derive the energy density of dark radiation $\rho_W$ after reheating. Then the amount of dark radiation at present (denoted as $\Omega_{\mathrm{DR}}$) can be estimated. The result is, if $\Omega_{\mathrm{DR}}<\Omega_{\mathrm{SM}}$ is expected at matter-radiation equality, the magnitude of $\Gamma_{SM}$ cannot be lower than the level of $\Gamma_W$, which restricts the reheating temperature to be $T_r>4\times10^9~\mathrm{GeV}$. In conclusion, under this constraint, the small mass WGB can be the dark matter candidate, which embodies a tiny amount of dark radiation produced in the inflaton decay and the majority of cold component originates from the vacuum fluctuation during inflation. Meanwhile, if it contributes to the whole abundance of dark matters, the mass should be around $m_W\sim3\times10^{-13}~\mathrm{GeV}$. For the heavy WGB case, the decay process is forbidden kinematically. However, the annihilation channel becomes significant, which is a kind of ``freeze-in'' mechanism of production \cite{freezein1, freezein2, FIMP}. There are two main channels for annihilation, direct annihilation owing to the $\psi^2W^\mu W_\mu$ coupling, and the other by gravitational interaction~\cite{Garny:2015sjg, Tang:2016vch, pgdm3, Garny:2017kha}. The amplitude $\mathcal A\equiv\sum|\mathcal M|^2$ of them can be calculated as follows \begin{equation} \mathcal A(\psi\psi\rightarrow\tilde W\tilde W)=16g_W^4\left(3+\frac{\bar{\bm s}(\bar{\bm s}/4-m_W^2)}{m_W^4}\right), \label{A1} \end{equation} \begin{equation} \begin{aligned} \mathcal A(\psi\psi\overset{\mathrm{grav}}{\rightarrow}\tilde W\tilde W)=\kappa^4\left(\frac{101m_W^4m_\psi^4}{60\bar{\bm s}^2}-\frac{m_W^2m_\psi^2}{20\bar{\bm s}}(11m_\psi^2+m_W^2)\right.\\ \left.+\frac{1}{240}(19m_\psi^4+76m_W^2m_\psi^2)-\frac{7\bar{\bm s}}{240}(m_W^2+m_\psi^2)+\frac{\bar{\bm s}^2}{160}\right), \label{A2} \end{aligned} \end{equation} where $\bar{\bm s}\equiv(p_{\psi1}+p_{\psi2})^2$, $\kappa\equiv\sqrt{32\pi G}=2$. Then the total cross section can be easily derived as \begin{equation} \sigma_{\mathrm{tot}}=\frac{1}{16\pi\bar{\bm s}tg_i^2}\frac{|\vec p_f|}{|\vec p_i|}\mathcal A_{\mathrm{tot}}, \label{CrossSection} \end{equation} where $t=2$ is the symmetric factor for the identical final states, $g_i$ is the degree of freedom for initial state. Finally, the relic abundance of dark matters produced in annihilation process can be calculated with the following formula (see also in \cite{pgdm3}) \begin{equation} Y=\int_{\sim0}^{\sim T_r}\frac{dT}{HTs}\left[\frac{Tg_i^2}{32\pi^4}\int d\bar{\bm s}\sigma_{\mathrm{tot}}\sqrt{\bar{\bm s}}(\bar{\bm s}-4m_\psi^2)K_1\left(\frac{\sqrt{\bar{\bm s}}}{T}\right)\right], \label{Y} \end{equation} where $H$ is the Hubble parameter, $s$ is the total entropy density mentioned earlier, and $K_1$ is the modified Bessel function of the second kind with order one. It is seen that for heavy particles, larger relic abundance of dark matter would result from higher reheating temperature. With supposing $m_\psi\ll m_W$, we can calculate the relic abundance $Y$ for each set of $T_r$ and $m_W$. Then comparing it with present abundance of dark matter $Y_0\sim5\times10^{-9}/m_W$, we can get the relation between $m_W$ and $T_r$ for $Y=Y_0$, as shown in Fig.~\ref{annihilation}. It shows that the WGB in the large mass range is feasible to be the dark matter candidate with abundance that is consistent with observation as long as the reheating temperature $T_r>10^{13}~\mathrm{GeV}$, and the $m_W$ corresponding to the proper abundance is approximately linear with $T_r$. Moreover, since the instantaneous reheating limit is estimated as $T_{\mathrm{max}}\sim(3H_{\mathrm{inf}}^2/g_{*S}(T_r))^{1/4}\sim2\times10^{15}~\mathrm{GeV}$, the WGB can reach enormous mass of up to $4\times10^{16}~\mathrm{GeV}$. \begin{figure} \centering \includegraphics[width=0.75\textwidth]{annihilation} \caption{The proper mass $m_W$ for the ``freeze in'' production (annihilation channel) that derives an observation-consistent relic abundance is approximately linear with the reheating temperature $T_r$, where the $m_W<10^{14}~\mathrm{GeV}$ range is over-produced due to non-perturbative production. Under the instantaneous reheating limit, the WGB can possess an enormous mass of up to $4\times10^{16}~\mathrm{GeV}$.} \label{annihilation} \end{figure} Now we can summarize the main results we have demonstrated in the preceding discussions. First, if the reheating temperature is too small, $T_r<10^3~\mathrm{GeV}$, the WGB can only serve as part of dark matter with insufficient abundance. Because the non-perturbative production is inefficient for all mass range, and the perturbative contribution is also not productive or forbidden by the observations. Then, for $10^3~\mathrm{GeV}<T_r\lesssim4\times10^9~\mathrm{GeV}$, only the non-perturbative production can reasonably provide enough abundance for WGB as dark matter, and only the large mass is allowed, $m_W\sim10^{13}\mathrm{-}10^{14}~\mathrm{GeV}$. Moreover, for $4\times10^9~\mathrm{GeV}\lesssim T_r<10^{13}~\mathrm{GeV}$, there are two feasible values of mass for WGB, the small mass $m_W\sim3\times10^{-13}~\mathrm{GeV}$ and the large mass $m_W\sim10^{14}~\mathrm{GeV}$. The production channel is also mainly the non-perturbative pattern. Finally, for $10^{13}~\mathrm{GeV}<T_r<T_{\mathrm{max}}$, the small mass case is similar to the foregoing one, which is restricted to $m_W\sim3\times10^{-13}~\mathrm{GeV}$, and produced mainly in the non-perturbative channel. But the permissible large mass case is different from the above, because the perturbative annihilation becomes dominant under extremely high $T_r$, which enables WGB with mass from $10^{14}~\mathrm{GeV}$ to $4\times10^{16}~\mathrm{GeV}$ to be a dark matter candidate. \section{Conclusions} We work on a scaling invariant theory of gravity with a quadratic scalar curvature, namely the Weyl $R^2$ gravity. The model contains a viable inflationary scenario that is different with the conventional Starobinsky $R^2$ model. We calculate the spectral index and tensor-to-scalar ratio, and confront them with the latest cosmological observations. Our results indicate that this model's predictions agree with the observations and its differences from Starobinsky model can be tested with future CMB experiment. The model also contains a stable gauge boson, Weyl gauge boson (WGB), which can serve as a dark matter candidate. The breaking of local scaling symmetry makes WGB massive in the inflationary period, which causes an inevitable non-perturbative production for WGB, namely emerging from the inflationary quantum fluctuations. Our investigations demonstrate that the relic abundance of non-perturbative produced WGB is related to the mass of WGB $m_W$ and the decay rate $\Gamma$ of inflaton. By comparing with the observation, we give the possible viable mass range of WGB, $m_W\sim 3\times10^{-13}~\mathrm{GeV}$ or $m_W>H_{\mathrm{inf}}$. Moreover, we also give the lower limit of decay width of the inflaton $\Gamma$ in this model, which corresponds to the reheating temperature $T_r>10^3~\mathrm{GeV}$. We also demonstrate that there is a specific coupling between WGB and inflaton $\Phi$, which can lead to inflaton's decay into WGB if $m_W<m_\Phi/2$. This provides a stringent constraint on the allowable reheating temperature in the case of small $m_W$. Finally, for the case of extremely high reheating temperature $T_r$, the perturbative freeze-in channel becomes important and the dominant contribution, namely the annihilation of particles in the thermal bath into WGB through direct coupling or gravitational interaction. It opens new mass range of WGB up to $4\times10^{16}~\mathrm{GeV}$ as dark matter candidate. \begin{acknowledgments} YT is supported by National Key Research and Development Program of China (Grant No.2021YFC2201901), Natural Science Foundation of China (NSFC) under Grants No.~11851302, the Fundamental Research Funds for the Central Universities and Key Research Program of the Chinese Academy of Sciences, Grant No. XDPB15. YLW is supported in part by the National Key Research and Development Program of China under Grant No.2020YFC2201501, and NSFC under Grants No.~11851302, No.~11851303, No.~11690022, No.~11747601, and the Strategic Priority Research Program of the Chinese Academy of Sciences under Grant No. XDB23030100. \end{acknowledgments}
636927dd12200f4566a80bc530260fa963f3ecba
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Dirichlet forms associated with one-dimensional diffusions} Let $I:=\left\langle l,r\right\rangle$ be an interval where $l$ or $r$ may or may not be in $I$ and $m$ be a positive Radon measure on $I$ with full topological support. The notation $m(l+)<\infty$ (resp. $m(r-)<\infty$) means that for some $\varepsilon>0$, $m\left((l,l+\varepsilon)\right)<\infty$ (resp. $m\left((r-\varepsilon, r)\right)<\infty$). Otherwise write $m(l+)=\infty$ (resp. $m(r-)=\infty$). When $l=-\infty$ (resp. $r=\infty$), $l+\varepsilon$ (resp. $r-\varepsilon$) in this meaning is replaced by some constant in $(l,r)$. Clearly, if $l\in I$ (resp. $r\in I$), then $m(l+)<\infty$ (resp. $m(r-)<\infty$). Fix a point $e\in \mathring I:=(l,r)$ and without loss of generality assume that $m(\{e\})=0$. Denote by \[ \mathbf{S}(\mathring I):=\{\mathbf{s}:\mathring I\rightarrow {\mathbb R}: \mathbf{s}\text{ is continuous and strictly increasing}, \; \mathbf{s}(e)=0\} \] the family of all scale functions on $\mathring I$. Define \[ \mathbf{s}(l):=\lim_{x\downarrow l}\mathbf{s}(x)\geq -\infty,\quad \mathbf{s}(r):=\lim_{x\uparrow r}\mathbf{s}(x)\leq \infty. \] Set $\bar{I}:=[l, r]$ to be the interval containing the boundary points even if $l$ or $r$ is infinite. If a function $f$ is undefined in $l$ or $r$, we understand $f(l)$ or $f(r)$ the limit $\lim_{x\rightarrow l\text{ or }r}f(x)$. Take $\mathbf{s}\in \mathbf{S}(\mathring{I})$ and set for $x\in \bar{I}$, \[ \sigma(x):=\int_e^x\int_e^\xi m(d\eta)d\mathbf{s}(\xi),\quad \mu(x):=\int_e^x \int_e^\xi d\mathbf{s}(\eta)m(d\xi). \] Here (and hereafter) $\int_e^\xi m(d\eta)$ means $\int_{(e,\xi]} m(d\eta)$ for $\xi>e$ and $-\int_{(\xi, e]}m(d\eta)$ for $\xi<e$, and analogical meaning holds for $\int_e^x m(d\xi)$. The following classification of the boundary point is well known; see, e.g., \cite[\S5.12]{I06}. \begin{definition} Given $\mathbf{s}\in \mathbf{S}(\mathring I)$, $l$ (resp. $r$) is called (with respect to $(\mathbf{s},m)$) \begin{itemize} \item[(1)] \emph{regular}, if $\sigma(l),\mu(l)<\infty$ (resp. $\sigma(r), \mu(r)<\infty)$); \item[(2)] \emph{exit}, if $\sigma(l)<\infty, \mu(l)=\infty$ (resp. $\sigma(r)<\infty, \mu(r)=\infty$); \item[(3)] \emph{entrance}, if $\sigma(l)=\infty, \mu(l)<\infty$ (resp. $\sigma(r)=\infty, \mu(r)<\infty$); \item[(4)] \emph{natural}, if $\sigma(l)=\mu(l)=\infty$ (resp. $\sigma(r)=\mu(r)=\infty$). \end{itemize} In addition, $l$ (resp. $r$) is called \emph{absorbing}, if $l$ (resp. $r$) is regular and $l\notin I$ (resp. $r\notin I$). It is called \emph{reflecting}, if it is regular and contained in $I$. \end{definition} \begin{remark} Note that $r$ is regular, if and only if $\mathbf{s}(r)<\infty$ and $m(r-)<\infty$. If $r$ is exit, then $\mathbf{s}(r)<\infty$ and $m(r-)=\infty$. If $r$ is entrance, then $\mathbf{s}(r)=\infty$ and $m(r-)<\infty$. If $r$ is natural, then at least one of $m(r-)$ and $\mathbf{s}(r)$ must be $\infty$. \end{remark} The endpoint $l$ or $r$ is called \emph{approachable} if $\mathbf{s}(l)>-\infty$ or $\mathbf{s}(r)<\infty$. Given a function $f$ on $I$, $f\ll d\mathbf{s}$ means that $f$ is absolutely continuous with respect to $d\mathbf{s}$, i.e. there exists an absolutely continuous function $g$ on $\mathbf{s}(I)=\{\mathbf{s}(x): x\in I\}$ such that $f=g\circ \mathbf{s}$. Meanwhile $df/d\mathbf{s}:=g'\circ \mathbf{s}$. Note that if $l$ or $r$ is approachable, then any function $f$ with $f\ll d\mathbf{s}$ and $df/d\mathbf{s}\in L^2(I,d\mathbf{s})$ admits the finite limit $f(l):=\lim_{x\downarrow l}f(x)$ or $f(r):=\lim_{x\uparrow r} f(x)$. Particularly $f\in C((l,r])$ or $f\in C([l,r))$; see \cite[\S2.2.3]{CF12}. What we are concerned with is a regular and irreducible Dirichlet form $({\mathscr E},{\mathscr F})$ on $L^2(I,m)$. To state its representation in the following lemma, denote by $\tilde{\mathbf{S}}(\mathring I)$ the family of all scale functions $\mathbf{s}\in \mathbf{S}(\mathring I)$ satisfying the condition: For $j=l$ or $r$, if $j\in I$ and $m(\{j\})>0$, then $|\mathbf{s}(j)|<\infty$. \begin{lemma} Let $I,m$ be given as above. Then $({\mathscr E},{\mathscr F})$ is a regular, irreducible and strongly local Dirichlet form on $L^2(I,m)$, if and only if there exists a unique scale function $\mathbf{s}\in \tilde\mathbf{S}(\mathring{I})$ such that \begin{equation}\label{eq:12} \begin{aligned} &{\mathscr F}=\{f\in L^2(I,m): f\ll d\mathbf{s}, df/d\mathbf{s}\in L^2(I,d\mathbf{s}), \\ &\qquad\qquad \qquad \qquad f(j)=0\text{ if }j \text{ is absorbing for }j=l\text{ or }r\},\\ &{\mathscr E}(f,g)=\frac{1}{2}\int_I \frac{df}{d\mathbf{s}}\frac{dg}{d\mathbf{s}}d\mathbf{s},\quad f,g\in {\mathscr F}. \end{aligned} \end{equation} \end{lemma} \begin{proof} \emph{Necessity}. Let $({\mathscr E},{\mathscr F})$ be such a Dirichlet form. Applying \cite[Theorem~2.1]{LY19} and the irreducibility, we can obtain a unique interval $J\subset I$, called effective interval, and a unique adapted scale function on $J$ in the sense of \cite[(2.2)]{LY19} representing $({\mathscr E},{\mathscr F})$. Note that $J$ must be ended by $l$ and $r$, because otherwise $I\setminus J$ would become a non-trivial $m$-invariant set (with respect to $({\mathscr E},{\mathscr F})$) as violates the irreducibility. Denote by the adapted scale function on $J$ by $\mathbf{s}$. Then $\mathbf{s}\in \mathbf{S}(\mathring I)$. To show $\mathbf{s}\in \tilde{\mathbf{S}}(\mathring I)$, argue by contradiction and suppose that $r\in I$, $m(\{r\})>0$ and $\mathbf{s}(r)=\infty$. The adaptedness of $\mathbf{s}$ indicates that $r\notin J$. Hence $\{r\}$ is a non-trivial $m$-invariant set, as leads to a contradiction. Therefore $\mathbf{s}\in \tilde{\mathbf{S}}(\mathring{I})$ and the expression of $({\mathscr E},{\mathscr F})$ can be obtained by \cite[Theorem~2.1]{LY19}. \emph{Sufficiency}. Let $J:=\left\langle l, r\right \rangle$, where $j\in J$ if and only if $j$ is reflecting with respect to $(\mathbf{s}, m)$ for $j=l$ or $r$. Then $J\subset I$ and $\mathbf{s}$ is adapted to $J$. By \cite[Theorem~2.1]{LY19}, \eqref{eq:12} gives a regular and strongly local Dirichlet form on $L^2(I,m)$ with the effective interval $J$ and adapted scale function $\mathbf{s}$. The condition $\mathbf{s}\in \tilde{\mathbf{S}}(\mathring {I})$ implies that $m(I\setminus J)=0$ and hence $({\mathscr E},{\mathscr F})$ is irreducible. That completes the proof. \end{proof} \begin{remark} The associated Markov process $X=(X_t)_{t\geq 0}$ of $({\mathscr E},{\mathscr F})$ is a diffusion process on $I$ with no killing inside whose scale function is $\mathbf{s}$ and speed measure is $m$; see, e.g., \cite[V\S7]{RW87}. \end{remark} From now on we denote by $I_e$ the effective interval of $({\mathscr E},{\mathscr F})$ as described in \cite[\S2.3]{LY19}. More precisely, $\mathring I\subset I_e\subset I$, and $j\in I_e$ if and only if $j$ is reflecting for $j=l$ or $r$. In addition, $j\in I\setminus I_e$ implies that $|\mathbf{s}(j)|=\infty$ and $m(\{j\})=0$. Any singleton contained in $I_e$ is of positive capacity and $I\setminus I_e$ is ${\mathscr E}$-polar. Particularly, ${\mathscr F}\subset C(I_e)$. The family \begin{equation}\label{eq:11} \mathscr C_{I_e}:=\{\varphi\circ \mathbf{s}: \varphi\in C_c^\infty(\mathbf{s}(I_e))\} \end{equation} is a special standard core of $({\mathscr E},{\mathscr F})$. \subsection*{Notations} Given an interval $J$, $C(J)$, $pC(J)$ and $C_c^\infty(J)$ stand for the families of all continuous functions, all non-negative continuous functions and all smooth functions with compact support on $J$ respectively. \section{Solutions of harmonic equation} Given a constant $\alpha> 0$, consider the following equation \begin{equation}\label{eq:21} \frac{1}{2}\frac{d}{dm}\frac{du}{d\mathbf{s}}(x)=\alpha u(x),\quad x\in \mathring{I}. \end{equation} A solution of \eqref{eq:21} means $u\in L^1_\text{loc}(\mathring{I},m)$ such that $u\ll d\mathbf{s}$ and a $d\mathbf{s}$-a.e. version $v$ of $du/d\mathbf{s}$ satisfies \begin{equation}\label{eq:22} 2\alpha\int_{(x,y]} u(\xi)m(d\xi)=v(y)-v(x),\quad \forall x,y\in \mathring{I}, x<y. \end{equation} Note that \eqref{eq:22} indicates that $v$ is right continuous and $v(r):=\lim_{x\uparrow r}v(x)$ (resp. $v(l):=\lim_{x\downarrow l}v(x)$) is well defined if $u|_{[e,r)}\in L^1([e,r),m)$ (resp. $u|_{(l,e]}\in L^1((l,e],m)$). This section is devoted to presenting two particular solutions of \eqref{eq:21} as obtained in \cite[Chapter II]{M68}; see also \cite[\S5.12]{I06}. Set, for $n=0,1,2,\cdots, x\in \mathring{I}$, \[ u^0(x)\equiv 1,\quad u^1(x)=\sigma(x),\quad u^{n+1}(x)=\int_e^x\int_e^y u^n(\xi)m(d\xi)d\mathbf{s}(y). \] Denote \[ u(x)=\sum_{n=0}^\infty \alpha^n u^n(x),\quad x\in \mathring I, \] and introduce the functions \[ \begin{aligned} u_+(x)&=u(x)\int_x^r u(y)^{-2}d\mathbf{s}(y),\quad x\in \mathring I\\ u_-(x)&=u(x)\int_l^x u(y)^{-2}d\mathbf{s}(y),\quad x\in \mathring I. \end{aligned} \] The following lemma due to \cite{M68} is crucial to our treatment. \begin{lemma}\label{LM21} \begin{itemize} \item[(1)] $1+\sigma(x)\alpha\leq u(x)\leq \exp\{\alpha \sigma(x)\}$. For $x>e$ (resp. $x<e$), \[ \begin{aligned} \int_x^r u(y)^{-2}d\mathbf{s}(y)&\leq \frac{1}{\alpha (1+\alpha \sigma(x))m((e,x])},\quad \\ & \left(\text{resp. } \int_l^x u(y)^{-2}d\mathbf{s}(y)\leq \frac{1}{\alpha (1+\alpha \sigma(x))m((x,e])} \right). \end{aligned}\] \item[(2)] $u, u_\pm \in pC(\mathring I)$ are solutions of \eqref{eq:21}. \item[(3)] $u_+$ is decreasing. If $r$ is not entrance, then $u_+(r)=0$. $du_+/d\mathbf{s}$ is increasing and if $r$ is entrance or natural, then $du_+/d\mathbf{s}(r)=0$. \item[(4)] $u_-$ is increasing in $x$. If $l$ is not entrance, then $u_-(l)=0$. $du_-/d\mathbf{s}$ is increasing in $x$ and if $l$ is entrance or natural, then $du_-/d\mathbf{s}(l)=0$. \end{itemize} \end{lemma} \begin{proof} See \cite[II, \S2]{M68}. \end{proof} \section{Analytic treatment of harmonic functions} Let $({\mathscr E}^0,{\mathscr F}^0)$ be the part Dirichlet form of $({\mathscr E},{\mathscr F})$ on $\mathring{I}$, i.e. \[ \begin{aligned} &{\mathscr F}^0:=\{f\in {\mathscr F}: f=0\text{ q.e. on }I\setminus \mathring{I}\}, \\ &{\mathscr E}^0(f,g):={\mathscr E}(f,g),\quad f,g\in {\mathscr F}^0. \end{aligned}\] It is a regular Dirichlet form on $L^2(\mathring I, m)$ having a special standard core \[ \mathscr C_{\mathring I}:=\{\varphi\circ \mathbf{s}: \varphi\in C_c^\infty(\mathbf{s}(\mathring I))\}. \] For any $\alpha>0$, ${\mathscr F}^0$ is a closed subspace of ${\mathscr F}$ under the norm $\|\cdot\|_{{\mathscr E}_\alpha}$ and the following direct product decomposition holds true: \[ {\mathscr F}={\mathscr F}^0\oplus_{{\mathscr E}_\alpha} \mathcal{H}_\alpha, \] where $\mathcal{H}_\alpha:=\{f\in {\mathscr F}: {\mathscr E}_\alpha(f,g)=0, \forall g\in {\mathscr F}^0\}$. The function in $\mathcal{H}_\alpha$ is called $\alpha$-harmonic. We note that ${\mathscr F}^0={\mathscr F}$ if and only if $I\setminus \mathring{I}$ is ${\mathscr E}$-polar, i.e. neither $l$ nor $r$ is reflecting, or equivalently, $I_e=\mathring{I}$. In this case $\mathcal{H}_\alpha=\{0\}$ for all $\alpha>0$. When $r$ is reflecting (resp. $l$ is reflecting), Lemma~\ref{LM21}~(1) yields that $u_-(r)\in (0,\infty)$ (resp. $u_+(l)\in (0,\infty)$). Meanwhile set \begin{equation}\label{eq:31} u^\alpha_r(x):=\frac{u_-(x)}{u_-(r)},\quad x\in (l,r]; \quad \left(\text{resp. }u^\alpha_l(x):=\frac{u_+(x)}{u_+(l)},\quad x\in [l,r)\right) \end{equation} It is worth pointing out that $u_+$ and $u_-$ are linear independent; see \cite[II, \S3\#5]{M68}. The result below characterizes the $\alpha$-harmonic functions. \begin{theorem}\label{THM31} For $\alpha>0$, the following holds: \[ \mathcal{H}_\alpha=\left\lbrace \begin{aligned} &\{0\},\qquad\qquad\quad \text{when } I_e=(l,r);\\ &\text{span}\{u^\alpha_r\},\qquad\;\, \text{when } I_e=(l,r]; \\ &\text{span}\{u^\alpha_l\},\qquad\;\, \text{when }I_e=[l,r);\\ &\text{span}\{u^\alpha_l, u^\alpha_r\},\quad \text{when }I_e=[l,r]. \end{aligned} \right. \] \end{theorem} \begin{proof} Only the case $I_e=(l,r]$ will be treated, and the other cases can be proved by a similar way. We first show that $u^\alpha_r\in {\mathscr F}$. To do this, take $\varepsilon>0$. On account of Lemma~\ref{LM21}~(2), $u^\alpha_r$ is a solution of \eqref{eq:21}. Denote the $d\mathbf{s}$-a.e. version of $du^\alpha_r/d\mathbf{s}$ satisfying \eqref{eq:22} still by $du^\alpha_r/d\mathbf{s}$. Both $u^\alpha_r$ and $du^\alpha_r/d\mathbf{s}$ are of bounded variation on $(l+\varepsilon,r-\varepsilon)$, and $u^\alpha_r$ is continuous. Then it follows from \eqref{eq:22} that \[ \begin{aligned} \int_{l+\varepsilon}^{r-\varepsilon} \left(\frac{du^\alpha_r}{d\mathbf{s}}\right)^2d\mathbf{s}&=\int_{l+\varepsilon}^{r-\varepsilon} \frac{du^\alpha_r}{d\mathbf{s}}du^\alpha_r \\ &=\frac{du^\alpha_r}{d\mathbf{s}}\cdot u^\alpha_r \bigg |_{l+\varepsilon}^{r-\varepsilon}-2\alpha \int_{(l+\varepsilon, r-\varepsilon]}u^\alpha_r(\xi)^2m(d\xi) \end{aligned}\] Hence \begin{equation}\label{eq:23} \int_{l+\varepsilon}^{r-\varepsilon} \left(\frac{du^\alpha_r}{d\mathbf{s}}\right)^2d\mathbf{s}+2\alpha \int_{(l+\varepsilon, r-\varepsilon]}u^\alpha_r(\xi)^2m(d\xi)=\frac{du^\alpha_r}{d\mathbf{s}}\cdot u^\alpha_r \bigg |_{l+\varepsilon}^{r-\varepsilon}. \end{equation} Since $u^\alpha_r$ is positive and increasing and $u^\alpha_r(r)=1$, it follows that $u^\alpha_r(l):=\lim_{x\downarrow l}u^\alpha_r(x)$ is finite. Note that $du^\alpha_r/d\mathbf{s}\geq 0$ since $u^\alpha_r$ is increasing. In addition, \eqref{eq:22} yields that $d u^\alpha_r/d\mathbf{s}$ is increasing and $du^\alpha_r/d\mathbf{s}(r):=\lim_{y\uparrow r}du^\alpha_r/d\mathbf{s}(y)$ is finite. Letting $\varepsilon\downarrow 0$ in \eqref{eq:23} and noticing that $u^\alpha_r(l)=0$ if $l$ is absorbing in view of Lemma~\ref{LM21}~(4), we get that $u^\alpha_r\in {\mathscr F}$. Next we assert that $u^\alpha_r\in \mathcal{H}_\alpha$. Let $f\in \mathscr C_{\mathring I}=\{\varphi \circ \mathbf{s}: \varphi\in C_c^\infty(\mathbf{s}(\mathring I))\}$. Mimicking the derivation of \eqref{eq:23}, one can obtain that \[ \int_{l+\varepsilon}^{r-\varepsilon} \frac{du^\alpha_r}{d\mathbf{s}}\frac{df}{d\mathbf{s}}d\mathbf{s}+2\alpha \int_{(l+\varepsilon, r-\varepsilon]}u^\alpha_r(\xi)f(\xi)m(d\xi)=\frac{du^\alpha_r}{d\mathbf{s}}\cdot f \bigg |_{l+\varepsilon}^{r-\varepsilon}. \] Note that $\lim_{\varepsilon\downarrow 0} f(r-\varepsilon)=\lim_{\varepsilon\downarrow 0}f(l+\varepsilon)=0$. Hence ${\mathscr E}_\alpha(u^\alpha_r,f)=0$. Since $\mathscr C_{\mathring I}$ is a special standard core of $({\mathscr E}^0,{\mathscr F}^0)$, we get $u^\alpha_r\in \mathcal{H}_\alpha$. Thirdly we prove that $\mathcal{H}_\alpha\subset \text{span}\{u_+,u_-\}$. Let $h\in \mathcal{H}_\alpha$. Take an arbitrary interval $J:=(a,b)\subset [a,b]\subset I_e$ with $e\in J$. For any $f\in {\mathscr F}$ with $\text{supp}[f]\subset J$, it holds ${\mathscr E}_\alpha(h,f)=0$. Set \[ F_h(x):=\int_e^x h(\xi)m(d\xi). \] Then $F_h$ is of bounded variation on $[a,b]$ and $f\in C([a,b])$ is also of bounded variation. Hence \[ \int_I f(x)h(x)m(dx)=\int_{[a,b]} f(x)dF_h(x)=-\int_{[a,b]}F_h(x)df(x). \] It follows from ${\mathscr E}_\alpha(h, f)=0$ that \[ \int_{[a,b]}\left(\frac{dh}{d\mathbf{s}}(x)-2\alpha F_h(x)\right)df(x)=0. \] Note that $\mathscr{C}_{J}:=\{\varphi\circ \mathbf{s}: \varphi\in C_c^\infty(\mathbf{s}(J))\}\subset {\mathscr F}$ and $\text{supp}[f]\subset J$ for any $f\in \mathscr{C}_J$. This yields that $dh/d\mathbf{s}-2\alpha F_h$ is constant on $J$. Particularly, $h|_{[a,b]}\in C([a,b])$ is a solution of the equation \eqref{eq:21} restricted to $J$. In view of \cite[II, \S4]{M68}, one can conclude that $h\in \text{span}\{u_+,u_-\}$. Finally it suffices to prove $u_+\notin {\mathscr F}$. In fact, it is straightforward to verify that $du_+/d\mathbf{s}(r)\cdot u_+(r)$ is finite. Since $u_+\geq 0$ satisfies \eqref{eq:22} and $du/d\mathbf{s}(e)=0$, it follows that $du_+/d\mathbf{s}$ is increasing and \[ \frac{du_+}{d\mathbf{s}}(l)\leq \frac{du_+}{d\mathbf{s}}(e)=-\frac{1}{u(e)}=-1. \] If $\sigma(l)=\infty$, then Lemma~\ref{LM21}~(1) yields that $u_+(l)=\infty$. An analogical derivation of \eqref{eq:23} leads to $u_+\notin {\mathscr F}$. If $\sigma(l)<\infty$, then Lemma~\ref{LM21}~(1) implies that \[ u_+(l)\geq \int_l^r u(y)^{-2}d\mathbf{s}(y)>0. \] Meanwhile $m(l+)=\infty$ leads to $u_+\notin L^2(I,m)$ and $m(l+)<\infty$ corresponds to an absorbing endpoint $l$. In the latter case $u_+\notin {\mathscr F}$ because $u_+(l)\neq 0$. That completes the proof. \end{proof} \begin{remark} The third and final steps in this proof would be simplified if we apply the probabilistic representation of harmonic functions \eqref{eq:41}. In the case $I_e=(l,r]$, \eqref{eq:41} shows that $\mathcal{H}_\alpha$ is of dimension $1$. Then $\mathcal{H}_\alpha=\text{span}\{u^\alpha_r\}$ can be concluded after $u_r^\alpha\in \mathcal{H}_\alpha$ is obtained. \end{remark} Let us turn to consider the special case $\alpha=0$. Denote by ${\mathscr F}_{\mathrm{e}}$ the extended Dirichlet space of $({\mathscr E},{\mathscr F})$, and \[ {\mathscr F}^0_{\mathrm{e}}:=\{f\in {\mathscr F}_{\mathrm{e}}: f=0,\text{ q.e. on }I\setminus \mathring{I}\}. \] Define $\mathcal{H}:=\{u\in {\mathscr F}: {\mathscr E}(u, f)=0,\forall f\in {\mathscr F}^0_{\mathrm{e}}\}$. Every function in $\mathcal{H}$ is called harmonic. Before moving on, we prepare a lemma to give the expression of ${\mathscr F}_{\mathrm{e}}$. \begin{lemma}\label{LM33} It holds that \[ \begin{aligned} {\mathscr F}_{\mathrm{e}}=\{f<\infty, m\text{-a.e.}: &f\ll d\mathbf{s}, df/d\mathbf{s}\in L^2(I,d\mathbf{s}), \\ & f(j)=0 \text{ if }|\mathbf{s}(j)|<\infty\text{ but }j\notin I \text{ for }j=l\text{ or }r\}. \end{aligned}\] \end{lemma} \begin{proof} See \cite[Theorem~2.2]{F14}. \end{proof} When $|\mathbf{s}(l)|+|\mathbf{s}(r)|<\infty$, set \[ u^0_l(x):=\frac{\mathbf{s}(r)-\mathbf{s}(x)}{\mathbf{s}(r)-\mathbf{s}(l)},\quad u^0_r(x):=\frac{\mathbf{s}(x)-\mathbf{s}(l)}{\mathbf{s}(r)-\mathbf{s}(l)},\quad x\in \mathring I. \] The main result characterizing harmonic functions is as follows. \begin{theorem}\label{THM34} The following hold: \begin{itemize} \item[(1)] When $I_e=(l,r)$, $\mathcal{H}=\{0\}$ if $\mathbf{s}(l)>-\infty$ or $\mathbf{s}(r)<\infty$; otherwise $\mathcal{H}=\text{span}\{1\}$. \item[(2)] When $I_e=[l,r)$, $\mathcal{H}=\text{span}\{u^0_l\}$ if $\mathbf{s}(r)<\infty$; otherwise $\mathcal{H}=\text{span}\{1\}$. \item[(3)] When $I_e=(l,r]$, $\mathcal{H}=\text{span}\{u^0_r\}$ if $\mathbf{s}(l)>-\infty$; otherwise $\mathcal{H}=\text{span}\{1\}$. \item[(4)] When $I_e=[l,r]$, $\mathcal{H}=\text{span}\{u^0_l,u^0_r\}$. \end{itemize} \end{theorem} \begin{proof} \begin{itemize} \item[(1)] In this case ${\mathscr F}_{\mathrm{e}}^0={\mathscr F}_{\mathrm{e}}$. Note that $({\mathscr E},{\mathscr F})$ is transient, if and only if $\mathbf{s}(l)>-\infty$ or $\mathbf{s}(r)<\infty$; see, e.g., \cite[Theorem~2.2.11 and Example~3.5.7]{CF12}. Under the transience, ${\mathscr E}(f,f)=0$ for $f\in{\mathscr F}_{\mathrm{e}}$ implies $f=0$. Hence $\mathcal{H}=\{0\}$. When $({\mathscr E},{\mathscr F})$ is recurrent, it follows from \cite[Theorem~5.2.16]{CF12} that $f$ is constant for any $f\in {\mathscr F}_{\mathrm{e}}$ with ${\mathscr E}(f,f)=0$. To the contrary, the recurrence of $({\mathscr E},{\mathscr F})$ implies that $1\in {\mathscr F}_{\mathrm{e}}$ and ${\mathscr E}(1,f)=0$ for any $f\in {\mathscr F}_{\mathrm{e}}$. These yield $\mathcal{H}=\text{span}\{1\}$. \item[(2)] It is straightforward to verify that $u^0_l\in {\mathscr F}_{\mathrm{e}}, {\mathscr E}(u^0_l, f)=0$ for any $f\in {\mathscr F}_{\mathrm{e}}^0$ if $\mathbf{s}(r)<\infty$, and $1\in {\mathscr F}_{\mathrm{e}}, {\mathscr E}(1,f)=0$ for any $f\in {\mathscr F}_{\mathrm{e}}^0$ if $\mathbf{s}(r)=\infty$. Hence $\text{span}\{u^0_l\}\subset \mathcal{H}$ if $\mathbf{s}(r)<\infty$ and $\text{span}\{1\}\subset \mathcal{H}$ if $\mathbf{s}(r)=\infty$. To the contrary, take $h\in \mathcal{H}$. For any $f\in {\mathscr F}_{\mathrm{e}}^0$, ${\mathscr E}(h,f)=0$ implies that \begin{equation}\label{eq:33} \int_l^r \frac{dh}{d\mathbf{s}}df=0. \end{equation} Since $\mathscr C_{\mathring I}=\{\varphi\circ \mathbf{s}: \varphi\in C_c^\infty(\mathbf{s}(\mathring{I}))\}\subset {\mathscr F}^0_{\mathrm{e}}$, it follows from \eqref{eq:33} that $dh/d\mathbf{s}$ is constant, i.e. $h=c_1\cdot \mathbf{s}+c_2$ for two constants $c_1$ and $c_2$. Consequently Lemma~\ref{LM33} yields that $h=c\cdot u^0_l$ for some constant $c$ if $\mathbf{s}(r)<\infty$ and $h$ is constant if $\mathbf{s}(r)=\infty$. \item[(3)] This case can be treated by an analogical way to (2). \item[(4)] It is easy to verify that $u^0_l, u^0_r\in {\mathscr F}_{\mathrm{e}}$ and ${\mathscr E}(u^0_l,f)={\mathscr E}(u^0_r,f)=0$ for any $f\in {\mathscr F}^0_{\mathrm{e}}$. Thus $\text{span}\{u^0_l,u^0_r\}\subset \mathcal{H}$. To the contrary, take $h\in \mathcal{H}$ and \eqref{eq:33} indicates that $h=c_1\mathbf{s}+c_2$ for some constants $c_1,c_2$. Then there exist another two constants $\tilde{c}_1$ and $\tilde{c}_2$ such that $h=\tilde{c}_1u^0_l+\tilde{c}_2u^0_r$. Therefore $\mathcal{H}\subset \text{span}\{u^0_l,u^0_r\}$. \end{itemize} That completes the proof. \end{proof} \section{Probabilistic counterparts of harmonic functions} Recall that $X$ is the diffusion process associated with $({\mathscr E},{\mathscr F})$. Denote by $\zeta$ the lifetime of $X$ and set \[ \tau:=\inf\{t>0:X_t\notin (l,r)\}. \] Then $X_\tau\in \{l,r\}$ for $\tau<\zeta$. For convenience, write $\mathcal{H}_0:=\mathcal{H}$ and set $u_l^0:=1$ (resp. $u_r^0:=1$) if $I_e=[l,r)$ and $\mathbf{s}(r)=\infty$ (resp. $I_e=(l,r]$ and $\mathbf{s}(l)=-\infty$). The harmonic functions appearing in the previous section admit the following probabilistic representation. \begin{theorem} Assume that $I_e\neq \mathring{I}$. Then for any $\alpha\geq 0$ and $x\in I_e$, \[ \begin{aligned} u^\alpha_l(x)&=\mathbf{E}_x\left[{\mathrm{e}}^{-\alpha \tau}; X_\tau=l, \tau<\zeta \right],\quad \text{if }l\in I_e;\\ u^\alpha_r(x)&=\mathbf{E}_x\left[{\mathrm{e}}^{-\alpha \tau}; X_\tau=r, \tau<\zeta \right],\quad \text{if }r\in I_e. \end{aligned}\] \end{theorem} \begin{proof} Set $\varphi^\alpha_j(\cdot):=\mathbf{E}_\cdot \left[{\mathrm{e}}^{-\alpha \tau}; X_\tau=j, \tau<\zeta \right]$ for $j=l$ or $r$. Suppose first that $\alpha>0$, or that $\alpha=0$ and $({\mathscr E},{\mathscr F})$ is transient. Then \begin{equation}\label{eq:41} \mathcal{H}_\alpha=\left\{\mathbf{E}_\cdot \left[{\mathrm{e}}^{-\alpha \tau}f(X_\tau);\tau<\zeta \right]: f\in {\mathscr F}\text{ for }\alpha>0\text{ and }f\in {\mathscr F}_{\mathrm{e}}\text{ for }\alpha=0 \right\}; \end{equation} see \cite[Theorems~3.2.2 and 3.4.2]{CF12}. When $I_e=[l,r)$, $X_\tau=l$ for $\tau<\zeta$. Hence \[ \mathcal{H}_\alpha=\text{span}\{\varphi^\alpha_l\}. \] It follows from Theorems~\ref{THM31} and \ref{THM34} that $\varphi^\alpha_l=cu^\alpha_l$ for some constant $c$. Note that $\varphi^\alpha_l(l)=1$ because $\mathbf{P}_l(\tau=0)=1$, and $u^\alpha_l(l)=1$. Therefore $c=1$. Another case $I_e=(l,r]$ can be treated analogically and we can obtain that $u^\alpha_r=\varphi^\alpha_r$. When $I_e=[l,r]$, $\zeta=\infty$ and $X_\tau\in \{l,r\}$. Then $\mathcal{H}_\alpha=\text{span}\{\varphi^\alpha_l, \varphi^\alpha_r\}$. Meanwhile $\varphi^\alpha_l(l)=\varphi^\alpha_r(r)=1$ and $\varphi^\alpha_l(r)=\varphi^\alpha_r(l)=0$. Therefore Theorem~\ref{THM31} yields $u^\alpha_l=\varphi^\alpha_l$ and $u^\alpha_r=\varphi^\alpha_r$. Finally consider $\alpha=0$ and $({\mathscr E},{\mathscr F})$ is recurrent. Particularly $\zeta=\infty$. When $I_e=[l,r)$ or $I_e=(l,r]$, it follows from \cite[Theorem~3.5.6~(2)]{CF12} that $\varphi^0_j(x)=\mathbf{P}_x(\sigma_j<\infty)=1$ for $j=l$ or $r$ and $x\in I_e$, where $\sigma_j:=\inf\{t>0:X_t=j\}$. Hence $\varphi^0_j=u^0_j$. When $I_e=[l,r]$, \cite[Theorem~3.4.8]{CF12} implies that $\varphi^0_l,\varphi^0_r\in \mathcal{H}$. Since $\varphi^\alpha_l(l)=\varphi^\alpha_r(r)=1$ and $\varphi^\alpha_l(r)=\varphi^\alpha_r(l)=0$, applying Theorem~\ref{THM34}, we can conclude that $u^0_l=\varphi^0_l, u^0_r=\varphi^0_r$. That completes the proof. \end{proof} The special case $\alpha=0$ leads to the characterization of the first hitting times of the endpoints $l$ and $r$. \begin{corollary} Let $\sigma_j:=\inf\{t>0:X_t=j\}$ for $j=l$ or $r$. Then the following hold: \begin{itemize} \item[(1)] When $I_e=[l,r)$, $\mathbf{P}_x(\sigma_l<\infty)=1$ for any $x\in I_e$ if $\mathbf{s}(r)=\infty$. If $\mathbf{s}(r)<\infty$, then \[ \mathbf{P}_x(\sigma_l<\zeta)=\frac{\mathbf{s}(r)-\mathbf{s}(x)}{\mathbf{s}(r)-\mathbf{s}(l)},\quad x\in I_e. \] \item[(2)] When $I_e=(l,r]$, $\mathbf{P}_x(\sigma_r<\infty)=1$ for any $x\in I_e$ if $\mathbf{s}(l)=-\infty$. If $\mathbf{s}(l)>-\infty$, then \[ \mathbf{P}_x(\sigma_r<\zeta)=\frac{\mathbf{s}(x)-\mathbf{s}(l)}{\mathbf{s}(r)-\mathbf{s}(l)},\quad x\in I_e. \] \item[(3)] When $I_e=[l,r]$, \[ \mathbf{P}_x(\sigma_l<\sigma_r)=\frac{\mathbf{s}(r)-\mathbf{s}(x)}{\mathbf{s}(r)-\mathbf{s}(l)},\quad x\in I_e. \] \end{itemize} \end{corollary} \section{Harmonic functions in generator domain} Denote by $\mathscr{L}$ with domain $\mathcal{D}(\mathscr{L})$ the $L^2$-generator of $({\mathscr E},{\mathscr F})$. In this section we answer the question that whether an $\alpha$-harmonic function belongs to $\mathcal{D}(\mathscr{L})$ for $\alpha>0$. Given a function $f\in {\mathscr F}$, $\frac{d}{dm}(df/d\mathbf{s})\in L^2(\mathring I,m)$ means that there exist a $d\mathbf{s}$-a.e. version of $df/d\mathbf{s}$, still denoted by $df/d\mathbf{s}$, and $g\in L^2(\mathring I,m)$ such that \begin{equation}\label{eq:51} \frac{df}{d\mathbf{s}}(x)-\frac{df}{d\mathbf{s}}(y)=\int_{(x,y]}g(\xi)m(d\xi),\quad l<x<y<r. \end{equation} Meanwhile $\frac{d}{dm}(df/d\mathbf{s}):=g$. Note that if $j\in I_e$ for $j=l$ or $r$, then \eqref{eq:51} implies that $df/d\mathbf{s}(j):=\lim_{x\rightarrow j}df/d\mathbf{s}(x)$ exists and is finite. The description of $\mathscr{L}$ is given as follows. A related consideration is referred to \cite{F14}. \begin{lemma} The $L^2$-generator of $({\mathscr E},{\mathscr F})$ is \[ \begin{aligned} &\mathcal{D}(\mathscr{L})=\bigg\{f\in {\mathscr F}: \frac{d}{dm}\frac{df}{d\mathbf{s}}\in L^2(\mathring I,m), \frac{df}{d\mathbf{s}}(j)=0\text{ if }j\in I_e, \\ &\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad m(\{j\})=0\text{ for }j=l\text{ or }r \bigg\}, \\ &\mathscr{L} f=\left\lbrace \begin{aligned} &\frac{1}{2}\frac{d}{dm}\frac{df}{d\mathbf{s}}(x),\quad\quad \quad \quad\;\; x\in \mathring{I}, \\ &\frac{1}{2}\frac{df}{d\mathbf{s}}(l)/m(\{l\}),\quad\quad\quad \text{if }l\in I_e, \\ &-\frac{1}{2}\frac{df}{d\mathbf{s}}(r)/m(\{r\}),\quad\;\; \text{if }r\in I_e, \end{aligned} \right. \end{aligned} \] where we make the convention $0/0:=0$. \end{lemma} \begin{proof} Let $\mathscr C_{I_e}$ be the special standard core of $({\mathscr E},{\mathscr F})$ defined as \eqref{eq:11}. Denote by ${\mathscr G}$ the right term in the first identity. Clearly $\mathscr{L} f$ given by the second identity is well defined for any $f\in {\mathscr G}$. It is straightforward to verify that $-\int_{I_e}\mathscr{L} f g dm={\mathscr E}(f,g)$ for any $f\in {\mathscr G}$ and $g\in \mathscr C_{I_e}$. Hence we only need to show $\mathcal{D}(\mathscr{L})\subset {\mathscr G}$. To do this, take $f\in \mathcal{D}(\mathscr{L})$ with $h:=\mathscr{L} f\in L^2(I_e,m)$. With out loss of generality assume that $df/d\mathbf{s}(e)$ is well defined and finite. Then ${\mathscr E}(f,g)=-\int_{I_e} h gdm$ for any $g\in \mathscr C_{I_e}$. Define \[ F_h(x):=\int_{(e,x]}h(\xi)m(d\xi)+\frac{1}{2}\frac{df}{d\mathbf{s}}(e), \quad x>e \] and \[ F_h(x):=-\int_{(x,e]}h(\xi)m(d\xi)+\frac{1}{2}\frac{df}{d\mathbf{s}}(e), \quad x<e. \] Set $F_h(l-):=-\int_{[l,e]}h(\xi)m(d\xi)+\frac{1}{2}\frac{df}{d\mathbf{s}}(e)$ if $l\in I_e$. For $j=l$ or $r$, if $j\notin I_e$, then $g(j)=0$. Hence we have \[ -\int_{I_e}h g dm=-\int_{[l,r]}gdF_h=\int_l^r F_h(x)dg(x)+F_h(l-)g(l)-F_h(r)g(r), \] where we impose $F_h(l-)\cdot 0=F_h(r)\cdot 0=0$ even if $F_h(l-)$ or $F_h(r)$ is not defined. It follows from ${\mathscr E}(f,g)=-\int_{I_e}hgdm$ that \begin{equation}\label{eq:52} \frac{1}{2}\int_l^r \frac{df}{d\mathbf{s}}(x)dg(x)=\int_l^r F_h(x)dg(x)+F_h(l-)g(l)-F_h(r)g(r),\quad \forall g\in \mathscr C_{I_e}. \end{equation} Taking all $g\in \mathscr C_{I_e}$ with $\text{supp}[g]\subset (l,r)$ and noticing $F_h(e)=\frac{1}{2}df/d\mathbf{s}(e)$, we can obtain that \begin{equation}\label{eq:53} F_h(x)=\frac{1}{2}\frac{df}{d\mathbf{s}}(x),\quad x\in (l,r). \end{equation} Particularly $\frac{1}{2}\frac{d}{dm}\frac{df}{d\mathbf{s}}=h\in L^2(\mathring{I},m)$. In addition, \eqref{eq:52} and \eqref{eq:53} yield that $F_h(l-)=0$ if $l\in I_e$ and $F_h(r)=0$ if $r\in I_e$. In the former case \[ F_h(l-)=F_h(l)-h(l)m(\{l\})=\frac{1}{2}\frac{df}{d\mathbf{s}}(l)-h(l)m(\{l\}). \] Hence $df/d\mathbf{s}(l)=0$ if $m(\{l\})=0$ and $h(l)=\frac{1}{2}\frac{df}{d\mathbf{s}}(l)/m(\{l\})$. The latter case can be treated analogically. Therefore we can obtain $f\in {\mathscr G}$. That completes the proof. \end{proof} Set $C:=\int_l^r u(y)^{-2}d\mathbf{s}(y)$, which is finite due to Lemma~\ref{LM21}~(1). It is straightforward to calculate that if $l\in I_e$, then \[ \begin{aligned} &u_-(l)=0,\quad u_+(l)=Cu(l)\in (0,\infty), \\ &\frac{du_-}{d\mathbf{s}}(l)=\frac{1}{u(l)}\in (0,\infty), \quad \frac{du_+}{d\mathbf{s}}(l)=C\frac{du}{d\mathbf{s}}(l)-\frac{1}{u(l)}\in (-\infty,0); \end{aligned}\] and if $r\in I_e$, then \[ \begin{aligned} &u_-(r)=Cu(r)\in (0,\infty),\quad u_+(r)=0, \\ &\frac{du_-}{d\mathbf{s}}(r)=C\frac{du}{d\mathbf{s}}(r)+\frac{1}{u(r)}\in (0,\infty),\quad \frac{du_+}{d\mathbf{s}}(r)=-\frac{1}{u(r)}\in (-\infty,0). \end{aligned} \] Put $c_l:=-\frac{du_+}{d\mathbf{s}}(l)/\frac{du_-}{d\mathbf{s}}(l)$ and $c_r:=-\frac{du_+}{d\mathbf{s}}(r)/\frac{du_-}{d\mathbf{s}}(r)$. Clearly $c_l, c_r\in (0,\infty)$. \begin{theorem} \begin{itemize} \item[(1)] When $I_e=[l,r)$, $\mathcal{H}_\alpha\cap \mathcal{D}(\mathscr{L})=\{0\}$ if $m(\{l\})=0$ and $\mathcal{H}_\alpha\cap \mathcal{D}(\mathscr{L})=\mathcal{H}_\alpha$ if $m(\{l\})>0$. \item[(2)] When $I_e=(l,r]$, $\mathcal{H}_\alpha\cap \mathcal{D}(\mathscr{L})=\{0\}$ if $m(\{r\})=0$ and $\mathcal{H}_\alpha\cap \mathcal{D}(\mathscr{L})=\mathcal{H}_\alpha$ if $m(\{r\})>0$. \item[(3)] When $I_e=[l,r]$, \[ \mathcal{H}_\alpha \cap \mathcal{D}(\mathscr{L})=\left\lbrace \begin{aligned} &\mathcal{H}_\alpha,\qquad\qquad \qquad\quad m(\{l\}), m(\{r\})>0; \\ &\text{span}\{u_++c_r u_-\},\quad m(\{l\})>0,m(\{r\})=0; \\ &\text{span}\{u_++c_l u_-\},\quad\, m(\{r\})>0,m(\{l\})=0; \\ &\{0\}, \qquad\qquad \qquad\quad m(\{l\})=m(\{r\})=0. \end{aligned} \right. \] \end{itemize} \end{theorem} \begin{proof} For the first and second assertions, it suffices to note that $du_+/d\mathbf{s}(l)\neq 0$ if $l\in I_e$ and $du_-/d\mathbf{s}(r)\neq 0$ if $r\in I_e$. Now consider $I_e=[l,r]$. When $m(\{l\}), m(\{r\})>0$, clearly $\mathcal{H}_\alpha\subset \mathcal{D}(\mathscr{L})$. When $m(\{l\})>0$ and $m(\{r\})=0$, $h=c_1 u_++c_2 u_-\in \mathcal{D}(\mathscr{L})$ if and only if \[ c_1\frac{du_+}{d\mathbf{s}}(r)+c_2\frac{du_-}{d\mathbf{s}}(r)=0. \] This amounts to $c_2/c_1=c_r$. Hence $\mathcal{H}_\alpha\cap \mathcal{D}(\mathscr{L})=\text{span}\{u_++c_ru_-\}$. The third case can be treated analogically. When $m(\{l\})=m(\{r\})=0$, $h=c_1 u_++c_2 u_-\in \mathcal{D}(\mathscr{L})$ if and only if \[ \begin{aligned} &c_1\frac{du_+}{d\mathbf{s}}(r)+c_2\frac{du_-}{d\mathbf{s}}(r)=0, \\ &c_1\frac{du_+}{d\mathbf{s}}(l)+c_2\frac{du_-}{d\mathbf{s}}(l)=0. \end{aligned}\] Note that $du/d\mathbf{s}(l)<0, du/d\mathbf{s}(r)>0$ and $u(l), u(r)>0$. Then we have $c_1=c_2=0$ because \[ \frac{du_+}{d\mathbf{s}}(r)\frac{du_-}{d\mathbf{s}}(l)-\frac{du_-}{d\mathbf{s}}(r)\frac{du_+}{d\mathbf{s}}(l)=-C^2\frac{du}{d\mathbf{s}}(l)\frac{du}{d\mathbf{s}}(r)-\frac{C}{u(r)}\frac{du}{d\mathbf{s}}(l)+\frac{C}{u(l)}\frac{du}{d\mathbf{s}}(r)>0. \] That completes the proof. \end{proof} \bibliographystyle{abbrv}
3c4fcc29c353639376a1701d255dd5b9c766c84c
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction and main result} This paper is concerned with the existence of periodic sign-changing solutions to a particular prototype of overdetermined boundary value problem on strip domains of the plane. In 1971, Serrin \cite{Serrin} proved by Alexandrov \cite{Alexandrov} moving plane method that the only bounded and regular domains in the Euclidean space $\mathbb{R}^N$ where the overdetermined problem \begin{equation}\label{eq:ProA3} -\Delta u=1\quad \text{ \quad in $\Omega$} \end{equation} and \begin{equation}\label{eq:ro3} u=0, \quad \partial_\nu u=\textrm{const} \quad \text{ on \quad $\partial \Omega$} \end{equation} is solvable are balls. Here $\nu$ is the unit outer to the boundary. \\ Soon after this celebrate result was communicated to the PDE community, several authors have developed interest in the study of symmetry properties as well as rigidity results of the overdetermined problem \eqref{eq:ProA3}-\eqref{eq:ro3} including the more general equation \begin{align}\label{probcafa} -\Delta u = f(u) \quad \text{in $\Omega$}, \qquad u=0, \quad \partial_\nu u=\textrm{const} \qquad \text{on $\partial \Omega$}, \end{align} where $f: [0,\infty) \to \mathbb{R}$ is a locally Lipschitz function. We refer the reader to \cite{Alessandrini, Gazzola, Greco, Philippin, GarofaloLewis, Prajapat, PaynePhilippin, Lamboley, FragalaGazzola, BrockHenrot, Reichel, PhilippinPayne, BerchioGazzolaWeth, FraGazzolaKawohl}, \cite{farina-valdinoci,farina-valdinoci:2010-1,farina-valdinoci:2010-2,farina-valdinoci:2013-1, farina-valdinoci:2013-2, BCNI}. In the classical literature a smooth domain $\O$ where the problem \eqref{probcafa} is solvable is called \emph{$f$-extremal domain.}. In 1997, Berestycki, Caffarelli and Nirenberg \cite{BCNI} addressed the classification of unbounded \emph{$f$-extremal domains} and conjectured that if $\Omega \subset \mathbb{R}^N$ is an \emph{$f$-extremal domain} such that $\mathbb{R}^N \setminus \overline \Omega$ is connected and \eqref{probcafa} admits a bounded solution, then $\Omega$ is either a half plane, or a generalized cylinder $\mathbb{R}^j \times B$ where $B$ is the unit Euclidean ball in $\mathbb{R}^{N-j}$, or the complement $B^c$ of a ball $B \subset \mathbb{R}^N$ or a cylinder. For $f(u)=\lambda_1 u$, where $\lambda_1$ is the first eigenvalue of the Laplacian with $0$-Dirichlet boundary condition, this conjecture was disproved in dimension $N\geq 3$ by Sicbaldi \cite{Sic}, and later in dimension $N\geq2$ by Sicbaldi and Schlenk in \cite{ScSi}, where they proved existence of periodic and unbounded extremal domains bifurcating from straight cylinder $\mathbb{R} \times B$. Subsequently, we considered the case $f\equiv 1$ in \cite{ Fall-MinlendI-Weth} and proved the existence of periodic unbounded domains bifurcating from generalized-type cylinder domains in $\mathbb{R}^N$. We also refer to \cite{Fall-MinlendI-Weth2, Ku-Pra, morabito-sicbaldi}, where the conjecture in \cite{BCNI} is addressed in space forms. \\ We note that the results in the previous works all assume one-sign solutions, while the existence of sign-changing solutions in the context of overdetermined boundary value problems is a subject of intensive investigation in the literature. In the present paper, we deal with the existence of sign-changing solutions to a specific prototype of overdetermined boundary value problem given by \begin{equation} \label{eq:perturbed-strip2} \left \{ \begin{aligned} - \lambda u_{xx} -u_{tt} &= u && \qquad \text{in $\Omega$,}\\ u &=0 &&\qquad \text{on $\partial \Omega$,}\\ \frac{\partial u}{\partial \eta} &=-1 &&\qquad \text{on $\partial \Omega^+$,}\\ \frac{\partial u}{\partial \eta} &=+1 &&\qquad \text{on $\partial \Omega^-$} \end{aligned} \right. \end{equation} for some $\lambda >0$. Here, $\nu$ is the outer unit normal vector field to the boundary of $\Omega$,$$ \partial \Omega^+= \{ (x, t) \in \partial \Omega, \quad t> 0 \}\quad \textrm{and} \quad\partial \Omega^-= \{ (x, t) \in \partial \Omega, \quad t< 0 \}.$$ Our aim is to prove the existence of sign-changing solutions to problem \eqref{eq:perturbed-strip2} on unbounded domains $\O \subset \mathbb{R}^2$. Related to this paper are the following conjectures of Schiffer in spectral theory, see \cite{schiffer:1954, schiffer:1955, ChatelainHe}. \textbf{\emph{Conjecture 1:}} Let $\O$ be a simply connected domain in $\mathbb{R}^N$ and $\lambda\ne 0$. Then there exists a Dirichlet eigenfunction $u\ne 0$ satisfying \begin{equation} (P_{\lambda}): \label{eq:schiffer} \left \{ \begin{aligned} -\Delta u &= \lambda u && \qquad \text{in $\Omega$,}\\ u &=0&& \qquad \text{on $\partial \Omega$,}\\ \frac{\partial u}{\partial \eta} &=const. &&\qquad \text{on $\partial \Omega$.} \end{aligned} \right. \end{equation} if and only if $\O$ is a ball. \textbf{\emph{Conjecture 2:}} Let $\O$ be a simply connected domain in $\mathbb{R}^N$. If $\lambda >0$, then there exists $u\ne 0$ such that \begin{equation} (Q_{\lambda}): \label{eq:schiffer} \left \{ \begin{aligned} -\Delta u &= \lambda u && \qquad \text{in $\Omega$,}\\ \frac{\partial u}{\partial \eta} &=0&&\qquad \text{on $\partial \Omega$,}\\ u &=const. &&\qquad \text{on $\partial \Omega$.} \end{aligned} \right. \end{equation} if and only if $\O$ is a ball. Indeed if $u$ is a solution of \eqref{eq:perturbed-strip2}, then the function $$ W^{\lambda} (y, \zeta):= u(\lambda y, \sqrt{\lambda}\zeta) $$ solves the overdetermined problem \begin{equation} \label{eq:W1} \left \{ \begin{aligned} - \Delta W^{\lambda} &= \lambda W^{\lambda} && \qquad \text{in $\Omega_\lambda$,}\\ W^{\lambda} &=0 &&\qquad \text{on $\partial \Omega_{\lambda} $,} \end{aligned} \right. \end{equation} \begin{align}\label{eqNeuW1} \frac{\partial W^{\lambda}}{\partial \eta} &=-1 \quad \text{on \quad $\partial \Omega_\lambda^+$} \quad \textrm{and}\quad \frac{\partial W^{\lambda}}{\partial \eta} =+1 \qquad \text{on \quad $\partial \Omega_\lambda^+$,} \end{align} where $$ \Omega_\lambda:= \{(\frac{x}{\lambda}, \frac{\t}{\sqrt{\lambda}}),\: \quad \: (x,\t) \in \Omega\}. $$ The solution $W^{\lambda}$ does not assume a constant Neumann data at boundary $\Omega_\lambda$ as \eqref{eqNeuW1} reveals. Nevertheless the problem \eqref{eq:W1}-\eqref{eqNeuW1} can be seen as a refined version of conjecture 1 above. In contract, interchanging the boundary conditions in \eqref{eq:perturbed-strip2} and considering constant zero Neumann data and constant Dirichlet equals $-1$, we are led to the problem \begin{align}\label{eq:Wl4} \left \{ \begin{aligned} - \Delta W^{\lambda} &= \lambda W^{\lambda} && \qquad \text{in $\Omega_\lambda$,}\\ W^{\lambda} &=-1 &&\qquad \text{on $\partial \Omega_{\lambda} $,} \end{aligned} \right. \end{align} \begin{align}\label{eqNeuWl4} \frac{\partial W^{\lambda}}{\partial \eta} &=0\quad \text{on \quad $\partial \Omega_\lambda$,}\end{align} which is a prototype in the conjecture 2. We announce here our forthcoming paper where we are addressing \eqref{eq:Wl4}-\eqref{eqNeuWl4}. We alert that this problem leads to a serious loss of regularity which we hope to overcome soon.\\ Up to now, only few works have been carried out regarding the existence on sign-changing solutions of overdetermined boundary value problems and the most recent in this context are \cite{Ramm, Deng, BCanutoDRial, B.Canuto}. In \cite{B.Canuto} and \cite{BCanutoDRial}, the authors addressed the following question: for $\o\in \mathbb{R}$, is it true that the only domain such that there exists a solution to the overdetermined problem \begin{equation}\label{eq:SignchangeBounded} \begin{cases} \Delta u+\o^2 u=-1 & \quad \textrm{in} \quad \Omega \vspace{3mm}\\ u=0 & \quad\textrm{on }\quad \partial\Omega \end{cases} \end{equation} and \begin{equation}\label{eq: SignchangeBoun2} \quad \partial_{\nu} u= \textrm{c } \quad \textrm{ on } \quad \partial \Omega. \end{equation} is a ball ? Moreover, the authors in \cite{BCanutoDRial} proved the under suitable assumptions on $\o$ that the only bounded domain $\O$ such that there exists a solution to \eqref{eq:SignchangeBounded}-\eqref{eq: SignchangeBoun2} is the ball $B_1$, independent on the sign of $u$, provided $\partial \O$ is a perturbation of the unit sphere $\partial B_1$ in $\mathbb{R}^N$. A similar result was derived in \cite{B.Canuto} by considering a different Neumann boundary condition. \\ Concerning the case of unbounded domains, our paper appears to be the first and in fact, we are not aware of any other existing result for sign-changing solutions in unbounded domains arising in the context of overdetermined boundary value problems. \\ To state our main result, we consider the reference domain $$\Omega_*= \mathbb{R} \times (-(2 m+1) \pi, (2 m+1) \pi) \subset \mathbb{R}^2$$ for some fixed non-negative integer $m$. Then problem \ref{eq:perturbed-strip2} is solved on $\Omega_*$ by the ($\lambda$-independent) solution $u_*(x,t)= \sin t$ for all $\lambda>0$. Our aim is construct domains $\Omega$ close to $\Omega_*$ with the property that the overdetermined boundary value problem \ref{eq:perturbed-strip2} is solvable on $\Omega$ by some sign-changing solution $u$. We consider the open set $$ Y_2^+:= \{h \in C^{2,\alpha}_{p, e}(\mathbb{R})\::\: h> 0 \quad \text{$h$ is even in $x$}\},$$ where $C^{2,\alpha}_{p, e}(\mathbb{R})$ stands for the space of $2\pi$ periodic functions in $\mathbb{R}$. For a function $h \in Y_2^+ $, we define the domain \begin{equation}\label{eq: domainh} \Omega_h:= \{(x, \frac{\t}{h(x)})\::\: (x,\t) \in \Omega_*\}. \end{equation} Our main result states the existence of sign-changing solutions $u$ to the overdetermined problem \eqref{eq:perturbed-strip2} on domains of the form $\Omega = \Omega_h$. \begin{Theorem}\label{Strip1} Let $m\in \mathbb{N}$ and $\alpha \in (0,1)$. There exists a strictly decreasing and finite sequence $(\mu_\ell(m))_{0\leq \ell \leq 2m}$ of real numbers in $(0, 1)$ with the following properties: for every ${0\leq \ell \leq 2 m}$, there exists ${\e_\ell}>0$ and a smooth curve $$ (-{\e_\ell},{\e_\ell}) \to (0,+\infty) \times C^{2,\alpha}(\overline {\Omega_{*}}) \times C^{2,\alpha}(\mathbb{R}),\qquad s \mapsto (\lambda_\ell(s),\varphi^\ell_s, \psi^\ell_s) $$ with $ \lambda_\ell(0)= \mu_\ell(m)$, $ (\varphi^\ell_0, \psi^\ell_0)\equiv(0,0)$ and such that for every $s\in (-{\e_\ell},{\e_\ell})$, there exists a solution $u^\ell_s \in C^{2,\alpha}(\overline {\Omega_{ 1+\psi^\ell_s}})$ of the overdetermined problem \begin{equation} \label{eq:solved} \left \{ \begin{aligned} - \lambda^\ell_s u_{xx} -u_{tt} &= u && \qquad \text{in $ \Omega_{ 1+\psi^\ell_s} $,}\\ u &=0 &&\qquad \text{on $\partial \Omega_{ 1+\psi^\ell_s}$,}\\ u_\nu &=-1 &&\qquad \text{on $\partial \Omega_{ 1+\psi^\ell_s}^+$,}\\ u_\nu &=+1 &&\qquad \text{on $\partial \Omega_{ 1+\psi^\ell_s}^-$}. \end{aligned} \right. \end{equation} Moreover, the function $\psi^\ell_s\in C^{2,\alpha}(\mathbb{R})$ is even and $2\pi$ periodic and \begin{align}\label{eqa2} \psi^\ell_s= s \bigl( \cos (x) + \kappa^\ell_s\bigr). \end{align} Furthermore, setting $$ \tilde u^\ell_s := \sin(t)+s \bigl(v_\ell + \mu^\ell_s\bigr),$$ where $$v_\ell (x,t)= \Bigl((-1)^\ell(2m+1)\pi \sin (\sqrt{1-\mu_\ell(m)}t)+t\cos (t)\Bigl)\cos (x),$$ the solution $u^\ell_s \in C^{2,\alpha}(\overline {\Omega_{ 1+\psi^\ell_s}})$ to \eqref{eq:solved} is of the form \begin{align}\label{eqasolutionform} u^\ell_s(x,t)= \tilde u^\ell_s\Bigl(x ,(1+ \psi^\ell_s(x))t\Bigl), \end{align} with a smooth curve $$ (-{\e_0},{\e_0}) \to C^{2,\alpha}(\overline {\Omega_{*}}) \times C^{2,\alpha}(\mathbb{R}), \qquad s \mapsto (\mu^\ell_s, \kappa^\ell_s) $$ satisfying \begin{align*} \int_{(-\pi,\pi)\times(-(2 m+1) \pi,(2 m+1) \pi) } \mu^\ell_s v_\ell(x,t)\,dxdt+\int_{(-\pi,\pi)} \kappa^\ell_s \cos (x)dx=0.\\ \end{align*} \end{Theorem} The fact that the solution $u^\ell_s \in C^{2,\alpha}(\overline {\Omega_{ 1+\psi^\ell_s}})$ to \eqref{eq:solved} changes sign is precise in Section \eqref{eq.setting} below. Indeed $\Omega_{ 1+\psi^\ell_s}$ is symmetric in the $t$ coordinate and $u^\ell_s $ is odd with respect to this variable. Furthermore, the sequence $(\mu_\ell(m))_{0\leq \ell \leq 2m}$ whose existence is claimed in Theorem \ref{Strip1} is explicitly given by \begin{align*} \mu_\ell(m)&=1-\frac{1}{4}\Bigl( \frac{1+2\ell }{1+2m}\Bigl)^2. \end{align*} In particular $ \mu_0(0)= \mu_m(m)=\frac{3}{4}.$\\ We now describe the proof of Theorem \ref{Strip1} while presenting the contents of the paper.\\ The proof of Theorem \ref{Strip1} is achieved by the use of Crandall-Rabinowitz bifurcation theorem, \cite{M.CR}. Our aim is solve the problem \eqref{eq:perturbed-strip2} on the domain $\O_h$ given by \eqref{eq: domainh}. In Section \ref{eqtranf}, we transform \eqref{eq:perturbed-strip2} to the fixed domain $\O_*$, see \eqref{eq:Proe1-ss1}. Next we write \eqref{eq:Proe1-ss1} into the solvability of a bifurcation equation $F_\lambda(u,h)=0$ defined in \eqref{eq to bifurcate}, and we give the expression of linearized operator $D F_\lambda(0,0)$ in \eqref{eq diffope2}. In Section \ref{exkus}, we compute the kernel of $D F_\lambda(0,0)$ and derive the spectral properties of the operator $D F_\lambda(0,0)$ in Lemma \ref{lemorthoKer} and Proposition \ref{propPhlinearop} as well as all the preliminary assumptions of Crandall-Rabinowitz bifurcation theorem\cite{M.CR}. The proof of Theorem \ref{Strip1} is completed in Section \ref{eq:ProofTheo1}. In section \ref{eq: Cradal Rabi1}, we give the Crandall-Rabinowitz bifurcation theorem for the reader convenience. \bigskip \noindent \textbf{Acknowledgements}: This work was carried out when the author was visiting the Institute of Mathematics and Informatics of the Goethe University Frankfurt as a Humboldt postdoctoral fellow. He is gratefully to the Humboldt Foundation for funding his research and wishes to thank Department of Mathematics of the Goethe-University Frankfurt for the hospitality. The author also thanks his host Prof. Tobias Weth and Prof. Mouhamed Moustapha Fall for their helpful suggestions and comments throughout the writing of this paper. \section{The tranformed problem and its linearization}\label{eqtranf} For some fixed non-negative integer $m$, we consider the domain $$\Omega_*= \mathbb{R} \times (-(2 m+1) \pi, (2 m+1) \pi) \subset \mathbb{R}^2$$ and the open set $$ Y_2^+:= \{h \in C^{2,\alpha}_{p, e}(\mathbb{R})\::\: h> 0 \quad \text{$h$ is even in $x$}\},$$ where $C^{2,\alpha}_{p, e}(\mathbb{R})$ stands for the space of $2\pi$ periodic functions in $\mathbb{R}$. For a function $h \in Y_2^+ $, we define the domain \begin{equation}\label{eq: domainh2} \Omega_h:= \{(x, \frac{\t}{h(x)})\::\: (x,\t) \in \Omega_*\}. \end{equation} We are looking for a solution $u$ of the overdetermined problem \begin{equation}\label{eq:perturbed-strip4} \left \{ \begin{aligned} - \lambda u_{xx} -u_{tt} &= u && \qquad \text{in $\Omega_h$,}\\ u &=0 &&\qquad \text{on $\partial \Omega_h$,}\\ \frac{\partial u}{\partial \eta} &=-1 &&\qquad \text{on $\partial \Omega_h^+$,}\\ \frac{\partial u}{\partial \eta} &=+1 &&\qquad \text{on $\partial \Omega_h^-$} \end{aligned} \right. \end{equation} for some $\lambda >0$. Here, $\nu$ is the outer unit normal vector field to the boundary of $\Omega_h$,$$ \partial \Omega_h^{+}= \{ (x, t) \in \partial \Omega_h, \quad t> 0 \}\quad \textrm{and} \quad\partial \Omega_h^{-}= \{ (x, t) \in \partial \Omega_h, \quad t< 0 \}.$$ Observe that $\Omega_h$ is parametrized by the mapping $$ \Psi_h: \Omega_* \to \Omega_h , \quad (x, \t) \mapsto (x, t)=(x, \frac{\t}{h(x)}),$$ with inverse given by $ \Psi^{-1}_h: \Omega_h \to \Omega_*, \quad (x, t) \mapsto (x, h(x) t)$.\\ The aim is to pull back problem \eqref{eq:perturbed-strip4} on the fixed unperturbed domain $\Omega_*$ via the ansatz \begin{align}\label{eqans} v(x,t)= u(x,h(x)t)=u(x,\tau) \qquad \text{for some function $u: \Omega_* \to \mathbb{R}$.} \end{align} For this we define $$ L_\lambda:= \partial_{tt} + \lambda \partial_{xx} + \id, $$ and we first to compute the differential operator $L^h_\lambda$ with the property that \begin{align}\label{eqreladiffopets} [L^h_\lambda u] (x,h(x)t) = [L_\lambda v](x,t) \qquad \text{for $(x,t) \in \Omega_h$} \end{align} for the function $v: \Omega_h \to \mathbb{R}$, $v(x,t)=u(x,h(x)t)$. Setting $\xi: = (x,h(x)t)$ in the following, we compute that $$ v_x(x,t )= u_x(\xi) + h'(x)t u_\tau (\xi), $$ $$ v_{xx}(x,t) = u_{xx}(\xi) + 2 h'(x)t u_{x \tau }(\xi) + h''(x)t u_\tau (\xi)+t^2 [h'(x)]^2u_{\tau \tau}(\xi) $$ and $$ v_{tt}(x,t)= h(x)^2 u_{\tau \tau}(\xi). $$ Consequently, \begin{align*} &L_\lambda v(r,t)= v(r,t) + \lambda v_{xx}v(r,t) + v_{tt}v(r,t)\\ &= u(\xi) + \lambda u_{xx}(\xi) + \bigl(h^2(x) + \lambda t^2 [h'(x)]^2\bigr) u_{\tau \tau}(\xi) + \lambda h''(x)t u_\tau (\xi) + 2 \lambda h'(x)t u_{\tau x}(\xi) \end{align*} and \begin{align*} L_\lambda v (x,\frac{\t}{h(x)}) &= u(x,\tau ) + \lambda u_{xx} (x,\tau ) + \Bigl(h^2(x) + \lambda \t^2 \frac{h'(x)^2}{h(x)^2} \Bigr) u_{\tau \tau} (x,\tau ) \\ &+ \lambda \frac{ h''(x) }{h(x)} \t u_\tau (x,\tau ) + 2 \lambda \frac{ h'(x) }{h(x)} \tau u_{\tau x}(x,\tau ). \end{align*} Therefore the differential operator $L^h_\lambda$ is given in coordinates $(x,\tau )$ by \begin{align} \label{eq:reldiffope} L_\lambda^h = \id + \lambda \partial_{xx} + \Bigl(h^2(x) + \lambda \t^2 \frac{h'(x)^2}{h(x)^2} \Bigr) \partial_{\tau \tau} + 2 \lambda \frac{ h'(x) }{h(x)} \tau \partial_{ x \tau } + \lambda \frac{ h''(x) }{h(x)} \t \partial_\t. \end{align} Next we express the normal derivative of $u$ with respect to the outer normal vector field on $\partial \Omega_*$ induced by the parametrization $ \Psi_h: \Omega_* \to \Omega_h , \quad (x, \t) \mapsto (x, \frac{\t}{h(x)})$.\\ Let the metric $g_h$ be defined as the pull back of the euclidean metric $g_{eucl}$ under the map $\Psi_h$, so that $\Psi_{h}:(\overline \O,g_h) \to (\overline \O_{h},g_{eucl})$ is an isometry. Denote by $$ \eta_h: \partial \Omega_* \to \mathbb{R}^{2} $$ the unit outer normal vector field on $\partial \Omega_* $ with respect to $g_h $. Since \mbox{$\Psi_{h}: (\overline \Omega_*, g_h) \to (\overline \O_h, g_{eucl})$} is an isometry, we have \begin{equation} \label{eq:rel-mu-phi-nu-phi} \eta_{h} = [d \Psi_h]^{-1} \mu_h \circ \Psi_h \qquad \text{on $\partial \Omega_* $,} \end{equation} where $\mu_h: \partial \O_h \to \mathbb{R}^{2}$ denotes the outer normal on $\partial \Omega_h$ with respect to the Euclidean metric $g_{eucl}$ given by \begin{equation} \label{eq:def-mu-phi} \mu_h (x,t) = \dfrac{ 1}{\sqrt{1+ \frac{((2 m+1) \pi)^2 h'^2(x) }{ h^4(x)}}} \Bigl( \dfrac{ (2 m+1) \pi h'(x) }{ h^2(x)}, \dfrac{t}{|t|} \Bigl) \in \mathbb{R}^{2} \qquad \text{for $(x,t) \in \partial \Omega_h.$} \end{equation} Moreover, by (\ref{eq:rel-mu-phi-nu-phi}) we have $\mu_h(\Psi_h (x,\tau) )=d\Psi_h (x,\tau) \eta_h (x,\tau) $ and therefore \begin{align*} \partial_{\eta_h} u (x,\tau) = d u (x,\tau) \eta_{h} (x,\tau) =d v (\Psi_{h}(x,\tau)) &d \Psi_{\phi}(x,\tau) \eta_{h}(x,\tau)= d v (\Psi_{h}(x,\tau)) \mu_h(\Psi_h (x,\tau) )\\ &= \langle \mu_h(\Psi_h (x,\tau) ), \nabla_{ (x, t)}v (\Psi_{h}(x,\tau)) \rangle_{g_{eucl}}. \end{align*} From \eqref{eqans} $$ \nabla_{ (x, t)}v (x, t)= \Bigl(u_x (x,h(x) t) + h'(x) t u_ \tau (x,h(x) t), h(x)u_\tau (x,h(x) t) \Bigl)$$ and we have $$ \nabla_{ (x, t)}v (\Psi_{h}(x,\tau))= \nabla_{ (x, t)}v (x, \frac{\tau }{h(x)})=\Bigl(u_x (x,\tau) + \frac{h'(x) }{h(x) } \tau u_ \tau (x,\tau), h(x)u_\tau (x,\tau) \Bigl)$$ and hence, \begin{align} \label{eq:normor} \partial_{\eta_h} u (x,\tau) = \dfrac{ 1}{\sqrt{1+ \frac{((2 m+1) \pi)^2 h'^2(x) }{ h^4(x)}}} \Bigl[ \frac{(2 m+1) \pi h'(x) }{ h^2(x)}\Bigl(u_x (x,\tau) + \frac{h'(x) }{h(x) } \tau u_ \tau (x,\tau) \Bigl)+ \dfrac{\tau}{|\tau|}h(x)u_\tau (x,\tau) \Bigl] \end{align} From \eqref{eqans} and \eqref{eqreladiffopets} the original problem \eqref{eq:perturbed-strip4} is equivalent to \begin{align}\label{eq:Proe1-ss1} \begin{cases} [L^h_\lambda u] (x, \t)= 0 &\quad \textrm{ in}\quad \Omega_* \\ u=0 &\quad\textrm{ on} \quad \partial \Omega_* \\ \partial_{\eta_{h}} u \equiv -1 &\quad\textrm{ on }\quad \partial \Omega^+_*\\ \partial_{\eta_{h}} u \equiv +1 &\quad\textrm{ on }\quad \partial \Omega^-_*, \end{cases} \end{align} where $ \partial_{\eta_{h}} u$ is expressed in \eqref{eq:normor}.\\ Our aim is then to find $(u, h)$ such that \eqref{eq:Proe1-ss1} holds. Before proving the existence of such a couple $(u, h)$, we make the following which allow to reduce the Neumann conditions in \eqref{eq:Proe1-ss1} to a single equation. \\ \begin{Remark}\label{Rmm} Let $u=u(x,t)$ satisfying $$ u(x,\pm(2 m+1) \pi)=Const.$$ Then $u_x(x,\pm(2 m+1) \pi)=0$ so that \eqref{eq:normor} yields \begin{align} \label{eq:nortt} \partial_{\eta_h} u (x, +(2 m+1) \pi)& = \dfrac{ 1}{\sqrt{1+ \frac{(2 m+1) \pi)^2 h'^2(x) }{ h^4(x)}}} \Bigl[ \frac{ ((2 m+1) \pi)^2 h'^2(x) }{ h^3(x) } + h(x) \Bigl] u_\tau (x, (2 m+1) \pi)\nonumber \\ \partial_{\eta_h} u (x,-(2 m+1) \pi) &= -\dfrac{ 1}{\sqrt{1+ \frac{((2 m+1) \pi)^2 h'^2(x) }{ h^4(x)}}} \Bigl[ \frac{ (2 m+1) \pi)^2 h'^2(x) }{ h^3(x) } + h(x) \Bigl] u_\tau (x, -(2 m+1) \pi).\nonumber \end{align} In addition to $ u(x,\pm(2 m+1) \pi)=Const.$, if we assume that $u=u(x,t)$ is odd in $t$, then $u_t (x,-(2 m+1) \pi)=u_t (x,(2 m+1) \pi)$ and \begin{equation}\label{eq:normlllls} \partial_{\eta_h} u (x, +(2 m+1) \pi)=-\partial_{\eta_h} u (x,-(2 m+1) \pi). \end{equation} In this case the equation \begin{equation} \label{eq:Proe1-1-neumann55} \partial_{\eta_{h}} u \equiv c \ne 0 \quad\textrm{ on }\quad \partial \Omega_* \end{equation} has no solution. Nevertheless, one can consider the overdetermined problem \begin{equation} \label{eq:schiffer-perturbed-for sine} \left \{ \begin{aligned} - \lambda u_{xx} -u_{tt} &= u && \qquad \text{in $\Omega$,}\\ u &=0 &&\qquad \text{on $\partial \Omega$,}\\ u_\nu &=-1 &&\qquad \text{on $\partial \Omega^+$,}\\ u_\nu &=+1 &&\qquad \text{on $\partial \Omega^-$,} \end{aligned} \right. \end{equation} where $ \partial \Omega^+= \{ (x, t) \in \partial \Omega, \quad t> 0 \}$ and $ \partial \Omega^-= \{ (x, t) \in \partial \Omega, \quad t< 0 \}$. It is obvious that the function $\sin (t)$ solves \eqref{eq:schiffer-perturbed-for sine} on $\Omega_*$. From \eqref{eq:normlllls}, the Neumann boundary conditions in \eqref{eq:schiffer-perturbed-for sine} therefore reduce to the single equation \begin{align} \label{eq:normale} \dfrac{ 1}{\sqrt{1+ \frac{((2 m+1) \pi)^2 h'^2(x) }{ h^4(x)}}} \Bigl[ \frac{ ((2 m+1) \pi)^2 h'^2(x) }{ h^3(x) } + h(x) \Bigl] u_\tau (x, (2 m+1) \pi)=-1. \end{align} \end{Remark} \section{The setting of the pull back problem and computation of the linearized operator}\label{eq.setting} To set up a framework for problem \eqref{eq:Proe1-ss1}, we define the function spaces $$ C^{2,\alpha}_{p,e}(\overline \Omega_*):= \{u \in C^{2,\alpha}(\overline \Omega_*)\::\: \text{$u=u (x, t)$ is $2\pi$ periodic $x$}\}, $$ $$ X_2:= \{u \in C^{2,\alpha}_{p,e}(\overline \Omega_*)\::\: \text{$u$ is odd in $t$ and even in $x$, and $u \equiv 0$ on $\partial \Omega_*$.}\} $$ as well as $$ X_0:= \{u \in C^{0,\alpha}(\overline \Omega_*)\::\: \text{$u$ is odd in $t$ and even in $x$, and $2\pi$ periodic in $x$}\} $$ and $$ Y_2:= \{h \in C^{2,\alpha}_{p,e}(\mathbb{R})\::\: \text{$h$ is even in $x$}\} \quad Z_2:= \{z \in C^{1,\alpha}_{p,e}(\mathbb{R})\::\: \text{$z$ is even in $x$}\}.$$ We also recall $Y_2^+:= \{h \in Y_2\::\: h>0\}$ and $u_*(x,t)= \sin t$.\\ Our aim is to prove that for some parameter $\lambda$, we can find the functions $(u,h)\in X_2 \times Y_2$ such that \begin{align}\label{eq:Proe11} \left \{ \begin{aligned} &[L^h_\lambda u] (x, \t)= 0 & \quad \textrm{ in}\quad \Omega_*\\ &u=0& \quad\textrm{ on} \quad \partial \Omega_* \\ &\dfrac{ 1}{\sqrt{1+ \frac{(2 m+1) \pi)^2 h'^2(x) }{ h^4(x)}}} \Bigl[ \frac{ ((2 m+1) \pi)^2 h'^2(x) }{ h^3(x) } + h(x) \Bigl] u_\tau (x, (2 m+1) \pi)=-1 & \quad \textrm{ on} \quad \mathbb{R}. \end{aligned} \right. \end{align} Define the mapping $$ Q: X_2 \times Y_2^+ \to Z_2 $$ by $$Q (u,h):=\dfrac{ 1}{\sqrt{1+ \frac{((2 m+1) \pi)^2 h'^2(x) }{ h^4(x)}}} \Bigl[ \frac{ ((2 m+1) \pi)^2 h'^2(x) }{ h^3(x) } + h(x) \Bigl] u_\tau (x, (2 m+1) \pi)+1.$$ and \begin{align}\label{eqQtilde} \widetilde{ Q } (u,h):= Q (u+ u_*,1+h). \end{align} Then $\widetilde{ Q } (0,0)=0$ and by computation \begin{align}\label{eq:derQ} D \widetilde{ Q }(0,0)(v,g)= v_\tau (\cdot, (2 m+1) \pi)-g(\cdot). \end{align} Next, we define \begin{align}\label{eq:maptFF} F_\lambda: X_2 \times Y_2^+ \to X_0 \times Z_2 , \qquad F_\lambda(u,h):= (L_\lambda^{1+h} (u+u_*), \widetilde{ Q } (u,h),) \end{align} where $u_*(x,t)= \sin (t)$ and consider the equation \begin{align}\label{eq to bifurcate} F_\lambda(u,h)=0. \end{align} By construction, if $F_\lambda(u,h)=0$, then the function $\tilde u = u_* + u$ solves the problem \eqref{eq:Proe11}. Moreover, we have $$ F_\lambda(0,0) = 0 \qquad \text{for all $\lambda >0$.} $$ To check if this trivial branch of solutions admits bifurcation, we need to consider the derivative $D F_\lambda(0,0)$. By direct computation, the operator $D F_\lambda(0,0)$ is given by \begin{align}\label{eq diffope} D F_\lambda(0,0)(v,g)= \Bigl(L_\lambda^1 v + {\mathcal L}_\lambda^g u_*, v_\tau (\cdot, (2 m+1) \pi)-g(\cdot) \Bigl), \end{align} with $$ {\mathcal L}_\lambda^g:= \Bigl(\partial_h \Big|_{h=1}L_\lambda^h\Bigr)g = 2g(x)\partial_{tt}+2\lambda g'(x)t \partial_{tx}+ \lambda g''(x)t \partial_t. $$ For a function $w$ depending only on $t$, we have $$ {\mathcal L}_\lambda^g w = 2g(x)\partial_{tt} + \lambda g''(x)t w_t. $$ Consequently, the first coordinate in $D F_\lambda(0,0)(v,g)$ is given by $$ L_\lambda^1 v + {\mathcal L}_\lambda^g u_* = v+ \lambda v_{xx} + v_{tt} -2g(x) \sin t + \lambda g''(x)t \cos t, $$ while the second is $$v_\tau (\cdot, (2 m+1) \pi)-g(\cdot).$$ We set \begin{align}\label{eqinroU} U(x,t):=v(x,t)+ g(x)t \cos (t). \end{align} Then we have by direct computation \begin{align}\label{eequivla} L_\lambda^1 v + {\mathcal L}_\lambda^g u_* &= v+ \lambda v_{xx} + v_{tt} -2g(x) \sin t + \lambda g''(x)t \cos t\nonumber\\ &= U+ \lambda U_{xx} + U_{tt}\nonumber\\ v_\tau (\cdot, (2 m+1) \pi)-g(\cdot)&=U_\tau (\cdot, (2 m+1) \pi) \end{align} and \begin{align}\label{eq diffope2} D F_\lambda(0,0)(v,g)= \Bigl( U+ \lambda U_{xx} + U_{tt}, U_\tau (\cdot, (2 m+1) \pi) \Bigl). \end{align} \section{Computation of the kernel of $D F_\lambda(0,0)$}\label{exkus} In this section, we determine the kernel of the operator $D F_\lambda(0,0)$. \\ So suppose that $(v,g)$ is an element of the kernel. Then from \eqref{eq diffope} and \eqref{eequivla}, the function $U$ is an odd function in $t$ and $2\pi$ periodic and even in $x$ satisfying \begin{align}\label{eq. for U} U+ \lambda U_{xx} + U_{tt}=0 \end{align} together with the conditions \begin{align}\label{eqbounU} U_\tau (\cdot, (2 m+1) \pi)=0,\quad U (\cdot, \pm(2 m+1) \pi))= \mp (2 m+1) \pi)g(\cdot). \end{align} In what follows, we consider the Fourier coefficients \begin{align}\label{eqfouriercoefs} U_k(t):= \frac{1}{\sqrt{2\pi}}\int_{0}^{2\pi} U(x,t)\cos (kx)\,dx, \qquad g_k:= \frac{1}{\sqrt{2\pi}} \int_{0}^{2\pi} g(x)\cos (kx)\,dx. \end{align} Multiplying \eqref{eq. for U} and \eqref{eqbounU} with $\cos (kx)$ and integrating in the $x$-variable from $0$ to $2\pi$, $U_k$ is an odd function of class $C^{2,\alpha}([-(2m+1)\pi,(2m+1)\pi])$ solving the initial value problem \begin{align}\label{initialfor U} U_k'' + (1-k^2 \lambda) U_k =0 \end{align} and \begin{align}\label{boudaries for U} U'_k(\pm (2m+1)\pi)&=0 \quad \text{and} \quad U_k(\pm (2m+1)\pi)=\mp (2 m+1) \pi)g_k. \end{align} \subsection{Exkursion on the initial value problem \eqref{initialfor U}-\eqref{boudaries for U}} \subsection*{In the case $g_k=0$} If $g_k=0$, then $U_k$ solves $$ U_k'' + (1-k^2 \lambda) U_k = 0, \qquad U_k((2 m+1)\pi)=0=U'_k(\pm (2m+1)\pi) $$ and we see that $U_k=0$. In this case, we see with \eqref{eqinroU} that the kernel of $D F_\lambda(0,0)$ is trivial. \subsection*{In the case $g_k \not = 0$} If $g_k \not = 0$, we may assume $g_k = 1$ by considering $U_k /g_k$ in place of $U_k$, so we check whether the linear initial value problem \begin{align}\label{eq:v-k-initial-value} &U_k'' + (1-k^2 \lambda) U_k = 0,\nonumber\\ &U'_k(\pm (2m+1)\pi)=0 \quad \text{and} \quad U_k(\pm (2m+1)\pi)=\mp (2 m+1) \pi). \end{align} We put $\mu= k^2 \lambda$, and let $u_\mu: \mathbb{R} \to \mathbb{R}$ denote the unique solution of the initial value problem \begin{equation} \label{eq:v-k-initial-vu} u_\mu'' + (1-\mu) u_\mu =0\qquad u_\mu( \pm (2m+1)\pi)= \mp (2m+1)\pi \end{equation} together with $$u'_\mu(\pm (2m+1)\pi)=0.$$ Then \begin{align}\label{eq:v-k-initial-vurelation} u_\mu(t)\equiv u (\mu, t)\quad \textrm{and}\quad U_k(t)= u (k^2 \lambda, t). \end{align} \subsection*{The case $\mu =1$} In this case the \eqref{eq:v-k-initial-vu} reads $$ u_\mu'' =0\qquad u_\mu( \pm (2m+1)\pi)= \mp (2m+1)\pi, $$ together with $$u'_\mu(\pm (2m+1)\pi)=0.$$ A fundamental system of the linear equation is given by $$ \phi_1^\mu(t)= 1 , \qquad \phi_2^\mu(t)=t, $$ and we have $u_\mu(t) =-t$ and $u'_\mu(\mp (2m+1)\pi)) =-1< 0$. Therefore, $u_\mu$ is not solution to \eqref{eq:v-k-initial-vu}. \subsection*{The case $0 \le \mu < 1$.} In this case, a fundamental system of the linear equation is given by $$ \phi_1^\mu(t)= \cos (\sqrt{1-\mu}t), \qquad \phi_2^\mu(t)= \sin (\sqrt{1-\mu}t) $$ and $$ u_\mu (t) =A\cos (\sqrt{1-\mu}t)+B \sin (\sqrt{1-\mu}t) $$ for some real constants $A$ and $B$. Since we are looking for an odd function, we must have $u_\mu (0)=0$, which implies $A=0$. Hence \begin{equation} \label{eq:v-k-change solu22} u_\mu (t) =B \sin (\sqrt{1-\mu}t). \end{equation} In the special case $\mu = 0$, we get $$ u_\mu(t) = B \sin t.$$ But then $ u_\mu ((\mp (2m+1)\pi))) =0\ne \mp (2m+1)\pi, $ meaning we have no solution in this case.\\ In the general case $\mu \in (0,1)$,\\ If $\sqrt{1-\mu}(2m+1)$ is an integer, we see with \eqref{eq:v-k-change solu22} that $ u_\mu ((\mp (2m+1)\pi))) =0\ne \mp (2m+1)\pi $ and we have no solution.\\ We therefore assume that $\sqrt{1-\mu}(2m+1)$ is not an integer. Then the conditions $u_\mu( \pm (2m+1)\pi)= \mp (2m+1)\pi$ with \eqref{eq:v-k-change solu22} yield $$ u_\mu(t)= -\frac{(2m+1)\pi}{\sin (\sqrt{1-\mu}(2m+1)\pi)} \sin (\sqrt{1-\mu}t) $$ and $$ u'_\mu((2m+1)\pi)= -\frac{(2m+1)\pi\sqrt{1-\mu}}{\sin (\sqrt{1-\mu}(2m+1)\pi)} \cos (\sqrt{1-\mu}(2m+1)\pi). $$ Consequently $$ u'_\mu((2m+1)\pi)=0 $$ iff and only if \begin{align}\label{seqofzeroes} \sqrt{1-\mu}(2m+1)= \frac{1}{2}+\ell, \quad \ell \in \mathbb{N}. \end{align} Since $\mu \in (0,1)$, $ \sqrt{1-\mu}< 1$ and hence $ 0\leq \ell \leq 2m$. For $m=0$ and $\mu \in (0,1)$, $\sqrt{1-\mu}$ is not an integer and $\sqrt{1-\mu}=\frac{1}{2}+\ell$ if and only if $\ell=0$ and \begin{align}\label{eqmequqls0} \mu=\frac{3}{4}. \end{align} \subsection{The case $\mu>1$.} A fundamental system of the linear equation is then given by $$ \phi_1^\mu(t)= e^{-\sqrt{\mu -1}t}, \qquad \phi_2^\mu(t)= e^{\sqrt{\mu -1}t} $$ and \begin{equation} \label{eq:v-k-change solution3} u_\mu(t)=-\frac{(2m+1)\pi}{\sinh (\sqrt{1-\mu}(2m+1)\pi)} \sinh (\sqrt{1-\mu}t) \end{equation} and \begin{equation} \label{eq:v-k-change solution3} u'_\mu(t)=-\frac{(2m+1)\pi\sqrt{1-\mu}}{\sinh (\sqrt{1-\mu}(2m+1)\pi)} \cosh (\sqrt{1-\mu} (2m+1)\pi)) <0.\\\\ \end{equation} \subsection{Computation of the kernel}\label{seckernel} Summarizing what we have got so far, for every $m\in \mathbb{N}$, \eqref{seqofzeroes} yields strictly decreasing sequence of $(\mu_\ell(m))_{0\leq \ell \leq 2m}$ made of zeroes of the function \begin{align}\label{eq:grapheigen} V: \mu \longmapsto u'_\mu((2m+1)\pi), \end{align} and such that \begin{align}\label{eq:foroodin1} u_{ \ell}(t)= -(-1)^\ell (2m+1)\pi \sin (\sqrt{1-\mu_\ell(m)}t) \end{align} is solution to \eqref{eq:v-k-initial-vu}. Moreover, for each ${0\leq \ell \leq 2m}$, $ \mu_\ell(m)\in (0, 1)$ and \begin{align}\label{seqofzeroes2} \mu_\ell(m)&=1-\frac{1}{4}\Bigl( \frac{1+2\ell }{1+2m}\Bigl)^2=\frac{\Bigl(1+2(2m-\ell))\bigl)\Bigl(3+2(2m+\ell))\bigl)}{4\Bigl(1+2m \Bigl)^2}. \end{align} Recalling \eqref{eq:v-k-initial-vurelation} it follows that for a suitable $\lambda>0$, the kernel of the operator $D F_\lambda(0,0)$ is determined by finding the functions $ U_k$, where the integers $k$ satisfy the restriction \begin{align}\label{eq:foroofc1} 0<k^2 \lambda<1. \end{align} Together with \begin{align}\label{eq:foroofc21} k^2 \lambda = \mu_\ell(m), \quad \textrm{for some }\quad {0\leq \ell \leq 2m} \end{align} Now choose any $0 \leq \ell_0 \leq 2m$ and take $\lambda= \mu_{\ell_0}(m)$. Then \eqref{eq:foroofc21} we are led to finding the $k$'s such that \begin{align}\label{eq:foroofc22} k^2 = \frac{\mu_\ell(m)}{\mu_{\ell_0}(m)}=\frac{\Bigl(1+2(2m-\ell)\bigl)\Bigl(3+2(2m+\ell)\bigl)}{\Bigl(1+2(2m-\ell_0)\bigl)\Bigl(3+2(2m+\ell_0))\bigl)} \quad \textrm{for some }\quad {0\leq \ell \leq 2m}. \end{align} Since the sequence $(\mu_\ell(m))_{0\leq \ell \leq 2m}$ is strictly decreasing, $\frac{\mu_\ell(m)}{\mu_{\ell_0}(m)}< 1 \quad \textrm{for every }\quad {\ell >\ell_0}$. So we might assume in \eqref{eq:foroofc22} that $\ell \leqslant \ell_0$.\\ Obviously $k=1$ for $\ell =\ell_0$. For $\ell < \ell_0$, we check that the ratio in the right hand side of \eqref{eq:foroofc22} is not an integer. Indeed, if there exists some $\ell < \ell_0$ such that $$\frac{\Bigl(1+2(2m-\ell)\bigl)\Bigl(3+2(2m+\ell)\Bigl)}{\Bigl(1+2(2m-\ell_0)\bigl)\Bigl(3+2(2m+\ell_0)\Bigl)}\in \mathbb{N}.$$ Then $(3+2(2m+\ell_0))$ must divide at least one of the factors $(1+2(2m-\ell))$ or $(1+2(2m-\ell_0))$. \\ If $(3+2(2m+\ell_0))$ divides $(1+2(2m-\ell))$, necessarily $(3+2(2m+\ell_0))\leqslant (1+2(2m-\ell))$. That is $2+2\ell_0\leqslant -2\ell$. If $(3+2(2m+\ell_0))$ divides $(3+2(2m+\ell))$, the same argument implies the inequality $ \ell_0 \leqslant \ell$, which is in contradiction with that assumption $\ell < \ell_0$.\\ We can therefore derive from \eqref{eqinroU} and \eqref{eq:foroodin1} the that for all $0 \leq \ell \leq 2m$, the kernel of the operator $D F_{\mu_{\ell}}(0,0)$ is one-dimensional and spanned by $(v_\ell,g_\ell)$ with $$ v_\ell (x,t)= w_{\mu_\ell(m)}(t)\cos x, \qquad g_\ell(x)=\cos x, $$ with $$w_{\mu_\ell(m)}(t)= -(-1)^\ell(2m+1)\pi \sin (\sqrt{1-\mu_\ell(m)}t)-t\cos (t) $$ and $$\sqrt{1-\mu_\ell(m)}(2m+1)=\frac{1}{2}+\ell.$$ We underline that the particular case $m=0$ gives $\mu_0=\frac{3}{4}$ and the kernel of $D F_{\mu_0}(0,0)$ spanned by $(v_0,g_0)$ with $$ v_0(x,t)= w_{\mu_*}(t)\cos x, \qquad g_0(x)=\cos x, $$ with $$ w_{\mu_*}(t)= -\pi \sin (t/2)-t\cos (t). $$ We also observe from \eqref{seqofzeroes2} that $\mu_m(m)=\frac{3}{4}$ and therefore, \begin{align}\label{eq:forfixed m} \mu_\ell(m) \geqslant \mu_{m}(m) =\frac{3}{4} \quad \textrm{ for all}\quad 0 \leq \ell \leq m. \end{align} In the next section, we gather the required assumptions to apply the bifurcation result from simple eigenvalues of Crandall-Rabinowitz to prove existence of branches of solution to the equation \eqref{eq to bifurcate}. \section{Properties of the linearized operator}\label{Spectral} In this section, we analyse the operator $DF_{\mu_\lambda}(0,0)$ and gather the assumptions that enable us to apply the Crandall-Rabinowitz bifurcation theorem. \\ In the following, we choose $\ell$ between $0$ and $2m$ and let $$\ker(DF_{\mu_\ell(m)}(0,0))^{\perp}\subseteq X_2\times Y_2\subseteq L^2_{p,e}((-\pi,\pi)\times (-(2 m+1) \pi, (2 m+1) \pi) )$$ be the complement of $DF_{\mu_\ell(m)}(0,0)$ with respect to the scalar product \nolinebreak \begin{equation}\label{scalar-product} \langle(v,g),(w,h)\rangle:=\int_{(-\pi,\pi)\times (-(2 m+1) \pi, (2 m+1) \pi) }v(x,t)w(x,t)\,dxdt+\int_{(-\pi,\pi)}g(x)h(x)dx. \end{equation} Next we consider the restriction mapping $$ DF_{\mu_\ell(m)}(0,0): \ker(DF_{\mu_\ell(m)}(0,0))^{\perp}\ni(w,h)\mapsto DF_{\mu_\ell(m)}(0,0) \cdot\left[ {\begin{array}{cc} w \\ h\\ \end{array} } \right] \in X_0 \times Z_2 $$ and set \begin{align}\label{MatriF} A(w)(x):&= \int_{(-\pi_m,\pi_m)}t\cos(t)\partial_{xx}w(x,t)\,dt, \quad &B(w)(x): = \int_{(-\pi_m,\pi_m)}\sin(t)w(x,t)\,dt \nonumber\\ \mathcal{L}(z)\cdot v:&= \int_{(-\pi,\pi)}v_t (x,\pi_m) z(x)\,dx, \quad & \mathcal{C}(w) \cdot v:= 2\int_{(-\pi,\pi)}v_t (x,\pi_m) w(x,\pi_m)\,dx \nonumber\\ \mathcal{K}(z)\cdot g:& = -\int_{(-\pi,\pi)}g(x)z(x)\,dx. \end{align} With these notations, we have \begin{Lemma}\label{lemorthoKer} Let $(v,g)\in \ker(DF_{\mu_\ell(m)}(0,0))^{\perp}$ and $(w,z)\in X_0\times Z_2$. Then, \begin{align}\label{op:adjoint} \Big\langle DF_{\lambda}(0,0)\left[ {\begin{array}{cc} v \\ g\\ \end{array} } \right],\left[ {\begin{array}{ccc} w \\ z\\ \end{array} } \right]\Big\rangle &=\Big\langle\left[ {\begin{array}{ccc} \id+\lambda \partial_{xx}+\partial_{tt}+ \mathcal{C} & \mathcal{ L} \\ \lambda A-2B & \mathcal{K} \\ \end{array} } \right]\left[ {\begin{array}{cc} w \\ z\\ \end{array} } \right],\left[ {\begin{array}{cc} v \\ g\\ \end{array} } \right]\Big\rangle. \end{align} Moreover for every \textrm{$ 0\leq \ell \leq 2m$}, we have \begin{align}\label{decompol1} X_0\times Z_2= DF_{\mu_\ell(m)}(0,0)\Big(\ker(DF_{\mu_\ell(m)}(0,0))^{\perp}\Big)\oplus E_\ell, \end{align} where \begin{equation} E_\ell := \spann\big(\overline w^\ell,\overline z^\ell \big)=\{a(\overline w^\ell,\overline z^\ell): a\in\mathbb{R}\},\end{equation} and \begin{align}\label{eqdisolcokernell} \overline w^\ell(x,t):= \sin (\sqrt{1-\mu_\ell(m)}t)\cos (x)\quad \textrm{and} \quad \overline z^\ell(x):= -2(-1)^\ell\cos (x). \end{align} \end{Lemma} \noindent{{\bf Proof. }} Let $(v,g)\in \ker(DF_{\mu_\ell(m)}(0,0))^{\perp}$ and $(w,z)\in X_0\times Z_2$. To shorten we let $\pi_m:= (2 m+1) \pi$. Then \begin{align*} & \Big\langle DF_{\lambda}(0,0)\left[ {\begin{array}{cc} v \\ g\\ \end{array} } \right],\left[ {\begin{array}{cc} w \\ z\\ \end{array} } \right]\Big\rangle\nonumber\\ &=\int_{(-\pi,\pi)\times (-\pi_m,\pi_m) }\big(v+\lambda v_{xx}+v_{tt}-2g(x)\sin(t)+\lambda g''(x)t\cos(t)\big)w(x,t)\,dxdt\nonumber\\ % &+\int_{(-\pi,\pi)}\bigl(v_t(x, \pi_m)-g(x)\bigl)z(x)\,dx \end{align*} Performing an integration by parts, we find \begin{align*} &\Big\langle DF_{\lambda}(0,0)\left[ {\begin{array}{cc} v \\ g\\ \end{array} } \right],\left[ {\begin{array}{ccc} w \\ z\\ \end{array} } \right]\Big\rangle \\ &= \int_{(-\pi,\pi)\times (-\pi_m,\pi_m) }w(v+\lambda v_{xx}+v_{tt})\,dxdt+\l\int_{(-\pi,\pi)\times (-\pi_m,\pi_m) }t\cos(t)g(x)w_{xx}(x,t)\,dxdt\\ % &-2\int_{(-\pi,\pi)\times (-\pi_m,\pi_m) }\sin(t)g(x)w(x,t)\,dxdt+\lambda \int_{-\pi_m}^{\pi_m} (wv_x-vw_x)\Big|_{-\pi}^{+\pi}dt+\int_{-\pi}^\pi(v_tw-w_tv)\Big|_{-\pi_m}^{+\pi_m}dx\\ % &+\lambda \int_{-\pi_m}^{+\pi_m}t\cos(t)(g'w-gw_x)\Big|_{-\pi}^{+\pi}dt+\int_{(-\pi,\pi)}\bigl(v_t(x, \pi)-g(x)\bigl)z(x)\,dx\\ % &=\int_{(-\pi,\pi)\times (-\pi_m,\pi_m) }v(w+\lambda w_{xx}+w_{tt})\,dxdt+\int_{-\pi}^{\pi}g(x)\big(\l A(w)-2B(w)\big) dx\\ % &+\int_{(-\pi,\pi)}\bigl(v_t(x, \pi_m)-g(x)\bigl)z(x)\,dx+2\int_{-\pi}^\pi v_t (x,\pi_m) w(x,\pi_m) dx+S(w,v,g)\\ % &=\Big\langle\left[ {\begin{array}{ccc} \id+\lambda \partial_{xx}+\partial_{tt}+ \mathcal{C} & \mathcal{ L} \\ \lambda A-2B & \mathcal{K} \\ \end{array} } \right]\left[ {\begin{array}{cc} w \\ z\\ \end{array} } \right],\left[ {\begin{array}{cc} v \\ g\\ \end{array} } \right]\Big\rangle+S(w,v,g)\\ % &=\Big\langle\mathcal{F}_\lambda \left[ {\begin{array}{cc} w \\ z\\ \end{array} } \right],\left[ {\begin{array}{cc} v \\ g\\ \end{array} } \right]\Big\rangle+S(w,v,g), \end{align*} where we have used \eqref{MatriF} and $S(w,v,g)$ is given by \begin{align*} S(w,v,g):& = \l \int_{-\pi_m}^{\pi_m}(w\partial_x v-v\partial_xw)\Big|_{-\pi}^{+\pi}dt+\l \int_{-\pi_m}^{\pi_m}t\cos(t)(g'w-gw_x)\Big|_{-\pi}^{+\pi}dt\\ &-2\int_{(-\pi,\pi)}v(x, \pi_m)w_t (x,\pi_m) \,dx. \end{align*} Since $v=0$ on $\partial\O$, $\partial_xw,\partial_xv$ and $g'$ are $2\pi$ periodic, and $w$ is even in $x$ and $t$, it follows that $S(w,v,g)=0$. Therefore we have \begin{equation}\label{adjoint-op} \Big\langle DF_{\lambda}(0,0)\left[ {\begin{array}{cc} v \\ g\\ \end{array} } \right],\left[ {\begin{array}{cc} w \\ z\\ \end{array} } \right]\Big\rangle = \Big\langle \mathcal{F}_\lambda \left[ {\begin{array}{cc} w \\ z\\ \end{array} } \right],\left[ {\begin{array}{cc} v \\ g\\ \end{array} } \right]\Big\rangle. \end{equation} This proves \eqref{op:adjoint}.\\ To prove the splitting \eqref{decompol1}, we let $(\overline w,\overline z)$ such that $ \mathcal{F}_\lambda \left[ {\begin{array}{cc} \overline w \\ \overline z\\ \end{array} } \right] = 0$, that is \begin{equation}\label{kernel-adjoint-op} \left\{\begin{aligned} \overline w+\l \partial_{xx}\overline w+\partial_{tt}\overline w+ \mathcal{C}(\overline w)+ \mathcal{ L}(\overline z&)=0 \\ \l A(\overline w)-2B(\overline w)+\mathcal{K}(\overline z&)= 0. \end{aligned} \right. \end{equation} We claim that \begin{equation}\label{Claim B8} \textit{The PDEs in \eqref{kernel-adjoint-op} is uniquely solvable in $X_2\times Y_2$ (up to a multiplicative constant).} \end{equation} Indeed writing $\overline w$ and $\overline z$ in the form $$ \overline w = \sum_{k\geq 0}\overline w_k(t)\cos(kx)\quad\text{and}\quad \overline z = \sum_{k\geq 0}\overline z_k\cos(kx) $$ the second equation in \eqref{kernel-adjoint-op} reads \begin{equation}\label{B18} \l \int_{-\pi_m}^{\pi_m}t\cos(t)\partial_{xx}\overline w(x,t)\,dt-2\int_{-\pi_m}^{\pi_m}\sin(t)\overline w(x,t)\,dt+\mathcal{K}(\overline z) = 0,\qquad x\in(-\pi,\pi). \end{equation} Next we apply $g(x)=\cos(kx)$ to \eqref{B18} and integrate (by using Fubini Theorem) to get \begin{equation}\label{B19} \int_{-\pi_m}^{\pi_m}\big(k^2\l t\cos(t)+2\sin(t)\big)\overline w_k(t)\,dt+\overline z_k=0. \end{equation} Similarly we apply the first equation in \eqref{kernel-adjoint-op} to $v(x,t)=\cos(kx)$ and integrate to find \begin{equation}\label{B20} \overline w_k''(t)+(1-k^2\l )\overline w_k(t)=0. \end{equation} Next we apply it again to $v(x,t)=\sin(t)\cos(kx)$ and derive \begin{equation} \label{Bz0} \overline z_k =-2\overline w_k (\pi_m). \end{equation} We set $\mu:= k^2\l= k^2\mu_\ell(m)$. Then If $\mu =1$, then the solution $\overline w(t)$ to the equation \begin{equation}\label{B200} \overline w ''(t)+(1-\mu )\overline w(t)=0. \end{equation} is given by $\overline w=A t$ and integrating by parts, we see with \eqref{Bz0} that $A=0$. \\ If $0 \leqslant \mu < 1$, the general solution of the equation \eqref{B20} is given by \begin{align}\label{C444} \overline w (t)=B \sin (\sqrt{1-\mu}t), \end{align} for some real constant $B$ and we deduce \begin{align}\label{C45} \overline z_k =-2 B \sin (\sqrt{1-\mu }\pi_m). \end{align} To check if $\overline w$ and $ \overline z$ satisfy \eqref{B19}, we rewrite this condition in term of $\mu$.\\ We set $\xi:=\sqrt{1-\mu}$. Then a straightforward computation allows to get \begin{align}\label{C23} \int_{0}^{\pi_m} \sin(t) \sin(\xi t) \,dt&= \frac{1}{2}\int_{0}^{\pi_m} \Bigl( \cos((1-\xi)t) - \cos((1+\xi)t) \,dt=\frac{1}{\mu} \sin(\xi \pi_m). \end{align} We also have \begin{align}\label{C22} \int_{0}^{\pi_m}\big(\mu t\cos(t) \sin(\xi t) \,dt&=\frac{\mu}{2}\int_{0}^{\pi_m} t\Bigl( \sin((1+\xi)t) - \sin((1-\xi)t)\Bigl) \,dt\nonumber\\ &=\frac{\mu \pi_m}{2} U(\pi_m)-\frac{2-\mu}{\mu} \sin(\xi \pi_m), \end{align} where the last line follows after integrating by parts and $$ U(t)=-\frac{1}{1+\xi} \cos((1+\xi)t) + \frac{1}{1-\xi} \cos((1-\xi)t)\quad \textrm{and}\quad U(\pi_m)= -\frac{2\sqrt{1-\mu} }{\mu}\cos(\sqrt{1-\mu} \pi_m).$$ Gathering \eqref{C23} and \eqref{C22}, it follows that \begin{equation}\label{B09} \int_{-\pi_m}^{\pi_m}\big(\mu t\cos(t)+2\sin(t)\big)\sin(\xi t)\,dt = 2\sin(\sqrt{1-\mu} \pi_m)-2\sqrt{1-\mu} \pi \cos(\sqrt{1-\mu} \pi_m). \end{equation} This with \eqref{C45} give \begin{equation}\label{Bverified} B \int_{-\pi_m}^{\pi_m} \big(\mu t\cos(t)+2\sin(t)\big)\sin(\xi t)\,dt+\overline z_k = -2B\sqrt{1-\mu} \pi_m \cos(\sqrt{1-\mu} \pi_m). \end{equation} It is plain from \eqref{Bverified} that $B=0$ for $\mu=0$. In this case the solution of \eqref{kernel-adjoint-op} given \eqref{C444} and \eqref{C45} is trivial. In particular $\overline z_0=0$ and $\overline w_0=0$. Furthermore, we see with \eqref{Bverified} that the condition \eqref{B19} is fulfilled with $B\ne 0$ if and only if \begin{equation}\label{Bverified2} k^2\mu_\ell(m)=\mu_{\bar{\ell}}(m) \quad\textrm{ for some $0\leqslant \bar{\ell}\leqslant 2m$}, \end{equation} which from the analysis in Subsection \ref{seckernel} is equivalent to $k=1$.\\ To complete the proof, we show that $\overline z_k=0$ and $\overline w_k=0$ for every $k\geqslant2$. To see this, we distinguish two cases:\\ If $k\geqslant2$ is such that $\mu=k^2\mu_\ell(m)<1$, then from the argument following \eqref{Bverified2}, we must have $B=0$.\\ Now if $k\geqslant2$ is such that $\mu=k^2\mu_\ell(m)>1$, then the general solution of \eqref{B20} in this case is given by $$ \overline w_k(t)=A \bigl( e^{\mu (k) t}-e^{-\mu (k)t}\bigl)=2 A \sinh (\mu (k) t),$$ where $$\mu (k):=\sqrt{k^2 \mu_{\ell}(m)-1}.$$ Using \cite[Page 231, $1.$]{I.S.I.M}, we find \begin{align}\label{B22} &\int_{0}^{\pi_m}\sin(t) \sinh (\mu (k) t)\,dt =\frac{1}{1+\mu (k)^2} \sinh (\mu (k) \pi_m). \end{align} Also \cite[Page 230, $6.$]{I.S.I.M} yields, \begin{align} \int_{0}^{\pi_m}\big(t\cos(t) e^{\mu (k) t}\,dt &=\frac{1}{1+\mu (k)^2}\Bigl[e^{\mu (k)\pi_m} \Bigl( \frac{\mu (k)^2-1}{1+\mu (k)^2} -\mu (k) \pi_m \Bigl)+\frac{\mu (k)^2-1}{1+\mu (k)^2}\Bigl],\nonumber\\ \int_{0}^{\pi_m}\big(t\cos(t) e^{-\mu (k) t}\,dt &=\frac{1}{1+\mu (k)^2}\Bigl[e^{-\mu (k)\pi_m} \Bigl( \frac{\mu (k)^2-1}{1+\mu (k)^2} +\mu (k) \pi_m \Bigl)+\frac{\mu (k)^2-1}{1+\mu (k)^2}\Bigl],\nonumber \end{align} so that \begin{align} \int_{0}^{\pi_m} \mu t \cos(t) \sinh (\mu (k) t)\,dt =\frac{\mu}{1+\mu (k)^2}\Bigl[ \Bigl( \frac{\mu (k)^2-1}{1+\mu (k)^2} \Bigl) \sinh (\mu (k) \pi_m) -\mu (k) \pi_m \cosh (\mu (k) \pi_m)\Bigl)\Bigl], \end{align} and \begin{align}\label{B32} &\int_{-\pi_m}^{\pi_m}\big(\mu t\cos(t)+2\sin(t)\big) \sinh (\mu (k) t)\,dt\nonumber\\ &=\frac{2}{1+\mu (k)^2}\Bigl[ \mu\Bigl( \frac{\mu (k)^2-1}{1+\mu (k)^2} \Bigl)+ 2 \Bigl) \sinh (\mu (k) \pi_m) -\mu \mu (k) \pi_m \cosh (\mu (k) \pi_m)\Bigl)\Bigl]\nonumber\\ &=2\Bigl(\sinh (\mu (k) \pi_m)-\mu (k) \pi_m \cosh (\mu (k) \pi_m)\Bigl). \end{align} From this \begin{align}\label{B32} \int_{-\pi_m}^{\pi_m}\big(\mu t\cos(t)+2\sin(t)\big) \overline w_k(t)&=2A \int_{-\pi_m}^{\pi_m}\big(\mu t\cos(t)+2\sin(t)\big)\sinh (\mu (k) t)\,dt+\overline z_k \nonumber\\ &=4A \Bigl(\sinh (\mu (k) \pi_m)-\mu (k) \pi_m \cosh (\mu (k) \pi_m )\Bigl)-4A \sinh (\mu (k) \pi_m)\nonumber\\ &=-4A\mu (k) \pi_m \cosh (\mu (k) \pi_m) \end{align} and we deduce that $A=0.$ Next, if $k\geqslant2$ is such that $\mu=k^2\mu_\ell(m)=1$, we already know from the argument following \eqref{B200} that the corresponding $\overline w_k$ vanishes. Gathering all the steps, we get $\overline z_k=0$ and $\overline w_k=0$ for every $k\geqslant2$.\\ Finally, the solution $\overline w$ to \eqref{kernel-adjoint-op} is given by \begin{align}\label{eqdisolcokernell} \overline w^\ell(x,t):= \sin (\sqrt{1-\mu_\ell(m)}t)\cos (x)\quad \textrm{and} \quad \overline z^\ell(x):= -2(-1)^\ell\cos (x) \end{align} and setting \begin{equation} E_\ell := \spann\big(\overline w^\ell,\overline z^\ell \big)=\{a(\overline w^\ell,\overline z^\ell): a\in\mathbb{R}\},\end{equation} we obtain \eqref{decompol1}. \hfill {$\square$}\goodbreak \medskip \begin{Proposition}\label{propPhlinearop} Let \textrm{$ 0\leq \ell \leq 2m$}. Then the linear operator $$ {\mathcal H}_\ell:=DF_{\mu_\ell(m)}(0,0): X_2 \times Y_2 \to X_0 \times Z_2 $$ has the following properties: \begin{itemize} \item[(i)] The kernel $N({\mathcal H}_\ell)$ of ${\mathcal H}_\ell$ is spanned $(v_\ell,g_\ell)$ with \begin{equation}\label{eq:kernel} v_\ell (x,t)= w_{\mu_\ell(m)}(t)\cos x, \qquad g_\ell(x)=\cos x, \end{equation} with $$w_{\mu_\ell(m)}(t)= -(-1)^\ell(2m+1)\pi \sin (\sqrt{1-\mu_\ell(m)}t)-t\cos (t) $$ and $$\sqrt{1-\mu_\ell(m)}(2m+1)=\frac{1}{2}+\ell.$$ \item[(ii)] The range of ${\mathcal H}_\ell$ is given by $$ R({\mathcal H}_\ell)= \left\lbrace (v,g)\in X_0\times Z_2: \int_{(-\pi,\pi)\times(-\pi_m,\pi_m) }\overline w_\ell(x,t)v(x,t)\,dxdt+\int_{(-\pi,\pi)}\overline z_\ell(x)g(x)dx=0\right\rbrace, $$ \end{itemize} with \begin{equation}\label{eq:for image} \overline w_\ell(x,t):=\sin (\sqrt{1-\mu_\ell(m)}t)\cos (x)\quad \textrm{and} \quad \overline z_\ell(x):=-2(-1)^\ell\cos (x). \end{equation} Moreover, \begin{equation} \label{eq:transversality-cond4} \partial_\lambda \Bigl|_{\lambda=\mu_\ell(m) }DF_{\l}(0,0)(v_\ell,g_\ell)\not \in \; R({\mathcal H}_\ell).\\ \end{equation} \end{Proposition} The remaining part of the paper is to prove Proposition \ref{propPhlinearop}. \\ \noindent{{\bf Proof. }} The proof of $(i)$ is already done at the end of Section \ref{exkus}. Moreover, the mapping $DF_{\mu_\ell(m) }(0,0)$ is injective. To prove $(ii)$ we first observe from \eqref{decompol1} in Lemma \ref{lemorthoKer} that \begin{equation} Im\Big(DF_{\mu_\ell(m) }(0,0)\Big)\subseteq E_\ell^{\perp}, \end{equation} where \begin{equation} E_\ell^{\perp} := \left\lbrace (v,g)\in X_0\times Y_2: \int_{(-\pi,\pi)\times (-\pi_m,\pi_m) }\overline w^\ell(x,t)v(x,t)\,dxdt+\int_{(-\pi,\pi)}\overline z^\ell(x)g(x)dx=0\right\rbrace. \end{equation} Now we will prove that the mapping \begin{equation} DF_{\mu_\ell(m)}(0,0): \ker(DF_{\mu_\ell(m)}(0,0))^{\perp}\longrightarrow E_\ell^{\perp} \end{equation} is surjective. \\ By Fredholm alternative theorem, for any $(v,z)\in X_0\times Z_2$, the PDEs \begin{equation}\label{eq-solvability} DF_{\mu_\ell(m)}(0,0)\cdot\left[ {\begin{array}{cc} w \\ h\\ \end{array} } \right] = (v,z) \end{equation} is solvable in $L^2_{p,e}(-\pi,\pi)\times L^2_{p,e}(-\pi_m,\pi_m)$ in the sense of distribution. Moreover by using Fourier method, it is not also difficult to show that if $v$ and $g$ are both periodic, then one can find a solution $(w,h)$ that is also periodic. By elliptic regularity we have $(w,h)\in C^{2,\alpha}_{p,e}(\overline\O_*)\times C^{2,\alpha}_{p,e}(\mathbb{R})$. Indeed, letting $$U(x,t):=w(x,t)+h(x)t\cos(t),$$ a direct calculation gives \begin{equation} DF_{\mu_\ell(m)}(0,0)\cdot\left[ {\begin{array}{cc} w \\ h\\ \end{array} } \right] = (v,z)\Longleftrightarrow \left\{\begin{aligned}\label{eqregul2} \mathcal{ L}_{\mu_\ell(m)}U+U&=v \quad\text{in}\quad \O_*\\ U&= \mp \pi_m h \quad\text{on}\quad \partial\O_*^{\mp}\\ \partial_\nu U &= z \quad\text{on}\quad \partial\O_*, \end{aligned} \right. \end{equation} with $\mathcal{ L}_{\mu_\ell(m)}=\mu_\ell(m)\partial_{xx}+\partial_{tt}$. We now have $\partial_\nu U = z\in C^{1,\alpha}(\mathbb{R})$ and by classical elliptic regularity, we deduce that $ U\in C^{2,\alpha}(\overline \O_*)$. There result from $U= \mp \pi_m h$ on $\partial\O_*^{\mp}$ that $ h \in C^{2,\alpha}(\mathbb{R})$ and also $ w\in C^{2,\alpha}(\overline \O_*)$. Finaly, we observe that the functions $(x, t)\mapsto -U(x,-t)$ and $(x, t)\mapsto \frac{1}{2}\left\lbrace U(x,t)+U(-x,t) \right\rbrace$ also solve the equation \eqref{eqregul2}. In particluar $U$ is odd in $t$, which implies that $w$ is odd in $t$. In addition, $U$ in $x$ and we deduce from $U= \mp \pi_m h$ on $\partial\O_*^{\mp}$ that $h$ and $w$ are even in $x$. \\ We complete the proof, we have to check \eqref{eq:transversality-cond4}. That is \begin{equation} \frac{d}{d\l}_{\Big|\l=\mu_\ell(m)}DF_\l(0,0)\left[ {\begin{array}{cc} v_\ell \\ g_\ell\\ \end{array} } \right]\notin E_\ell^\perp, \end{equation} $$ v_\ell (x,t)= w_{\mu_\ell(m)}(t)\cos x, \qquad g_\ell(x)=\cos x, $$ with $$w_{\mu_\ell(m)}(t)= -(-1)^\ell(2m+1)\pi \sin (\sqrt{1-\mu_\ell(m)}t)-t\cos (t) $$ and $$\sqrt{1-\mu_\ell(m)}(2m+1)=\frac{1}{2}+\ell.$$ Following \eqref{eq diffope2}, we set $$ U_\ell(x,t):=v_\ell(x,t)+ g_\ell(x)t \cos (t)= -(-1)^\ell\pi_m \sin (\sqrt{1-\mu_\ell(m)}t)\cos x. $$ Then $$ D F_{\lambda}(0,0)(v_\ell, g_\ell)= \Bigl((\lambda-\mu_\ell(m))(-1)^\ell\pi_m \sin (\sqrt{1-\mu_\ell(m)}t)\cos x, 0 \Bigl) $$ and \begin{align} &\Big<(\overline w^\ell,\overline z^\ell),\Bigl((-1)^\ell\pi_m \sin (\sqrt{1-\mu_\ell(m)}t)\cos x, 0 \Bigl)\Big>_{L^2((-\pi,\pi)\times (-\pi_m,\pi_m)} \nonumber\\ &= (-1)^\ell\pi_m \int_{(-\pi,\pi)\times (-\pi_m,\pi_m) }\cos^2(x) \sin^2 (\sqrt{1-\mu_\ell(m)}t)\,dxdt= (-1)^\ell \pi \pi^2_m\ne 0. \end{align} \hfill {$\square$}\goodbreak \medskip \section{Solving problem \eqref{eq:Proe11} }\label{eq:ProofTheo1} In this section we complte the proof of Theorem \ref{Strip1}. \noindent {\bf Proof of Theorem \ref{Strip1} (completed).} Recalling \eqref{eq:maptFF}, the proof of Theorem \ref{Strip1} will be established by applying the Crandall-Rabinowitz Bifurcation Theorem to solve the equation \begin{align}\label{eq:maptFsolvF} F_\lambda(u,h)= (L_\lambda^{1+h} (u+u_*), \widetilde{ Q } (u,h))=(0,0). \end{align} where $(u,h)\in X_2 \times Y_2^+$ and $u_*(x,t)= \sin (t)$. As already observed in Section \ref{eq.setting}, if \eqref{eq:maptFsolvF} holds, then the function $\tilde u = u_* + u$ solves the problem $(Q)$ in \eqref{eq:Proe11}.\\ To solve equation \eqref{eq:maptFsolvF}, we fix $\ell $ betweeen $ 0$ and $2m$, and consider the operator $${\mathcal H}_\ell:=DF_{\mu_\ell(m)}(0,0).$$ in Proposition \eqref{propPhlinearop}, as well as the space \begin{align}\label{eq:spaorthokernel} \mathcal{X}_\ell^{\perp} := \left\lbrace (v,g)\in X_2 \times Y_2^+: \int_{(-\pi,\pi)\times(-\pi_m,\pi_m) }v(x,t)v_\ell(x,t)\,dxdt+\int_{(-\pi,\pi)} g(x)g_\ell(x)dx=0\right\rbrace. \end{align} By Proposition~\eqref{propPhlinearop} and the Crandall-Rabinowitz Theorem (see \cite[Theorem 1.7]{M.CR}), we then find ${\e_\ell}>0$ and a smooth curve $$ (-{\e_\ell},{\e_\ell}) \to \mathbb{R}_+ \times X_2\times Y_2^+ , \qquad s \mapsto (\lambda^\ell_s,\varphi^\ell_s, \psi^\ell_s) $$ such that \begin{enumerate} \item[(i)] $F_{\lambda_s} (\varphi_s, \psi_s)=0$ for $s \in (-{\e_0},{\e_0})$, \item[(ii)] $ \lambda^\ell_0= \mu_\ell(m)$, and \item[(iii)] $ (\varphi^\ell_s, \psi^\ell_s) = s \bigl((v_\ell,g_\ell) + (\mu^\ell_s, \kappa^\ell_s)\bigr)$ for $s \in (-\e_0,\e_0)$ with a smooth curve $$ (-{\e_0},{\e_0}) \to \mathcal{X}_\ell^{\perp}, \qquad s \mapsto (\mu^\ell_s, \kappa^\ell_s) $$ satisfying $ (\mu^\ell_0, \kappa^\ell_0)=(0,0)$ and $$\int_{(-\pi,\pi)\times(-\pi_m,\pi_m) } \mu^\ell_s v_\ell(x,t)\,dxdt+\int_{(-\pi,\pi)} \kappa^\ell_s g_\ell(x)dx=0.$$ \end{enumerate} Since $(\lambda^\ell_s,\varphi^\ell_s, \psi^\ell_s)$ is a solution to \eqref{eq:maptFsolvF} for every $s\in (-\e_0,\e_0)$, the function $$\tilde u^\ell_s = u_* + s \bigl(v_\ell + \mu^\ell_s\bigr).$$ solves the overdetermined boundary value problem $(Q)$ in \eqref{eq:Proe11}. Recalling the ansatz \eqref{eqans}, the function \begin{align}\label{eqans2} v^\ell_s(x,t)= \tilde u^\ell_s(x ,(1+ s(g_\ell(x) +\kappa^\ell_s(x))t) \end{align} solves the problem (P) in \eqref{eq:perturbed-strip2} on the domain $$ \Omega^\ell_s:= \Biggl\{\Bigl(x, \frac{\t}{1+ s(g_\ell(x) +\kappa^\ell_s(x))}\Bigl)\::\: (x,\t) \in \Omega_*\Biggl\}. $$ The proof is complete. \hfill {$\square$}\goodbreak \medskip \section{Crandall-Rabinowitz bifurcation theorem} \label{eq: Cradal Rabi1} \begin{Theorem}[Crandall-Rabinowitz bifurcation theorem, \cite{M.CR}] \label{eq: Cradal Rabi} Let $X$ and $Y$ be two Banach spaces, $U\subset X$ an open set of $X$ and $I$ an open interval of $\mathbb{R}$. We assume that $0\in U$. Denote by $\varphi$ the elements of $U$ and $\lambda$ the elements of $I$. Let $F: I\times U\rightarrow Y$ be a twice continuously differentiable function such that \begin{enumerate} \item $ F(\lambda, 0)=0\quad \textrm{ for all }\quad \lambda \in I,$ \item $\ker(D_\varphi F(\lambda_*, 0))=\mathbb{R} \varphi_*$ for some $\lambda_*\in I$ and $\varphi_*\in X\setminus \{0\}$, \item $\textrm{Codim Im}(D_\varphi F(\lambda_*, 0))=1,$ \item $D_\lambda D_\varphi F(\lambda_*, 0)(\varphi_*) \notin \textrm{Im}(D_\varphi F(\lambda_*, 0)$. \end{enumerate} Then for any complement $Z$ of the subspace $\mathbb{R} \varphi_*$, spanned by $\varphi_*$, there exists a continuous curve $$(-\e, \e)\longrightarrow \mathbb{R}\times Z, \quad s\mapsto (\lambda(s), \varphi(s))$$ such that \begin{enumerate} \item $\lambda(0)=\lambda_*, \quad \varphi(0)=0,$ \item $s(\varphi_*+\varphi (s))\in U,$ \item $F(\lambda(s), s(\varphi_*+\varphi (s))=0$. \end{enumerate} Moreover, the set of solutions to the equation $F(\lambda, u)=0$ in a neighborhood of $(\lambda_*, 0)$ is given by the curve $\{ (\lambda, 0), \lambda\in \mathbb{R}\}$ and $\{ s(\varphi_*+\varphi (s)), s\in(-\e, \e)\}$. \end{Theorem}
7817db0c7ff9bb7a63331995154075a255336f31
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Continual learning (CL) is a practical learning scenario under a continuous and online stream of annotated data~\cite{lopez2017gem, prabhu2020gdumb, bang2021rainbow}. Due to continuously changing data distribution, the CL methods are known to suffer from the stability-plasticity dilemma due to catastrophic interference and resistance to learning new information~\cite{mccloskey1989catastrophic,goodfellow2013empirical}. In addition, when the CL model is deployed in real-world such as e-commerce applications, the annotated labels are often unreliable due to less controlled data curation process, \eg, crowd-sourcing~\cite{xu2021improving}. Although data labels are likely to be contaminated in real-world due to human errors, existing CL studies have largely assumed that the given training data has no annotation error~\cite{kirkpatrick2017ewc, prabhu2020gdumb}, which might hinder practical usages of many CL methods in real-world applications. A very recent work~\cite{kim2021continual_spr} relaxes this assumption by proposing an online CL setup under data stream with less reliable labels. However, they assume a disjoint class incremental scenario such that there is no class overlapping between task streams, which is argued as {less} practical for real-world applications in the literature~\cite{prabhu2020gdumb,bang2021rainbow}. To step forward in addressing continuously changing data distribution that can be falsely labeled, we first design a novel CL task of \textit{online continual learning on a contaminated data stream on blurry task boundaries~\cite{prabhu2020gdumb}} as a more realistic and practical continual learning scenario. Sample selection strategy is arguably important for episodic memory-based CL methods \cite{kirkpatrick2017ewc, prabhu2020gdumb, bang2021rainbow, aljundi2019online, kim2021continual_spr}. Specifically, diversity-aware sample selection policy is shown to be effective in the online blurry CL scenarios~\cite{bang2021rainbow}. However, on the contaminated data stream, diversity-based memory construction may promote to include many examples with corrupted labels in the episodic memory, leading to poor performance thanks to very high capacity of deep models to overly fit all the falsely labeled examples~\cite{zhang2021understanding}. To address this issue, we propose a unified framework of memory sampling policy with robust learning with the episodic memory and semi-supervised learning with unreliable data, named \textbf{PuriDivER\xspace} (\underline{Puri}ty and \underline{Div}ersity aware \underline{E}pisode \underline{R}eplay\xspace). Fig.~\ref{fig:overview} illustrates an overview of the proposed method to address the new CL task set-up. \begin{figure*}[t!] \centering \includegraphics[width=0.75\textwidth]{figures/overview_cvpr22.pdf} \vspace*{-0.1cm} \caption{Overview of PuriDivER\xspace for the online blurry continual learning with noisy labels, where all the tasks share classes (\ie, blurry tasks~\cite{prabhu2020gdumb}) and examples might be falsely labeled. PuriDivER\xspace updates episodic memory by balancing examples' diversity and purity, and unifies a robust training scheme based on semi-supervised learning not to be interfered by unreliable labels in the episodic memory. } \label{fig:overview} \vspace{-1em} \end{figure*} Specifically, for the memory sampling policy, we propose to construct a robust episodic memory that preserves a set of training examples that are \emph{diverse} and \emph{pure}. Unfortunately, maintaining the information diversity and purity is in \emph{trade-off}; clean examples mostly exhibit smaller losses (less diverse) than noise examples due to the memorization effect of deep neural networks~\cite{arpit2017closer, song2021robust}. Thus, emphasizing purity in memory sampling does not promote sample diversity and \emph{vice versa}. % To address the dilemma, we define a score function of promoting the label purity with an additional term to promote diversity by optimizing the sample distribution to be similar to the one with noisy examples. % In addition, we incorporate a novel robust learning scheme to further promote both purity and diversity when we use the samples from the episodic memory (Sec.~\ref{sec:sub:robustlearning}). Thus, we enforce high diversity and purity around the memory twice; by its construction and usage. Our empirical validations show that the proposed method outperforms combinations of prior arts to address the combined challenges by noticeable margins on multiple evaluations using CIFAR-10/100, WebVision and Food-101N. Our contributions are summarized as follows: \vspace{-0.5em} \begin{itemize}[leftmargin=10pt] \setlength\itemsep{-0.5em} \item Proposing the first online \emph{blurry} CL set-up with contaminated data stream, which is realistic and challenging, and establishing a strong baseline for it. \item Proposing a unified framework of considering diversity and purity in memory updates and usage strategy. \item Proposing an adaptive balancing scheme for dynamic trade-off between diversity and purity in memory sampling for addressing various noise ratio in CL. \item Proposing a semi-supervised robust learning scheme with label cleaned up samples and unreliable samples regarded as unlabeled samples. % \end{itemize} \section{Related Work} \label{sec:related_work} There is a large body of literature to address the two challenges of online CL and learning from noisy data, separately. Here, we selectively review the most relevant ones. \subsection{Task-free Blurry Online Continual Learning} Recent studies~\cite{bang2021rainbow,prabhu2020gdumb,aljundi2019gss} argue that the disjoint CL setup is less realistic but prevalent in literature and propose a new setup where task boundaries share classes, called `blurry'. While the disjoint setup assumes each task has non-overlapping classes, the blurry setup allows that all tasks possibly share the same set of classes with different class distributions. Moreover, we categorize CL methods by the way of using the data; online and offline. Offline setup allows a model to use data many times, while online setup only allows a model to observe a data stream once at the current moment, which is more difficult but practical. % Task-free setup refers to the setup that does not allow the access of task id at inference. There have been many studies on task-free online continual learning (either blurry or disjoint), which are categorized into two; \textit{1) rehearsal-based approaches}~\cite{bang2021rainbow,prabhu2020gdumb,riemer2018learning}, where episodic memory is used to store a few examples of old tasks, and \textit{2) regularization-based approaches}~\cite{kirkpatrick2017ewc,rwalk}, which regularizes neural network parameters from drastic updates for new information to preserve the information of old tasks for less forgetting. Since rehearsal-based approaches generally outperform the regularization ones, we use it. % For better rehearsal with an episodic memory, many strategies have been proposed for data sampling. Unfortunately, most of them are not suitable for the online continual learning setup except the following few. MER~\cite{riemer2018learning} applied \textit{reservoir sampling} for updating memory in online continual learning, and it can approximately optimize over the stationary distribution of all seen examples. GDumb~\cite{prabhu2020gdumb} proposed the \textit{greedy balancing sampler} such that it focuses on balancing the number of examples for each class. \textit{Rainbow memory}~\cite{bang2021rainbow} and OCS~\cite{yoon2021online} are proposed to diversified sampling by regular interval of uncertainty and constructing a `Core-Set'~\cite{sener2018coreset}, respectively. However, proposed methods assume reliable labels only. \subsection{Learning with Unreliable Labels} A number of approaches have been proposed to prevent a model from overfitting to unreliable or noisy labels. One of the typical methods is `sample selection', which trains the model for selected small-loss examples whose labels are likely to be correct. MentorNet~\cite{jiang2018mentornet} maintains a teacher network to provide the student network with the small-loss examples. Similarly, Co-teaching(+) \cite{han2018coteaching, yu2019coteachingplus} utilizes two models, where each model selects a certain number of small-loss examples and feeds them to its peer model for training. Alternatively, `re-labeling' corrects noisy labels to reliable ones. SELFIE \cite{song2019selfie} re-labels the examples by predicted labels' consistency. SEAL \cite{chen2021seal} averages the model's softmax output of each example over the whole training set. Although they utilize the entire data, when the number of classes or noise rate increases, a risk of overfitting to false labels still persists due to possible false correction. % To address this, there have been efforts to combine `semi-supervised learning' with `sample selection.' SELF \cite{nguyen2019self} progressively filters out falsely labeled examples from noisy data by using self-ensemble predictions. DivideMix \cite{berthelot2019mixmatch} fits bi-modal univariate Gaussian mixture models\,(GMMs) to the loss of training examples for sample selection, and then applied the MixMatch algorithm \cite{li2019dividemix}. However, this family of robust methods assumes the offline setup with sufficient amount of training data whereas the training data is limited in the blurry online continual learning setup. \subsection{Continual Learning with Unreliable Labels} A straightforward approach for CL with unreliable labels is combining a memory sampling method for online learning with a robust learning method for handling the unreliable labels. However, this naive integration may not resolve the combined challenge because of aforementioned trade-off between diversity and purity of the examples. Recently, SPR~\cite{kim2021continual_spr} is proposed to solve online continual learning with contaminated data via self-purifying scheme. However, the experiments are only conducted on disjoint setup that is less realistic, and there are large rooms to improve in accuracy even in that setup (see Sec. 5 in the supplementary material). In contrast, we approach this problem by constructing the episodic memory with high diversity and purity, and mitigate the potential risk of memory sampling by using a complementary robust learning approach (see Tab.~\ref{tab:dpm_ablation}) in more realistic CL scenario. \section{Task Definition} \label{sub:problem} We design a new online CL setup that is on a contaminated data stream with \emph{blurry} task boundaries following \cite{bang2021rainbow}. Let $C$ and $T$ be the number of classes and tasks, respectively. At each task $t$, the set of classes are split into a set of \emph{major classes}, $M_t$ and a set of \emph{minor classes}, $m_t$. For describing the imbalanced degree of major and minor classes, we define the hyperparameter ($L$) as the number of minor classes over the number of all the classes, and those tasks are called \textit{blurry-$L$}. Each class could be either a major class once in a certain task or a minor class in the other tasks. Formally, tasks should satisfy the following conditions: \vspace{-0.5em} \begin{equation} \begin{split} & \cup_{t=1}^{T} M_t = \cap_{t=1}^{T} M_t \cup m_t = \{1, \dots ,C\}, \\ & \cup_{i, j = 1, i \neq j}^{T}M_i \cap M_j = \varnothing. \vspace{-1em} \end{split} \end{equation} To configure blurry tasks, we split the streaming data $\mathcal{S}_t$ for the task $t$ into subsets of different classes; $\mathcal{S}_t = \{\mathcal{S}_{(t, c)} : c \in \{1, \dots ,C\} \}$. For a given task $t$, $L = |\cup_{c \in m_t} \mathcal{S}_{(t, c)}| / |\mathcal{S}_t|$, where $L$ is the specified class imbalance ratio at task $t$. In particular, in the presence of noisy labels, the streaming data {\small$\mathcal{S}_t$} for a task $t$ include falsely labeled examples, thus {\small $\mathcal{S}_t=\{(x_i, \tilde{y_i})\}_{i=1}^{|\mathcal{S}_t|}$} where $x_i$ is an example and $\tilde{y_i}$ is its noisy label which may be different from the true (\ie, not contaminated) label $y_i$. \section{Pure and Diverse Episode Replay} To address the online blurry continual learning with unreliable labels, we propose a method to construct and use the episodic memory. Specifically, we propose (1) a sampling method `diverse' exemplars from the online stream for episodic memory with label purifying scheme (Sec. \ref{sub:memory_update}), and (2) to use the `purified' diverse examples from the memory by semi-supervised learning with noisy labels for extra diversity with purity (Sec. \ref{sec:sub:robustlearning}). We call this method Purity and Diversity aware Episode Replay\xspace (\textbf{PuriDivER\xspace}). We describe a brief version of algorithm in Alg.~\ref{alg:abstract} and detailed version in the supplementary material (Sec. 1). \setlength{\textfloatsep}{7pt}% \begin{algorithm}[t] \small \caption{Purity and Diversity aware Episode Replay\xspace} \label{alg:abstract} \begin{algorithmic}[1] \State {\textbf{Input:} $\mathcal{S}_{t}$: stream data at task $t$, $\mathcal{M}$: exemplars stored in a episodic memory, $T$: the number of tasks, $\theta_0$: initial model.} \For {$t$ = 1 {\bf to} T} \For {each mini-batch $\mathcal{B} \in \mathcal{S}_{t}$} % \State{$\theta \leftarrow \theta - \alpha \nabla \sum_{i \in \mathcal{B}} \ell(\theta(x_i), \tilde{y_i})$} {\small\color{orange}\Comment{online training}} % \For {$x_i, \tilde{y_i}$ in $\mathcal{B}$} \State{Update $\mathcal{M}$ from $\mathcal{M} \cup (x_i, \tilde{y_i})$}{\small\color{orange}\Comment{Sec.~\ref{sub:memory_update}}} % \EndFor \EndFor \For {$e=1$ {\bf to} MaxEpoch} \State{Split $\mathcal{C}$, $\mathcal{R}$, $\mathcal{U}$ from $\mathcal{M}$ via Eqs.~\eqref{eq:gmm_loss} and \eqref{eq:uncertainty_loss}} \For {each mini-batch $\mathcal{B_C} \in \mathcal{C}$, $\mathcal{B_R} \in \mathcal{R}$, $\mathcal{B_U} \in \mathcal{U}$ } % % \State{$\theta \leftarrow \theta - \alpha \nabla [\ell_{cls} + \eta \ell_{reg}$]}{\small\color{orange}\Comment{Sec.~\ref{sec:sub:robustlearning}}} \EndFor \EndFor % % % % \EndFor \end{algorithmic} \end{algorithm} \subsection{Episodic Memory Construction} \label{sub:memory_update} Selecting a diverse set of examples for the episodic memory is arguably one of the beneficial steps to improve accuracy of CL model~\cite{bang2021rainbow}. Since labels are unreliable in our setup, however, this approach would expedite overfitting to falsely labeled examples because they are likely regarded as the ones that are highly diverse thus included in the memory and used in training. On the other hand, to address purity, we may use a small-loss trick for purity aware sampling, but it only selects the examples with low diversity. Thus, the diversity and purity are in trade-off. To address the dilemma, we define a sampling score function that considers both aspects for the episodic memory, and it is lower the better. Specifically, the proposed score function consists of two factors; (1) purity of an example by assuming that the `small-loss examples' are likely correctly labeled, and (2) the similarity in representation space between the `relevant representation' of the sample to all other samples with the same noisy label in the memory for diversity. % The representation vector is defined as: \begin{definition} \label{definition_relevant} Let {$f(x_i) \in \mathbbm{R}^n$} be the representation vector of an example $x_i$, where $f(\cdot)$ be a representation learner. A \textbf{relevant representation} {$f_{rel}(x_i; j)$} for a class $j$ is defined as a subset of elements {$e (\in f(x_i)$)} such that {\small $f_{rel}(x_i; j)=\{ e \in f(x_i) ~|~ w{(e,j)} > \frac{1}{|C|} \sum_{c=1}^{C}w{(e,c)}\}$}, where {$w{(e,c)}$} is a weight parameter of the classification FC layer associated with the element $e$, its inputs to the FC layer, and class $j$. \label{def:relevant_feature} \end{definition} Formally, we define and use the score function of an example $x_i$ to select samples, considering both the purity and diversity with its noisy label $\tilde{y_i}$ as: \begin{equation} \small \label{eq:score} \begin{aligned} S(&x_i, \tilde{y_i}) = (1-\alpha_k) \overbrace{\ell\big(x_i, \tilde{y_i} \big)}^{\text{purity}} \\ & + \alpha_k \overbrace{ \frac{1}{\big|\mathcal{M}[\tilde{y_i}]\big|} \sum_{ \hat{x_i} \in \mathcal{M}[\tilde{y_i}]}{\rm cos}\big(f_{rel}(x_i; \tilde{y_i}), f_{rel}(\hat{x_i}; \tilde{y_i})\big)}^{\text{diversity}}, \end{aligned} \end{equation} where $\mathcal{M}$ is the episodic memory at the current moment, $k$ is minibatch index to which $x_i$ is belong and $\mathcal{M}[\tilde{y_i}]$ is a set of examples annotated as $\tilde{y_i}$ in the memory. We use the cosine similarity (\ie, $\cos(\cdot, \cdot)$) to measure the similarity between two representations. $\alpha_k$ is the balancing coefficient of diversity and purity. When the score is high, the sample is more likely corrupted in label and does not contribute to diversity much. Specifically, the high value of the first term (for purity) implies that $\tilde{y_i}$ can be a corrupted label with high probability. The high value of the second term (for diversity) implies that the examples annotated with $\tilde{y_i}$ in the memory are similar to $x_i$, which can have less impact to train the model. By the computed score, we update the memory by dropping a single example with the highest score when we add a new sample from the data stream. Finding a proper $\alpha_k$ is another non trivial issue. % \vspace{-1em} \paragraph{Adaptive Balancing Coefficient.} We argue that the optimal balancing coefficient $\alpha_k$ could vary depending on the label noisiness or learning difficulty of each example\,(Sec.~\ref{sec:coefficent} for empirical analysis). To make the algorithm adaptive to learning difficulty and noisiness of an example, we additionally propose an adaptive $\alpha_k$. % As argued in curriculum learning literature~\cite{bengio2009curriculum,graves2017automated}, easy or clean examples are favored in the early stage of training of a model. Similarly, we conjecture that diverse examples are more important at the later stage of training for better generalization. To implement this idea that implicitly considers learning difficulty and noise ratio, we propose an adaptive balancing coefficient for a $k^{th}$ minibatch based on the example's training loss that is a proxy of label noisiness and learning difficulty (\ie, if loss is large, learning that sample is difficult) as: \begin{equation} \alpha_k = 0.5 \cdot \min \left( 1 / {\ell(\mathbf{X}_k,\mathbf{\tilde{Y}}_k)}, 1 \right), \end{equation} where $\ell(\mathbf{X}_k,\mathbf{\tilde{Y}}_k)$ is the average loss for all examples in the $k^{th}$ batch. We empirically validate its effectiveness in Sec.~\ref{sec:coefficent}. \subsection{Episodic Memory Usage} \label{sec:sub:robustlearning} Even with the memory of diverse and expectedly pure samples, the episodic memory may include noisy examples, since the label corrupted examples are mostly one with high diversity. % However, due to the small size of the episodic memory, robust learning with the memory does not bring significant accuracy improvement. Here, we propose a hybrid learning scheme that combines re-labeling and unsupervised learning with unreliably labeled examples. Specifically, we first split the examples in the episodic memory into clean and noisy subsets based on the small-loss trick that is widely used when handling noisy labels~\cite{li2019dividemix, arazo2019betamixture}. We then fit a GMM to the training loss of all examples in the memory such that it estimates the probability of an example being $p_G(\cdot)$~\cite{li2019dividemix}. Given a noisy example $x_i$ with its unreliable label $\tilde{y_i}$, we obtain probability of label purity by the posterior probability of GMMs as: \begin{equation} p_{G}\big(g | \ell(x_i, \tilde{y_i}; \Theta)\big) = \frac{p_{G}\left(\ell(x_i, \tilde{y_i};\Theta) | g \right) \cdot p_{G}(g)}{p_{G}\left(\ell(x_i, \tilde{y_i}; \Theta) \right)}, \end{equation} where $g$ denotes a Gaussian modality for the small-loss examples, $\Theta$ denotes weight parameters of the model, $\ell(x_i,\tilde{y_i};\Theta) = - \log(p_{m} (x_i, \tilde{y_i}; \Theta))$ and $p_{m}(x_i, c)$ is the softmax output of the model for class $c$. We finally obtain the clean set $\mathcal{C}$ and noisy set $\mathcal{N}$ as: \begin{equation} \begin{gathered} \mathcal{C} := \big\{ (x_i, \tilde{y_i}) \!\in\! \mathcal{M} : p_{G}\big(g | \ell(x_i, \tilde{y_i}; \Theta)\big) \!\geq \!0.5\big\}, \\ \mathcal{N} := \big\{ (x_i, \tilde{y_i})\! \in\! \mathcal{M} : p_{G}\big(g | \ell(x_i, \tilde{y_i}; \Theta)\big) \!< \!0.5\big\}. \label{eq:gmm_loss} \end{gathered} \end{equation} In modern approaches of handling noisy labels~ \cite{han2018coteaching, yu2019coteachingplus, song2021robust}, only the clean set is used to train the model in a supervised manner, while the noisy set is discarded for robust learning. However, in continual learning, as an episodic memory only contains a few number of samples, we need to utilize as many samples as possible, instead of discarding any. A straightforward way of using them is to purify them. However, considering that the memory contains samples with various classification confidences (\ie, logit values of a model), if we use the low confidence examples for re-labeling, they are likely incorrectly re-labeled (\ie, purified) due to the perceptual consistency of a neural net.~\cite{reed2015bootstrap}. To address this issue, we further split the noisy set into two subsets; one with high confidence to be re-labeled and the other with low confidence to be used for unsupervised learning. Then, we re-label the former but consider the latter as an unlabeled examples and employ the unsupervised learning; specifically, we use `consistency regularization.' In particular, to split the noise set into the two sets, we define \emph{predictive uncertainty} as: \begin{equation} \label{eq:uncertainty} {\rm U}(x_i) = 1.0 - \max_{c} \big(p_{m}(x_i, c; \Theta)\big), \end{equation} where $c \in \{1, \dots ,C\}$. According to our empirical analysis (see Fig.~\ref{fig:validity_gmm_fitting}-(b)), the uncertainty of the two sets follows \emph{bi-modal} distributions similar to the loss distribution of clean and noise examples. To distinguish two modalities without knowing ground-truth labels, we again fit a GMM to the uncertainty of the (expected) noisy examples in the noise set $\mathcal{N}$. Similar to Eq.~\ref{eq:gmm_loss}, we split the noise set into the `re-labeling set' ($\mathcal{R}$) and the `unlabeled set' ($\mathcal{U}$) as: \begin{align} &\mathcal{R} := \big\{ (x_i, \tilde{y_i}) \!\in\! \mathcal{N} : p_{G}\big(u | {\rm U}(x_i)\big)\big) \!\geq \!0.5\big\} \nonumber, \\ &\mathcal{U} := \big\{ (x_i, \tilde{y_i})\! \in\! \mathcal{N} : p_{G}\big(u | {\rm U}(x_i)\big) \!< \!0.5\big\}, \label{eq:uncertainty_loss} \end{align} where $u$ is the Guassian component for the low-uncertainty examples. Since the examples with high uncertainty are difficult to estimate the true label, we treat them as the unlabeled set instead to prevent false supervision~\cite{rizve2020uncertainty_aware}. \vspace{-1em}\paragraph{Re-labeling on $\mathcal{R}$.} We refurbish the example with low uncertainty (\ie, high confidence) by the convex combination of its given noisy label $\tilde{y_i}$ and the model's prediction $p_{m}(x_i)$, whose coefficient is its confidence, \ie, the posterior probability of the mixture component $u$ as: \begin{equation} \label{eq:relabel} \hat{y_i} = p_{G}(u | {\rm U}(x_i)) \cdot p_{m}(x_i) + \big(1.0-p_{G}(u | {\rm U}(x_i))\big) \cdot \tilde{y_i}. \end{equation} Employing a soft re-labeling approach to progressively refine the given noisy label based on the model's prediction evolving during training, we mitigate the overfitting to incorrectly modified labels at the beginning of training. Hence, the training loss for the clean set ($\mathcal{C}$) and re-labeling set ($\mathcal{R}$) is formulated with their label supervision as: \begin{equation} \!\!\ell_{cls} = \frac{1}{|\mathcal{C} \cup \mathcal{R}|} \cdot (\!\!\!\!\!\sum_{(x_i, \tilde{y}_i) \in \mathcal{C}} \!\!\!\!\!\ell(x_i, \tilde{y}_i; \Theta) + \!\!\!\!\!\!\sum_{(x_j, \hat{y}_j) \in \mathcal{R}}\!\!\!\!\!\ell(x_j, \hat{y}_j; \Theta)\big).\! \end{equation} \vspace{-1em} \paragraph{Semi-supervised Learning with $\mathcal{U}$.} We finally learn information from less confident samples in $\mathcal{U}$. As their labels are very unreliable, relabeling might not correct them. Thus, we consider them as unlabeled data and use consistency regularization, which is widely used in the semi-supervised learning literature\,\cite{berthelot2019mixmatch, tarvainen2017mean}. It helps learn useful knowledge from the examples without their labels by penalizing the prediction difference between the two examples transformed from the same one as: \begin{equation} \label{eq:ssl} \ell_{reg} = \frac{1}{|\mathcal{U}|} \sum_{x_i \in \mathcal{U}} \big|\big|p_{m}\big(s(x_i);\Theta\big) - p_{m}\big(w(x_i);\Theta\big)\big|\big|_2, \end{equation} where $s(\cdot)$ and $w(\cdot)$ are strong and weak augmentation functions for an example $x_i$. We use AutoAugment\,\cite{cubuk2019autoaugment} as $s(\cdot)$ and random horizontal flipping as $w(\cdot)$. Thus, our final loss function on the three meticulously designed subsets, namely a clean set $\mathcal{C}$, a re-labeled set $\mathcal{R}$, an unlabeled set $\mathcal{U}$, and $\mathcal{M}=\mathcal{C} \cup \mathcal{R} \cup \mathcal{U}$, can be written as: \begin{equation} \label{eq:final} \ell(\mathcal{M}) = \ell_{cls}(\mathcal{C} \cup \mathcal{R}) + \eta \cdot \ell_{reg}(\mathcal{U}). \end{equation} \section{Experiments} \subsection{Experimental Set-up} \label{sec:exp_setup} \paragraph{Datasets.} We empirically validate our PuriDivER\xspace on image classification tasks on the blurry CL setups~\cite{bang2021rainbow} with corrupted labels. We use CIFAR-10, CIFAR-100\,\cite{cifar}, a real-world noisy data of large-scale crawled food images; Food-101N~\cite{lee2018cleannet_food101n}, and a subset of real-world noisy data consisting of large-scale web images whose classes are same as ImageNet~\cite{deng2009imagenet}; WebVision~\cite{li2017webvision}. \vspace{-1em}\paragraph{Noisy Label Set-ups.} Following~\cite{li2019dividemix, han2018coteaching, yu2019coteachingplus, song2019selfie}, we inject two types of synthetic noise that is widely used in the literature to emulate noisy label in CIFAR-10/100; namely symmetric\,(SYM) and asymmetric\,(ASYM) label noise. Symmetric noise flips the ground-truth (GND) label into other possible labels with equal probability, while asymmetric noise flips the GND into one with high probability. For thorough evaluations, we adjust the ratio of label noise from 20\% to 60\%. We use the real label noise in Food-101N and WebVision datasets. According to \cite{song2020learning}, estimated noise ratio of both datasets are $20.0\%$. We provide the detailed experimental configurations for online CL with noisy labels in the supplementary material (Sec. 2). \begin{comment} \begin{table*}[t] \centering \caption{Last test accuracy on CIFAR-10 (K=500) and CIFAR-100 (K=2,000) with SYM-\{20\%, 40\%, 60\%\} and ASYM-\{20\%. 40\%\}, WebVision (K=1,000) and Food-101N (K=2,000), where $K$ denotes size of episodic memory.} \label{tab:cifar_result} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{@{}lrrrrrrrrrrrr@{}} \toprule & \multicolumn{5}{c}{CIFAR-10} & \multicolumn{5}{c}{CIFAR-100} & \multicolumn{1}{c}{WebVision} & \multicolumn{1}{c}{Food-101N}\\ \cmidrule(lr){2-6} \cmidrule(lr){7-11} \cmidrule(lr){12-12} \cmidrule(lr){13-13} {Methods}& \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} & \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} &\\ & % \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{Real} & \multicolumn{1}{c}{Real} \\ \cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-9} \cmidrule(lr){10-11} \cmidrule(lr){12-12} \cmidrule(lr){13-13} RSV~\cite{riemer2018learning} & 54.5 \footnotesize{$\pm$ 2.1} & 39.2 \footnotesize{$\pm$ 0.9} & 28.7 \footnotesize{$\pm$ 0.4} & 53.6 \footnotesize{$\pm$ 1.6} & 40.0 \footnotesize{$\pm$ 1.2} & 29.4 \footnotesize{$\pm$ 0.1} & 19.3 \footnotesize{$\pm$ 1.2} & 10.5 \footnotesize{$\pm$ 0.4} & 29.8 \footnotesize{$\pm$ 0.8} & 20.3 \footnotesize{$\pm$ 1.0} & 18.4 \footnotesize{$\pm$ 0.8} & 11.6 \footnotesize{$\pm$ 1.0} \\ ~~ $+$ SELFIE~\cite{song2019selfie} & 54.5 \footnotesize{$\pm$ 1.7} & 39.2 \footnotesize{$\pm$ 1.1}& 28.8 \footnotesize{$\pm$ 2.9} & 51.8 \footnotesize{$\pm$ 4.1} & 40.4 \footnotesize{$\pm$ 1.4} & 28.9 \footnotesize{$\pm$ 0.4} & 19.5 \footnotesize{$\pm$ 1.5} & 10.5 \footnotesize{$\pm$ 0.4} & 29.8 \footnotesize{$\pm$ 0.9} & 20.1 \footnotesize{$\pm$ 1.2} & 19.1 \footnotesize{$\pm$ 0.4} & 11.1 \footnotesize{$\pm$ 1.3}\\ ~~ $+$ Co-teaching~\cite{han2018coteaching} & 56.1 \footnotesize{$\pm$ 2.3}& 39.8 \footnotesize{$\pm$ 4.4} & 30.5 \footnotesize{$\pm$ 3.6} & 53.5 \footnotesize{$\pm$ 2.9} & 38.7 \footnotesize{$\pm$ 1.3} & 30.4 \footnotesize{$\pm$ 0.3} & 22.0 \footnotesize{$\pm$ 1.2} & 13.3 \footnotesize{$\pm$ 0.3} & 30.8 \footnotesize{$\pm$ 1.4} & 20.3 \footnotesize{$\pm$ 0.6} & 16.5 \footnotesize{$\pm$ 0.3} & 11.3 \footnotesize{$\pm$ 1.0}\\ ~~ $+$ DivideMix~\cite{li2019dividemix} & 56.1 \footnotesize{$\pm$ 1.3} & 43.7 \footnotesize{$\pm$ 0.3} & 35.1 \footnotesize{$\pm$ 1.9} & 56.1 \footnotesize{$\pm$ 0.6} & 38.9 \footnotesize{$\pm$ 2.5} & 30.5 \footnotesize{$\pm$ 0.7} & 23.1 \footnotesize{$\pm$ 1.6} & 13.1 \footnotesize{$\pm$ 0.5} & 30.2 \footnotesize{$\pm$ 0.5} & 20.1 \footnotesize{$\pm$ 0.7} & 11.7 \footnotesize{$\pm$ 1.1} & 7.3 \footnotesize{$\pm$ 0.4}\\ \cmidrule(lr){1-13} GBS~\cite{prabhu2020gdumb} & 54.8 \footnotesize{$\pm$ 1.2} & 41.8 \footnotesize{$\pm$ 0.9} & 27.3 \footnotesize{$\pm$ 2.1} & 54.2 \footnotesize{$\pm$ 1.7} & 40.4 \footnotesize{$\pm$ 1.1} & 28.0 \footnotesize{$\pm$ 0.2} & 18.8 \footnotesize{$\pm$ 1.7} & 10.2 \footnotesize{$\pm$ 0.8} & 29.5 \footnotesize{$\pm$ 0.9} & 20.3 \footnotesize{$\pm$ 0.5} & 20.3 \footnotesize{$\pm$ 2.1} & 10.5 \footnotesize{$\pm$ 0.4} \\ ~~ $+$ SELFIE~\cite{song2019selfie} & 55.4 \footnotesize{$\pm$ 0.8} & 41.6 \footnotesize{$\pm$ 0.3} & 27.8 \footnotesize{$\pm$ 1.8} & 51.3 \footnotesize{$\pm$ 4.7} & 40.7 \footnotesize{$\pm$ 0.9} & 28.0 \footnotesize{$\pm$ 0.6} & 18.4 \footnotesize{$\pm$ 1.9} & 9.9 \footnotesize{$\pm$ 0.7} & 29.6 \footnotesize{$\pm$ 0.9} & 19.8 \footnotesize{$\pm$ 0.6} & 20.0 \footnotesize{$\pm$ 2.1} & 10.4 \footnotesize{$\pm$ 0.3}\\ ~~ $+$ Co-teaching~\cite{han2018coteaching} & 55.1 \footnotesize{$\pm$ 0.9} & 42.7 \footnotesize{$\pm$ 0.9} & 31.4 \footnotesize{$\pm$ 3.6} & 54.0 \footnotesize{$\pm$ 0.9} & 39.5 \footnotesize{$\pm$ 1.3} & 29.5 \footnotesize{$\pm$ 0.7} & 20.9 \footnotesize{$\pm$ 1.3} & 12.8 \footnotesize{$\pm$ 1.5} & 29.0 \footnotesize{$\pm$ 1.6} & 20.5 \footnotesize{$\pm$ 1.3} & 17.8 \footnotesize{$\pm$ 1.8} & 10.5 \footnotesize{$\pm$ 0.2}\\ ~~ $+$ DivideMix~\cite{li2019dividemix} & 57.8 \footnotesize{$\pm$ 1.9} & 48.8 \footnotesize{$\pm$ 1.9} & 34.3 \footnotesize{$\pm$ 1.3} & 57.4 \footnotesize{$\pm$ 0.6} & 44.6 \footnotesize{$\pm$ 5.5} & 29.6 \footnotesize{$\pm$ 0.8} & 21.4 \footnotesize{$\pm$ 1.1} & 13.2 \footnotesize{$\pm$ 0.2} & 28.7 \footnotesize{$\pm$ 0.7} & 19.6 \footnotesize{$\pm$ 1.1} & 14.0 \footnotesize{$\pm$ 0.6} & 6.9 \footnotesize{$\pm$ 0.1}\\ \cmidrule(lr){1-13} RM~\cite{bang2021rainbow} & 57.1 \footnotesize{$\pm$ 0.1} & 46.5 \footnotesize{$\pm$ 2.6} & 33.5 \footnotesize{$\pm$ 3.0} & 58.3 \footnotesize{$\pm$ 2.6} & 46.2 \footnotesize{$\pm$ 1.9} & 31.7 \footnotesize{$\pm$ 1.3} & 23.9 \footnotesize{$\pm$ 0.9} & 14.2 \footnotesize{$\pm$ 0.4} & 32.0 \footnotesize{$\pm$ 1.0} & 21.6 \footnotesize{$\pm$ 1.2} & - & - \\ ~~ $+$ SELFIE~\cite{song2019selfie} & 56.8 \footnotesize{$\pm$ 1.3} & 44.8 \footnotesize{$\pm$ 0.6} & 31.8 \footnotesize{$\pm$ 4.4} & 57.9 \footnotesize{$\pm$ 1.5} & 46.9 \footnotesize{$\pm$ 1.9} & 32.1 \footnotesize{$\pm$ 0.8} & 22.1 \footnotesize{$\pm$ 1.0} & 12.4 \footnotesize{$\pm$ 0.7} & 31.7 \footnotesize{$\pm$ 0.4} & 20.9 \footnotesize{$\pm$ 0.9} & - & -\\ ~~ $+$ Co-teaching~\cite{han2018coteaching} & 57.5 \footnotesize{$\pm$ 1.8} & 47.6 \footnotesize{$\pm$ 0.7} & 35.1 \footnotesize{$\pm$ 2.0} & 58.5 \footnotesize{$\pm$ 1.5} & 45.9 \footnotesize{$\pm$ 2.0} & 31.9 \footnotesize{$\pm$ 0.9} & 22.8 \footnotesize{$\pm$ 0.5} & 14.4 \footnotesize{$\pm$ 0.2} & 32.4 \footnotesize{$\pm$ 0.4} & 21.3 \footnotesize{$\pm$ 1.1} & - & -\\ ~~ $+$ DivideMix~\cite{li2019dividemix} & 61.3 \footnotesize{$\pm$ 0.8} & 50.9 \footnotesize{$\pm$ 3.3} & 34.9 \footnotesize{$\pm$ 3.1} & 60.6 \footnotesize{$\pm$ 1.7} & 46.4 \footnotesize{$\pm$ 5.1} & 31.2 \footnotesize{$\pm$ 0.7} & 23.4 \footnotesize{$\pm$ 0.9} & 14.8 \footnotesize{$\pm$ 0.8} & 30.6 \footnotesize{$\pm$ 0.3} & 21.1 \footnotesize{$\pm$ 0.6} \\ \cmidrule(lr){1-13} \textbf{PuriDivER\xspace} (ours) & \textbf{61.3 \footnotesize{$\pm$ 2.1}} & \textbf{59.2 \footnotesize{$\pm$ 0.3}} & \textbf{52.4 \footnotesize{$\pm$ 2.0}} & \textbf{61.6 \footnotesize{$\pm$ 1.6}} & \textbf{47.1 \footnotesize{$\pm$ 3.2}} & \textbf{35.6 \footnotesize{$\pm$ 0.4}} & \textbf{33.4 \footnotesize{$\pm$ 0.3}} & \textbf{28.8 \footnotesize{$\pm$ 0.6}} & \textbf{34.6 \footnotesize{$\pm$ 0.3}} & \textbf{25.7 \footnotesize{$\pm$ 1.1}} & \textbf{25.8 \footnotesize{$\pm$ 0.7}} & \textbf{13.4 \footnotesize{$\pm$ 0.3}}\\ \bottomrule \end{tabular}% } \end{table*} \end{comment} \begin{table*}[t!] \centering \caption{Last test accuracy on CIFAR-10 (K=500) and CIFAR-100 (K=2,000) with SYM-\{20\%, 40\%, 60\%\} and ASYM-\{20\%. 40\%\}, where $K$ denotes size of episodic memory.} \vspace*{-0.2cm} \label{tab:cifar_result} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{@{}lrrrrrrrrrr@{}} \toprule & \multicolumn{5}{c}{CIFAR-10} & \multicolumn{5}{c}{CIFAR-100} \\ \cmidrule(lr){2-6} \cmidrule(lr){7-11} {Methods}& \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} & \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} \\ & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} \\ \cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-9} \cmidrule(lr){10-11} RSV~\cite{riemer2018learning} & 54.5 \footnotesize{$\pm$ 2.1} & 39.2 \footnotesize{$\pm$ 0.9} & 28.7 \footnotesize{$\pm$ 0.4} & 53.6 \footnotesize{$\pm$ 1.6} & 40.0 \footnotesize{$\pm$ 1.2} & 29.4 \footnotesize{$\pm$ 0.1} & 19.3 \footnotesize{$\pm$ 1.2} & 10.5 \footnotesize{$\pm$ 0.4} & 29.8 \footnotesize{$\pm$ 0.8} & 20.3 \footnotesize{$\pm$ 1.0} \\ ~~ $+$ SELFIE~\cite{song2019selfie} & 54.5 \footnotesize{$\pm$ 1.7} & 39.2 \footnotesize{$\pm$ 1.1}& 28.8 \footnotesize{$\pm$ 2.9} & 51.8 \footnotesize{$\pm$ 4.1} & 40.4 \footnotesize{$\pm$ 1.4} & 28.9 \footnotesize{$\pm$ 0.4} & 19.5 \footnotesize{$\pm$ 1.5} & 10.5 \footnotesize{$\pm$ 0.4} & 29.8 \footnotesize{$\pm$ 0.9} & 20.1 \footnotesize{$\pm$ 1.2} \\ ~~ $+$ Co-teaching~\cite{han2018coteaching} & 56.1 \footnotesize{$\pm$ 2.3}& 39.8 \footnotesize{$\pm$ 4.4} & 30.5 \footnotesize{$\pm$ 3.6} & 53.5 \footnotesize{$\pm$ 2.9} & 38.7 \footnotesize{$\pm$ 1.3} & 30.4 \footnotesize{$\pm$ 0.3} & 22.0 \footnotesize{$\pm$ 1.2} & 13.3 \footnotesize{$\pm$ 0.3} & 30.8 \footnotesize{$\pm$ 1.4} & 20.3 \footnotesize{$\pm$ 0.6} \\ ~~ $+$ DivideMix~\cite{li2019dividemix} & 56.1 \footnotesize{$\pm$ 1.3} & 43.7 \footnotesize{$\pm$ 0.3} & 35.1 \footnotesize{$\pm$ 1.9} & 56.1 \footnotesize{$\pm$ 0.6} & 38.9 \footnotesize{$\pm$ 2.5} & 30.5 \footnotesize{$\pm$ 0.7} & 23.1 \footnotesize{$\pm$ 1.6} & 13.1 \footnotesize{$\pm$ 0.5} & 30.2 \footnotesize{$\pm$ 0.5} & 20.1 \footnotesize{$\pm$ 0.7}\\ \cmidrule(lr){1-11} GBS~\cite{prabhu2020gdumb} & 54.8 \footnotesize{$\pm$ 1.2} & 41.8 \footnotesize{$\pm$ 0.9} & 27.3 \footnotesize{$\pm$ 2.1} & 54.2 \footnotesize{$\pm$ 1.7} & 40.4 \footnotesize{$\pm$ 1.1} & 28.0 \footnotesize{$\pm$ 0.2} & 18.8 \footnotesize{$\pm$ 1.7} & 10.2 \footnotesize{$\pm$ 0.8} & 29.5 \footnotesize{$\pm$ 0.9} & 20.3 \footnotesize{$\pm$ 0.5} \\ ~~ $+$ SELFIE~\cite{song2019selfie} & 55.4 \footnotesize{$\pm$ 0.8} & 41.6 \footnotesize{$\pm$ 0.3} & 27.8 \footnotesize{$\pm$ 1.8} & 51.3 \footnotesize{$\pm$ 4.7} & 40.7 \footnotesize{$\pm$ 0.9} & 28.0 \footnotesize{$\pm$ 0.6} & 18.4 \footnotesize{$\pm$ 1.9} & 9.9 \footnotesize{$\pm$ 0.7} & 29.6 \footnotesize{$\pm$ 2.1} & 10.4 \footnotesize{$\pm$ 0.3}\\ ~~ $+$ Co-teaching~\cite{han2018coteaching} & 55.1 \footnotesize{$\pm$ 0.9} & 42.7 \footnotesize{$\pm$ 0.9} & 31.4 \footnotesize{$\pm$ 3.6} & 54.0 \footnotesize{$\pm$ 0.9} & 39.5 \footnotesize{$\pm$ 1.3} & 29.5 \footnotesize{$\pm$ 0.7} & 20.9 \footnotesize{$\pm$ 1.3} & 12.8 \footnotesize{$\pm$ 1.5} & 29.0 \footnotesize{$\pm$ 1.6} & 20.5 \footnotesize{$\pm$ 1.3} \\ ~~ $+$ DivideMix~\cite{li2019dividemix} & 57.8 \footnotesize{$\pm$ 1.9} & 48.8 \footnotesize{$\pm$ 1.9} & 34.3 \footnotesize{$\pm$ 1.3} & 57.4 \footnotesize{$\pm$ 0.6} & 44.6 \footnotesize{$\pm$ 5.5} & 29.6 \footnotesize{$\pm$ 0.8} & 21.4 \footnotesize{$\pm$ 1.1} & 13.2 \footnotesize{$\pm$ 0.2} & 28.7 \footnotesize{$\pm$ 0.7} & 19.6 \footnotesize{$\pm$ 1.1} \\ \cmidrule(lr){1-11} RM~\cite{bang2021rainbow} & 57.1 \footnotesize{$\pm$ 0.1} & 46.5 \footnotesize{$\pm$ 2.6} & 33.5 \footnotesize{$\pm$ 3.0} & 58.3 \footnotesize{$\pm$ 2.6} & 46.2 \footnotesize{$\pm$ 1.9} & 31.7 \footnotesize{$\pm$ 1.3} & 23.9 \footnotesize{$\pm$ 0.9} & 14.2 \footnotesize{$\pm$ 0.4} & 32.0 \footnotesize{$\pm$ 1.0} & 21.6 \footnotesize{$\pm$ 1.2} \\ ~~ $+$ SELFIE~\cite{song2019selfie} & 56.8 \footnotesize{$\pm$ 1.3} & 44.8 \footnotesize{$\pm$ 0.6} & 31.8 \footnotesize{$\pm$ 4.4} & 57.9 \footnotesize{$\pm$ 1.5} & 46.9 \footnotesize{$\pm$ 1.9} & 32.1 \footnotesize{$\pm$ 0.8} & 22.1 \footnotesize{$\pm$ 1.0} & 12.4 \footnotesize{$\pm$ 0.7} & 31.7 \footnotesize{$\pm$ 0.4} & 20.9 \footnotesize{$\pm$ 0.9} \\ ~~ $+$ Co-teaching~\cite{han2018coteaching} & 57.5 \footnotesize{$\pm$ 1.8} & 47.6 \footnotesize{$\pm$ 0.7} & 35.1 \footnotesize{$\pm$ 2.0} & 58.5 \footnotesize{$\pm$ 1.5} & 45.9 \footnotesize{$\pm$ 2.0} & 31.9 \footnotesize{$\pm$ 0.9} & 22.8 \footnotesize{$\pm$ 0.5} & 14.4 \footnotesize{$\pm$ 0.2} & 32.4 \footnotesize{$\pm$ 0.4} & 21.3 \footnotesize{$\pm$ 1.1} \\ ~~ $+$ DivideMix~\cite{li2019dividemix} & 61.3 \footnotesize{$\pm$ 0.8} & 50.9 \footnotesize{$\pm$ 3.3} & 34.9 \footnotesize{$\pm$ 3.1} & 60.6 \footnotesize{$\pm$ 1.7} & 46.4 \footnotesize{$\pm$ 5.1} & 31.2 \footnotesize{$\pm$ 0.7} & 23.4 \footnotesize{$\pm$ 0.9} & 14.8 \footnotesize{$\pm$ 0.8} & 30.6 \footnotesize{$\pm$ 0.3} & 21.1 \footnotesize{$\pm$ 0.6} \\ \cmidrule(lr){1-11} \textbf{PuriDivER\xspace} (ours) & \textbf{61.3 \footnotesize{$\pm$ 2.1}} & \textbf{59.2 \footnotesize{$\pm$ 0.3}} & \textbf{52.4 \footnotesize{$\pm$ 2.0}} & \textbf{61.6 \footnotesize{$\pm$ 1.6}} & \textbf{47.1 \footnotesize{$\pm$ 3.2}} & \textbf{35.6 \footnotesize{$\pm$ 0.4}} & \textbf{33.4 \footnotesize{$\pm$ 0.3}} & \textbf{28.8 \footnotesize{$\pm$ 0.6}} & \textbf{34.6 \footnotesize{$\pm$ 0.3}} & \textbf{25.7 \footnotesize{$\pm$ 1.1}} \\ \bottomrule \end{tabular}% } \vspace*{-1.5em} \end{table*} \vspace{-1em}\paragraph{Metrics.} As a main performance metric, we report the \emph{last} test\,(or validation) accuracy, which is the most widely used metric in CL literature~\cite{rwalk, han2018coteaching}, where ``last" refers to the moment when all tasks arrive. To quantitatively evaluate robustness in CL with noisy labels, we propose metrics of `purity' and `diversity' for the episodic memory $\mathcal{M}$ as: \begin{equation} \footnotesize \label{eq:metric} \!\begin{aligned} & {\rm Purity} = \frac{\sum_{(x_i,\tilde{y_i}) \in \mathcal{M}} \mathbbm{1}(\tilde{y_i}=y_i)}{|\mathcal{M}|},\\ & {\rm Div.} = \frac{1}{C} \sum_{c=1}^{C} \frac{2}{|\mathcal{M}_{c}|(|\mathcal{M}_{c}|\! - \!1)} \!\!\sum_{ \substack{x_i, x_j \in \mathcal{M}_{c}\\ x_i \neq x_j}}\!\!\! ||f (x_i) \!-\! f(x_j) ||_2,\!\!\!\!\! \end{aligned} \end{equation} where $f(x_i)$ is the representation vector of an example $x_i$ by a jointly trained (using all tasks, not in CL setup) model, and $\mathcal{M}_c$ is a subset of $\mathcal{M}$ consisting of training examples whose ground-truth label is $c$, and $C$ is the number of classes. `Purity' measures how many clean examples are correctly included in the memory. `Diversity' measures how much the examples in the memory are spread out in the representation space per class. We describe the trade-off of purity and diversity in the supplementary material (Sec. 4). \vspace{-1em}\paragraph{Baselines.} We compare our PuriDivER\xspace with the combination of representative memory sampling methods for continual learning and robust learning methods for noisy labels. As summarized in Sec.~\ref{sec:related_work}, the memory sampling methods include \textit{reservoir sampling}\,(RSV)\,\cite{riemer2018learning}, \textit{greedy balancing sampler}\,(GBS)~\cite{prabhu2020gdumb}, and \textit{rainbow memory}\,(RM)~\cite{bang2021rainbow}. Since RM originally updates memory per every task, we update memory of RM at every batch for online CL scenario. % For the robust learning baselines, we consider three widely used approaches in the literature for addressing noisy labels; a re-labeling approach \textit{SELFIE}~\cite{song2019selfie}, a sample selection approach \textit{Co-teaching}~\cite{han2018coteaching}, and a semi-supervised learning approach \textit{DivideMix}~\cite{li2019dividemix}. We compared PuriDivER\xspace to them; three memory only sampling methods with three robust learning methods combined plus three using memory sampling only, total of twelve. \vspace{-1em} \paragraph{Implementation Details.} We use ResNet~\cite{he2016resnet} family as a backbone for all compared algorithms; ResNet18, ResNet32, ResNet34 and ResNet34 are used for CIFAR-10/100, Food-101N, and WebVision, respectively. For CIFARs, we train ResNet using an initial learning rate of $0.05$ with cosine annealing and a batch size of 16 for 256 epochs, following \cite{bang2021rainbow}. For Food-101N and WebVision, we use the same training hyper-parameters for CIFARs except the training epochs (256 $\to$ 128). In all experiments, we use 1.0 for $\eta$ in Eq.~\ref{eq:final}, and use CutMix~\cite{yun2019cutmix} and AutoAugment~\cite{cubuk2019autoaugment} for data augmentation with the memory. For reliable validation, we repeat all the experiments thrice with a single NVIDIA P40 GPU and report the average results. { \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{X}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}} \begin{table}[t] \caption{Last validation accuracy on WebVision (K=1,000) and Food-101N (K=2,000), where $K$ is episodic memory size.} \vspace{-2em} \begin{center} \footnotesize \begin{tabular}{L{3.6cm} L{1.75cm} X{1.75cm}} \toprule Methods & WebVision & Food-101N \\\midrule RSV~\cite{riemer2018learning} & 18.4 \footnotesize{$\pm$ 0.8} & 11.6 \footnotesize{$\pm$ 1.0} \\ RSV$+$ SELFIE~\cite{song2019selfie}& 19.1 \footnotesize{$\pm$ 0.4} & 11.1 \footnotesize{$\pm$ 1.3} \\ RSV$+$ Co-teaching~\cite{han2018coteaching}& 16.5 \footnotesize{$\pm$ 0.3} & 11.3 \footnotesize{$\pm$ 1.0} \\ RSV$+$ DivideMix~\cite{li2019dividemix} & 11.7 \footnotesize{$\pm$ 1.1} & 7.3 \footnotesize{$\pm$ 0.4} \\ \cmidrule(lr){1-3} GBS~\cite{prabhu2020gdumb} & 20.3 \footnotesize{$\pm$ 2.1} & 10.5 \footnotesize{$\pm$ 0.4} \\ GBS $+$ SELFIE~\cite{song2019selfie} & 20.0 \footnotesize{$\pm$ 2.1} & 10.4 \footnotesize{$\pm$ 0.3} \\ GBS $+$ Co-teaching~\cite{han2018coteaching} & 17.8 \footnotesize{$\pm$ 1.8} & 10.5 \footnotesize{$\pm$ 0.2} \\ GBS $+$ DivideMix~\cite{li2019dividemix} & 14.0 \footnotesize{$\pm$ 0.6} & 6.9 \footnotesize{$\pm$ 0.1} \\ \cmidrule(lr){1-3} RM~\cite{bang2021rainbow} & 23.1 \footnotesize{$\pm$ 0.1} & 11.7 \footnotesize{$\pm$ 0.2} \\ RM$+$ SELFIE~\cite{song2019selfie} & 21.4 \footnotesize{$\pm$ 1.1} & 12.0 \footnotesize{$\pm$ 0.2} \\ RM$+$ Co-teaching~\cite{han2018coteaching} & 21.8 \footnotesize{$\pm$ 0.8} & 12.0 \footnotesize{$\pm$ 0.4} \\ RM$+$ DivideMix~\cite{li2019dividemix} & 18.2 \footnotesize{$\pm$ 0.8} & 9.2 \footnotesize{$\pm$ 0.9} \\\midrule \textbf{PuriDivER\xspace} (Ours) & \textbf{25.8 \footnotesize{$\pm$ 0.7}} & \textbf{13.4 \footnotesize{$\pm$ 0.3}} \\ \bottomrule \end{tabular} \end{center} \label{tab:real_result} \vspace{-1em} \end{table} } \begin{comment} { \begin{table}[t] \centering \caption{Last validation accuracy on WebVision (K=1,000) and Food-101N (K=2,000), where $K$ is episodic memory size.} \vspace{-1.5em} \label{tab:real_result} \resizebox{0.85\linewidth}{!}{% \begin{tabular}{@{}lrr@{}} \toprule Methods & WebVision & Food-101N \\ \cmidrule(lr){1-3} RSV~\cite{riemer2018learning} & 18.4 \footnotesize{$\pm$ 0.8} & 11.6 \footnotesize{$\pm$ 1.0} \\ RSV$+$ SELFIE~\cite{song2019selfie}& 19.1 \footnotesize{$\pm$ 0.4} & 11.1 \footnotesize{$\pm$ 1.3} \\ RSV$+$ Co-teaching~\cite{han2018coteaching} & 16.5 \footnotesize{$\pm$ 0.3} & 11.3 \footnotesize{$\pm$ 1.0} \\ RSV$+$ DivideMix~\cite{li2019dividemix} & 11.7 \footnotesize{$\pm$ 1.1} & 7.3 \footnotesize{$\pm$ 0.4} \\ \cmidrule(lr){1-3} GBS~\cite{prabhu2020gdumb} & 20.3 \footnotesize{$\pm$ 2.1} & 10.5 \footnotesize{$\pm$ 0.4} \\ GBS $+$ SELFIE~\cite{song2019selfie} & 20.0 \footnotesize{$\pm$ 2.1} & 10.4 \footnotesize{$\pm$ 0.3} \\ GBS $+$ Co-teaching~\cite{han2018coteaching} & 17.8 \footnotesize{$\pm$ 1.8} & 10.5 \footnotesize{$\pm$ 0.2} \\ GBS $+$ DivideMix~\cite{li2019dividemix} & 14.0 \footnotesize{$\pm$ 0.6} & 6.9 \footnotesize{$\pm$ 0.1} \\ \cmidrule(lr){1-3} \textbf{PuriDivER\xspace} (ours) & \textbf{25.8 \footnotesize{$\pm$ 0.7}} & \textbf{13.4 \footnotesize{$\pm$ 0.3}} \\ \bottomrule \end{tabular}% } \end{table} } \end{comment} \begin{figure*}[t!] \centering \begin{subfigure}[t]{0.495\linewidth} \includegraphics[width=0.49\textwidth]{figures/cifar10_sym40_accuracy.pdf} \hfill \includegraphics[width=0.496\textwidth]{figures/cifar10_sym40_purity.pdf} \caption{CIFAR-10} \label{fig:cifar10_sym40} \end{subfigure} \begin{subfigure}[t]{0.495\linewidth} \includegraphics[width=0.49\textwidth]{figures/cifar100_sym40_accuracy.pdf} \hfill \includegraphics[width=0.496\textwidth]{figures/cifar100_sym40_purity.pdf} \caption{CIFAR-100} \label{fig:cifar100_sym40} \end{subfigure} \vspace{-1em} \caption{Last test accuracy as a function of memory purity when the task injection progresses on CIFAR-10/100 with SYM-40\%. We provide more results with various noise ratio in the supplementary material (Sec. 3).} \label{fig:cifar_result} \vspace{-1em} \end{figure*} \begin{figure}[t!] \centering \begin{subfigure}[t]{0.49\linewidth} \includegraphics[width=\textwidth]{figures/loss_uncerts/loss_1_13_bins50.pdf} % \label{fig:historgram_loss} \end{subfigure} \begin{subfigure}[t]{0.49\linewidth} \includegraphics[width=\textwidth]{figures/loss_uncerts/uncert_2_117_bins30.pdf} % \label{fig:histogram_uncert} \end{subfigure} \vspace{-1.8em} \caption{Distribution of examples in the episodic memory training on CIFAR-10 with SYM-20\%. GMMs effectively distinguish between (left) clean and noisy labels by loss, and (right) correct and incorrect predictions by uncertainty (Eq.~\ref{eq:uncertainty})} \label{fig:validity_gmm_fitting} % \end{figure} \subsection{Results} \label{sec:results} We compare the proposed PuriDivER\xspace with twelve baselines on the two CIFARs datasets with varying symmetric and asymmetric noise, and summarize the results in Tab.~\ref{tab:cifar_result}. We also compare methods on real-world noisy datasets; WebVision and Food-101N datasets in Tab.~\ref{tab:real_result}. As shown in the two tables, PuriDivER\xspace consistently outperforms all other compared methods. Comparing PuriDivER\xspace with other methods, in particular, accuracy increases up to 16\% on CIFARs, 11\% and 3\% on WebVision and Food-101N, respectively. Interestingly, the performance gain becomes large as the noise ratio increases or the difficulty of training data increases from CIFAR-10 to 100. Noticeably, SELFIE~\cite{song2019selfie} does not improve the accuracy in average when combined with the three memory sampling approaches. We believe that the SELFIE rather produces many false corrections in the online learning setup, since it requires an abundant number of data for re-labeling unlike episodic memory that contains a small number of data. Despite the use of multiple networks, Co-teaching~\cite{han2018coteaching} marginally improves the performance. % Unlike SELFIE and Co-teaching, DivideMix considerably improves the accuracy in CIFAR-10, but not in CIFAR-100 with asymmetric noise and real noise datasets, which have more realistic label noise. We expect that the size of (expected) noisy dataset is larger when splitting whole dataset into the clean and the noisy data, as noise ratio becomes larger or learning becomes more difficult. As such, it has too small (expected) clean data to train the model due to the small size of episodic memory. In Tab.~\ref{tab:real_result}, we observe that PuriDivER\xspace presents a competitive capability on noisy CL tasks in real-world label corruption while outperforming comparable methods. \subsection{Detailed Analyses} \label{sec:ssl_sr} \subsubsection{Purity of Episodic Memory} We first investigate the effect of memory purity on the performance of our method. We measure the last test accuracy as a function of the memory purity (Eq.~\ref{eq:metric}). % We compare our PuriDivER\xspace with RSV, GBS and RM integrated with DivideMix in Fig.~\ref{fig:cifar_result}. As shown in the figure, ours significantly outperforms them in both accuracy and memory purity on CIFAR-10 and CIFAR-100 by large margins. Particularly, the performance gap between PuriDivER\xspace and other methods gradually increase as more tasks arrive by an synergistic effect of our episodic memory construction\,(Sec.~\ref{sub:memory_update}) and memory usage schemes\,(Sec.~\ref{sec:sub:robustlearning}). Interestingly, the performance gain of PuriDivER\xspace increases as data becomes more difficult. It implies that the purity of other baselines relatively much worsen in CIFAR-100, while ours maintains its significant dominance. There are similar gains on various noise ratio as shown in the supplementary material (Sec. 3). \vspace{-1em} \subsubsection{Ablations on Robust Learning Components} We now investigate the contribution of each component of the proposed robust learning approach to the accuracy. % The both sides of Fig.~\ref{fig:validity_gmm_fitting} show the loss distribution of all examples in the memory $\mathcal{M}$ and the uncertainty distribution (Eq.~\ref{eq:uncertainty_loss}) of the examples in (expected) noisy set $\mathcal{N}$, respectively. The loss distributions in Fig.~\ref{fig:validity_gmm_fitting}-(left) are bi-modal for clean and noisy examples, thus clearly separating them by fitting GMMs. Likewise, the uncertainty distributions in Fig.~\ref{fig:validity_gmm_fitting}-(right) are bi-modal as well for the correctness of model's predictions. Hence, re-labeling using the model's prediction for the left Gaussian components (\ie, certain examples) ensures that the proposed re-labeling method achieves high precision. \begin{table}[t] \centering \caption{Ablation study for PuriDivER\xspace on CIFAR-10 and CIFAR-100 with various noise ratios and types. SYM and ASYM refer to the symmetric and asymmetric label noise, respectively. } \vspace{-0.5em} \label{tab:dpm_ablation} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{@{}ccrrrrrrrrrr@{}} \toprule & & \multicolumn{5}{c}{CIFAR-10 (K=500)} & \multicolumn{5}{c}{CIFAR-100 (K=2,000)} \\ \multicolumn{2}{c}{Robust Learning}& \multicolumn{3}{c}{SYM} & \multicolumn{2}{c}{ASYM} & \multicolumn{3}{c}{SYM} & \multicolumn{2}{c}{ASYM} \\ Re-label & Consistency & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} \\ \cmidrule(lr){1-2} \cmidrule(lr){3-5} \cmidrule(lr){6-7} \cmidrule(lr){8-10} \cmidrule(lr){11-12} & & \textbf{61.8} & 55.4 & 46.9 & 60.6 & 46.4 & 33.1 & 26.8 & 18.6 & 31.5 & 21.3 \\ \checkmark & & 57.7 & 55.4 & 44.1 & 61.0 & 46.6 & 34.7 & 31.5 & 26.2 & 33.2 & 22.7 \\ & \checkmark & 48.6 & 46.2 & 31.3 & 52.1 & 36.7 & 31.7 & 24.3 & 18.1 & 29.9 & 20.3 \\ \cmidrule(lr){1-12} \checkmark & \checkmark & 61.3 & \textbf{59.2} & \textbf{52.4} & \textbf{61.6} & \textbf{47.1} & \textbf{35.6} & \textbf{33.4} & \textbf{28.8} & \textbf{34.6} & \textbf{25.7} \\ \bottomrule \end{tabular}% } \vspace{-0.5em} \end{table} Tab.~\ref{tab:dpm_ablation} summarizes the contribution of the re-labeling and consistency regularization in PuriDivER\xspace. Using either re-labeling or consistency regularization alone does not improve the accuracy in many experiments because re-labeling would make many false correction, and consistency regularization utilizes only a small size of clean set $\mathcal{C}$. For those reasons, they also drastically decrease the performance as the noise ratio increases. In contrast, training the model for the clean and re-labeled set $\mathcal{C} \cup \mathcal{R}$ with the consistency loss for the unlabeled set $\mathcal{U}$ significantly improves the accuracy by up to 10.2\% compared to the baseline without them. By using the both methods, since a good number of examples in the re-label set $\mathcal{R}$ would be correctly labeled, the $\mathcal{R}$ can also be utilized to train the model better with clean set $\mathcal{C}$. Further, as we re-split the three sets $\mathcal{C}$, $\mathcal{R}$ and $\mathcal{U}$ at every epoch, it is likely that many data will have both effects of re-labeling and consistency regularization over the epochs, which leads to further improvement. \begin{table}[t!] \centering \caption{Last test accuracy over various static $\alpha$ on CIFAR-10 and CIFAR-100 with SYM-\{20\%, 40\%, 60\%\} and ASYM-\{20\%, 40\%\}. $K$ is the size of episodic memory.} \vspace{-1em} \label{tab:various_coeff} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{@{}crrrrrrrrrr@{}} \toprule & \multicolumn{5}{c}{CIFAR-10 (K=500)} & \multicolumn{5}{c}{CIFAR-100 (K=2,000)} \\ \cmidrule(lr){2-6} \cmidrule(lr){7-11} & \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} & \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} \\ $\alpha$ & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} \\ \cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-9} \cmidrule(lr){10-11} 0.1 & 57.4 & 55.1 & 51.6 & 58.9 & 47.4 & 36.1 & 33.6 & \textbf{28.1} & 34.0 & \textbf{25.6} \\ 0.3 & 58.1 & 55.3 & \textbf{52.6} & 58.4 & \textbf{49.0} & 35.5 & \textbf{33.6} & 27.3 & 34.6 & 25.5 \\ 0.5 & \textbf{60.5} & \textbf{57.0} & 47.1 & \textbf{60.4} & 46.7 & \textbf{37.0} & 32.3 & 23.0 & \textbf{36.6} & 25.5 \\ 0.6 & 29.5 & 30.3 & 24.4 & 36.0 & 33.7 & 25.3 & 18.9 & 13.5 & 26.7 & 18.2 \\ 1.0 & 26.1 & 19.4 & 19.3 & 33.0 & 28.1 & 15.2 & 10.5 & 7.2 & 20.7 & 16.6 \\ \bottomrule \end{tabular} } \vspace{-1.0em} \end{table} \begin{figure}[t!] \centering \begin{subfigure}[t]{0.49\linewidth} \includegraphics[width=\textwidth]{figures/various_coeff_a.pdf} % \label{fig:various_coeff_a} \end{subfigure} \begin{subfigure}[t]{0.49\linewidth} \includegraphics[width=\textwidth]{figures/various_coeff_b.pdf} % \label{fig:various_coeff_b} \end{subfigure} \vspace{-2em} \caption{Accuracy by different $\alpha$ on CIFAR-10 with SYM-\{20\%, 40\%, 60\%\}; (left) comparison of the last test accuracy with and without the adaptive strategy, (right) comparison of the mean of $\alpha$ for each task with the adaptive strategy.} \vspace{-0.5em} \label{fig:various_coeff} \end{figure} \vspace{-0.5em} \subsubsection{Balancing Coefficient} \label{sec:coefficent} Tab.~\ref{tab:various_coeff} illustrates the effect of balancing coefficient $\alpha$ on the accuracy. As shown in the table, the test accuracy decreases drastically when $\alpha > 0.5$ because diversity dominantly influences memory sampling rather than memory purity. In the presence of label noise, this suggests that memory purity plays a significant role in performance, as opposed to the conventional CL methods that mainly emphasize example diversity~\cite{bang2021rainbow}. Hence, we set the range of adaptive balancing coefficient $\alpha$ to (0, 0.5) instead of (0, 1). Additionally note that the best $\alpha$ value depends on the noise ratio. % Generally, with increased noise ratios, a smaller $\alpha$ incurs higher accuracy since memory purity is far more important than diversity when label noise is severe. \vspace{-1em}\paragraph{Efficacy of Adaptive Strategy.} We compare the performance of PuriDivER\xspace with and without using the proposed adaptive balancing coefficient strategy, and summarize the results in Fig.~\ref{fig:various_coeff}-(left). PuriDivER\xspace with the adaptive strategy always outperforms others. In addition, as shown in Fig.~\ref{fig:various_coeff}-(right), the $\alpha$ values are properly determined by PuriDivER\xspace with the adaptive strategy for three difference noise scenarios. The $\alpha$ tends to increase as the task number increases except for the initial task. It implies that small-loss\,(clean) examples are favored at the earlier stage of training for robust learning, while diverse examples are favored at the later stage of training for better generalization. Therefore, the proposed adaptive strategy allows PuriDivER\xspace to exploit the best $\alpha$ value for the various noise scenario. \vspace{-1em} \setlength{\columnsep}{10pt}% \begin{wrapfigure}{r}{0.4\linewidth} \vspace{-2em} \includegraphics[width=1\linewidth]{figures/time_analysis.pdf} \vspace{-2em} \caption{Total training time and accuracy on CIFAR-10 SYM-40\% for various methods.} \label{fig:time} \vspace{-1.5em} \end{wrapfigure} \subsubsection{Time Cost} In online continual learning, time cost is significant for the model to adapt the distribution change of data stream. Unfortunately, there is a trade-of between time and accuracy. In Fig.~\ref{fig:time}, RSV, GBS and RM have small amount of training time but poor accuracy, while SPR takes too much time to be utilized in online setup. Despite the additional time cost for memory construction compared to RSV and GBS, PuriDivER\xspace exhibits a good trade-off between the accuracy and time cost, compared to others. \section{Conclusion} We address a setup of online and blurry CL with noisy labels, which occurs frequently in real world AI deployment scenarios. Specifically, we propose a method to address this practical task by adaptively balancing diversity and purity by an episodic memory management scheme followed by a robust learning with semi-supervised learning for additional diversity and purity enforcement for the memory usage. We also define an adaptively balancing coefficient to accommodate various noise ratio and sample-wise learning efficiency. We empirically validate that our PuriDivER\xspace not only improves accuracy over combinations of prior arts but also helps better sampling for memory. \vspace{-1.3em}\paragraph{Limitation.} Although PuriDivER\xspace outperforms prior arts by large margins, developing methods in noisy CL setups are in its nascent steps; \eg, no new class is added as the task progresses. Also, scaled-up empirical validation is important and desirable. \vspace{-1.3em}\paragraph{Potential Negative Societal Impact.} As the CL method is for deploying AI to broader context, the data can come from any sources thus the data privacy issue may arise. Although the proposed method has \emph{no intention} to allow such consequences, the method may carry such negative effects. Efforts to prevent such concerns would be a focus of secure machine learning research. \footnotesize{\vspace{-1.3em}\paragraph{Acknowledgement.} All authors thank NAVER Smart Machine Learning (NSML)~\cite{kim2018nsml} for experimental environments. This work was partly supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No.2022R1A2C4002300) and Institute for Information \& communications Technology Promotion (IITP) grants funded by the Korea government (MSIT) (No.2020-0-01361-003 and 2019-0-01842, Artificial Intelligence Graduate School Program (Yonsei University, GIST), and No.2021-0-02068 Artificial Intelligence Innovation Hub).} {\small \bibliographystyle{ieee_fullname} \section{Detailed Algorithm} \label{app:detailed} Algorithm~\ref{alg:detailed} describes overall procedure of PuriDivER\xspace. For each task, a model is trained with online data stream $S_t$ via SGD optimizer (Lines 3--5). Since we can see the data at once by definition of online learning, episodic memory is updated every batch. To get the diversified examples in the memory, we consider the examples of memory and a new example from batch as memory candidates, then remove one that has the maximum value of score function (Lines 7--9). After constructing memory, the model trains with memory. Since the memory might have contaminated data by selecting examples considering both diversity and purity, we split the memory as three parts every epoch; clean set $\mathcal{C}$, noisy but high model's confident set $\mathcal{R}$, noisy and low model's confident set $\mathcal{U}$ (Lines 11--13). Finally, we apply to the different loss function of each set that is appropriate for handling noisy labels (Lines 14--15). \begin{algorithm}[h!] \small \caption{Purity and Diversity aware Episode Replay\xspace} \label{alg:detailed} \begin{algorithmic}[1] \State {\textbf{Input:} $\mathcal{S}_{t}$: stream data at task $t$, $\mathcal{M}$: exemplars stored in a episodic memory, $T$: the number of tasks, $\theta_0$: initial model.} \For {$t$ = 1 {\bf to} T} % \For {each mini-batch $\mathcal{B} \in \mathcal{S}_{t}$} % % \State{/* {\color{orange}Online Training} */} \State{$\theta \leftarrow \theta - \alpha \nabla \sum_{i \in \mathcal{B}} \ell(\theta(x_i), \tilde{y_i})$} % \State{/* {\color{orange} Memory Construction} */} \For {$x_i, \tilde{y_i}$ in $\mathcal{B}$} \State{$\mathcal{M} \leftarrow \mathcal{M} \cup (x_i, \tilde{y_i})$} \State{$\mathcal{M}$.remove($\arg\max_{(x,\tilde{y}) \in \mathcal{M}} S(x, \tilde{y})$) by \bmp{Eq. 2} } % \EndFor \EndFor \State{/* {\color{orange} Memory Usage} */} \For {$e=1$ {\bf to} MaxEpoch} \State{Split $\mathcal{C}$, $\mathcal{N}$ from $\mathcal{M}$ via \bmp{Eq. 5}} \State{Split $\mathcal{R}$, $\mathcal{U}$ from $\mathcal{N}$ via \bmp{Eq. 7}} % % \For {each mini-batch $\mathcal{B_C} \in \mathcal{C}$, $\mathcal{B_R} \in \mathcal{R}$, $\mathcal{B_U} \in \mathcal{U}$ } % \State{$\theta \leftarrow \theta - \alpha \nabla [\ell_{cls} + \eta \ell_{reg}$]} \EndFor \EndFor \EndFor \end{algorithmic} \end{algorithm} \section{Detailed Configuration for Online Continual Learning} \label{app:config_stream_data} To split dataset into several tasks, we follow [\bmp{5}] to make \textit{blurry-CL}. \textit{Blurry-CL} contains two types of classes, major and minor classes. We set $L=0.1$, so the number of minor classes are 10\% of the entire of classes at each task. Since some labels might be incorrect, real class distribution of each task might be different. We configure CIFAR-10/100, WebVision and Food-101N as 5, 5, 10 and 5 tasks, respectively. Since Food-101N has 101 classes, the number of major classes is 21 at the last task. Furthermore, we consider online-CL which the incoming samples are presented to a model only once except for the examples from the memory. \section{Accuracy and memory purity by various noise ratios} \label{app:various_noise_ratio} We add experimental results of the last accuracy and memory purity of PuriDivER\xspace on CIFAR-10/100 with the symmetric noise 20\% and 60\% in Fig.~\ref{fig:cifar10_appendix_result} and ~\ref{fig:cifar100_appendix_result}. We can find consistent results as in \bmp{Fig. 2}. On different scenarios, PuriDivER\xspace outperforms the other baselines for both accuracy and memory purity over the entire task stream. Especially, in memory purity, PuriDivER\xspace greatly outperforms the other baselines, and it shows that our method can effectively find clean labels from corrupted data for the online continual learning setup. Since we believe that memory sampling and robust learning from PuriDivER\xspace are the relationship to help each other, so the last accuracy and memory purity increases and have larger gap as the task number increases. \begin{figure*}[h!] \centering \begin{subfigure}[t]{0.495\linewidth} \includegraphics[width=0.495\textwidth]{figures/cifar10_sym20_accuracy.pdf} \hfill \includegraphics[width=0.495\textwidth]{figures/cifar10_sym20_purity.pdf} \caption{CIFAR-10 with SYM-20\%} \label{fig:cifar10_sym20} \end{subfigure} \begin{subfigure}[t]{0.495\linewidth} \includegraphics[width=0.495\textwidth]{figures/cifar10_sym60_accuracy.pdf} \hfill \includegraphics[width=0.495\textwidth]{figures/cifar10_sym60_purity.pdf} \caption{CIFAR-10 with SYM-60\%} \label{fig:cifar10_sym60} \end{subfigure} \caption{Illustration of last accuracy and memory purity changes as the task number increases on CIFAR-10 with SYM-\{20\%, 60\%\}.} \label{fig:cifar10_appendix_result} \end{figure*} \begin{figure*}[h!] \centering \begin{subfigure}[t]{0.495\linewidth} \includegraphics[width=0.495\textwidth]{figures/cifar100_sym20_accuracy.pdf} \hfill \includegraphics[width=0.495\textwidth]{figures/cifar100_sym20_purity.pdf} \caption{CIFAR-100 with SYM-20\%} \label{fig:cifar100_sym20} \end{subfigure} \begin{subfigure}[t]{0.495\linewidth} \includegraphics[width=0.495\textwidth]{figures/cifar100_sym60_accuracy.pdf} \hfill \includegraphics[width=0.495\textwidth]{figures/cifar100_sym60_purity.pdf} \caption{CIFAR-100 with SYM-60\%} \label{fig:cifar100_sym60} \end{subfigure} \caption{Illustration of last accuracy and memory purity changes as the task number increases on CIFAR-100 with SYM-\{20\%, 60\%\}.} \label{fig:cifar100_appendix_result} \end{figure*} \begin{figure*}[h!] \centering \begin{subfigure}[t]{0.25\linewidth} \includegraphics[width=\textwidth]{figures/diversity_vs_purity_sym20.pdf} \caption{} \label{fig:cifar10_sym20_div_pur} \end{subfigure} \hspace{1em} \begin{subfigure}[t]{0.25\linewidth} \includegraphics[width=\textwidth]{figures/diversity_vs_purity_sym40.pdf} \caption{} \label{fig:cifar10_sym40_div_pur} \end{subfigure} \hspace{1em} \begin{subfigure}[t]{0.25\linewidth} \includegraphics[width=\textwidth]{figures/diversity_vs_purity_sym60.pdf} \caption{} \label{fig:cifar10_sym60_div_pur} \end{subfigure} \caption{Illustration of diversity and purity in the memory as the coefficient $\alpha$ changes on CIFAR-10 with (a) SYM-20\%, (b) SYM-40\%, and (c) SYM-60\%. } \label{fig:cifar10_diversity_vs_purity} \end{figure*} \begin{figure*}[h!] \centering \begin{subfigure}[t]{0.25\linewidth} \includegraphics[width=\textwidth]{figures/cifar100_diversity_vs_purity_sym20.pdf} \caption{} \label{fig:cifar100_sym20_div_pur} \end{subfigure} \hspace{1em} \begin{subfigure}[t]{0.25\linewidth} \includegraphics[width=\textwidth]{figures/cifar100_diversity_vs_purity_sym40.pdf} \caption{} \label{fig:cifar100_sym40_div_pur} \end{subfigure} \hspace{1em} \begin{subfigure}[t]{0.25\linewidth} \includegraphics[width=\textwidth]{figures/cifar100_diversity_vs_purity_sym60.pdf} \caption{} \label{fig:cifar100_sym60_div_pur} \end{subfigure} \caption{Illustration of diversity and purity in the memory as the coefficient $\alpha$ changes on CIFAR-100 with (a) SYM-20\%, (b) SYM-40\%, and (c) SYM-60\%. } \label{fig:cifar100_diversity_vs_purity} \end{figure*} \section{Diversity vs. Purity} \label{app:div_pur} To analyze how diversity and purity in a memory change according to coefficient $\alpha$, we plot the diversity and purity metrics (defined in \bmp{Eq. 12}) in Fig.~\ref{fig:cifar10_diversity_vs_purity} and \ref{fig:cifar100_diversity_vs_purity} for various noise ratios. As hyper-parameter $\alpha$ increases, the diversity score increases while the purity score decreases in all figures. When $\alpha$ is increased beyond a certain value, it can be seen that purity is sacrificed for the sample diversity. If there are too many noisy labels in a memory, a trained model would inevitably learn the noisy labels, which can lead to performance degradation. Therefore, the best strategy is to set the $\alpha$ before the abrupt decrease in the purity score. For example, in Fig.~\ref{fig:cifar10_sym20_div_pur} and \ref{fig:cifar10_sym40_div_pur}, memory purity is over 95\% until $\alpha=0.5$, and then falls to less than 50\% when $\alpha$ is set to 0.6. Thus, the best strategy for balancing the diversity and memory purity can be obtained at $\alpha=0.5$. Meanwhile, in the case of Fig.~\ref{fig:cifar10_sym60_div_pur}, memory purity drops to 70\% at $\alpha=0.5$, so it can be expected that the best performance is obtained at $\alpha=0.3$, before memory purity is too much degraded. This is because memory purity becomes more important as the ratio of noisy labels contained in memory increases. These results are consistent with the results in \bmp{Tab. 4}. \begin{table}[t!] \centering \caption{Comparison of our method and SPR in disjoint setup.} \vspace{-1em} \label{tab:comp_spr} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{@{}lrrrrrc@{}} \toprule & \multicolumn{5}{c}{CIFAR-10} & \multicolumn{1}{c}{WebVision} \\ \cmidrule(lr){2-6} \cmidrule(lr){7-7} & \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} \\ Methods & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & Real \\ \cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-7} Self-Centered filter [\bmp{17}] & 36.5 & 35.7 & 32.5 & 37.1 & 36.9 & 33.0 \\ Self-Replay [\bmp{17}] & 40.1 & 31.4 & 22.4 & 44.1 & 43.2 & 48.0 \\ SPR [\bmp{17}] & 43.9 & 43.0 & 40.0 & 44.5 & 43.9 & 40.0 \\ \cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-7} \textbf{PuriDivER\xspace} (Ours) & \textbf{61.2} & \textbf{60.9} & \textbf{56.0} & \textbf{62.4} & \textbf{46.4} & \textbf{51.8} \\ \bottomrule \end{tabular} } \vspace{-0.2em} \end{table} \section{Comparison to SPR in Disjoint Tasks} \label{app:spr} As SPR [\bmp{17}] is proposed for similar task setup, we compare our PuriDivER\xspace to SPR [\bmp{17}] in the disjoint setup for which the SPR is proposed, and summarize the results in Tab.~\ref{tab:comp_spr}. Following their experimental setup, we configure five tasks with randomly paired classes for CIFAR-10, % and use the top 14 largest classes in seven tasks with randomly paired classes for WebVision. SPR uses two different memories; a delayed buffer, which the incoming data is saved temporarily, and a purified buffer which maintains purified data, and a fixed memory size of 500 or 1,000 for CIFAR-10 or WebVision, respectively. As the delayed buffer is only utilized to auxiliary model (called Self-Replay Model) to use only purified examples for model training, their actual memory size is $2\times$ of the episodic memory. Hence, we set memory size as 1,000 and 2,000 in CIFAR-10 and WebVision for fair comparison. Interestingly, PuriDivER\xspace outperforms SPR by 3\%-18\% in all experiments (Tab.~\ref{tab:comp_spr}). We believe it is because the SPR always purifies incoming contaminated data stream before training the model, but it has a high risk of overfitting by false model predictions. \end{document}
96dc31d745e895c746a8cbc4dc233a62c2863b53
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Triangular clusters form one of the most basic building blocks of frustrated magnets in two dimensions~\cite{Starykh2015}, including the paradigmatic Heisenberg antiferromagnets on the triangular or kagome lattice. In particular the $S=1/2$ Heisenberg antiferromagnet on the kagome lattice, which can be interpreted as a a lattice of corner-sharing triangles, has attracted considerable interest as a promising system for realizing a quantum spin liquid~\cite{Savary2016,Yan2011,Depenbrock2012,Jiang2012,He2017} in its groundstate. In most candidate materials, the magnetic exchange couplings do however not realize a perfect kagome lattice and are instead distorted~\cite{Norman2016}, which can have significant impact on the low temperature physics, e.g., by stabilizing magnetic order~\cite{Schnyder2008}, precluding the formation of a quantum spin liquid. This is, however, not true for all kinds of distortions, as seen for example in the “breathing-distorted” kagome lattice, where upward and downward triangles both remain equilateral but inequivalent to each other (\cref{fig:lattices}(a))~\cite{Mila98,Aidoudi2011,Honecker11}. Even under strong such breathing distortion, a quantum spin-liquid phase of the kagome lattice is expected to be stable~\cite{Repellin2017,Jahromi2020}. Such a distortion is indeed observed in the spin-1/2 vanadium oxyfluoride [NH${}_4$]${}_2$[C${}_7$H${}_{14}$N][V${}_7$O${}_6$F${}_{18}$], which shows no sign of order or spin freezing down to low temperatures~\cite{Aidoudi2011,Clark2013,Orain2017}. It is thus important to accurately examine the ground state and low-temperature thermodynamic behavior of such distorted model systems. \begin{figure} \includegraphics{figs/lattices.pdf} \caption{(a) The breathing kagome lattice with intratrimer bonds $J_\triangle$ along the upwards triangles and intertrimer bonds $J_\bigtriangledown$ along the downwards triangles. (b) The triangle-square lattice with the intratrimer bonds $J_1$, $J_2$, and $J_3$ as well as the intertrimer bonds $J$. The $x$ ($y$) lattice direction points to the right (upwards). } \label{fig:lattices} \end{figure} Unbiased numerical studies of both the undistorted and the breathing distorted kagome lattice have so far been based mainly on exact diagonalization (ED) calculations~\cite{Yan2011,Sugiura13,Laeuchli19,Schnack18} on (relatively) small clusters, tensor-network methods such as the density matrix renormalization group (DMRG)~\cite{Yan11,Depenbrock2012,Repellin2017,He17} or infinite projected-entangled pair states (iPEPS) and related approaches~\cite{Liao17,Chen18,Jahromi2020}, which do however suffer in the case of DMRG from finite-circumference cylinder geometries and in the case of iPEPS from limited accessible bond dimensions. Unbiased quantum Monte Carlo methods such as the stochastic series expansion (SSE)~\cite{Sandvik1991,Sandvik1992,Sandvik1999,Syljuasen2002,Alet2005} typically suffer from the negative sign problem~\cite{Henelius00, Troyer2005} in the face of frustration. Averting this basis-dependent sign problem is however possible for a set of special models by performing a local change of basis. A notable example for this is the class of highly-frustrated Heisenberg antiferromagnets on lattices with “fully frustrated” interactions, where changing to a suitable cluster basis removes the sign-problem~\cite{Nakamura1998,Alet2016,Honecker2016,Ng2017,Stapmanns2018,Weber2021}. In this work, we show how a suitable cluster basis can also be beneficial in the case of weakly coupled trimer clusters. Here, the sign problem is in general still present but can be reduced to a degree where unbiased calculations of the thermodynamic quantities become possible down to the low-temperature regime. We will perform these calculations for the $S=1/2$ Heisenberg antiferromagnet on two basic lattices of coupled trimers, highlighting the strengths and shortcomings of this approach. First, we will consider a square lattice of triangle clusters (the triangle-square lattice, \cref{fig:lattices}(b)), where the triangular clusters are arranged on a bipartite parent lattice so that the frustration predominantly arises within the clusters themselves. This model Hamiltonian has been put forward~\cite{Wessel2001,Wang2001} to describe the frustrated quantum magnetism observed in the cuprate-based compound La${}_4$Cu${}_3$MoO${}_{12}$. Second, we will then return to the kagome lattice with strong breathing distortion (\cref{fig:lattices}(a)) as a more challenging example where also the interaction between trimers takes place on a highly frustrated triangular parent lattice~\cite{Repellin2017,Jahromi2020}. The remainder of this article is structured as follows. In \cref{sec:basis} we outline the details of the different cluster bases we employ in our simulation. In \cref{sec:ts}, we present our results for the triangle-square lattice, which are contrasted in \cref{sec:bk} to those for the breathing-distorted kagome lattice. Finally, in \cref{sec:conc}, we draw a conclusion on our results and provide an outlook. \section{Cluster bases} \label{sec:basis} In this paper, we employ and compare three different computational bases that correspond to the eigenbasis of different physical single-trimer operators. The first is the conventional single-spin $S_z$-basis~\cite{Sandvik1991}, in which the $S^z$ component of each trimer spin is diagonal, \begin{equation*} S^z_{\Delta,\alpha} \ket{m_1,m_2,m_3} = m_\alpha \ket{m_1,m_2,m_3},\quad \alpha = 1,2,3. \end{equation*} The second is the dimer basis, $\ket{l_{12}, m_{12}, m_3}$, which diagonalizes the total spin, $\mathbf{S}_{\Delta,12}^2 = (\mathbf{S}_{\Delta,1} + \mathbf{S}_{\Delta,2})^2$, and magnetization, $S_{\Delta,12}^z = S^z_{\Delta,1} + S^z_{\Delta,2}$, along one bond of the trimer (taken here to be the one connecting $\mathbf{S}_1$ and $\mathbf{S}_2$) and leaves the third spin untouched, \begin{align} \ket{1, 1, m_3} &= \ket{\uparrow, \uparrow, m_3},~\ket{1, -1, m_3} = \ket{\downarrow, \downarrow, m_3},\nonumber\\ \ket{1, 0, m_3} &= (\ket{\uparrow,\downarrow} + \ket{\downarrow,\uparrow}) \otimes \ket{m_3}/\sqrt{2}, \nonumber\\ \ket{0, 0, m_3} &= (\ket{\uparrow,\downarrow} - \ket{\downarrow,\uparrow}) \otimes \ket{m_3}/\sqrt{2}. \end{align} Finally we consider the trimer basis, where the total spin, $\mathbf{S}_\Delta^2 = (\sum_{\alpha=1}^3 \mathbf{S}_{\Delta,\alpha})^2$, and total magnetization, $S^z_\Delta = \sum_{\alpha=1}^3 S_{\Delta,\alpha}^z$ of the full trimer are diagonal. In addition to these two, a third operator is needed to completely distinguish the 8 states on the trimer. This operator is not uniquely determined, but can be readily constructed from symmetry considerations. First, choosing an SU(2) symmetric operator ensures that it has a common eigenbasis with $\mathbf{S}^2_\Delta$ and $S^z_\Delta$. Second, by additionally requiring time-reversal symmetry, its eigenbasis (and thus the trimer basis) can be chosen to be real-valued with respect to the single-spin $S^z$ basis. Therefore, the Hamiltonian, which is also real-valued in the $S^z$ basis, will not acquire a phase problem by transformation to the trimer basis \footnote{Even with a complex basis, one can, in principle, retain real-valued weights within the SSE and related algorithms due to pairs of configurations with cancelling imaginary parts \cite{Hen2021}. In this work, however, we concentrate on real-valued bases.}. The simplest way of fulfilling these condition is to use one of the dimer total spin operators, such as $(\mathbf{S}_1 + \mathbf{S}_2)^2$, which we do in the following. Therefore, for the trimer basis $\ket{l_\Delta, m_\Delta, l_{\Delta,12}}$, we have three quantum numbers and \begin{align} \ket{3/2, +3/2, 1} &= \ket{\uparrow\ua\uparrow},\quad \ket{3/2, -3/2 ,1} = \ket{\downarrow\da\downarrow},\nonumber\\ \ket{3/2, +1/2, 1} &= (\ket{\uparrow\ua\downarrow} + \ket{\uparrow\downarrow\uparrow} + \ket{\downarrow\uparrow\ua})/\sqrt{3},\nonumber\\ \ket{3/2, -1/2, 1} &= (\ket{\downarrow\da\uparrow} + \ket{\downarrow\uparrow\downarrow} + \ket{\uparrow\downarrow\da})/\sqrt{3},\nonumber\\ \ket{1/2, +1/2, 0} &= (\ket{\uparrow\downarrow} - \ket{\downarrow\uparrow}) \otimes \ket{\uparrow}/\sqrt{2},\nonumber\\ \ket{1/2, -1/2, 0} &= (\ket{\downarrow\uparrow} - \ket{\uparrow\downarrow}) \otimes \ket{\downarrow}/\sqrt{2},\nonumber\\ \ket{1/2, +1/2, 1} &= (\ket{\uparrow\downarrow\uparrow} + \ket{\downarrow\uparrow\ua} - 2 \ket{\uparrow\ua\downarrow})/\sqrt{6},\nonumber\\ \ket{1/2, -1/2, 1} &= (\ket{\downarrow\uparrow\downarrow} + \ket{\uparrow\downarrow\da} - 2 \ket{\downarrow\da\uparrow})/\sqrt{6}. \end{align} For the Hamiltonian of uncoupled trimers, the single-spin basis has a sign problem. The dimer basis is sign-free under the condition that the decoupled trimers are mirror symmetric perpendicular to the dimer it singles out. By contrast, the trimer basis can be made sign-free in any case by choosing an appropriate third operator so that it coincides with the eigenbasis of a single trimer. Once an intertrimer coupling is introduced, in general, all three bases are subject to the sign problem. The severity of this sign problem depends on the model studied and can also differ largely between different bases. For example, for the specific case of the fully-frustrated trilayer (FFTL) model considered in Ref.~\cite{Weber2021}, the sign problem is completely eliminated only in the trimer basis (the FFTL is obtained upon adding in \cref{fig:lattices}(b) couplings of strength $J$ between all spins belonging to nearest-neighbor trimers). In the following, we will show how, in contrast to the single-spin basis, the dimer and trimer bases remain useful in the regime of weak intertrimer coupling and allow us to resolve the thermodynamics of the two trimer magnets that we examine here. \section{Triangle-square lattice} In this section, we first consider the triangle-square lattice model of coupled spin trimers. In this system, the trimers are arranged on a biparite square lattice, so that the magnetic frustration resides within the individial trimers. The ground state phase diagram of this model has been analyzed based on ED and mean-field theory~\cite{Wessel2001,Wang2001}. As detailed further in Sec.~\ref{Sec:TSGSO}, in the weak $J'$-regime, the ground state phase diagram is composed of various magnetically ordered regimes, depending on the relative strength of the three intratrimer couplings. In the following we consider finite-size systems with periodic boundary conditions, where the number of spins relates via $N=3L^3$ to the linear system size $L$ of the square lattice. \label{sec:ts} \subsection{Sign} \begin{figure} \includegraphics{figs/triangle_square_sign.pdf} \caption{Average configuration sign, $\langle \mathrm{sign}\rangle$, of the $L=12$ triangle-square lattice in different computational bases for different values of the intratrimer couplings $J_{1/2/3}$ and the intertrimer coupling $J$. In panels (a--d) solid lines show the dimer and trimer basis using the total spin of the $\mathbf{S}_1$-$\mathbf{S}_2$ dimer as a quantum number. In panel (c), the dashed lines show rotated versions of these bases using the $\mathbf{S}_2$-$\mathbf{S}_3$ dimer, allowing for an improved sign in this case.} \label{fig:triangle_square_sign} \end{figure} We start our discussion of the triangle-square lattice by comparing the average configuration sign, $\langle \mathrm{sign}\rangle$~~\cite{Henelius00, Troyer2005, Honecker2016}, for the three different bases and at different points in the parameter space of the intradimer couplings. (\cref{fig:triangle_square_sign}). Generally, the average sign decays to zero as temperature goes to zero, but the scale of this decay depends on the basis. For the single-spin basis it is set by the dominant of the intratrimer couplings $J_{1}$, $J_{2}$, $J_{3}$. For weakly coupled trimers (\cref{fig:triangle_square_sign}(a--c)), the dimer and trimer bases greatly outperform the single spin basis, retaining a robust sign down to $T\sim J$. Along the symmetric line $J_1 =J_2$, the dimer basis is slightly more favorable than the trimer basis and off the symmetric line (\cref{fig:triangle_square_sign}(c)), the trimer basis is favorable. In the special case where $J_1\ne J_2$ but $J_2=J_3$ a rotated version of the dimer and trimer basis, using the $S_2$-$S_3$ instead of the $S_1$-$S_2$ dimer, can be used to further enhance the average sign (\cref{fig:triangle_square_sign}). For stronger couplings (\cref{fig:triangle_square_sign}(d)), the trimer basis becomes less effective than the single spin basis while the dimer basis retains a robust sign down to $T\sim J$ (in practice, our SSE simulations remain feasible for $\langle \mathrm{sign}\rangle$ larger than $O(10^{-2})$). This behavior can be intuitively understood by considering the ways in which the triangle-square lattice can be extended to eliminate the sign-problem in the respective bases. For the single-spin basis, no such extension exists. The only way to remove the sign-problem is to remove couplings -- both inter- and intratrimer -- until there is no more geometric frustration. For the dimer basis, if $J_1 = J_2$, the model becomes sign-free upon adding further interactions of strength $J$ among all spins that belong to neighboring horizontal dimers so that that the model turns into rows of fully frustrated two-leg ladders interlaced by rows of single spin-1/2s. In the trimer basis, the model can be made sign-free for any values of $J_{1}$, $J_{2}$, and $J_{3}$ by extending it to the FFTL model~\cite{Weber2021}, however doing so requires more additional couplings than in the case of the dimer basis. Going back to the original triangle-square lattice, we may assume that at temperatures $T$ that are large compared to the energy scale of these modifications, the system should behave similarly to the sign-free system. In particular, the average sign should stay finite. At lower temperatures, where these differences become important, the sign will, however, drop towards zero. For the single-spin basis, the energy scale needed to make the model sign-free is that of the intratrimer couplings. For the dimer basis, the scale is the bigger of $|J_1-J_2|$ (to make the model symmetric) and $J$. For the trimer basis it is $J$, although with a larger prefactor since in the extended model, more bonds are added. Thus, unless the mirror symmetry is broken, the dimer basis is superior. After having examined the behavior of the average computational sign, we next consider the thermodynamic behavior of the triangle-square lattice. \subsection{Thermodynamics} In the following, we will investigate the thermodynamics of the weakly coupled triangle-square lattice in the regime $T\gtrsim J$, choosing for different points in the phase diagram the best-performing basis according to the preceding analysis. We will commence by looking at the magnetic susceptibility, followed by the specific heat of the system, at the three characteristic sets of intratrimer couplings already considered in the above analysis of the average sign. \begin{figure} \includegraphics{figs/triangle_square_chi.pdf} \caption{The magnetic susceptibility $\chi$ of the $L=12$ triangle-square lattice, multiplied by the temperature $T$ as a function of temperature for different values of the intra- and intertrimer couplings. The insets show a magnification of the data in the low temperature region. For comparison, the exact solutions for decoupled trimers ($J=0$) and $L=2$ are drawn.} \label{fig:triangle_square_chi} \end{figure} The magnetic susceptibility $\chi$ (\cref{fig:triangle_square_chi}) shows that at weak intertrimer coupling $J \ll J_1, J_2, J_3$, the physics at high temperatures is well described by an ensemble of decoupled trimers ($J=0$). In this ensemble, there is a crossover from the high-temperature Curie law $T\chi = 1/4$ to a lower-temperature regime, where the spins on each trimer combine into one effective spin-1/2, corresponding to a $T\chi=1/12$ Curie law. At even lower temperatures, the uncoupled-trimer approximation breaks down as the intertrimer interactions couple the effective spin-1/2s, eventually leading to different AFM orders compatible with the square parent lattice of the trimers~\cite{Wessel2001,Wang2001}. This crossover happens at different temperatures, depending on the intratrimer couplings, with $(J_1,J_2)/J_3 = (0.5,1.0)$ being the most robust to interactions out of those studied here. With increasing intertrimer interaction $J$, deviations from the decoupled-trimer form are also visible at higher temperatures. We note that while the exact solution for $L=2$ captures this behavior qualitatively, it significantly differs from the $L=12$ QMC results at low temperatures. This indicates an increased correlation length at low temperatures in the triangle-square lattice. At the same time, this deviation confirms that the QMC approach does perform well beyond the temperature regime of trivial few-trimer physics. \begin{figure} \includegraphics{figs/triangle_square_specheat.pdf} \caption{The specific heat $C$ of the $L=12$ triangle-square lattice, divided by the temperature $T$ as a function of temperature for different values of the intra- and intertrimer couplings. Black lines show the exact solution for $J=0$.} \label{fig:triangle_square_specheat} \end{figure} The specific heat $C$ provides a different perspective on this situation (\cref{fig:triangle_square_specheat}). Here, at high temperatures, the data is again well described by the decoupled case (showing even less deviations than $\chi$ at $J/J_3 = 0.1$). We note that the area under the $C/T$ curves shown in \cref{fig:triangle_square_specheat} corresponds to the released entropy of the model and a deviation from the value $\log 2$ per spin signifies a residual extensive ground state degeneracy. For $J=0$ this is indeed the case as the ground state is a product state of doublets (or quartets in the special case $J_1=J_2=J_3$). At low temperatures, the intertrimer interactions will in general lift this degeneracy leading to an additional release of entropy. For $J/J_3=0.01$, we cannot resolve this regime due to the severity of the sign-problem at such low temperatures. At $J/J_3 = 0.1$, the corresponding temperature scale is higher and we clearly resolve a low-temperature peak in the case $(J_1,J_2)/J_3 = (1,1)$ corresponding to the lifting of the quartet degeneracy. In summary, in this section, we computed the thermodynamics of the triangle-square lattice, resolving different temperature regimes where different couplings of the Hamiltonian start to play a role. In the next step, we will take a closer look at the low-temperature regime and check various predictions of ground-state order in the triangle-square lattice. \subsection{Ground-state orders} \label{Sec:TSGSO} As mentioned in the previous section, at low temperatures, each trimer of the triangle-square lattice forms an effective spin-1/2, or in other words, only the lowest energy doublet contributes to the physics. In a leading-order perturbative expansion in the weak intertrimer coupling $J$, an effective Heisenberg model \begin{equation} H_\text{eff} = \sum_{\Delta} J_x^\text{eff} \mathbf{s}_\Delta \cdot \mathbf{s}_{\Delta +\hat{x}} + J_y^\text{eff} \mathbf{s}_\Delta \cdot \mathbf{s}_{\Delta +\hat{y}} \end{equation} for these effective spins, denoted $\mathbf{s}_\Delta = P_{\Delta}\,\mathbf{S}_{\Delta}\,P_{\Delta}$, can be derived~\cite{Wang2001}, where $P_{\Delta}$ is a projector to the lowest energy doublet on trimer ${\Delta}$. Because the trimers themselves are arranged on a square parent lattice, this effective low-energy model is no longer frustrated and its ground state phase-diagram is well known to display magnetic order at different wave vectors $\mathbf{Q}$ depending on the signs of $J^\text{eff}_{x/y}$, which in turn depend on the values of $J_{1/2/3}$~\cite{Wessel2001,Wang2001}. The case $J_1=J_2=J_3$ forms an exception in this analysis since the low-energy subspace consists of two degenerate SU(2) doublets. In addition to an effective SU(2) spin $\mathbf{s}_\Delta$, this gives rise to a pseudospin low-energy degree of freedom $\boldsymbol{\tau}$ distinguishing the two doublets. The effective Hamiltonian then becomes \begin{equation} \label{eq:ts_degenerate_ham} H_\text{eff}' = J \sum_{\Delta} \mathbf{s}_\Delta \cdot \mathbf{s}_{\Delta +\hat{x}} A_{\Delta, \Delta+\hat{x}} + \mathbf{s}_\Delta \cdot \mathbf{s}_{\Delta +\hat{y}} A_{\Delta, \Delta+\hat{y}}, \end{equation} where the operators $A_{\Delta,\Delta'}$ act on the pseudospins (given in detail in Ref.~\cite{Wang2001} and further below). The ground state of this model is not well known, but ED and mean-field theory suggest the formation of $(\pi,\pi)$ order around $J_1=J_2=J_3$. A sketch of the complete phase diagram as obtained in Ref.~\cite{Wessel2001} is shown in \cref{fig:triangle_square_phasediag}. \begin{figure} \includegraphics{figs/triangle_square_phasediag.pdf} \caption{Illustration of the magnetic phase diagram of the triangle-square lattice model obtained from ED in Ref.~\cite{Wessel2001}. Depending on the intratrimer coupling ratios, the effective spin-1/2 degrees of freedom per trimer form magnetic order along different wave vectors $\mathbf{Q}$. The extent of the $(\pi,\pi)$ phase depends on the magnitude of $J$, shrinking to the singular point $J_1=J_2=J_3$ as $J\rightarrow 0$; the illustration corresponds to $J\approx 0.1 J_3$. } \label{fig:triangle_square_phasediag} \end{figure} In the following, we will check the validity of this phase diagram for finite but small intertrimer couplings. To this end, we compute the magnetic structure factor, \begin{equation} S(\mathbf{Q}) = \frac{1}{L^2} \sum_{\Delta, \Delta'} e^{i \mathbf{Q}\cdot(\mathbf{R}_\Delta-\mathbf{R}_{\Delta'})} \braket{\mathbf{S}_{\Delta} \cdot \mathbf{S}_{\Delta'}}, \end{equation} with the unit cell positions $\mathbf{R}_\Delta$, while simultaneously scaling the system size $L$ and the temperature $T=J_3/2L$ to resolve the onset of the different magnetic ground state orders. Since the sign problem is least severe along the symmetric line $J_1=J_2$, we concentrate on this case in the following analysis. \begin{figure} \includegraphics{figs/triangle_square_strucfac.pdf} \caption{Finite-size and temperature scaling ($T=J_3/2L$) of the magnetic structure factor $S(\mathbf{Q})$ of the triangle-square lattice along the symmetric line ($J_1=J_2$, $J/J_3=0.1$, see \cref{fig:triangle_square_phasediag}). The system size increases with the opacity of the lines. } \label{fig:triangle_square_strucfac} \end{figure} A scan of the structure factor at different possible ordering wave vectors (\cref{fig:triangle_square_strucfac}) reveals that along the symmetric line, the $(\pi,0)$ and $(\pi,\pi)$ orders are most prevalent, with the former dominating at high $J_1=J_2$ and the latter taking over in the regime around $J_1=J_2=J_3$. At lower $J_1=J_2$, the competition between different orders is very close. However, out of the three structure factors, the one belonging to $(\pi,0)$ is the only one growing with system size in this region, suggesting that it will dominate in the thermodynamic limit. These findings are in agreement with the phase diagram obtained using ED, perturbation theory and mean-field theory. In particular, the close competition at low $J_1=J_2$ can be explained by a weak effective coupling $J_y^\text{eff}$ that only appears at higher orders perturbatively in the intertrimer coupling $J$ \cite{Wang2001}. As we saw, most of the phase diagram of the triangle-square lattice can be understood in terms of the effective spin-1/2 degrees of freedom formed by each trimer. So far, however, we have not considered the pseudospin degree of freedom at the point $J_1=J_2=J_3$. This degree of freedom has a similar role as the third quantum number we had to add in the trimer basis in \cref{sec:basis} in that it lives in the subspace of fixed $l_\Delta$ and $m_\Delta$. In \cref{sec:basis}, we used the eigenbasis of the operator $(\mathbf{S}_{\Delta,1}+\mathbf{S}_{\Delta,2})^2$ to map out this part of the trimer Hilbert space while retaining a real basis. Without this constraint, it is however often useful to use a basis that makes the symmetry of the $J_1=J_2=J_3$ trimer explicit. One such basis is the eigenbasis of the chirality operator~\cite{Subrahmanyam95} \begin{equation} \tau^z_\Delta := \frac{\sqrt{3}}{4} \mathbf{S}_{\Delta,1} \cdot \left(\mathbf{S}_{\Delta,2} \times \mathbf{S}_{\Delta,3}\right) =: \ketbra{R}{R} - \ketbra{L}{L}, \end{equation} with \begin{align} \ket{L,\uparrow} &= \frac{1}{\sqrt{3}} \left(\ket{\uparrow\ua\downarrow} + \omega \ket{\uparrow\downarrow\uparrow} + \omega^* \ket{\downarrow\uparrow\ua}\right),\\ \ket{L,\downarrow} &= \frac{1}{\sqrt{3}} \left(\ket{\downarrow\da\uparrow} + \omega \ket{\downarrow\uparrow\downarrow} + \omega^* \ket{\uparrow\downarrow\da}\right),\\ \ket{R,\uparrow} &= \frac{1}{\sqrt{3}} \left(\ket{\uparrow\ua\downarrow} + \omega^* \ket{\uparrow\downarrow\uparrow} + \omega \ket{\downarrow\uparrow\ua}\right),\\ \ket{R,\downarrow} &= \frac{1}{\sqrt{3}} \left(\ket{\downarrow\da\uparrow} + \omega^* \ket{\downarrow\uparrow\downarrow} + \omega \ket{\uparrow\downarrow\da}\right), \end{align} and $\omega = e^{i 2\pi/3}$. Writing the effective Hamiltonian of \cref{eq:ts_degenerate_ham} in this basis yields \cite{Wang2001} \begin{align} H_\text{eff} = \frac{J}{9} \sum_{\Delta} & A^l_{\Delta}A^r_{\Delta+\hat{x}}\,\mathbf{S}_\Delta \cdot \mathbf{S}_{\Delta+\hat{x}}\nonumber\\ + &A^d_{\Delta}A^u_{\Delta+\hat{y}}\, \mathbf{S}_\Delta \cdot \mathbf{S}_{\Delta+\hat{y}}, \label{eq:ff:ts_heff} \end{align} where \footnote{Because our spin numbering convention differs from Ref.~\cite{Wang2001}, we pick up an extra phase $\omega$ here, simplifying the Hamiltonian slightly.} \begin{align} A^l_{\Delta} &= 1-2\omega^*\tau^+_\Delta-2\omega \tau^-_\Delta,\nonumber\\ &= 1 + \tau_\Delta^x + \sqrt{3} \tau_\Delta^y,& \\ A^r_\Delta &= 1-2 \omega \tau^+_{\Delta} - 2 \omega^* \tau^{-}_{\Delta},\nonumber\\ &=1+\tau_\Delta^x - \sqrt{3} \tau_\Delta^y\\ A^d_{\Delta} &= 1-2 \tau^x_\Delta,\\A^u_{\Delta} &= 2+2 \tau^x_\Delta. \end{align} act on the pseudospin degree of freedom via the operators $\tau^+ = \ketbra{L}{R}$ and $\tau^- = (\tau^+)^\dagger$. Note that the shape of the $A$ operators is strongly constrained by the symmetries of the triangle-square lattice. The horizontal mirror symmetry $\Sigma$, represented by $\tau^x$ (skipping the trimer index $\Delta$) on each trimer implies \begin{equation} \Sigma A^l \Sigma^{-1} = A^r, \quad \Sigma A^d \Sigma^{-1} = A^d, \quad \Sigma A^u \Sigma^{-1} = A^u. \end{equation} Similarly, the time-reversal symmetry $\Theta$, given by $K \tau^x$, where $K$ is the complex conjugation operator in the chirality basis, leads to \begin{align} \Theta A^l \Theta^{-1} &= A^l,& \Theta A^r \Theta^{-1} &= A^r,\\ \Theta A^d \Theta^{-1} &= A^d, & \Theta A^u \Theta^{-1} &= A^u. \end{align} At low temperatures, the pseudospin degree of freedom may spontaneously break either of these symmetries, forming a chiral or lattice nematic state. The former was indeed proposed based on mean-field theory results for $H_\text{eff}'$ \cite{Wang2001}. In contrast to the magnetic order which constitutes the breaking of a continuous symmetry, the pseudospin can break its discrete symmetries also at finite temperature. To check these possibilities, we compute the correlation functions of the chirality pseudospin $\tau^z$, which is odd under time reversal, \begin{equation} C^z(\mathbf{r}) = \braket{\tau^z_0 \tau^z_{\mathbf{r}}}, \end{equation} and the operator $\tau^y = \frac{2}{\sqrt{3}} (\mathbf{S}_1 - \mathbf{S}_2)\cdot \mathbf{S}_3$, which is odd under horizontal reflections, \begin{equation} C^y(\mathbf{r}) = \braket{\tau^y_0 \tau^y_{\mathbf{r}}}. \end{equation} Since we cannot directly simulate in the chirality basis, both of these correlation functions contain operators that are off-diagonal in our computational basis. Nevertheless, it is possible to compute them on-the-fly during the loop update. In \cref{sec:loopmeas} we show how such on-the-fly measurements can be performed within the SSE loop update also in the presence of a sign problem. Having identified $\tau^z$ and $\tau^y$ in terms of constituent spin operators, we note that $\tau^x = (\mathbf{S}_1 + \mathbf{S}_2)^2 - 1$. This highlights that the chirality basis and the computational “$l_{\Delta,12}$” trimer basis introduced in \cref{sec:basis} are related by a simple unitary pseudospin rotation. Consequently, in the $l_{\Delta,12}$-trimer basis, the correlation functions $C^z$ and $C^y$ can still be expressed by simple (albeit different) Pauli matrices, \begin{align} \tau^z &= \ketbra{1/2}{1/2}_{l_\Delta}\otimes \mathbf{1}_{m_\Delta} \otimes i(\ketbra{1}{0} - \ketbra{0}{1})_{l_{\Delta,12}},\\ \tau^y &= \ketbra{1/2}{1/2}_{l_\Delta}\otimes \mathbf{1}_{m_\Delta} \otimes (\ketbra{1}{0} + \ketbra{0}{1})_{l_{\Delta,12}}. \end{align} For this reason, we prefer the trimer basis over the dimer computational basis for this calculation even though it has a slightly reduced average sign. In the dimer basis, calculating $C^z$ and $C^y$ in a similar way is in principle possible, but with much more complicated matrix elements due to the split of the Hilbert space of $\mathbf{S}_{\Delta,1}$, $\mathbf{S}_{\Delta,2}$, and $\mathbf{S}_{\Delta,3}$ constituting the spin chirality into two distinct computational cluster-basis sites. \begin{figure} \includegraphics{figs/triangle_square_chirality.pdf} \caption{Chirality correlation functions $C^z$ and $C^y$ for the triangle-square lattice for $J_1=J_2=J_3$, $J/J_3=0.1$ at $T/J_3=0.05$. Panels (a) and (b) show the respective correlations in both the $x$ and $y$ lattice directions while panel (c) compares them along the dominant $x$ direction.} \label{fig:triangle_chiral} \end{figure} As seen from the QMC data shown for $C^z(\mathbf{r})$ (top left panel a) and $C^y(\mathbf{r})$ (top right panel b) in \cref{fig:triangle_chiral}, we observe a rapid decay of these correlations along both lattice directions, i.e., for $\mathbf{r} \propto \hat{\mathbf{x}}$ ($x$ direction) and $\mathbf{r}\propto\hat{\mathbf{y}}$ ($y$ direction). The chirality correlations exhibit a finite value only among nearest neighbor trimers, and are essentially zero beyond $r>2$ (the value of $C^y(\mathbf{r})$ at $\mathbf{r}=2\,\hat{\mathbf{x}}$ is also suppressed with increasing system size $L$, cf. the bottom panel c). We therefore do not obtain indication for the presence of any further symmetry breaking induced by the chirality degree of freedom~\cite{Wang2001} within the accessible temperature regime of our QMC approach. \section{Breathing kagome lattice} After having considered a system of coupled trimers, for which the superlattice of trimers is bipartite, we next consider the case of the (breathing) kagome lattice, which is formed by a (non-bipartite) triangular lattice of coupled trimers. In this system there is thus an additional source of magnetic frustration beyond the one introduced by the antiferromagnetic intratrimer couplings. We again consider finite-size systems with periodic boundary conditions, and also in this case the number of spins relates via $N=3L^3$ to the linear system size $L$ of the triangular lattice. \label{sec:bk} \subsection{Sign} \begin{figure} \includegraphics{figs/kagome_sign.pdf} \caption{Average configuration sign, $\langle \mathrm{sign}\rangle$, of the $L=12$ breathing kagome lattice in different computational bases for different breathing distortions $J_\bigtriangledown/J_\triangle$.} \label{fig:kagome_sign} \end{figure} For the kagome lattice with breathing distortion, we also start by comparing the average configuration sign for the computational bases introduced in \cref{sec:basis} (\cref{fig:kagome_sign}). For weak intertrimer couplings $J_\bigtriangledown$, the dimer and trimer bases again strongly outperform the single-spin basis retaining a finite sign down to $T\sim J_\bigtriangledown$, while at stronger couplings this advantage fades away. In contrast to the triangle-square lattice, however, at weak intertrimer couplings, the sign is nearly identical between the dimer and trimer basis for $J_\bigtriangledown/J_\triangle \lesssim 0.1$, with a slight advantage of the trimer basis in the low-$T$ regime. At larger $J_\bigtriangledown$, the dimer basis has a slightly higher average sign, but eventually falls below the sign of the single-spin basis. Therefore, moving forward, we will focus on the weak coupling regime, i.e. the regime of high breathing distortion, and use the trimer computational basis. \subsection{Thermodynamics} \begin{figure} \includegraphics{figs/kagome_chi.pdf} \caption{The magnetic susceptibility $\chi$ of the breathing kagome lattice multiplied by the temperature $T$ as a function of $T$ for different breathing distortions $J_\bigtriangledown/J_\triangle$. For $J_\bigtriangledown=0$, the ED solution for decoupled trimers is shown. For finite $J_\bigtriangledown$, the dashed lines show $L=2$ ED data.} \label{fig:kagome_chi} \end{figure} \begin{figure} \includegraphics{figs/kagome_specheat.pdf} \caption{The specific heat $C$ of the breathing kagome lattice as a function of temperature $T$ for different breathing distortions $J_\bigtriangledown/J_\triangle$. For $J_\bigtriangledown = 0$ the ED solution for decoupled trimers is shown. For finite $J_\bigtriangledown$, the dashed lines show $L=2$ ED data.} \label{fig:kagome_specheat} \end{figure} In analogy to the triangle-square lattice, we compute the magnetic susceptibility $\chi$ (\cref{fig:kagome_chi}) and the specific heat $C$ (\cref{fig:kagome_specheat}). At high temperatures and weak intertrimer couplings, these observables converge to the same decoupled trimer limit as the triangle-square lattice. In the susceptibility (\cref{fig:kagome_chi}), the effective spin-1/2 plateau at low temperatures again vanishes with increasing intertrimer interactions. The specific heat shows the onset of a low temperature peak associated with the lifting of degeneracies by the intertrimer interactions. In general, due to the sign problem it is challenging to reach the low-temperature regime $T\sim J_\bigtriangledown$, but in our accessible temperature range both the susceptibility and the specific heat are well described by ED data for $L=2$. This is in contrast to the triangle-square lattice for which at similar temperatures, significant deviations from the $L=2$ data were found due to the onset of magnetic correlations. \begin{figure} \includegraphics{figs/kagome_mag.pdf} \caption{Magnetization per site $M$ of the breathing kagome lattice as a function of magnetic field $h$ for different breathing distortions $J_\bigtriangledown/J_\triangle$, taken at $T=0.083J_\triangle$.} \label{fig:kagome_mag} \end{figure} In addition to these observables, we furthermore computed the magnetization (per site) $M=\frac{1}{M}\sum_i S^z_i$ at a finite magnetic field $h$ introduced to the Hamiltonian, \begin{equation} H' = H - h \sum_{\Delta} S_\Delta^z\, , \end{equation} which shows two extended plateaus (\cref{fig:kagome_mag}) corresponding to the magnetizations per trimer $\braket{m_\Delta}=1/2$ and $\braket{m_\Delta}=3/2$, respectively~\cite{Honecker11}. At the boundaries of these plateaus, the competition between different magnetization sectors renders the energetic contributions due to the small intertrimer coupling more important. In these regions the magnetization displays smooth crossovers, where at our lowest accessible temperature of around $T/J_\triangle = 0.083$, we do not resolve signs of further plateaus. In general, increasing $J_\bigtriangledown$ at fixed $T/J_\triangle$ leads to stronger frustration and thus to an overall decrease of the magnetization. Previous works have found a quantum phase transition from a nematic state breaking the lattice rotation symmetry to a spin liquid state at weak intertrimer coupling in the range of $J_\bigtriangledown/J_\triangle \approx 0.05$ \cite{Repellin2017}. While we see no signatures of such a transition in the thermodynamic behavior presented until now, measuring the associated nematicity order parameter and its correlation function is in principle possible within our approach, allowing for the direct detection of such a phase, if it persists to high enough temperatures. In \cref{sec:nematicity}, we show the absence of a lattice nematic state for $T/J_\triangle \gtrsim 0.083$, limiting a finite-temperature lattice nematic phase, if it persits, to lower temperatures than those accessible to our QMC approach. \section{Conclusion} \label{sec:conc} In this article we computed the thermodynamics of two models of weakly coupled Heisenberg trimers using quantum Monte Carlo simulations in different cluster bases. In both the triangle-square lattice and the breathing kagome lattice, these cluster bases allowed us to resolve temperatures down to the order of the weak intertrimer coupling, greatly outperforming the single-spin basis. For the triangle-square lattice, we further picked up the signatures of different magnetic orders expected to form in the ground state. We also showed that correlations related to the additional chirality degree of freedom for the case of equal intratrimer couplings can be efficiently accessed using the trimer basis. However, no additional symmetry breaking as observed within the accessibly temperature range. The thermodynamic data for the breathing kagome lattice was found to be well-described by a simple $L=2$ cluster throughout our accessible temperature range. In particular, we observe the presence of a two-peak structure in the specific heat in both the lattice-nematic and the quantum spin liquid regime of the breathing kagome lattice. Whereas some studies also reported a two-peak structure in the undistored kagome lattice ($J_\bigtriangledown=J_\triangle$)~\cite{misguich05,Shimokawa16}, recent work concludes instead in favor of a single peak with a pronounced low-$T$ shoulder in the undistored kagome lattice~\cite{Sugiura13,Chen18,Schnack18}. It would therefore be interesting to further examine the evolution of the low-temperature specific heat upon increasing $J_\bigtriangledown$ from the strong breathing regime that we can access by QMC into the weak breathing region, including the undistored limit. \begin{acknowledgments} We thank Andreas Honecker and J\"urgen Schnack for useful discussions. We acknowledge the support of the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) through Grant No. WE/3649/4- 2 of the program FOR 1807 and through project RTG 1995, and the IT Center at RWTH Aachen University and the JSC J\"ulich for access to computing time through JARA-HPC. \end{acknowledgments}
facbba192c78cb79ac8c457313fdb38c0d7e90f0
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Neurons and Synapses} Neuronal representations at various spatiotemporal scales are critical for neural computation within the mammalian nervous system which includes information processing at cellular scales such as synaptic transmission between individual synapses or groups of synapses across membranes such as dendrites, axonal transmission between axons terminals and cell bodies called perikarya or soma within a neuron cell body, intraneuronal dendritic compartments, interneuronal compartments. From subcellular organelles to neural ensembles; from ion channels localized clusters composed mainly of two subunits each, namely ion channels (see Section 2) organized into tetramers each having 4 pore domains connected together by intracellular linkages such those found throughout neuronal systems. From molecular genetic perspectives, many questions regarding how cells process sensory information have led researchers to focus their attention towards identifying genes coding for proteins which regulate neurotransmission \cite{1}. Specifically, this is due to a need to understand how emergent properties emerge from these network structures at multiple spatiotemporal scales. One such cellular automaton-based model has been proposed earlier. \cite{2} Spiking Neurons provide answers because they produce high frequency signals encoding sensory stimuli during synaptic communication where neurotransmitters induce either opening or closing ion channels allowing ions flow through open gates inducing an allosteric change permitting influxes/effluxes upon depolarization/hyperpolarization states thereby producing an action potential spike representing an encoded symbol according to its timing over time. \bigskip Over the past decades scientists have sought ways develop mathematical constructs able describe voltage dynamics within neurones thereby providing insight into their functionality including modeling single neuron response curves mathematically using first principles describing input parameters derived from empirical data points obtained via invasive techniques which involves recording extracellularly potentials directly related to membrane potentials along dendritic arborizations which can be considered equivalent computationally speaking if not identical; given its ability perform computations via differential equations. \section{Ion Channels and Transporters - The Building Blocks Of Brain Function And Disease} Ionic currents carried out by selective transmembrane proteinaceous pores play crucial roles inside living cells involved in maintaining homeostatic equilibrium known collectively as homeostasis. \cite{3} Many disorders including epilepsy, autism, schizophrenia, Alzheimer’s disease have been linked directly or indirectly via mutations disrupting ionic channel function.\cite{4}\cite{5}\cite{6}\cite{7}\cite{8}\cite{9}\cite{10} Current interests involve studying single channel properties however it has become more tractable now because its open probability is affected mostly by an electrical signal transmitted through other types of gated receptor like ligand gated receptors (Ligand binding domain – LBD – GPCR signaling). Currents carried out by selective transmembrane proteinaceous pores play crucial roles inside living cells involved maintaining homeostasis. \section{Networks Of Neuron Cell Assemblies With Multiple Levels Of Compartmentalization} Network modeling can be used either topologically describing links among individual elements constituting nodes within a network,or mathematically using equations based upon continuous space differential equations that describe dynamics over time. Network Analysis provides quantitative measures related to functional connectivity allowing inferences about structure-function relationships. For example, functional connectivity reflects topological specificity. \cite{11} Network analysis refers either structural relations defined among elements forming connections using anatomical tracing techniques wherein fibers are visualized microscopically following histological staining \cite{12,13,14} or functional relations defined according data obtained through mathematical analysis; e g fMRI images reflecting statistical fluctuations during resting state EEG activity corresponding respectively anatomical structure formation through growth and development,or dynamical self organization via interaction. Network Analysis provides quantitative measures related to functional connectivity allowing inferences about structure-function relationships. \cite{15,16} \section{Large Scale Integration Across Multiple Layers As Well As In Vivo Connectomes} Large scale integration across multiple layers refers specifically to spatially distant cortical areas that interact functionally often called long range coupling. \cite{17} It contrasts with local computations referring specifically computation performed by spatially compact assemblies consisting mainly excitatory projection neurons located primarily in superficial laminae while also interacting with inhibitory interneurons embedded predominantly within deeper layers; thus representing feedforward input projections into local target pyramidal cells which are themselves reciprocally interconnected amongst one another often called horizontal interactions. Long Range coupling represents wide spectrum ranging from fast action potential propagation across small diameter unmyelinated axons typically of white matter tracts to slower electrical signalling mediated most notably by gap junctions between astroglial cells located adjacent pyramidal neurons where they provide support functions involving K+ recycling required for proper neuronal firing responseto synaptic input but not necessarily restricted thereto. \section{Modeling Spatial Pattern Formation Including Self Organized Criticality} One approach toward building functional networks within a larger brain structure such as cortex is by understanding how local microcircuits interact over space to form global behaviors. Therefore it is important not only to model the dynamics of single neurons but also their collective interactions over multiple time scales. This involves taking into account both the intrinsic dynamical properties of individual neurons such as firing rate adaptation and excitability through voltage gated ion channels and their specific morphological distributions or connection topology. In the previous work, \cite{1} it was discusses how cellular automata could account For the generation of global rhythmic patterns in brainwaves. For example if one neuron fires more frequently than another then its influence should be weighted more highly when modeling synaptic connections between two cells whose firing rates overlap. Such a formalism naturally leads toward self organized criticality (or fractal caused cellular automata) \cite{2} where an ensemble displays scale free behavior like those found throughout nature across many spatiotemporal scales ranging from earthquakes through avalanches during sleep cycles up until neuronal avalanche during seizures observed following traumatic brain injury (TBI) \cite{2}. Since many physiological phenomena display power law statistics one often refers back to statistical physics where they are known simply as critical. \bigskip Examples include phase transitions, magnetization profiles through spin glasses etc. While nonlinear differential equations cannot analytically derive critical states they can predict them numerically provided enough degrees freedom exist in order for them too have similar weights across different time lags making it less susceptible too external noise effects which would cause deviations away from a power law distribution, however stochastic terms must be introduced when considering single neuron systems even if just modelled stochastically so that they remain at least marginally stable against large changes due simply because there was never really any external input/noise imposed upon them. \bigskip However such methods may result too strong once long range correlations start forming since they do not distinguish between high activity events produced by temporally correlated inputs vs uncorrelated inputs which can induce spurious correlations along other dimensions within the system leading eventually towards synchronization (refer \cite{2}) rather than dephasing among cells which seems counter intuitive since synchrony indicates relatively higher levels of information flow within each particular cell group but does not imply any meaningful communication among different cell groups; furthermore increased levels synchrony may actually represent instability instead since synchronization tends toward producing coherent signals while desynchronization produces incoherent signals except under very special circumstances wherein some amount of synchrony remains especially when oscillations occur within certain frequency bands thereby allowing coupling via oscillatory entrainment between coupled oscillators producing coherent signals. \section{STP IN NEURAL NETWORKS} Most existing neurobiologically motivated neural network simulations are typically focused at an average level where most synapses have identical dynamics so that averaged quantities such as synaptic currents can be simply computed by adding up presynaptic spikes convolved by postsynaptic potentials or currents. However, significant variability is often observed within single synapses which suggests that synapse specific behaviors might be important. \bigskip Furthermore, different synapse types exhibit widely varying decay time constants ranging from seconds down to milliseconds, which cannot all be described by averaging over an ensemble distribution of long and short term plasticity type synapses together. Therefore it is necessary to incorporate into simulations more detailed biologically realistic forms for synaptic weights like spike timing dependent plasticity (STDP) or use stochastic rules like those used earlier for modeling spike count driven learning in analog systems where memory units compete through a {Global Fitness Function} rather than local changes driven solely by synaptic strength such as those presented previously. \bigskip Synaptic dynamics naturally lead one naturally into thinking about various kinds of randomness involved here including randomness introduced via noisy spiking events which may occur sporadically during ongoing activity or randomly at each firing event across a broad frequency range depending upon whether postspike refractoriness occurs or not. This leads naturally into further speculation about what kinds of intrinsic noise could exist inside biological neurons themselves given their active membranes---many studies have shown various degrees and sources/sources giving rise to noise throughout neuronal membranes - some very low levels while others higher but still subthreshold levels depending upon context. For example, fast voltage gated ionic channels introduce high levels discrete noise whose statistics reflect certain aspects of underlying channel behavior whereas other slow channels do not fluctuate greatly across membrane potential values thus creating small amplitude white shot noise whose statistics depend on membrane capacitance. \bigskip Note too how this discussion starts getting pretty abstract here especially when looking beyond cell membranes towards dendritic spines where even more complicated biochemical effects must take place eventually leading ultimately perhaps back again towards simplified neuron model simulations? At least something along these lines can be observed when looking at two competing theories describing structural vs nonspatial learning theories starting off with point neuron model simulation experiments designed primarily around differences between Hebbian theory's maximization principle versus Anti Hebbian theory's minimization principle followed then later shifting attention away from differential equations towards more direct use within simpler particle swarm optimization techniques wherein a number representing fitness could change according to temporal evolution via gradient descent techniques implemented through evolutionary procedures.\cite{18,19,20,21,22,23} We leave this part for future discussion. \section{PDNF Models Simulating Brain Connectivity Densities Using Computational Approaches} Computational modeling studies have played an important role not only when examining cellular level features such as single neuron dynamics but also when investigating large scale system level functions including information processing by ensembles. For simple models, there have been proposals consisting only two populations or layers 1 and 2 interacting via spike timing dependent synaptic plasticity (STDP). These show that after repeated trials even though individual layer 1 neurons do not exhibit any particular behavior like learning they still generate useful outputs when used in larger groups because they induce layer 2 cells into synchronization via their interaction through STDP. While this is similar conceptually to many learning rules used currently it highlights the fact that just because individual units are not exhibiting any specific computation does not mean that they may be unable to perform useful computations together once placed within a more global context which introduces additional parameters such as structure formation within network. \bigskip Recently it has been proposed that since real world inputs are highly variable spatially over space and time nonlinearity plays an important role particularly at higher cognitive levels so it seems reasonable therefore to examine what effects nonlinearly induced spatial patterns can have at higher levels of neuronal activity. \cite{24,25,26} To investigate this phenomenon one needs to study local excitatory connections involving spiking neural networks among neocortical pyramidal cells where excitatory synapses were distributed according to various inhomogeneous probability distributions corresponding roughly speaking either planar projections like those found between retinal ganglion cells or 3D isotropic volumes like those observed between cortical pyramidal cells thereby creating local connection topologies resembling random graphs or small world graphs respectively. \bigskip In addition, long term depression (LTD) induction under certain conditions depending upon local excitation relative inhibition (E/I) ratios result specifically altering dendritic depolarization patterns could lead eventually to changes at the neuronal level due primarily alterations made locally during LTP induction cycles especially if occurring across multiple layers simultaneously thereby suggesting one means through which synapse placement could contribute towards emergence/formation of criticality phenomena during development.\cite{2} \bigskip Also in the past, it had been demonstrated using single compartment biophysical simulations incorporating realistic synaptic delays \cite{27} along dendrites where postsynaptic current densities vary inversely proportional to intercellular distances corresponding, generally speaking, with either GABAergic inhibition being relatively sparse compared with excitation or vice versa found significant evidence supporting theories about autism related disorders especially given previously reported anatomical abnormalities along apical dendrites \cite{28, 29} near perisomatic regions among autistic individuals although more detailed experimental testing would be required before conclusions regarding autism pathophysiology could be drawn. \bigskip Several other recent advances include theoretical treatments linking fractal geometry together with neuronal calcium currents \cite{30} producing self organizing wave forms using Hodgkin Huxley type equations. These ideas might eventually play a role in learning abilities especially relating toward memory formation based upon its ability for generating robust low frequency oscillation patterns seen experimentally during slow wave sleep. Other similar types of theoretical treatments include modeling aspects related towards epilepsy mechanisms whereby inhibitory interneuron induced synchronization phenomena mediated through electrical coupling between neighboring cells may ultimately lead into epileptogenic burst firing behavior particularly among thalamo cortical projection systems whereby inhibitory feedback loops may cause abnormal synchronous oscillations capable potentially causing seizures resulting from abnormally increased numbers and synchrony strength while perhaps conversely bursts occurring asynchronously rather than being precisely locked onto each other's discharge times caused weaker entrainment leading into decreased synchronized oscillatory activities possibly preventing seizure generation altogether suggesting various possible treatment options aimed primarily toward reduction instead regulation control methods taking advantage largely from nonlinear characteristics \section{Conclusion: The Path Forward} Computational neuroscience has made significant strides over the past few decades towards understanding how neural circuits encode information about sensory inputs into observable behaviours, and recently it has expanded its scope to investigate higher cognitive functions like language, decision making, motor control, social cognition. Much progress was facilitated by new experimental techniques such as optogenetics which allowed precise stimulation or inhibition of specific cell types within neural circuits in vivo leading to breakthroughs not possible before ephys recordings became feasible at sufficiently high bandwidths ($>$ 1 KHz). While these techniques were critical for uncovering mechanisms behind computations performed by individual cells or small neuronal populations inside living brains, they typically require invasive manipulation through electrodes/optical fibers implanted inside the cortex or sensory organ such that manipulations cannot be readily generalized across species nor across different individuals within a given species without substantial training time prior experimentation. \bigskip Additionally, extracellular electrodes used in ephys recording usually have low signal quality compared with microelectrodes used for intracellular recording so they are not suitable for single neuron electrophysiology recordings needed to study activity dependent synaptic plasticity which requires minimal levels background noise/interference during long durations acquisition sessions spanning minutes up hours during development or days during adulthood due increased habituation caused by elevated levels of calcium transients associated with activity dependent plasticity often measured using fluorescent calcium indicators. \bigskip In contrast microfabrication technology developed over past two decades enables construction and implementation of devices called 'neural probes' capable measuring cellular electrical activities from submicron thin membranes embedded within biologically compatible polymer layers fabricated onto silicon wafers compatible with fabrication methods commonly used by semiconductor industry; when inserted into brains in vivo, their electrochemical interfaces offer stable electrochemical measurements capable of resolving single action potentials firing events along individual neurons down 10--20 microns deep below cortical surface enabling measurement more closely matching what happens inside living brains than ever before allowing researchers unprecedented access into inner workings physiological details underlying behaviorally relevant computations performed inside human beings especially when combined simultaneously along many parallel paths rather than focusing on individual aspects alone; once prototyped onto wafer substrates through application specific integrated circuit (ASIC) manufacturing methods leveraging CMOS compatibility available commercially today they can also be repurposed into commercial devices marketed worldwide already serving countless diverse industrial sectors ranging from healthcare monitoring through agriculture bioengineering. \bigskip Despite tremendous potential afforded them by availability via commercialization thousands already existing designs implemented all around you probably never knew existed but may soon become widely adopted technologies providing society previously impossible scale economies favoring cost effectiveness when scaling production exponentially; design efforts therefore have shifted away form reliance solely on electronic design automation software suites incorporating rules written directly against transistor level schematics now easily replicated quickly even if schematics change requiring recompiling again triggering generation update cycles often taking days until final product shipped whereas hardware engineering revolves around fabricating chips either manually one after another ad nauseam after spending weeks sketching out initial idea followed immediately afterwards months later waiting anxiously until device arrived only then proceed manually writing code against it carefully documenting each step being taken every day driving productivity rapidly towards end goal much faster than software tool suite counterparts. \end{multicols} \bibliographystyle{plain}
1f52677fb94289f6c7560a695642f20bd2e05af9
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:introduction} The segmentation of continuous speech is one process required for speech translation (ST). In text-to-text machine translation (MT), an input text is usually segmented into sentences using punctuation marks as boundaries. However, such explicit boundaries are unavailable in ST. Pre-segmented speech in a bilingual speech corpus can be used when training an ST model, but not in realistic scenarios. Since existing ST systems cannot directly translate long continuous speech, automatic speech segmentation is needed. \par Pause-based segmentation using voice activity detection (VAD) is commonly used for segmenting speech for preprocessing automatic speech recognition (ASR) and ST, even though pauses do not necessarily coincide with semantic boundaries. Over-segmentation, in which a silence interval fragments a sentence, and under-segmentation, in which multiple sentences are included in one segment while ignoring a short pause, are problems that reduce the performances of ASR and ST \cite{wan2021segmenting}. \par In this study, we propose a novel speech segmentation method\footnote{ There is an independent work by Tsiamas et al., (2022) (https://arxiv.org/abs/2202.04774).} based on the segment boundaries in a bilingual speech corpus. ST corpora usually include bilingual text segment pairs with corresponding source language speech segments. If we can similarly segment input speech to such ST corpora, we might successfully bridge the gap between training and inference. Our proposed method uses a Transformer encoder \cite{vaswani2017attention} that was trained to predict segment boundaries as a frame-level sequence labeling task for speech inputs. \par The proposed method is applicable to cascade and end-to-end STs because it directly segments speech. Cascade ST is a traditional ST system that consists of an ASR model and a text-to-text MT model. An end-to-end ST uses a single model to directly translate source language speech into target language text. We limit our scope to a conventional end-to-end ST, which treats segmentation as an independent process from ST. Integrating a segmentation function into end-to-end ST is future work. \par We conducted experiments with cascade and end-to-end STs on MuST-C \cite{di2019must} for English-German and English-Japanese. In the English-German experiments, the proposed method achieved improvements of -9.6 WER and 3.2 BLEU for cascade ST and 2.7 BLEU for end-to-end ST compared to pause-based segmentation. In the English-Japanese experiments, the improvements were -9.6 WER and 0.5 BLEU for cascade ST and 0.6 BLEU for end-to-end ST. A hybrid method with the proposed segmentation model and VAD further improved both language pairs. \section{Related work} Early studies on segmentation for ST considered modeling with the Markov decision process \cite{mansour2010morphtagger, sinclair2014semi}, conditional random fields \cite{nguyen-vogel-2008-context, lu2010better}, and support vector machines \cite{diab-etal-2004-automatic, sadat-habash-2006-combination, matusov-etal-2007, rangarajan-sridhar-etal-2013-segmentation}. They focused on cascade ST systems that consist of an ASR model and a statistical machine translation (SMT) model, which were superseded by newer ST systems based on neural machine translation (NMT). \par In recent studies, many speech segmentation methods based on VAD have been proposed for ST. Gaido et al. \cite{DBLP:journals/corr/abs-2104-11710} and Inaguma et al. \cite{inaguma-etal-2021-espnet} used the heuristic concatenation of VAD segments up to a fixed length to address the over-segmentation problem. Gállego et al. \cite{gallego2021end} used a pre-trained ASR model called wav2vec 2.0 \cite{baevski2020wav2vec} for silence detection. Yoshimura et al. \cite{yoshimura2020end} used an RNN-based ASR model to consider consecutive blank symbols (``\_") as a segment boundary in decoding using connectionist temporal classification (CTC). Such CTC-based speech segmentation has an advantage; it is easier to intuitively control segment lengths than with a conventional VAD because the number of consecutive blank symbols that is considered a boundary can be adjusted as hyperparameters. However, these methods often split audio at inappropriate boundaries for ST because they mainly segment speech based on long pauses. \par Re-segmentation using ASR transcripts is widely used in cascade STs. Improvements in MT performance have been reported by re-segmenting transcriptions to sentence units using punctuation restoration \cite{lu2010better, rangarajan-sridhar-etal-2013-segmentation, cho2015punctuation, ha2015kit, cho17_interspeech} and language models \cite{stolcke1996automatic, wang2016efficient}. Unfortunately, they are difficult to use in end-to-end ST and cannot prevent ASR errors due to pause-based segmentation. We discuss ASR degradation due to speech segmentation with VAD in section \ref{subsec:results-baselines}. \par Finally, we refer to speech segmentation methods based on segmented speech corpora that are more relevant to our study. Wan et al. \cite{wan2021segmenting} introduced a re-segmentation model for modifying the segment boundaries of ASR output using movie and TV subtitle corpora. Wang et al. \cite{wang2019online} and Iranzo-Sánchez et al. \cite{iranzo-sanchez-etal-2020-direct} proposed an RNN-based text segmentation model using the segment boundaries of a bilingual speech corpus. Unlike these methods that require ASR transcripts, our proposed method directly segments speech and can be used in an end-to-end ST as well as in a cascade ST. \section{Proposed method} \label{sec:method} Our method defines speech segmentation as a frame-level sequence labeling task of acoustic features. This section describes the following details of it: the process that extracts training data for the speech segmentation task from the speech translation corpus (\ref{subsec:data}), the architecture of the proposed model (\ref{subsec:model}), and the training (\ref{subsec:training}) and inference algorithms (\ref{subsec:inference}). \subsection{Data extraction} \label{subsec:data} We use a bilingual speech corpus that includes speech segments aligned to sentence-like unit text as training data for speech segmentation from continuous speech into units suitable for translation. Data extraction examples are shown in Fig. \ref{fig:sample}. Two consecutive segments are concatenated and assigned a label, $x\in\{0, 1\}$, representing that the corresponding frame is inside (0) and outside (1) of the utterance. \setlength\textfloatsep{15pt} \begin{figure}[t] \centering \includegraphics[keepaspectratio, width=7.7cm]{figures/data_extraction.pdf} \caption{Data extraction examples from MuST-C: Labels 0 and 1 are assigned to each FBANK frame based on each segment's starting and ending times.} \label{fig:sample} \end{figure} \subsection{Segmentation model} \label{subsec:model} The architecture of the proposed speech segmentation model is illustrated in Fig. \ref{fig:model}. It consists of a 2D convolution layer, Transformer encoder layers, and an output layer (Linear+Softmax), which outputs label probability $\hat{x}_n\in R^2$ at the $n$-th frame of the convolution layer. The convolution layer reduces the sequence length by a quarter to handle long speech sequences. Downsampling is applied to teacher label $x$ to align its length with the model’s output. Here, labels are simply extracted at regular time intervals calculated from the input-output length ratio. \begin{figure}[t] \centering \includegraphics[keepaspectratio, width=5.9cm]{figures/model.pdf} \caption{Transformer encoder-based speech segmentation model} \label{fig:model} \end{figure} \subsection{Training} \label{subsec:training} The model is trained using the data extracted in section \ref{subsec:data} and learns to minimize cross-entropy loss $\mathcal{L}_{seg}(\hat{x},x)$ between prediction $\hat{x}$ and label $x$: \begin{equation} \label{eq:loss} \begin{split} \mathcal{L}_{seg}(\hat{x},x):=-\sum_{n=1}^N\left\{ w_s\log\frac{\exp(\hat{x}_{n,1})}{\exp(\hat{x}_{n,0}+\hat{x}_{n,1})}x_{n,1}\right. \\ \left.+~(1-w_s)\log\frac{\exp(\hat{x}_{n,0})}{\exp(\hat{x}_{n,0}+\hat{x}_{n,1})}x_{n,0} \right\} \end{split}, \end{equation} where $w_s$ is a hyperparameter that adjusts the weights of the unbalanced labels. Since most of the labels are $0$ (within utterances), we increase the weight on the loss of label $1$ (outside utterances). We set $w_s=0.9$ based on the best loss of the validation data in a preliminary experiment. \subsection{Inference} \label{subsec:inference} During inference, speech is segmented at a fixed-length $T$ and input independently into the segmentation model. Fixed-length segments are then resegmented according to the labels predicted by the segmentation model. The segmentation model simply selects label $l_n \in \{0,1\}$ with the highest probability at each time $n$: \begin{equation} \label{eq:single} l_n := \mathop{\rm arg~max}\limits(x_n). \end{equation} \subsubsection{Hybrid method} \label{subsubsec:hybrid} In addition, to make the predictions more appropriate, we combined the model predictions calculated in Eq. (\ref{eq:single}) with the results of the VAD tool: \begin{equation} \label{eq:hybrid} l_n := \left\{ \begin{array}{ll} \mathop{\rm arg~max}\limits(x_n) \land \mathrm{vad}_n & (len(n-1) < maxlen) \\ \mathop{\rm arg~max}\limits(x_n) \lor \mathrm{vad}_n & (len(n-1) \geq maxlen), \\ \end{array} \right. \end{equation} where $\mathrm{vad}_n \in \{0,1\}$ is the VAD output at time $n$, corresponding to the active and inactive frames. Segment length $len(n) $ at time $n$ is denoted as follows: \begin{equation} len(n) := \left\{ \begin{array}{lr} len(n-1) + 1&(l_n = 1) \\ 0&(l_n = 0) \\ \end{array}, \right. \end{equation} where $len(0) := 0$. Eq. (\ref{eq:hybrid}) implies that a frame can only be included in a segment boundary when segmentation model \textbf{and} VAD agree. This agreement constraint may result in very long segments, so we relax it not to require the agreement once the segment length exceeds $maxlen$. In that case, a frame can be included in a segment boundary if either the segmentation model \textbf{or} the VAD allows it. \section{Experimental setup} \subsection{Tasks} \label{subsec:task} We conducted experiments with English to German and English to Japanese ST. We used MuST-C v1 for the English-German and v2 for the English-Japanese experiments. Each dataset consisted of triplets of segmented English speech, transcripts, and target language translations. The English-German and English-Japanese datasets contained about 230k and 330k segments. As acoustic features, we used 83-dimensional vectors consisting of an 80-dimensional log Mel filterbank (FBANK) extracted by Kaldi\footnote{https://github.com/kaldi-asr/kaldi} and 3-dimensional pitch information. We preprocessed the text data with Byte Pair Encoding (BPE) to split the sentences into subwords with SentencePiece \cite{kudo2018sentencepiece}. A dictionary with a vocabulary of 8,000 words was shared between the source and target languages. \par To evaluate the performance, we aligned the outputs of a model for automatically segmented speeches by each segmentation method (section \ref{subsec:method}) to the reference text with an edit distance-based algorithm \cite{matusov2005evaluating}. We then calculated WER for ASR and BLEU for MT and ST. \renewcommand{\arraystretch}{1.1} \begin{table}[t] \centering \caption{Model settings: {\dag}version 0.10.3} \label{table:config} \begin{tabular}{|l|clc|} \hline Settings (ESPnet{\dag} options) & \multicolumn{1}{c|}{ASR} & \multicolumn{1}{l|}{ST} & \multicolumn{1}{l|}{MT} \\ \hline\hline Epochs (epochs) & \multicolumn{1}{c|}{45} & \multicolumn{2}{c|}{100} \\ \hline Encoder layers (elayers) & \multicolumn{2}{c|}{12} & 6 \\ \hline Decoder layers (elayers) & \multicolumn{3}{c|}{6} \\ \hline FNN dimensions (eunits, dunits) & \multicolumn{3}{c|}{2048} \\ \hline Attention dimensions (adim) & \multicolumn{3}{c|}{256} \\ \hline Attention heads (aheads) & \multicolumn{3}{c|}{4} \\ \hline Mini-batch (batch-size) & \multicolumn{2}{c|}{64} & 96 \\ \hline Gradient accumulation (accum-grad) & \multicolumn{2}{c|}{2} & 1 \\ \hline Gradient clipping (grad-clip) & \multicolumn{3}{c|}{5} \\ \hline Learning rate (transformer-lr) & \multicolumn{1}{c|}{5} & \multicolumn{1}{l|}{2.5} & 1 \\ \hline \begin{tabular}[c]{@{}l@{}}Warmup\\ (transformer-warmup-steps)\end{tabular} & \multicolumn{3}{c|}{25000} \\ \hline Label smoothing (lsm-weight) & \multicolumn{3}{c|}{0.1} \\ \hline Attention dropout (dropout-rate) & \multicolumn{3}{c|}{0.1} \\ \hline \end{tabular} \end{table} \subsection{ST systems} \label{subsec:st} We used the Transformer implementation of ESPnet\footnote{https://github.com/espnet/espnet} \cite{watanabe2018espnet, inaguma-etal-2020-espnet} to build the ASR and MT models for the cascade ST and an ST model for the end-to-end ST. For the ASR and ST models using acoustic features as input, we added a 2D-convolution layer before the transformer encoder layers. The model settings are shown in Table \ref{table:config}. We trained the ASR model with hybrid CTC/attention \cite{watanabe2017hybrid} that incorporates the CTC loss into the Transformer. The weight on the CTC loss was set to 0.3. The ST model parameters were initialized with the encoder of the ASR model. The parameters of each model were stored for each epoch. After training to the maximum number of epochs, we averaged the parameters of five epochs with the highest validation scores for evaluation. \subsection{Segmentation methods} \label{subsec:method} \subsubsection{Baseline 1: VAD} As a baseline, we used WebRTC VAD, a GMM-based VAD. We tried nine conditions in the range of \textit{Frame size}=\{10, 20, 30 ms\} and \textit{Aggressiveness}=\{1, 2, 3\}. \subsubsection{Baseline 2: fixed-length} Fixed-length is a length-based approach that splits speech at a pre-defined fixed length \cite{sinclair2014semi}. Although over- and under-segmentations are likely to occur because the method does not take acoustic and linguistic clues into account, its advantage is that the segment length was kept constant. We tried ten fixed-length settings with parameters ranging from 4 to 40 seconds at 4-second intervals. \subsubsection{Speech segmentation optimization} We performed speech segmentation using our proposed model described in section \ref{subsec:model}. During training, two consecutive segments were concatenated, as described in section \ref{subsec:data}. The model’s setting was almost identical as that of the ASR encoder shown in Table \ref{table:config}. However, since the speech segment concatenation roughly doubles the average length of the input, we set the number of mini-batches to 32 and the number of gradient accumulations to 4. Fixed-length $T$ of the input during the inference was set to 20 seconds based on the best score of the validation data. \subsubsection{Hybrid method} We also performed the hybrid method with our model and VAD, as introduced in section \ref{subsubsec:hybrid}. For the hybrid method, we used a WebRTC VAD with (frame size, aggressiveness) = (10 ms, 2) and set \textit{maxlen} to ten seconds. \begin{figure}[t] \centering \includegraphics[keepaspectratio, width=8cm]{figures/plot_wer_bleu.pdf} \caption{Baseline scores on English-German cascade ST: Vertical axis indicates BLEU (left) and WER scores (right) for ASR and MT models.} \label{fig:baseline} \end{figure} \section{Results and discussion} \subsection{Baselines} \label{subsec:results-baselines} Figure \ref{fig:baseline} shows the ASR and MT results by cascade ST for each fixed-length. For comparison, the scores for the setting with the highest BLEU of VAD are shown as straight lines (Best VAD). With the fixed-length approach, WER and BLEU improved in proportion to the input length and deteriorated after reaching a certain length. This result suggests that longer segments can prevent the degradation of the ASR and ST performances due to automatic segmentation. On the other hand, we identified an upper limit to the segment length that the model successfully handled, which depends on its capability. Therefore, automatic speech segmentation is important to prevent ST performance degradation. In addition, the best VAD results were worse than the best fixed-length results (Best Fixed-length)\footnote{A similar trend was shown in a previous study \cite{DBLP:journals/corr/abs-2104-11710}.}, suggesting that over- and under-segmentation due to pause-based segmentation significantly reduced the ASR and ST performances. \begin{table}[t] \centering \caption{Results measured in WER and BLEU for tst-COMMON on MuST-C English-German cascade and end-to-end ST.} \label{table:ende} \begin{tabular}{l|cc|c} \hline & \multicolumn{2}{c|}{Cascade ST} & End-to-end ST \\ \hline & WER & BLEU & BLEU \\ \hline Oracle & 12.60 & 23.59 & 22.50 \\ \hline Best VAD & 30.59 & 17.02 & 16.40 \\ Best Fixed-length & 20.60 & 19.29 & 17.96 \\ Our model & 20.99 & 20.18 & 19.10 \\ ~~+VAD hybrid & \textbf{19.06} & \textbf{20.99} & \textbf{19.87} \\ \hline \end{tabular} \end{table} \begin{table}[t] \centering \caption{Results measured in WER and BLEU for tst-COMMON on MuST-C English-Japanese cascade and end-to-end ST.} \label{table:enja} \begin{tabular}{l|cc|c} \hline & \multicolumn{2}{c|}{Cascade ST} & End-to-end ST \\ \hline & WER & BLEU & BLEU \\ \hline Oracle & 9.30 & 12.50 & 10.60 \\ \hline Best VAD & 25.81 & 9.26 & 8.14 \\ Best Fixed-length & 18.89 & 9.64 & 8.52 \\ Our model & 16.21 & 9.71 & 8.77 \\ ~~+VAD hybrid & \textbf{13.67} & \textbf{10.60} & \textbf{9.24} \\ \hline \end{tabular} \end{table} \subsection{Proposed method} Table \ref{table:ende} shows the overall results of the English-German experiments. Our model outperformed VAD and the fixed-length segmentations for both cascade and end-to-end STs. Roughly speaking, there are improvements in +3 BLEU for the Best VAD and in +1 BLEU for the Best Fixed-length. This suggests that our model can split the speech into segments that correspond to sentence-like units suitable for translation. \par In addition, the hybrid method with VAD significantly improved both cascade (-1.93 WER and +0.81 BLEU) and end-to-end STs (+0.77 BLEU). We confirmed that a hybrid method with our model and VAD greatly improved the translation performance. However, room for improvement remains compared to the oracle segments contained by the MuST-C corpus. \par Table \ref{table:enja} shows the overall results of the English-Japanese experiments. They resemble those in English-German; our model outperformed the existing methods, and a hybrid with VAD achieved more significant improvements. We conclude that the proposed method is also effective for distant language pairs. \begin{table}[t] \centering \caption{Example of ASR and MT outputs with segmentation positions: $\blacksquare$ indicates segment boundaries.} \label{table:case-exp} \begin{tabularx}{\linewidth}{p{23.7mm}|X} \hline \textbf{Oracle (ASR)} & \textit{bonobos are together with chimpanzees you aposre living closest relative $\blacksquare$} \\ \textbf{Oracle (MT)} & \textit{Bonobos sind zusammen mit Schimpansen, Sie leben am nachsten Verwandten. $\blacksquare$} \\ \hline \textbf{Best VAD (ASR)} & \textit{bonobos are $\blacksquare$ together with chimpanzees you aposre living closest relative that ...} \\ \textbf{Best VAD (MT)} & \textit{Bonobos sind es. $\blacksquare$ Zusammen mit Schimpansen leben Sie im Verhaltnis zum ...} \\ \hline \textbf{Our model (ASR)} & \textit{bonobos are together with chimpanzees you aposre living closest relative $\blacksquare$} \\ \textbf{Our model (MT)} & \textit{Bonobos sind zusammen mit Schimpansen, Sie leben am nachsten Verwandten. $\blacksquare$} \\ \hline \end{tabularx} \end{table} \begin{figure}[t] \centering \includegraphics[keepaspectratio, width=7cm]{figures/waveform.pdf} \caption{Visualization of waveforms and segmentation positions} \label{fig:case-wave} \end{figure} \subsection{Case study} Table \ref{table:case-exp} shows an example of the ASR and MT outputs of the cascade ST using VAD and our segmentation model. In VAD, more over- and under-segmentation occurred compared to the oracle segments. In the example, the best VAD resulted in over-segmentation (``\textit{bonobos are $\blacksquare$ together}") and under-segmentation (``\textit{relative that ...}"). These errors caused differences in the oracle segments in the MT results. On the other hand, our model split the speech at a boundary close to an oracle segment and obtained the same translation results. \par Figure \ref{fig:case-wave} shows an example of the waveforms and their segmentation positions. The top two waveforms show that our model and VAD caused over-segmentation. As the bottom waveform shows, hybrid decoding split the audio at a boundary near the oracle and alleviated the problem by requiring an agreement between our model and the VAD. \section{Conclusions} We proposed a speech segmentation method based on a bilingual speech corpus. Our method directly split speech into segments that correspond to sentence-like units to bridge the gap between training and inference. Our experimental results showed the effectiveness of the proposed method compared to conventional segmentation methods on both cascade and end-to-end STs. We also demonstrated that combining the predictions of our model and VAD further improved the translation performance. \par Future work will integrate a segmentation function into an end-to-end ST. In this study, we treated segmentation as an independent process from ST, although it should be included in the \emph{end-to-end} ST. We will investigate ways to integrate our proposed segmentation method into ST for streaming or online processing. Future work will also further investigate different domains, other language pairs, and noisy environments and improve the segmentation model to reduce the need for VAD. \section{Acknowledgements} Part of this work was supported by JST SPRING Grant Number JPMJSP2140 and JSPS KAKENHI Grant Numbers JP21H05054 and JP21H03500. \clearpage \bibliographystyle{IEEEtran}
88a3b290b8c1b63c0f2705a2b4d03235f092f63e
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\@startsection{section}{1}{\z@}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}{\large\bf}{\@startsection{section}{1}{\z@}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}{\large\bf}} \defAppendix \Alph{section}{\arabic{section}} \def\Alph{section}.\arabic{subsection}{\arabic{section}.\arabic{subsection}} \def\arabic{subsubsection}{\arabic{subsubsection}} \def
835078edb9ff4e7ad6fcc741fa5843af4dac7fda
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{\@startsection {section}{1}{\zeta@} {-3.5ex \@plus -1ex \@minus -.2ex} {2.3ex \@plus.2ex} {\normalfont\Large\bfseries}} \renewcommand\subsection{\@startsection{subsection}{2}{\zeta@} {-3.25ex\@plus -1ex \@minus -.2ex} {1.5ex \@plus.2ex} {\normalfont\large\bfseries}} \makeatother \newcommand{\arXivlink}[1]{\href{http://arXiv.org/abs/#1}{arXiv:#1}} \newcommand{\alg}[1]{\mathfrak{#1}} \newcommand{\comm}[2]{[#1,#2]} \newcommand{\acomm}[2]{\{#1,#2\}} \newcommand{\gen}[1]{\mathfrak{#1}} \newcommand{\corr}[1]{{\color{black}#1}} \newcommand{\corp}[1]{{\color{black}#1}} \newcommand{\cortwo}[1]{{\color{red}#1}} \newcommand{\mathfrak{1}}{\mathfrak{1}} \newcommand{\textup{AdS}}{\textup{AdS}} \def\mathbf{1}{\mathbf{1}} \def{\rm Tr}{{\rm Tr}} \def{\rm tr}{{\rm tr}} \def{\rm const}{{\rm const}} \def\textrm{diag}{\textrm{diag}} \def\vspace{3pt}{\vspace{3pt}} \def\nonumber{\nonumber} \def\alpha{\alpha} \def\beta{\beta} \def\gamma{\gamma} \def\delta{\delta} \def\epsilon{\epsilon} \def\varepsilon{\varepsilon} \def\eta{\eta} \def\theta{\theta} \def\zeta{\zeta} \def\lambda{\lambda} \def\kappa{\kappa} \def\mu{\mu} \def\nu{\nu} \def\lambda{\lambda} \def\Lambda{\Lambda} \def\rho{\rho} \def\sigma{\sigma} \def\tau{\tau} \def\phi{\phi} \def\Phi{\Phi} \def\varphi{\varphi} \def\chi{\chi} \def\omega{\omega} \def{\sqrt \l}{{\sqrt \lambda}} \def{\rm h}{{\rm h}} \defh{h} \def$AdS_5 \times S^5~${$AdS_5 \times S^5~$} \def\rangle{\rangle} \def\langle{\langle} \def\EuScript{S}_{_0}{\EuScript{S}_{_0}} \def\EuScript{P}_{_0}{\EuScript{P}_{_0}} \def\EuScript{\tilde P}_{_0}{\EuScript{\tilde P}_{_0}} \def\EuScript{D}{\EuScript{D}} \def\textrm{p}{\textrm{p}} \def\textrm{q}{\textrm{q}} \def\textrm{c}{\textrm{c}} \def\textrm{e}{\textrm{e}} \defm{m} \defx'{x'} \def{\rm a}{{\rm a}} \def\theta_+{\theta_+} \def\theta_-{\theta_-} \def\theta_\pm{\theta_\pm} \def\theta_\mp{\theta_\mp} \def{\textrm I}{{\textrm I}} \def\mathcal{S}{\mathcal{S}} \def|\phi\phi\rangle{|\phi\phi\rangle} \def|\phi\psi\rangle{|\phi\psi\rangle} \def|\psi\phi\rangle{|\psi\phi\rangle} \def|\psi\psi\rangle{|\psi\psi\rangle} \def{\rm x}{{\rm x}} \def{\rm v}{{\rm v}} \deff{f} \def\frac{\sqrt{\xx^2}}{\xx}{\frac{\sqrt{{\rm x}^2}}{{\rm x}}} \def\frac{\xx'}{\sqrt{\xx'^2}}{\frac{{\rm x}'}{\sqrt{{\rm x}'^2}}} \def{\mathfrak{Q}}{{\mathfrak{Q}}} \def{\mathfrak{S}}{{\mathfrak{S}}} \def{\mathfrak{P}}{{\mathfrak{P}}} \def{\mathfrak{K}}{{\mathfrak{K}}} \def{\mathfrak{C}}{{\mathfrak{C}}} \def\mathsf{E}{\mathsf{E}} \usepackage{blkarray} \begin{document} \thispagestyle{empty} \begin{flushright}\footnotesize\ttfamily DMUS-MP-22/02 \end{flushright} \vspace{2em} \begin{center} {\Large\bf \vspace{0.2cm} {\color{black} \large On factorising twists in $AdS_3$ and $AdS_2$}} \vspace{1.5cm} \textrm{Alessandro Torrielli\footnote{\texttt{[email protected]}}} \vspace{2em} \vspace{1em} \begingroup\itshape Department of Mathematics, University of Surrey, Guildford, GU2 7XH, UK \par\endgroup \end{center} \vspace{2em} \begin{abstract}\noindent In this paper we study factorising twists of the massless $AdS_3$ and $AdS_2$ integrable $R$-matrices, and explore the programme of analysis of form factors which Maillet et al developed for ordinary spin-chains. We derive the factorising twists from the universal $R$-matrix of the $\alg{gl}(1|1)$ Yangian double, and discuss the RTT relations for the two- and three-site monodromy matrix. We show how the twist can be used to compute a simple scalar product. We then implement our construction in the language of free fermions. Finally, we show how to obtain the massless $AdS_2$ quantum $R$-matrix from the Yangian universal $R$-matrix, and compute a peculiar factorising twist for this case as well. \end{abstract} \newpage \overfullrule=0pt \parskip=2pt \parindent=12pt \headheight=0.0in \headsep=0.0in \topmargin=0.0in \oddsidemargin=0in \vspace{-3cm} \thispagestyle{empty} \vspace{-1cm} \tableofcontents \setcounter{footnote}{0} \section{Introduction} \subsection{Integrability in $AdS_3$ and $AdS_2$ backgrounds} \subsubsection{$AdS_3$} Integrability in $AdS_3 \times S^3 \times M^4$ \cite{Bogdan}, with $M^4$ being either $T^4$ or $S^3 \times S^1$ \cite{Sundin:2012gc}, - see \cite{rev3,Borsato:2016hud} for reviews - has produced a vast number of results by walking in the footsteps of the originally established $AdS_5$ analysis \cite{Beisertreview,Foundations}. A vast array of articles has explored numerous aspects of this integrable system \cite{OhlssonSax:2011ms,seealso3,Borsato:2012ss,Borsato:2013qpa,Borsato:2013hoa,Rughoonauth:2012qd,PerLinus,CompleteT4,Borsato:2015mma,Beccaria:2012kb,Sundin:2013ypa,Bianchi:2013nra,Bianchi:2013nra1,Bianchi:2013nra2}. The undeniably new ingredient which features in $AdS_3$ are the massless excitations \cite{Sax:2012jv,Borsato:2016xns,Sax:2014mea,Baggio:2017kza} which call into the game the ideas behind the massless $S$-matrix and massless flows \cite{Zamol2,Fendley:1993jh,DiegoBogdanAle}. A substantial body of work has been produced in these investigations \cite{Lloyd:2013wza,Abbott:2012dd,Abbott:2014rca,MI,Abbott:2020jaa,Eberhardt:2017fsi,Gaber1,Gaber2,Gaber3,Gaber4,Gaber5, GaberdielUltimo,Prin,Prin1,Abbott:2015mla,Per9,Hoare:2018jim,AntonioMartin,Regelskis:2015xxa,olobo,Baggio,JuanMiguelAle}). Recently, the Quantum Spectral Curve (QSC) has been adapted to the massive $AdS_3 \times S^3 \times T^4$ spectral problem in \cite{QSC} (see also references therein for an outline of the formalism). A new series of articles \cite{AleSSergey}, see also \cite{Seibold:2022mgg}, has revisited several aspects of $AdS_3 \times S^3 \times T^4$ $S$-matrix integrability and made novel proposals, most importantly for the dressing phases and notably the mirror TBA. The current paper will not be focusing on the dressing phases, and our results, merely pertaining to the Hopf algebra, will apply generally. The Hopf algebra structure typical of AdS/CFT \cite{Hopf}, when realised in the sector of massless excitations, very clearly shows the perspective of the quantised string theory as a $q$-deformation of the standard 2D Poincar\'e (super)symmetry coproduct. The articles \cite{CesarRafa,Charles} first explored this connection in the case of $AdS_5$, recently revisited in \cite{Riccardo}, see also \cite{qseealso}. When dealing with the case of $AdS_3$, this was put to fruition in \cite{JoakimAle,BorStromTorri,Andrea}. In \cite{gamma1,gamma2}, building upon these ideas, it was shown that there is a change of variables which manifests the difference-form of the massless $S$-matrix. This form is identical to the non-trivial BMN limit when taken for particles with the same worldsheet chirality \cite{DiegoBogdanAle}. The `pseudo-relativistic' variable suggested the massive version introduced in \cite{AleSSergey}. While the $q$-Poincar\'e deformation is just the ordinary string theory, re-written in a way which displays the built-in quantum group, in $AdS_3$ one can genuinely deform the model to introduce a mixture of RR and NSNS fluxes \cite{Cagnazzo:2012se,s1,s2,Babichenko:2014yaa,seealso12}. This has the effect of changing the single-particle energy $E$ vs. momentum $p$ dispersion relation, which becomes \cite{ArkadyBenStepanchuk,Lloyd:2014bsa}: \begin{equation} \label{eq:disp-rel} E = \sqrt{\Big(m + \frac{k}{2 \pi} p\Big)^2 + 4 h^2 \sin^2\frac{p}{2}}. \end{equation} In this formula $k \in \mathbbmss{N}$ is the WZW level while $m$ is the particle-mass and $h$ is the coupling (see \cite{OhlssonSax:2018hgc} for a complete analysis of the string moduli space). In \cite{gamma2} a particular procedure on the massive mixed-flux $S$-matrix managed to produce another instance of massless relativistic $S$-matrices, describing critical theories whose central charge is encoded in a very compact set of TBA equations. \subsubsection{$AdS_2$} Integrability in $AdS_2 \times S^2 \times T^6$ \cite{ads2} has also been investigated in depth, in the attempt to catch a non-perturbative glimpse of the dual theory - either a superconformal quantum mechanics or a chiral CFT \cite{dual,gen}. Integrability has been demonstrated \cite{Sorokin:2011rr,Cagnazzo:2011at,amsw}, and in \cite{Hoare:2014kma} the putative $S$-matrix for massive and massless excitations was derived, based on a $\mathfrak{psu}(1|1)^2$ Hopf algebra with triple central extension. The (Yangian) representations which are relevant for massive magnons are long (typical) (cf. \cite{Arutyunov:2009pw}), while the massless modes form short representations \cite{Hoare:2014kma,Hoare:2014kmaa}. We should mention that both $AdS_3$ and $AdS_2$ still present some open questions in the matching with perturbation theory, see also \cite{Per6, Per10, MI,Borsato:2016xns}. The massive $S$-matrix is rather more complicated than its higher-dimensional counterparts, however in the massless limit it enormously simplifies. In \cite{Andrea2} a discussion was provided of how the BMN limit is distantly connected with ${\cal{N}}=1$ supersymmetric $S$-matrices \cite{Fendley:1990cy} via a particular limiting procedure. The $AdS_2$ $S$-matrix has the typical structure of 8-vertex models or of the XYZ spin-chain \cite{Baxter:1972hz, Baxter:1972hz1,Schoutens,MC} - in particular the algebraic Bethe ansatz is not directly applicable due to the lack of a reference state \cite{Levkovich-Maslyuk:2016kfv}, see also \cite{Nepo, Nepo1, Nepo2, Nepo3, Nepo4, Nepo5, Nepo6} (although a pseudovacuum is present for the tensor product of two copies). This problem was overcome in \cite{Andrea2}, see also the subsequent \cite{Ale}, by exploiting the so-called {\it free fermion} condition - as noticed in \cite{MC,Ahn} for these type of models - and by using the idea of inversion relations from \cite{Zamolodchikov:1991vh}. The free fermion condition holds in fact in far greater generality \cite{Lieb,MitevEtAl}. The article \cite{Dublin} afterwards produced a complete analysis and a comprehensive set of Bogoliubov transformations which recast the $AdS_3$ - and to a more limited extent the $AdS_2$ and $AdS_5$ - integrable systems in terms of free fermionic creation and annihilation operators. This builds on the classification presented in \cite{Marius}, see also the recent analysis performed in \cite{NewMarius}. \subsection{This paper} Recently, the form factor programme has moved its first steps in $AdS_3$, with the intention of tackling the correlation functions. The paper \cite{AleSBurkhardtLePlat} has applied the hexagon approach (see references in \cite{AleSBurkhardtLePlat} for the advances made by this approach in $AdS_5$) to the $AdS_3$ case, and initiated the analysis of correlators in particular cases, especially those involving protected operators. In \cite{AleForm} we have entirely restricted to the massless sector and exploited the difference form to apply the more traditional method which Babujian et al devised for Sine-Gordon (see references within \cite{AleForm}), and conjectured integral expressions for the form factors up to three particles by solving the form-factor axioms. A general formula was contemplated for a general number of particles, but testing it is still beyond reach. In this paper we mostly remain in the context of massless modes, and explore an alternative idea due to \cite{Maillet,Maillet2}. This is based on the properties of Hopf algebras and in particular on the idea of factorising twists, which we will review in the text. The crude point is to try and make a change of basis whereby the calculation of form factors and correlation functions is remarkably simplified, and the complication is cast away within the change of basis. Such transformation makes use of Drinfeld twists and on the property of $R$-matrices to admit such factorising twists which reduce it to the identity. This is a feature which is deeply engrained in the quantum group origin of the $R$-matrix and its triangular decomposition, as we will discuss in what follows. Here we will move the very first few steps in this direction, as it turns out that our situation is, once again, harder than the ones traditionally investigated and solved via this technique. Nevertheless, we will be able to unveil useful properties and curious relations which will allow us to setup the programme in a very similar way to what is traditionally done. We will in fact be able to do this for massless modes in both $AdS_3$ and $AdS_2$. Along the way, we will also discover how to derive the massless quantum $AdS_2$ $R$-matrix from the Yangian universal $R$-matrix. The paper is strutured as follows: in section \ref{s2} we recall the notion of Hopf-algebra twists; in section \ref{s3} we recall the massless $AdS_3$ $S$-matrix; in section \ref{s4} we derive the factorising twist from the universal $R$-matrix of the $\alg{gl}(1|1)$ Yangian, discuss how the coproducts transform after we (un)do the twist, and tackle the three-site problem for the monodromy matrix; in section \ref{s5} we show how to recover a simple scalar product \cite{JuanMiguelAle} using the twist; in section \ref{specu} we speculate on the general case; in section \ref{s7} we make a connection with the free-fermion realisation \cite{Dublin}; in section \ref{s8} we make an extension to mixed-flux backgrounds; in section \ref{s9} we treat the $AdS_2$ case and show how to use the Yangian universal $R$-matrix to derive the massless $R$-matrix, alongside with a rather unusual version of the factorising twist. We then make some Conclusions and Acknowledgments. \section{Hopf algebra twists\label{s2}} We briefly recall here the notion of Hopf algebra twist \cite{Chari:1994pz}. Given a quasi-triangular Hopf algebra $\cal{A}$, where we denote by $\mathfrak{1}$ the unit with respect to the multiplication, with $\Delta$ the coproduct, with $\epsilon$ the counit and with $\cal{R}$ the universal $R$-matrix, we can obtain another quasi-triangular Hopf algebra by {\it twisting} it. This means that, if we can find an invertible element ${\cal{F}} \in {\cal{A}\otimes \cal{A}}$ satisfying \begin{eqnarray} (\epsilon \otimes \mathfrak{1}) \, {\cal{F}} = (\mathfrak{1} \otimes \epsilon) \, {\cal{F}} = \mathfrak{1}, \qquad ({\cal{F}} \otimes \mathfrak{1})(\Delta \otimes \mathfrak{1} ) {\cal{F}} = (\mathfrak{1} \otimes {\cal{F}}) (\mathfrak{1} \otimes \Delta) {\cal{F}} \end{eqnarray} (with $\mathfrak{1}$ acting by multiplication in the above formulas), then the new coproduct and, respectively, new $R$-matrix \begin{eqnarray} \tilde{\Delta}(x) = {\cal{F}} \Delta(x) {\cal{F}}^{-1} \qquad \forall \, \, x \in {\cal{A}}, \qquad \tilde{{\cal{R}}} = {\cal{F}}^{op} {\cal{R}} {\cal{F}}^{-1}, \end{eqnarray} define a new quasi-triangular Hopf algebra. The idea of a factorising twist correponds to finding a particular twists such that the new $R$-matrix is equal to $\mathfrak{1} \otimes \mathfrak{1}$. From the definition, this automatically implies that the old $R$-matrix can be factorised as \begin{eqnarray} {\cal{R}} =( {\cal{F}}^{op})^{-1} \, \mathfrak{1}\otimes \mathfrak{1} \, {\cal{F}} = ( {\cal{F}}^{op})^{-1} {\cal{F}}. \end{eqnarray} Because the new $R$-matrix is equal to identity, the new coproduct must be co-commutative - although it can be highly non-trivial. In fact, one has \begin{eqnarray} \tilde{\Delta}^{op}(x) \tilde{{\cal{R}}} = \tilde{{\cal{R}}} \tilde{\Delta}(x) \qquad \forall \, \, x \in {\cal{A}}, \qquad \tilde{{\cal{R}}} = \mathfrak{1} \otimes \mathfrak{1} \qquad \leftrightarrow \qquad \tilde{\Delta}^{op} = \tilde{\Delta}. \end{eqnarray} For purely bosonic Hopf algebras a theorem by Drinfeld always guarantees the existence of a factorising twist under suitable assumptions - see \cite{Maillet,Maillet2}, where a very detailed presentation of Hopf and quasi-Hopf algebras and their twists is also offered. \section{The massless $AdS_3$ $S$-matrix\label{s3}} In this paper we will only focus on the same-chirality massless $S$-matrix of the $AdS_3 \times S^3 \times T^4$ superstring, as it will be sufficient to illustrate our main results. We will also not be concerned at present with the scalar (so-called {\it dressing}) factor, but will instead focus merely on the suitably normalised matrix part. We will also make systematic use of the associated $R$-matrix. If the $S$-matrix is defined as \begin{equation} S : V_1 \otimes V_2 \longrightarrow V_2 \otimes V_1, \qquad S |v_\alpha (\gamma_1) \rangle \otimes |v_\beta (\gamma_2)\rangle = S^{\rho \sigma}_{\alpha \beta} (\gamma_1 - \gamma_2) |v_\rho (\gamma_2) \rangle \otimes |v_\sigma (\gamma_1)\rangle,\label{summat} \end{equation} the $R$-matrix is instead given by \begin{eqnarray} S = \Pi \circ R, \qquad R = \rho_1 \otimes \rho_2 \, ({\cal{R}}), \end{eqnarray} where $\Pi$ is the graded permutation on the states: \begin{eqnarray} \Pi |x\rangle \otimes |y\rangle = (-)^{[x][y]} \, |y\rangle \otimes |x\rangle, \end{eqnarray} where $[x]$ provides the fermionic number of the excitation $x$ and equals $0$ for bosons and $1$ for fermions. The notation $|v_\alpha(\gamma_i)\rangle$ denotes a basis of vectors of so-called {\it one-particle} representation: namely, we have a basis of the vector space $V_i$, which is of dimension $d_i$ (typically both $d_i=2$ for $i=1,2$ in this paper), hence $\alpha = 1,...,d_i$; such vector space carries an $\cal{A}$-representation $\rho_i:{\cal{A}} \to End(V_i)$, and such a representation is characterised by a particular parameter $\gamma_i$ (which is real for unitary representations). Such a parameter will play the role of the physical rapidity of the scattering states, but in general is to be understood as the eigenvalue of a particular Casimir element of $\cal{A}$ in the representation $\rho_i$. In (\ref{summat}) summation of repeated indices is understood. In the paper\footnote{We thank the anonymous referee for the pointing out a notational discrepancy in a previous version of the paper.} we will typically understand an italic $R$ symbol as denoting the representation $\rho_1 \otimes \rho_2$ of the corresponding $\cal{R}$ universal object (for instance, we will have $R_+$ by which we will mean $\rho_1 \otimes \rho_2 \, ({\cal{R}}_+)$, etc.). Likewise for the symbol $F$ (with respect to its corresponding $\cal{F}$). We will also exploit the difference-form of the $S$-matrix in the appropriate pseudo-relativistic variables \begin{eqnarray} \gamma_i = \log \tan \frac{p_i}{4}, \qquad i=1,2, \end{eqnarray} $p_i$ being the momentum of the $i$-th particle. The $R$-matrix then maps \begin{equation} R : V_1 \otimes V_2 \longrightarrow V_1 \otimes V_2. \end{equation} In the specific case we will study the matrix representation has been worked out in \cite{DiegoBogdanAle}, and reads \begin{equation}\label{eq:RLLlimtheta} \begin{aligned} &R |b\rangle \otimes |b\rangle\ = {} \, |b\rangle \otimes |b\rangle, \\ &R |b\rangle \otimes |f\rangle\ = -\tanh\frac{\gamma}{2} |b\rangle \otimes |f\rangle + {\rm sech}\frac{\gamma}{2}|f\rangle \otimes |b\rangle, \\ &R |f\rangle \otimes |b\rangle\ = {} \, {\rm sech}\frac{\gamma}{2} |b\rangle \otimes |f\rangle + \tanh\frac{\gamma}{2} |f\rangle \otimes |b\rangle, \\ &R |f\rangle \otimes |f\rangle\ = - {} \, |f\rangle \otimes |f\rangle\,, \end{aligned} \end{equation} where \begin{equation} \label{eq:diff-form} \gamma = \gamma_1 - \gamma_2\, \end{equation} and $(b,f)$ are a (boson, fermion) doublet, which we will conventionally number as $|b\rangle = |1\rangle$ and $|f\rangle = |2\rangle$ (not to be confused with the spaces $1$ and $2$ of the tensor product). We have also suppressed the $\gamma$ in the basis vectors to lighten up the notation (\ref{summat}) - here $d_i=2$ (in fact $1+1$) $\forall \, \, i=1,2$. One can verify that this $R$-matrix satisfies \begin{eqnarray} R_{21} (-\gamma) R_{12}(\gamma) = 1_2 \otimes 1_2, \qquad R_{12}(\gamma) = R, \qquad R_{21}(\gamma) = perm \circ R,\label{bru} \end{eqnarray} where $1_2$ is the two-dimensional identity matrix. Property (\ref{bru}) is the manifestation of the {\it braiding unitarity} property of the $R$-matrix in the chosen two-dimensional representation. The map $perm$ is the graded permutation on the operators: \begin{eqnarray} perm (A \otimes B) = (-)^{[A][B]} B \otimes A, \qquad A,B : V_i \longrightarrow V_i, \qquad i=1 \, \, \mbox{or} \, \, 2, \end{eqnarray} and it is only defined for operators which are homogeneous with respect to the fermionic grading. In this paper we shall only consider operators which are homogeneous in this sense. Practically, one can write \begin{eqnarray} R = R_{12}(\gamma) = R^{abcd}(\gamma) E_{ab}\otimes E_{cd}, \qquad R_{21}(\gamma) = (-)^{([a]+[b])([c]+[d])} R^{abcd}(\gamma) E_{cd}\otimes E_{ab}. \end{eqnarray} In these formulas, all repeated indices are summed over the range $1,2$. $E_{ij}$ are the matrices with all zeroes except a $1$ in row $i$ and column $j$. The $R$-matrix also has the curious property \begin{eqnarray} R_{12}^2(\gamma) = 1_2 \otimes 1_2. \end{eqnarray} \section{$R$-matrix twist\label{s4}} \subsection{Two sites from the Universal $R$-matrix} The $R$-matrix twist is obtained by making use of the universal $R$-matrix formulation of the $\mathfrak{gl}(1|1)$ Yangian, which is the quantum supergroup underlying all $AdS_3$ $S$-matrices. We first review the Khoroshkin-Tolstoy construction which provides the universal $R$-matrix and which, when evaluated in specific representations, gives us the physical $R$-matrix described in the previous section. The first thing to do is to define the (super)Yangian of $\alg{gl}(1|1)$ in the so-called second realisation of Drinfeld's \cite{Drinfeld:1987sy}, see in particular \cite{Khoroshkin:1994uk,Koro2}\cite{unive0,unive}. In fact what admits a universal $R$-matrix is the (super)Yangian double $DY(\alg{gl}(1|1))$, which is generated by Chevalley-Serre elements ${}{e}_n$, ${}{f}_n$, ${}{h}_n$, ${}{k}_n$, $n\in\mathbbmss{Z}$, satisfying \begin{equation} \label{eq:Lie} \begin{gathered} \comm{{}{h}_0}{{}{e}_n} = -2{}{e}_n , \qquad \comm{{}{h}_0}{{}{f}_n} = +2{}{f}_n, \qquad \acomm{{}{e}_m}{{}{f}_n} = -{}{k}_{m+n} , \\ \comm{{}{h}_m}{{}{h}_n} = \comm{{}{h}_m }{{}{k}_n} = \comm{{}{k}_m }{{}{k}_n} = \comm{{}{k}_m }{{}{e}_n} = \comm{{}{k}_m }{{}{f}_n} = \acomm{{}{e}_m}{{}{e}_n} = \acomm{{}{f}_m}{{}{f}_n} = 0 , \\ \comm{{}{h}_{m+1}}{{}{e}_n} - \comm{{}{h}_m}{{}{e}_{n+1}} + \acomm{{}{h}_m}{{}{e}_n} = 0, \qquad \comm{{}{h}_{m+1}}{{}{f}_n} - \comm{{}{h}_m}{{}{f}_{n+1}} - \acomm{{}{h}_m}{{}{f}_n} = 0. \end{gathered} \end{equation} Closely following \cite{Koro2}, one then needs to introduce the generating functions ({\it currents}) \begin{equation} K^{\pm}(t) = \mathfrak{1}\pm \sum_{\substack{n \ge 0 \\ n<0}} {}{k}_n t^{-n-1}, \qquad H^{\pm}(t) = \mathfrak{1}\pm \sum_{\substack{n \ge 0 \\ n<0}} {}{h}_n t^{-n-1} . \end{equation} The universal $R$-matrix then reads \begin{equation} \label{eq:rmatrix} {\cal{R}}={\cal{R}}_+{\cal{R}}_1{\cal{R}}_2{\cal{R}}_-, \end{equation} where \begin{equation} \begin{gathered}\label{pro} {\cal{R}}_+=\prod_{n\ge 0}\exp(- {}{e}_n\otimes {}{f}_{-n-1}),\qquad {\cal{R}}_-=\prod_{n\ge 0}\exp({}{f}_n\otimes {}{e}_{-n-1}), \\ \begin{aligned} {\cal{R}}_1 &= \prod_{n\ge 0} \exp \left\{ \mbox{res}_{t=z}\left[(-1) \frac{d}{dt}(\log H^+(t)) \otimes \log K^-(z+2n+1)\right]\right\}, \\ {\cal{R}}_{2} &= \prod_{n\ge 0} \exp \left\{ \mbox{res}_{t=z}\left[(-1) \frac{d}{dt}(\log K^+(t))\otimes \log H^-(z+2n+1)\right]\right\}. \end{aligned} \end{gathered} \end{equation} The residue appearing in the above formula is given by \begin{equation} \mbox{res}_{t=z}\left[A(t)\otimes B(z)\right] = \sum_k a_k\otimes b_{-k-1}, \end{equation} after having re-expressed the currents in the form $A(t)=\sum_k a_k t^{-k-1}$, $B(z)=\sum_k b_k z^{-k-1}$. The following ({\it evaluation}) representation $\rho$ satisfies all the relations \eqref{eq:Lie}, $\lambda$ being the so-called {\it evaluation} or {\it spectral} parameter: \begin{equation} \rho{}({e}_n) = \lambda^n \, \rho(e_0), \qquad \rho{}({f}_n) = \lambda^n \, \rho(f_0), \qquad \rho{}({k}_n) = \lambda^n \, \rho(k_0), \qquad \rho{}({h}_n) = \lambda^n \rho(h_0),\label{onep} \end{equation} having set \begin{eqnarray} \rho(e_0) = a \, E_{12}, \qquad\rho (f_0) = d \, E_{21}, \qquad \rho(k_0) = - a d \, 1_2, \qquad \rho(h_0) = E_{11}-E_{22}, \end{eqnarray} to match with the representation our physical $R$-matrix is written in, where both $a$ and $d$ can take indices $a_i$ and $d_i$, $i=1,2$, to denote which space they pertain to. The parameters $a_i$ and $d_i$ are a priori complex numbers which determine the particular representation of interest, and will be set to specific values in order to reproduce particular physical situations occuring in string theory. The same holds for $\lambda$, which acquires the index $\lambda_i$, $i=1,2$. Such a representation can equivalently be reformulated by defining an evaluation map from $DY(\mathfrak{gl}(1|1))$ onto the universal enveloping algebra $U(\mathfrak{gl}(1|1))$ of the Lie superalgebra $\mathfrak{gl}(1|1)$, and then provide the appropriate representation of $U(\mathfrak{gl}(1|1))$. Because of the fermionic nature of the root generators, the root part of the universal $R$-matrix naturally truncates to \begin{equation} \begin{aligned} R_+ &= 1_2 \otimes 1_2-\sum_{n\geq0}{}\rho_1({e}_n)\otimes {}\rho_2({f}_{-n-1})=1_2 \otimes 1_2+\frac{\rho_1(e_0)\otimes \rho_2(f_0)}{\lambda_1 - \lambda_2},\\ R_- &= 1_2 \otimes 1_2+\sum_{n\geq0}{}\rho_1({f}_n)\otimes {}\rho_2({e}_{-n-1})=1_2 \otimes 1_2-\frac{\rho_1(f_0)\otimes \rho_2(e_0)}{\lambda_1 - \lambda_2}. \end{aligned} \end{equation} Specifically one can write in matrix form \begin{eqnarray} R_+ = \begin{pmatrix}1&0&0&0\\0&1&\frac{a_1 d_2}{\lambda}&0\\0&0&1&0\\0&0&0&1\end{pmatrix}, \qquad R_- = \begin{pmatrix}1&0&0&0\\0&1&0&0\\0&\frac{a_2 d_1}{\lambda}&1&0\\0&0&0&1\end{pmatrix}, \end{eqnarray} with\footnote{\label{confu}It is mildly confusing to call $\lambda$ again the difference: we hope that the context will always clarify between $\lambda$ the difference and $\lambda$ in the one-particle representation (\ref{onep}), where it really should be $\lambda_i$.} $\lambda = \lambda_1 - \lambda_2$. When it comes to the Cartan generators, in an appropriate domain of convergence one finds \begin{equation} -\frac{d}{dt}\log H^+ = \sum_{m=1}^{\infty} \left\{{\lambda^m} -{(\lambda-{}\rho_1({h}_0))^m}\right\} t^{-m-1} \end{equation} and \begin{multline} \log K^-(z+2n+1) = \log K^-(2n+1) + \\ +\sum_{m=1}^{\infty} \left\{\frac{1}{(\lambda-1-2n)^m} -\frac{1}{(\lambda-1-2n-{}\rho_2({k}_0))^m}\right\} \frac{z^{m}}{m}, \end{multline} and similarly for $R_2$. Since the generators $h_0$ and $k_0$ appearing in these expressions are diagonal, the way they appear in the functions is of no concern and one can obtain expressions for each diagonal entry. Taking the residue and resumming these expressions is still a lengthy procedure, which can be found described for instance in \cite{unive}. The final result reads \begin{eqnarray} \label{R1e2} R_1 = \Omega_1 \begin{pmatrix}1&0&0&0\\0&\frac{\lambda - a_2 d_2}{\lambda}&0&0\\0&0&1&0\\0&0&0&\frac{\lambda - a_2 d_2}{\lambda}\end{pmatrix}, \qquad R_2 = \Omega_2\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&\frac{\lambda}{\lambda + a_1 d_1}&0\\0&0&0&\frac{\lambda}{\lambda + a_1 d_1}\end{pmatrix}, \end{eqnarray} where $\Omega_i$, $i=1,2$, are two scalar factors built out of gamma matrices which we are ignoring as irrelevant to our present discussion. We now select the representation parameters as \begin{eqnarray} a_j = \sqrt{i(x^-_j - x^+_j)}, \qquad d_j = \frac{x^+_j - x^-_j}{i a_j}, \qquad \lambda_j = - i x^-_j + const, \qquad j=1,2, \end{eqnarray} to obtain the $AdS_3$ $R$-matrix in Zhukovsky variables. We refer to \cite{Foundations}, in particular section 3.23, for one description of a version of this parameterisation as it first originated in this context in a related problem (the $AdS_5 \times S^5$ superstring) and the connection with the Zhukovski map, which justifies its name. Reference \cite{unive} is then more closely related to our present case, especially section 6, and references therein. The constant in the parameterisation for $\lambda_i$ is irrelevant and will cancel in the diffference $\lambda$. After evaluating the $R$-matrix in this parameterisation, we finally take the massless limit in the same-chirality setting \begin{eqnarray} x^\pm_i = e^{\pm i \frac{p_i}{2}} \end{eqnarray} and obtain exactly the matrix $R_{12}(\gamma)$, up to a simple twist\footnote{This simple twist is described in \cite{unive}, see also \cite{Foundations}, and corresponds to a choice of frame factors. Such an additional twist could easily be incorporated but it does not add anything to our discussion, therefore we have chosen to neglect it.}, provided we also change the sign of $\gamma$ in the final matrix\footnote{The universal $R$-matrix does not know a priori which ordering of the momenta we choose, so we believe that in principle it should not be a problem to change $\gamma \to -\gamma$ (equivalently $\gamma_1$ with $\gamma_2$) in the final formula, as long as we do it systematically all along. We can in fact take the point of view that the universal $R$-matrix, for our purposes, just gives us a systematic recipe to obtain the (twist) matrix in representations from an abstract framework - if the recipe involves an additional simple systematic operation at the end, then the recipe will have served its present purpose.}. As explained in \cite{korotwi}, the above formula for the universal $R$-matrix is already designed to be factorised, and we can simply read off the factorising twist: \begin{eqnarray} \label{two} {\cal{F}}_{12}(\gamma) = {\cal{R}}_2 \, {\cal{R}}_-, \qquad {\cal{F}}_{21}^{-1}(-\gamma) = {\cal{R}}_+ \, {\cal{R}}_1. \end{eqnarray} One can also brute-force verify using the actual $4 \times 4$ matrices that the two equations in (\ref{two}) are compatible with each other in the representation $\rho_1 \otimes \rho_2$. One specifically finds (again having changed $\gamma \to -\gamma$ in the final step) \begin{eqnarray} F_{12}(\gamma) = E_{11}\otimes E_{11} + E_{11}\otimes E_{22} + \tanh \frac{\gamma}{2} (E_{22}\otimes E_{11} + E_{22}\otimes E_{22}) + \mbox{sech}\frac{\gamma}{2} E_{21}\otimes E_{12}, \end{eqnarray} or \begin{eqnarray} F_{12}(\gamma) = \begin{pmatrix}1&0&0&0\\0&1&0&0\\0&\mbox{sech}\frac{\gamma}{2}&\tanh \frac{\gamma}{2}&0\\0&0&0&\tanh \frac{\gamma}{2}\end{pmatrix}, \qquad F_{21}^{-1}(-\gamma) = \begin{pmatrix}1&0&0&0\\0&-\mbox{coth}\frac{\gamma}{2}&\mbox{csch}\frac{\gamma}{2}&0\\0&0&1&0\\0&0&0&-\mbox{coth}\frac{\gamma}{2}\end{pmatrix}, \end{eqnarray} where we denote ${.}_{21} = {.}^{op}$ indifferently. The fact that the twist is a lower triangular matrix literally corresponds to the fact that the Khoroshkin-Tolstoy formula highlights the block-triangular decomposition of the $R$-matrix. This is in turn associated with the Chevalley-Serre (Drinfeld's second) presentation of the Yangian relations based on the positive and negative root- and Cartan element decomposition. Notice that (\ref{two}) combined with (\ref{pro}) provides a universal expression for the twist. We also remark that, in the specific representation we are using, because of the peculiarity of the massless $AdS_3$ $R$-matrix which satisfies $R_{21}(-\gamma)=R_{12}(\gamma)$ (and hence, as we pointed out earlier, $R^2(\gamma) = 1_2 \otimes 1_2$ because of braiding unitarity) \cite{JoakimAle}, we have that equally \begin{eqnarray} R = F_{21}^{-1}(-\gamma) F_{12}(\gamma)= F_{12}^{-1}(\gamma) F_{21}(-\gamma). \end{eqnarray} \subsection{Twisted Symmetries} Let us define \begin{eqnarray} \Delta_\rho \equiv [\rho_1 \otimes \rho_2] \circ \Delta, \end{eqnarray} and similarly for the other symbols $\delta,\tilde{\Delta} $ which we will use to denote different coproduct maps. We will also use the notation \begin{eqnarray} Q \equiv e_0, \qquad Q^\dagger \equiv f_0, \qquad b_n \equiv h_n, \end{eqnarray} in order to connect with the traditional notation utilised in the AdS/CFT literature. To inspect what the coproduct of the simplest (level-zero) supercharges becomes after the twist, we can begin by focusing on the ${\cal{N}}=2$ relativistic supersymmetry which the $R$-matrix inherits simply by virtue of being of the same form as its relativistic limit. One can in fact directly verify \cite{Dublin} that the (massless- relativistic- like) supercharges \begin{eqnarray} \Delta_\rho(Q) = e^{\frac{\gamma_1}{2}}E_{12} \otimes 1_2 + 1_2 \otimes e^{\frac{\gamma_2}{2}} E_{12}, \qquad \Delta_\rho(Q^\dagger) = e^{\frac{\gamma_1}{2}}E_{21} \otimes 1_2 + 1_2 \otimes e^{\frac{\gamma_2}{2}} E_{21} \end{eqnarray} are (already co-commutative) symmetries of the $R$-matrix: $\Delta_\rho^{op}(Q)R=R\Delta_\rho(Q)$ and $\Delta_\rho^{op}(Q^\dagger)R=R\Delta_\rho(Q^\dagger)$. The twist should maintain them co-commutative, since the new $R$-matrix equals the identity. By direct computation we find, with $\gamma = \gamma_1 - \gamma_2$, \begin{eqnarray} &&\tilde{\Delta}_\rho(Q) = F_{12}(\gamma) \Delta_\rho(Q)F_{12}^{-1}(\gamma) = \mbox{coth}\frac{\gamma}{2} \Big[-e^{\frac{\gamma_2}{2}} 1_2\otimes E_{12} + e^{\frac{\gamma_1}{2}} E_{12}\otimes 1_2\Big],\nonumber\\ &&\tilde{\Delta}_\rho(Q^\dagger) = F_{12}(\gamma) \Delta_\rho(Q^\dagger)F_{12}^{-1}(\gamma) = \Delta_\rho(Q^\dagger),\nonumber \end{eqnarray} both satisfying the co-commutativity condition: in the case of $\tilde{\Delta}_\rho(Q)$ the prefactor changes sign under ${}^{op}$, and so does the bracket; in the case of $\tilde{\Delta}(Q^\dagger)$, we have that it equals $\Delta_\rho(Q^\dagger)$ which was of course already co-commutative. In \cite{Dublin} it was also shown (see discussion around formula (4.60) there) how the more traditional AdS/CFT braided coproducts, in the case of massless $AdS_3$, reduce to combinations\footnote{It was shown in \cite{JoakimAle} that for massless $AdS_3$ there are actually two inequivalent coproducts one can use, one more standard and the other one only existing thanks to the particular form of the massless dispersion relation. Both these versions are reported in formula (4.55) in \cite{Dublin}.} of the above ${\cal{N}}=2$ one and another symmetry, let us call it $\delta q$ \begin{eqnarray} \label{that} \delta_\rho q = e^{\frac{\gamma_1}{2}+\gamma_2} E_{12} \otimes 1_2 - e^{\frac{\gamma_2}{2}+\gamma_1} 1_2 \otimes E_{12} \end{eqnarray} (and the hermitian conjugate obtained replacing $E_{12}$ by $E_{21}$). One can verify by brute force that (\ref{that}) is a (this time non co-commutative) symmetry. The action of the twist turns this into \begin{eqnarray} \widetilde{\delta_\rho q} = \mbox{coth}\frac{\gamma}{2} \Big[-e^{\gamma_1+\frac{\gamma_2}{2}} 1_2\otimes E_{12} + e^{\gamma_2+\frac{\gamma_1}{2}} E_{12}\otimes 1_2\Big], \end{eqnarray} which is indeed co-commutative (again by compensation of two minuses under the ${}^{op}$ operation, one from the pre-factor and one from the bracket). The hermitian conjugate is instead turned into \begin{eqnarray} \widetilde{\delta_\rho q^\dagger} = -e^{\gamma_1+\frac{\gamma_2}{2}} 1_2\otimes E_{21} - e^{\gamma_2+\frac{\gamma_1}{2}} E_{21}\otimes 1_2, \end{eqnarray} which is co-commutative by direct inspection. Combining these results and the formula provided in \cite{Dublin}, we can write the (two inequivalent) massless $AdS_3$ coproducts after the twist as the following co-commutative combinations\footnote{We repeat here the following definition from \cite{Dublin} for ease of reading: \begin{eqnarray} Q_\pm \equiv \sqrt{\sin \frac{p_1}{2}}e^{\pm i \frac{p_2}{4}} E_{12} \otimes 1_2 + \sqrt{\sin \frac{p_2}{2}}e^{\mp i \frac{p_1}{4}} 1_2 \otimes E_{12},\nonumber \end{eqnarray} with $p_i \in (0,\pi)$. Despite the use of the letter `$Q$', the combinations $Q_\pm$ above are operators acting on the space $V_1 \otimes V_2$. In physical parlance they were obtained simply as brute-force symmetries of the $S$-matrix - in an equivalent sense we mean that they satisfy \begin{eqnarray} Q_\pm^{op} R = R Q_\pm \nonumber \end{eqnarray} by brute force computation. }: \begin{eqnarray} \tilde{Q}_{\pm} = g_{12} \, \mbox{coth}\frac{\gamma}{2} \Big[(1\pm i e^{\gamma_2}) e^{\frac{\gamma_1}{2}}E_{12} \otimes 1_2-(1\pm i e^{\gamma_1}) 1_2 \otimes e^{\frac{\gamma}{2}}E_{12}\Big] \end{eqnarray} where $g_{12}$ is a scalar function symmetric under the exchange of $1$ and $2$, hence transparent to the symmetry condition (and trivially co-commutative itself), and the coth again changing sign under ${}^{op}$ and compensating the bracket. In the case of the hermitian conjugate we get after the twist the co-commutative combinations \begin{eqnarray} \tilde{Q}_{\pm}^\dagger = g_{12} \, \Big[(1\mp i e^{\gamma_2}) e^{\frac{\gamma_1}{2}}E_{21} \otimes 1_2+(1\mp i e^{\gamma_1}) 1_2 \otimes e^{\frac{\gamma}{2}}E_{21}\Big]. \end{eqnarray} AdS/CFT integrability also admits a so-called secret symmetry \cite{unive0,secret,segreto}. In the $AdS_3$ context there is a level zero version of this symmetry (at odds with $AdS_5$ and $AdS_4$), namely \begin{eqnarray} \Delta_\rho(b_0) = (E_{11}-E_{22}) \otimes 1_2 + 1_2 \otimes (E_{11}-E_{22}), \end{eqnarray} with $F$ the fermion number. There is then a level one Yangian correspondent, which in the massless case reduces to a ``conformal'' Yangian symmetry \cite{Ale}: \begin{eqnarray} \Delta_\rho(b_1) = e^{\frac{\gamma_1 + \gamma_2}{2}} \Big[E_{12} \otimes E_{21} + E_{21} \otimes E_{12}\Big]. \end{eqnarray} After the twist, they become \begin{eqnarray} \tilde{\Delta}_\rho(b_0) = 2 E_{11} \otimes E_{11} - 2 E_{22} \otimes E_{22}, \end{eqnarray} which is clearly co-commutative, and, respectively ($\gamma$ always being $\gamma_1 - \gamma_2$), \begin{eqnarray} \tilde{\Delta}_\rho(b_1)= \mbox{coth}\frac{\gamma}{2}\Big[\frac{2 e^{\gamma_1 + \gamma_2}}{e^{\gamma_1} + e^{\gamma_2}} (E_{11} \otimes E_{22} - E_{22} \otimes E_{11}) + e^{\frac{\gamma_1 +\gamma_2}{2}} (E_{12} \otimes E_{21} + E_{21} \otimes E_{12})\Big]. \end{eqnarray} The latter is also co-commutative, considering that the prefactor changes sign, and also the bracket (recalling that both $E_{12}$ and $E_{12}$ are fermionic generators), under the ${}^{op}$ operation. \subsection{Three sites} The generalisation to three sites (and then an arbitrary number) is made difficult by the fact that the coproduct, although known in principle for the Yangian of $\alg{gl}(1|1)$, is not easy to handle. In particular, it is given in closed form on the currents, while on the modes it is obtained in principle by matching Laurent expansions, making the explicit expression bulky to manage. Nevertheless, we have found a concrete matrix which provides the answer for three sites. For three sites, we require to solve the following factorisation problem: \begin{eqnarray} F_{321}(\gamma_3,\gamma_2,\gamma_1) R_{123}(\gamma_1,\gamma_2,\gamma_3) = F_{123}(\gamma_1,\gamma_2,\gamma_3), \end{eqnarray} where \begin{eqnarray} R_{123}(\gamma_1,\gamma_2,\gamma_3) = R_{12}(\gamma_1-\gamma_2)R_{13}(\gamma_1-\gamma_3)R_{23}(\gamma_2-\gamma_3), \end{eqnarray} with the familiar assignment of indices for the triple tensor product. The factorising twist $F_{123}$ ought to be an invertible, lower-triangular matrix. It is not difficult to find an explicit solution to this condition, which is parameterised by four unknown functions $f_k(\gamma_1,\gamma_2,\gamma_3)$, $k=1,2,3,4$, all of which must be \underline{symmetric} functions under the exchange of $\gamma_1$ and $\gamma_3$: \begin{eqnarray} F_{123}(\gamma_1,\gamma_2,\gamma_3) = F_{12}(\gamma_1-\gamma_2) \Big[D_1 + D_2 \cdot E_{21}\otimes 1_2 \otimes E_{12} + D_3 \cdot 1_2 \otimes E_{21} \otimes E_{12}\Big],\label{ansaz} \end{eqnarray} the $D_q$, $q=1,2,3$, being diagonal matrices \begin{eqnarray} \label{24} D_1 = \mbox{diag}(\tilde{d}_1,...,\tilde{d}_8), \qquad D_2 = \mbox{diag}(\tilde{e}_1,...,\tilde{e}_8), \qquad D_3 = \mbox{diag}(\tilde{f}_1,...,\tilde{f}_8), \end{eqnarray} satisfying \begin{eqnarray} &&\tilde{d}_7 = f_4 \, \mbox{coth}\frac{\gamma_1-\gamma_2}{2} \, \tanh \frac{\gamma_2-\gamma_3}{2},\nonumber\\ &&\tilde{f}_7 = f_4 \, \mbox{sech} \frac{\gamma_2-\gamma_3}{2},\nonumber\\ &&\tilde{e}_7 = -f_4 \, \mbox{coth}\frac{\gamma_1-\gamma_2}{2} \, \mbox{csch} \frac{\gamma_1-\gamma_3}{2}, \qquad \tilde{d}_6 = f_4 \, \mbox{coth}\frac{\gamma_1-\gamma_3}{2},\nonumber\\ &&\tilde{d}_5 = \tilde{d}_3 = \tilde{f}_3 \, \tanh \frac{\gamma_2-\gamma_3}{2}, \qquad \tilde{d}_1 = f_2, \qquad \tilde{d}_4 = f_4 \, \mbox{coth}\frac{\gamma_1-\gamma_3}{2}, \nonumber\\ &&\tilde{e}_5 = f_3 \, \mbox{coth}\frac{\gamma_1-\gamma_2}{2} \, \mbox{csch}\frac{\gamma_1-\gamma_3}{2} \, \tanh \frac{\gamma_2-\gamma_3}{2}, \nonumber\\ &&\tilde{d}_2 = f_3 \tanh \frac{\gamma_1-\gamma_2}{2} \, \mbox{coth}\frac{\gamma_1-\gamma_3}{2}, \nonumber\\ &&\tilde{d}_8 = f_1 \, \mbox{coth} \frac{\gamma_1-\gamma_2}{2} \, \tanh \frac{\gamma_1-\gamma_3}{2}, \qquad \tilde{f}_3 = f_3 \, \mbox{sech} \frac{\gamma_2-\gamma_3}{2}.\label{soluzw} \end{eqnarray} By convention, if no argument is given to a function of three variables in these formulas (for instance, say, just writing $\tilde{d}_4$), then it is understood to be in the 123 ordering, namely $(\gamma_1,\gamma_2,\gamma_3)$. Notice that not all the $24$ parameters (\ref{24}) appear in (\ref{soluzw}). This is because in reality they do not feature in the ansatz itself, since multiplying by the $E_{12}$s and $E_{21}$s effectively eliminates a lot of parameters (making them redundant). Notice that the solution we have found in this way is automaticaly lower triangular given the ansatz we started from, and it is invertible as long as all the functions $f_k$ are non-zero. A justification for the ansatz (\ref{ansaz}) will be provided in section \ref{specu}. At this point we can verify one of the theorems of \cite{Maillet} on three sites. Since we have that \begin{eqnarray} R_{123}(\gamma_1,\gamma_2,\gamma_3) T_1(\gamma_1)T_2(\gamma_2)T_3(\gamma_3) = T_3(\gamma_3)T_2(\gamma_2)T_1(\gamma_1)R_{123}(\gamma_1,\gamma_2,\gamma_3), \end{eqnarray} where $T_i$ is the monodromy matrix with auxiliary space $i$ (whose entry act on the quantum space of a chain of $L$ sites), then the factorisation property implies (suppressing the arguments for simplicity, as they always follow the assignment of auxiliary spaces) \begin{eqnarray} F_{321}^{-1}F_{123}T_1 T_2 T_3 = T_3 T_2 T_1 F_{321}^{-1}F_{123}.\label{virtue} \end{eqnarray} Therefore, by defining \begin{eqnarray} \tilde{T}_{123} = F_{123} T_1 T_2 T_3 F_{123}^{-1}, \end{eqnarray} we see that \begin{eqnarray} \tilde{T}_{123} = \tilde{T}_{321} \end{eqnarray} by virtue of (\ref{virtue}). \section{A simple scalar product\label{s5}} In this section we show how a simple scalar product can be reproduced by means of the factorising twist. This is in a perfect alignment with the philosophy of \cite{Maillet}. Let us consider the quantity \begin{eqnarray} \label{scala} \langle 0| C(\gamma_1) B(\gamma_2)|0\rangle, \end{eqnarray} which is related to the off-shell scalar product of one-magnon states\footnote{The precise relationship is carefully detailed in \cite{JuanMiguelAle}, section 4.1.}. The operators $B$ and $C$ are the creation and annihilation operators of the algebraic Bethe ansatz: namely, the monodromy matrix with auxiliary site $0$ can be written as \begin{eqnarray} T_0 = E_{11} \otimes A + E_{12} \otimes B + E_{21} \otimes C + E_{22} \otimes D, \end{eqnarray} with the $E_{ij}$ acting on the space $0$ (depending on an auxiliary parameter $\gamma_0$) and $A,B,C,D$ acting on the quantum space of a chain of $L$ sites. The pseudovacuum $|0\rangle$ is taken as the state with all bosons along the chain. The scalar product (\ref{scala}) is simple enough to be computable from the RTT relations in one move. Since the pseudovacuum satisfies \begin{eqnarray} C(\gamma_0)|0\rangle = 0, \qquad A(\gamma_0)|0\rangle = \alpha(\gamma_0) |0\rangle, \qquad D(\gamma_0)|0\rangle = \delta(\gamma_0) |0\rangle \end{eqnarray} (having suppressed the dependence on the quantum spaces with inhomogeneities $\gamma_m$, $m=1,...,L$), we can simply use the particular RTT relation \begin{eqnarray} [C(\gamma_1),B(\gamma_2)] = \mbox{csch}(\gamma_1 - \gamma_2)\Big(D(\gamma_2)A(\gamma_1) - D(\gamma_1)A(\gamma_2)\Big), \end{eqnarray} to obtain \begin{eqnarray} \langle 0| C(\gamma_1) B(\gamma_2)|0\rangle = \mbox{csch}(\gamma_1 - \gamma_2)\Big(\alpha(\gamma_1)\delta(\gamma_2) - \alpha(\gamma_2)\delta(\gamma_1)\Big).\label{coin} \end{eqnarray} This can be made completely explicit by recalling that \cite{JuanMiguelAle} \begin{eqnarray} \alpha(\gamma)=1, \qquad \delta(\gamma) = \prod_{m=1}^L \tanh \frac{\gamma - \gamma_m}{2}. \end{eqnarray} The same result can be obtained by means of the factorising twist. Indeed one can extract the operators $C$ and $B$ by (super)tracing the monodromy matrix in its auxiliary space: \begin{eqnarray} C = \mbox{str}_0 \, E_{12} \otimes 1_N \cdot T_0, \qquad B = - \mbox{str}_0 \, E_{21} \otimes 1_N \cdot T_0, \end{eqnarray} where str denotes the supertrace and $1_{2^N} \equiv 1_2 \otimes 1_2 \otimes ... \otimes 1_2$ ($N$ times, as many as the number of physical, namely non-auxiliary, spaces of the monodromy matrix). One can then rely on another theorem in \cite{Maillet}, whose exact assumptions we satisfy in our case. From the very definition of the factorising twist we have in fact (suppressing arguments) \begin{eqnarray} R_{12} T_1 T_2 = T_2 T_1 R_{12} \qquad \leftrightarrow \qquad F_{21}^{-1} F_{12} T_1 T_2 = T_2 T_1 F_{21}^{-1} F_{12}, \end{eqnarray} hence \begin{eqnarray} F_{12} T_1 T_2 F_{12}^{-1} = F_{21} T_2 T_1 F_{21}^{-1},\label{by} \end{eqnarray} which means that $\tilde{T}_{12} = F_{12} T_1 T_2 F_{12}^{-1}$ is symmetric\footnote{In a sense the relations \begin{eqnarray} \tilde{T}_{12} = \tilde{T}_{21}\nonumber \end{eqnarray} are the abstract RTT relations after the twist. A particular representation (of course not the only one) is \begin{eqnarray} \tilde{T}_{12} = \tilde{T}_1 \tilde{T}_2, \qquad \tilde{T}_i = \prod_{j=1}^N \tilde{R}_{ij} = 1_2 \otimes 1_2 \otimes ... \otimes 1_2 \, \, \, \, \, (N+1 \, \, \mbox{times}), \qquad i=1,2.\nonumber \end{eqnarray} } under the exchange of $1$ and $2$. Moreover, since $F_{12}$, $F_{12}^{-1}$ and $\langle 0| T_1 T_2|0\rangle$ are all lower trianguar\footnote{One can see that \begin{eqnarray} \langle 0| T_1 T_2|0\rangle = (-)^{([i]+[j])([k]+[l])} E_{ij} \otimes E_{kl} \langle 0| T_1^{ij} T_2^{kl}|0\rangle \nonumber \end{eqnarray} while \begin{eqnarray} \langle 0| T_2 T_1|0\rangle = E_{ij} \otimes E_{kl} \langle 0| T_1^{kl} T_2^{ij}|0\rangle, \nonumber \end{eqnarray} so if one is a lower triangular matrix in the tensor product of the two auxiliary space $1$ and $2$, the other is upper triangular. One concludes by recalling that $T^{11} = A, \, T^{12}=B, \, T^{21}=C, \, T^{22}=D$. }, we also have that \begin{eqnarray} F_{12} \langle 0| T_1 T_2|0\rangle F_{12}^{-1}\label{1} \end{eqnarray} is lower triangular. Likewise, \begin{eqnarray} F_{21} \langle 0| T_2 T_1|0\rangle F_{21}^{-1}\label{2} \end{eqnarray} is upper triangular. But since (\ref{1}) and (\ref{2}) are equal - by sandwiching (\ref{by}) between two pseudo-vacua - then they must be both equal to a diagonal matrix in the tensor product of the auxiliary spaces $1$ and $2$. In addition, these similarities must both equal the diagonal part of $\langle 0| T_2 T_1|0\rangle$. Based on this one therefore concludes that \begin{eqnarray} \label{uaggio} \langle 0|T_1 T_2|0\rangle = F_{12}^{-1} \Big[\langle 0|T_1|0\rangle \otimes \langle 0|T_2|0\rangle\Big] F_{12}, \qquad \langle 0|T_i|0\rangle = \begin{pmatrix}\alpha(\gamma_i)&0\\0&\delta(\gamma_i)\end{pmatrix}, \qquad i=1,2. \end{eqnarray} At this point one can easily see that \begin{eqnarray} \langle 0| C(\gamma_1) B(\gamma_2)|0\rangle = - \mbox{str}_{12} E_{12} \otimes E_{21} \langle 0|T_1 T_2|0\rangle, \end{eqnarray} since the quantum and the auxiliary spaces do not interfere, hence using (\ref{uaggio}) and (graded) cyclicity of the supertrace one obtains \begin{eqnarray} \langle 0| C(\gamma_1) B(\gamma_2)|0\rangle = - \mbox{str}_{12} \Big(F_{12} \cdot E_{12} \otimes E_{21} \cdot F_{12}^{-1} \cdot [\alpha(\gamma_1) E_{11} + \delta(\gamma_1) E_{22}]\otimes [\alpha(\gamma_2) E_{11} + \delta(\gamma_2) E_{22}]\Big), \nonumber \\\label{rhs}. \end{eqnarray} We have denoted $\mbox{str}_{12} = \mbox{str}_{1} \otimes \mbox{str}_{2}$, which is the natural supertrace on the tensor product space. We have at this point all the ingredients from the previous sections, so it is a simple exercise multiplying out these matrices to prove that the r.h.s. of (\ref{rhs}) exactly coincides with the r.h.s. of (\ref{coin}). This corresponds to the statement \cite{Maillet} that the factorising twists provide a change of basis which diagonalise the scalar products of Bethe states. \section{Speculation on a general formula and form factors\label{specu}} The natural question is to try and extend the result from three to an arbitrary number of sites. In the case of the models dealt with in \cite{Maillet}\cite{Maillet2}, a special relationship between the entries of the twist matrix and the $R$-matrix allowed a particular ansatz to be made for the general case. Unfortunately such relationship is slightly different here, enough to prevent that ansatz to go through. Specifically, one can prove by direct calculation that \begin{eqnarray} F_{12}(\gamma) = 1_2 \otimes E_{22} + 1_2 \otimes E_{11} \cdot R_{12}(\gamma) + \tau,\label{nice} \end{eqnarray} where $\tau$ is the (undesired) term $\tau = (\tanh \frac{\gamma}{2}-1) E_{22} \otimes E_{22}$. This extra term is undesired precisely because it does not behave well (or at least in a predictable way) under $\Delta \otimes \mathfrak{1} $ - while all other terms in (\ref{nice}) do. In fact, it is known how $\Delta$ acts on the unit element of $\cal{A}$, and how $\Delta \otimes \mathfrak{1} $ acts on $\cal{R}$ - one simply uses the quasi-triangular condition $(\Delta \otimes \mathfrak{1} ) {\cal{R}} = {\cal{R}}_{13}{\cal{R}}_{23}$. In the end this means that we cannot reduce the general factorising twist to a product of $R$-matrices. As mentioned earlier, using the coproduct directly on the universal expression for the twist is not easily managed either. One could in fact in principle apply the formula ${\cal{F}}_{123} = {\cal{F}}_{12}(\Delta \otimes \mathfrak{1} ) {\cal{F}}$, but in practice this is not easy to calculate. We can at least provide here a justification for the three-site ansatz (\ref{ansaz}). By using the homomorphism property of the coproduct we have \begin{eqnarray} (\Delta \otimes \mathfrak{1} ) {\cal{F}} = (\Delta \otimes \mathfrak{1} ) {\cal{R}}_2 \cdot (\Delta \otimes \mathfrak{1} ) {\cal{R}}_-, \end{eqnarray} and using the universal expressions (\ref{pro}) we obtain \begin{eqnarray} &&(\Delta \otimes \mathfrak{1} ) {\cal{R}}_- = \prod_{n\geq 0} \exp \Delta(f_n) \otimes e_{-n-1}\nonumber\\ &&(\Delta \otimes \mathfrak{1} ){\cal{R}}_{2} = \prod_{n\ge 0} \exp \mbox{res}_{t=z}\left[(-1) \frac{d}{dt}(\log \Delta(K^+(t))\otimes \log H^-(z+2n+1)\right]. \end{eqnarray} Given the expected schematic structure \cite{Koro2} \begin{eqnarray} \Delta(K^+(u)) = \mbox{Cartan current} \otimes \mbox{Cartan current}, \qquad \Delta(f) = \mathfrak{1} \otimes f + f \otimes \mbox{Cartan current},\nonumber \end{eqnarray} (where $f$ schematically denotes generators of the type $f_n$) we can therefore see that in the representation of interest the ansatz (\ref{ansaz}) corresponds to the possible terms deriving from the universal formula. \section{Free fermion realisation\label{s7}} In \cite{Dublin} it was shown how to recast the $AdS_3$ massless same-chirality $S$-matrix in terms of free-fermion oscillators, in a way that vastly simplifies its appearance. One first introduces fermionic operators \begin{eqnarray} c_1 = E_{12}\otimes 1_2, \qquad c_2 = 1_2 \otimes E_{12}, \qquad c_1^\dagger = E_{21}\otimes 1_2, \qquad c_2^\dagger = 1_2 \otimes E_{21}, \end{eqnarray} obeying canonical anti-commutation relations $\{c_i,c^\dagger_j\}= \delta_{ij}$ (and zero otherwise\footnote{In the mapping to the tensor-product matrices, the oscillator-language `$1$' corresponds to $1_2 \otimes 1_2$.}), such that the oscillator vacuum is $|1\rangle\otimes |1\rangle$. A canonical transformation is then applied: \begin{eqnarray} c_1 = \cos \alpha \, \eta_1 - \sin \alpha \, \eta_2, \qquad c_2 = \sin \alpha \, \eta_1 + \cos \alpha \, \eta_2 \end{eqnarray} (together with the hermitian conjugates). This transformation is designed in such a way that the new generators $\eta_i, \eta^\dagger_i$, $i=1,2$, still satisfy canonical anti-commutation relations $\{\eta_i,\eta^\dagger_j\}= \delta_{ij}$ (and zero otherwise). The choice of branch for the transformation parameter is determined by setting \begin{eqnarray} \mbox{cot}\alpha = - e^{-\frac{\theta_1 - \theta_2}{2}}. \end{eqnarray} Using these oscillators, the $R$-matrix is extremely simple and in fact diagonal. Modulo a scalar pre-factor, it reads \cite{Dublin} \begin{eqnarray} R = 1 - 2 \eta^\dagger_1 \eta_1. \end{eqnarray} Likewise, the factorising twist is also rather simple in terms of free-fermion operators: one can verify that \begin{eqnarray} F_{12}(\theta) = 1 - \mbox{sech}\frac{\theta}{2} \Big[\eta^\dagger_2 + e^{-\frac{\theta}{2}} \eta^\dagger_1 \Big]\eta_1. \end{eqnarray} The labels $1$ and $2$ attached to the $\eta$s have lost the meaning of spin-chain sites, since the canonical transformation mixes the two sites. Therefore, it is not immediately straightforward to compute the opposite twist\footnote{See the discussion around formula (4.48) in \cite{Dublin}.}. One can nevertheless verify that \begin{eqnarray} F_{21}^{-1}(-\theta) = 1 + \mbox{csch}\frac{\theta}{2} \Big[\eta^\dagger_2 - e^{\frac{\theta}{2}} \eta^\dagger_1 \Big]\eta_1, \end{eqnarray} from which the relation $F_{21}^{-1}(-\theta)F_{12}(\theta) = 1 - 2 \eta^\dagger_1 \eta_1 = R$ follows by virtue of the canonical anti-commutation relations obeyed by the $\eta$s and of known identities of hyperbolic functions. \section{Mixed flux bacgkrounds\label{s8}} We can apply the same strategy to the case of mixed RR and NS-NS flux in the limit where we recover the difference form \cite{gamma2}. The procedure is of course general as it relies on the universal $R$-matrix, but in this limiting case the expressions are more immediately recognisable and easier to handle. By following the same steps as we did in the massless pure RR case which we have previously discussed, and by implementing the same series of manipulations which are outlined below formula (3.1) in \cite{gamma2}, we obtained the following expression for the factorising twist: \begin{eqnarray} F_{12}(q_1,q_2) = \begin{pmatrix}1&0&0&0\\0&1&0&0\\0&-\frac{(e^{\frac{2 i \pi}{k}}-1)\sqrt{q_1q_2}}{q_2 - e^{\frac{2 i \pi}{k}}q_1}&\frac{e^{\frac{i\pi}{k}}(q_1-q_2)}{e^{\frac{2 i \pi}{k}}q_1 - q_2}&0\\0&0&0&\frac{e^{\frac{i\pi}{k}}(q_1-q_2)}{e^{\frac{2 i \pi}{k}}q_1 - q_2}\end{pmatrix}, \end{eqnarray} $k$ being the mixed-flux parameter. Besides being lower-triangular as expected, this expression is also clearly scale-invariant and of difference form: in fact, by expressing the momenta $q_i$ using the familiar massless (for definiteness right-moving) parametrisation $q_i = e^{\theta_i}$, and setting $\theta = \theta_1 - \theta_2$, one obtains \begin{eqnarray} F_{12}(q_1,q_2) = F_{12}(\theta) = \begin{pmatrix}1&0&0&0\\0&1&0&0\\0&\mbox{csch}(\frac{\pi}{k} - \frac{\theta}{2}) \, \sinh \frac{\pi}{k}&-\mbox{csch}(\frac{\pi}{k} - \frac{\theta}{2}) \, \sinh \frac{\theta}{2}&0\\0&0&0&-\mbox{csch}(\frac{\pi}{k} - \frac{\theta}{2}) \, \sinh \frac{\theta}{2}\end{pmatrix}. \end{eqnarray} By direct calculation one verifies that multiplying $F_{21}^{-1}(q_2,q_1) F_{12}(q_1,q_2)$ exactly reproduces the $R$-matrix in formula (3.3) of \cite{gamma2} (where the ordering $q_2,q_1$ is equivalent to $\theta \to -\theta$). The level-zero symmetry in this particular case is known \cite{gamma2} to be a deformed (and, in particular, non co-commutative) version of ${\cal{N}}=2$ massless relativistic supersymmetry: \begin{eqnarray} \Delta_\rho(Q) = \sqrt{q_1} \, E_{12} \otimes 1_2 + e^{\frac{i \pi}{k}} 1_2 \otimes \sqrt{q_2}\, E_{12}, \qquad \Delta_\rho(Q^\dagger) = \sqrt{q_1} \, E_{21} \otimes 1_2 + e^{\frac{-i \pi}{k}} 1_2 \otimes \sqrt{q_2} \, E_{21}. \end{eqnarray} After the action of the twist the $R$-matrix is again equal to the identity, hence the coproducts ought to be co-commutative: we obtain \begin{eqnarray} \tilde{\Delta}_\rho(Q) = a(q_1,q_2) \, 1_2\otimes E_{12} + a(q_2,q_1) \, E_{12}\otimes 1_2, \qquad \tilde{\Delta}_\rho(Q^\dagger) = b(q_1,q_2) \, 1_2\otimes E_{12} + b(q_2,q_1) \, E_{12}\otimes 1_2,\label{exo}\nonumber\\ \end{eqnarray} with \begin{eqnarray} a(q_1,q_2) = \frac{e^{-\frac{i \pi}{k}}\sqrt{q_2}\, (q_1 - e^{-\frac{2i \pi}{k}} q_2)}{q_1-q_2}, \qquad b(q_1,q_2) = e^{-\frac{i \pi}{k}} \sqrt{q_2}. \end{eqnarray} The expressions (\ref{exo}) are indeed manifestly co-commutative. Although this issue was not explored in \cite{gamma2}, we have found the presence of the secret symmetry in this mixed-flux situation as well. There is a level-zero version: \begin{eqnarray} \Delta_\rho(b_0) = (E_{11}-E_{22}) \otimes 1_2 + 1_2 \otimes (E_{11}-E_{22}), \end{eqnarray} with $F$ the fermionic number; there is also as usual a level-one version, which is of a comparable level of complication as the massive version: \begin{eqnarray} &&\Delta_\rho(b_1) = i \, \mbox{cot} \frac{i \pi}{k} \Big[q_1 \, (E_{11}-E_{22}) \otimes 1_2 + 1_2 \otimes q_2 \, (E_{11}-E_{22}) \Big]\qquad \qquad \qquad \nonumber\\ &&\qquad \qquad \qquad \qquad \qquad \qquad+ 2 \sqrt{q_1 q_2} \, e^{\frac{i \pi}{k}} E_{21}\otimes E_{12} + 2 \sqrt{q_1 q_2} \, e^{\frac{-i \pi}{k}} E_{12}\otimes E_{21}. \end{eqnarray} Notice that one always has to remember that the relative sign in the tail of the secret symmetry must be ``plus'', since a minus would mean (considering the fermionic statistics) that we are just finding the symmetry $\Delta_\rho(Q) . \Delta_\rho(Q^\dagger)$, which simply descends from the fact that $\Delta_\rho(Q)$ and $\Delta_\rho(Q^\dagger)$ are separately symmetries and therefore is not independent. After the twist, the level zero ``secret'' symmetry becomes the same as the twisted RR level zero secret symmetry, while the level one version become something rather complicated which is not very illuminating, except for the fact that it is verifiably co-commutative. \subsection{Zhukovsky variables} It finally is worth reporting for completeness the representation of the factorising twist in terms of Zhukovsky variables, which applies to massive particles as well. With a particular choice of the so-called {\it frame factors}, one has \begin{eqnarray} F_{12}(x_1^\pm,x_2^\pm) = \begin{pmatrix}1&0&0&0\\0&1&0&0\\0&\frac{i \eta_1 \eta_2}{x_1^+ - x_2^-}&\frac{x_1^- - x_2^+}{x_1^+ - x_2^-}&0\\0&0&0&\frac{x_1^- - x_2^+}{x_1^+ - x_2^-}\end{pmatrix}, \qquad \eta_i = \sqrt{i (x_i^--x_i^+)}, \qquad i=1,2. \end{eqnarray} Althogh written in a specific representation for the supersymmetry generators, when decorated with appropriate bound state numbers as in \cite{unive} this formula does retain some degree of universality, in the sense that it does not require the mass-shell condition to be derived and therefore it applies for general short representations. \section{$AdS_2$ and the Universal $R$-matrix\label{s9}} We shall now discuss the case of the $AdS_2$ integrable system and show that one can obtain the $R$-matrix in a specific limit from the general framework of the universal $R$-matrix of $\alg{gl}(1|1)$ which we have been using for $AdS_3$ as well. This is the first realisation of a quantum (as opposed to classical) $AdS_2$ $R$-matrix along these lines. The supersymmetry generators relevant for the $AdS_2$ integrable $R$-matrix in the massless BMN limit (taken with the right-moving chirality for both scattering particles for simplicity) have been studied in \cite{Andrea2} - see also \cite{Hoare:2014kma}, and are given by \begin{eqnarray} \check{Q}_i = e^{\frac{\theta_i}{2}-i\frac{\pi}{4}}\sqrt{\frac{1}{2}}\begin{pmatrix}0&1\\1&0\end{pmatrix}, \qquad \check{S}_i = e^{\frac{\theta_i}{2}+i\frac{\pi}{4}}\sqrt{\frac{1}{2}}\begin{pmatrix}0&1\\1&0\end{pmatrix}.\label{rep} \end{eqnarray} The notation which we are using in this section for the algebra generators is $\check{Q} \equiv \check{\rho}(q)$, $\check{S} \equiv \check{\rho}(s)$, $P \equiv \check{\rho}(w)$ and $P^\dagger \equiv \check{\rho}(w^\dagger)$, where $\check{\rho}$ denotes the matrix representation, and $x \in \cal{A}'$, while the index $i$ appearing in (\ref{rep}) denotes whether this representation is applied to particle $1$ or $2$ (with rapidity $\theta_1$, resp. $\theta_2$). The algebra $\cal{A}'$ is a defined by \begin{eqnarray} \{q,q\} = \frac{w}{2}, \qquad \{s,s\} = \frac{w^\dagger}{2}, \qquad [w,.] = [w^\dagger,.]=0, \end{eqnarray} where the dot represents any element in $\cal{A}'$. We want to apply - purely empirically as a matter of exercise, and working exclusively with the matrix representation - the same Khoroshkin-Tolstoy formula as in the case of $AdS_3$. This involves computing \begin{eqnarray} \frac{\check{Q}\otimes \check{S}}{\lambda_1 - \lambda_2} \label{dis} \end{eqnarray} in the representation $\check{\rho}_1 \otimes \check{\rho}_2$: here $\check{\rho}_i$ is also used to denote the representation $\check{\rho}$ taken with parameter $\theta_i$, $i=1,2$ (this being the physical particle rapidity in this particular problem). The expression (\ref{dis}) turns out to be equal to \begin{eqnarray} \frac{\check{S}\otimes \check{Q}}{\lambda_1 - \lambda_2} \end{eqnarray} in the representation $\check{\rho}_1 \otimes \check{\rho}_2$. The denominators are as usual the result of (minus) the sum $\sum_{n=0}^\infty \lambda_1^n \, \lambda_2^{-n-1}$ computed from the matrices $\check{Q}_n \equiv \lambda^n \check{Q}, \, \check{S}_n \equiv \lambda^n \check{S}$. The philosophy we are following here is that we would simply insert these matrices in the places where the representation of the Khoroshkin-Tolstoy formula would normally foresee the appearance of $\rho(e_n)$ and $\rho(f_n)$, and see what the calculation gives - purely as a matter of an empirical calculation. We are hoping then to draw some potentially useful intuition from this exercise. Physically we are in the situation of not knowing the algebra and only knowing the $R$-matrix, thereby having to try to gain as much intuition as we can on a possible algebraic reformulation of the physical problem, from such types of empyrical calculations. We use the fact that physical considerations require $\lambda_i = e^{\theta_i}$ (up to an irrelevant additive constant). We also send the difference $\theta = \theta_1 - \theta_2 \to \infty$ according to the arguments outlined in \cite{Andrea2}, and obtain \begin{eqnarray} \frac{\check{Q}\otimes \check{S}}{\lambda_1 - \lambda_2} = -\frac{1}{2} \mbox{csch}\frac{\theta}{2} \to - e^{-\frac{\theta}{2}} \qquad \theta \to \infty. \end{eqnarray} This means that the exponents of both root factors $R_+$ and $R_-$ in the universal formula of Khoroshkin and Tolstoy's (\ref{pro}) are small, hence we can adopt a linearised approximation \begin{eqnarray} R_+ \to 1_2\otimes 1_2 - \frac{\check{Q}\otimes S}{\lambda_1 - \lambda_2}, \qquad R_- \to1_2\otimes 1_2 + \frac{\check{S}\otimes \check{Q}}{\lambda_1 - \lambda_2}. \end{eqnarray} Note that this would normally be the case without the need of any approximation, since the root elements are supersymmetry generators which normally are nilpotent (as in the case of $AdS_3$). In $AdS_2$, however, this is clearly not the case as $(\check{Q})^2 = P \neq 0$ and $\check{S}^2 = P^\dagger \neq 0$, with $P$ and $P^\dagger$ proportional to the identity matrix, therefore the root factors in the universal formula do not truncate\footnote{The exact resummation would produce trigonometric functions of the evaluation parameter, which we would then expand to the linearised order.}. Nevertheless we can proceed as in the standard case if we set ourselves in the asymptotic limit, which is reminiscent of the analysis developed in \cite{Andrea2} for these $R$-matrices. Always following the philosophy expressed above, the Cartan factors $R_1$ and $R_2$ are computed in the familiar way and are exactly given by (\ref{R1e2}) with $\lambda_i = e^{\theta_i}$ and $a_i d_i = -2 c \,e^{\theta_i}$. We then multiply all the factors $R_+, R_1, R_2, R_-$ together, normalise the entry $|1\rangle\otimes |1\rangle \to |1\rangle \otimes |1\rangle$ to $1$, and take $\theta$ to be large. We get in this way exactly the expression for the $R$-matrix which was dubbed {\it Solution 5} in \cite{Andrea2} for the choice $\alpha=1$ which we have made in (\ref{rep}): \begin{eqnarray} R = \begin{pmatrix}1&0&0&e^{\frac{\theta}{2}}\\0&1&e^{\frac{\theta}{2}}&0\\0&e^{\frac{\theta}{2}}&-1&0\\epsilon^{\frac{\theta}{2}}&0&0&-1\end{pmatrix},\label{5} \end{eqnarray} where we can see the typically $8$-vertex form of the $AdS_2$ $R$-matrices. Likewise, in perfect consonance with the arguments of \cite{Andrea2}, by taking the $\theta \to -\infty$ asymptotic limit we obtain was was called {\it Solution 3} in \cite{Andrea2} for the choice $\alpha=1$: \begin{eqnarray} R = \begin{pmatrix}1&0&0&-e^{\frac{-\theta}{2}}\\0&-1&e^{\frac{-\theta}{2}}&0\\0&e^{\frac{-\theta}{2}}&1&0\\-e^{\frac{-\theta}{2}}&0&0&-1\end{pmatrix}.\label{3} \end{eqnarray} We remind that we are studying worldsheet right-movers, which fits with the form of these $R$-matrices. As in $AdS_3$, it has been necessary to change $\theta \to - \theta$ in the final step of the derivation to match with (\ref{5}) and (\ref{3}). Despite being here obtained in an asymptotic limit, the $R$-matrices (\ref{5}) and (\ref{3}) exactly satisfy the Yang-Baxter equation \cite{Andrea2}. The procedure of taking an asymptotic limit prevents us from obtaining the factorising twist as we instead did for $AdS_3$. In a sense, it is likely that the factorisation might occurr between a twist for solution $5$ and an inverse opposite twist for solution $3$, which always seem to be paired up - see also \cite{gamma1}. One complicating component in the case of $AdS_2$ is that the entries of the type $E_{12} \otimes E_{12}$ and $E_{21} \otimes E_{21}$ - which are the genuinely $8$-vertex type - remain the same up to a sign under ${}^{op}$. Likewise, under inversion they do remain in the same triangle of the matrix, therefore if one assumes a twist which is lower triangular, even admitting that it has one of the extreme $8$-vertex type entries turned on, there is no way to generate the extreme opposite entry (which the $R$-matrix obviously has) by computing something like $F_{21}^{-1} F_{12}$. The only way would be either to have a ``full'' twist (with lower and upper triangular parts) or two twists, as we anticipated above, of the sort $U_{21}^{-1} V_{12}$. Indeed, we have verified that the following decomposition holds: \begin{eqnarray} R_{sol.5}(\theta) = U_{21}^{-1}(-\theta) V_{12}(\theta), \end{eqnarray} where \begin{eqnarray} V_{12}(\theta) \sim R_2 R_- \qquad \theta \to \infty \end{eqnarray} (in the solution-$5$ regime) and \begin{eqnarray} U_{12}(\theta) \sim R_+ R_1 \qquad \theta \to -\infty \end{eqnarray} (in the solution-$3$ regime), again taking only the first order approximation of the asymptotic expansion\footnote{Specifically, such statements always refer to the expansion in the variable $\xi = e^{\frac{\theta}{2}}$.}. We have also disregarded a global scalar factor in front of the $R$-matrix, since in any case the dressing factor is not a concern of this paper (which is focused on purely algebraic characteristics). \section{Conclusions} In this paper we have obtained the factorising twists for the massless $AdS_3$ and $AdS_2$ integrable $R$-matrices, and attempted to transfer to lower-dimensional AdS/CFT the programme pioneered by Maillet et al \cite{Maillet,Maillet2} for ordinary spin-chains. We have derived the factorising twists from the universal $R$-matrix of the $\alg{gl}(1|1)$ Yangian double, and studied the RTT relations for the two- and three-site monodromy matrix. We have shown how the twist can be used to compute a simple scalar product, and we have implemented our construction in the langauge of free fermions developed in \cite{Dublin}. Finally, we have shown for the first time how to obtain the massless $AdS_2$ quantum $R$-matrix from the Yangian universal $R$-matrix with a particular limiting procedure, and we have computed a peculiar factorising twist for this case as well. Even though much of the analysis proceeds as in \cite{Maillet}, ultimately the models which we consider here are harder and we can make much less progress in the technical implementation. It will be very important in future work to try and overcome these obstacles, and obtain a manageable expression for the twist on a generic number of sites of the mondromy matrix, and arbitrary permutations of the sites \cite{Maillet}. General formulas do exist in the literature for ordinary spin-chain, but even without the complications which we have here the general formulas tend to be overwhelmingly complicated. It will also be extremely useful to pursue further the extension to the massive representations, which we have here only shown that it is possible, by using the Zhukovsky variables. It would be interesting to explore whether the classification of \cite{Marius,NewMarius} can be ``filtered'', in a way, according to which $R$-matrices admit a factorising twist and which perhaps do not. This might complement the analysis of which quantum group structures underlie the various categories of models, and whether such structures do reiterate in any sense the positive-negative-Cartan traingular decomposition which is typical of simple Lie (super)algebras. It would be nice to see whether these ideas can be connected to the separation of variables programme \cite{bgood}. Although different, the spirit of finding a change of basis which simplifies the algebraic Bethe ansatz is reminiscent of those advances, likewise the use which is made of these transformations to compute correlation functions. It would be very interesting to connect with other approaches to form factors \cite{fofa} and fully exploit the factorisability of the $R$-matrix. It would be nice to take advantage of the fact that the $AdS_5$ $R$-matrix, in all its representations, should naturally admit a factorising twist, since the quantum group it is based upon does respect the triangular structure \cite{AlerevY}, see also the recent \cite{les}. Such twist is probably significantly more complicated, and perhaps practically far less manageable, than the ones which we have found in this paper. Drinfeld twists have appeared in recent literature (the most recent to our knowledge being \cite{twists}) to implement deformations, while here we have in a sense undone the twisting to strip the $R$-matrix down to identity. It would be interesting however to connect the two complementary views. \section{Acknowledgments} We thank Juan Miguel Nieto for reading the manuscript and spotting several typos. We thank Patrick Dorey for discussions and for the suggestion to explore the methods developed by Maillet et al to study form factors. We very much thank Suvajit Majumder for discussions about the universal $R$-matrix of the $\alg{gl}(1|1)$ Yangian. We thank Sergey Frolov and Tristan McLoughlin for interesting discussions, and Fabrizio Nieri for an ongoing collaboration on the Lukyanov approach to form factors. We thank the anonymous referee for several very important comments and remarks on the mathematical consistency of the notation used. This work is supported by the EPSRC-SFI grant EP/S020888/1 {\it Solving Spins and Strings}. \section*{\label{sec:Data}Data Access Statement} No data beyond those presented in this paper are needed to validate its results.
8d910ae32f6c9d48ff490c2848d1dde378a3d556
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:intro} \begin{figure}[t] \centering {\includegraphics[width=1.0\linewidth]{intro_tight.pdf}} \caption{ The comparisons of model outputs (logits) and Kullback–Leibler (KL) distance between two networks that are trained from scratch. Analysis is conducted on CIFAR100-LT dataset with Imbalanced Factor (IF) of 100. The logits are visualized on the basis of a random selected example, and the KL distance is computed based on the whole test set and then the average results of each category are counted and reported. Although the employed two networks have the same network structure and training settings, their predictions differ largely from each other especially in tail classes. Bested viewed in color. } \label{fig_intro} \end{figure} In recent years, deep neural networks have achieved resounding success in various visual tasks, i.e., face analysis~\cite{wan2020multi,zhao2003face}, action and gesture recognition~\cite{Zhou_Li_Wan_2021,mitra2007gesture}. Despite the advances in deep technologies and computing capability, the huge success also highly depends on large well-designed datasets of having a roughly balanced distribution, such as ImageNet~\cite{deng2009imagenet}, MS COCO~\cite{lin2014microsoft} and Places~\cite{zhou2017places}. This differs notably from real-world datasets, which usually exhibit long-tailed data distributions~\cite{wang2017learning,liu2019large} where few head classes occupy most of the data while many tail classes have only few samples. In such scenarios, the model is easily dominated by those few head classes, whereas low accuracy rates are usually achieved for many other tail classes. Undoubtedly, the long-tailed characteristics challenges deep visual recognition, and also immensely hinders the practical use of deep models. In long-tailed visual recognition, several works focus on designing the class re-balancing strategies~\cite{tan2017efficient,tan2019attention,he2009learning,cui2019class,huang2016learning,wang2017learning} and decoupled learning~\cite{kang2019decoupling,cao2019learning}. More recent efforts aim to improve the long-tailed learning by using multiple experts~\cite{xiang2020learning,wang2020long,li2020overcoming,cai2021ace,zhang2021test}. The multi-expert algorithms follow a straightforward idea of complementary learning, which means that different experts focus on different aspects and each of them benefits from the specialization in the dominating part. For example, LFME~\cite{xiang2020learning} formulates a network with three experts and it forces each expert learn samples from one of head, middle and tail classes. Previous multi-expert methods~\cite{wang2020long,xiang2020learning,cai2021ace}, however, only force each expert to learn the knowledge in a specific area, and there is a lack of cooperation among them. \iffalse In long-tailed visual recognition, most early works focus on designing the class re-balancing strategies~\cite{he2009learning,buda2018systematic,cui2019class,huang2016learning,ren2018learning,wang2017learning} to balance the contributions of training samples for all classes. Although class re-balancing methods can obtain some accuracy improvements, they are often confronted with risk of overfitting due to the distortion in data distribution or high sensitivity of hyper-parameters. Later, some researchers~\cite{kang2019decoupling,cao2019learning} propose to decouple the network training into representation learning and classifier learning. The decoupled learning can address the overfitting problem via a two-stage learning manner, but the imbalanced data distribution issues have not been well handled especially in the representation learning stage. More recent efforts aim to improve the long-tailed learning by using multiple experts~\cite{xiang2020learning,wang2020long,li2020overcoming,cai2021ace,zhang2021test}. The multi-expert algorithms follow a straightforward idea of complementary learning, which means that different experts focus on different aspects and each of them benefits from the specialization in the dominating part. For example, LFME~\cite{xiang2020learning} formulates a network with three experts and it forces each expert learn samples from one of head, middle and tail classes. Multi-expert framework usually can achieve satisfactory recognition accuracy on long-tailed recognition since each of those experts is well learned on its own field. \fi Our motivation is inspired by a simple experiment as shown in Fig.~\ref{fig_intro}, where the different networks vary considerably, particularly in tail classes, even if they have the same network structure and the same training settings. This signifies the great uncertainty in the learning process. One reliable solution to alleviate the uncertainty is the collaborative learning through multiple experts, namely, that each expert can be a teacher to others and also can be a student to learn additional knowledge of others. Grounded in this, we propose a Nested Collaborative Learning (NCL) for long-tailed visual recognition. NCL contains two main important components, namely Nested Individual Learning (NIL) and Nested Balanced Online Distillation (NBOD), the former of which aims to enhance the discriminative capability of each network, and the later collaboratively transfers the knowledge among any two experts. Both NCL and NBOD are performed in a nested way, where the NCL or NBOD conducts the supervised learning or distillation from a full perspective on all categories, and also implements that from a partial perspective of focusing on some important categories. Moreover, we propose a Hard Category Mining (HCM) to select the hard categories as the important categories, in which the hard category is defined as the category that is not the ground-truth category but with a high predicted score and easily resulting to misclassification. The learning manners from different perspectives are nested, related and complementary, which facilitates to the thorough representations learning. Furthermore, inspired by self-supervised learning~\cite{he2020momentum}, we further employ an additional moving average model for each expert to conduct self-supervision, which enhances the feature learning in an unsupervised manner. In the proposed NCL, each expert is collaboratively learned with others, where the knowledge transferring between any two experts is allowed. NCL promotes each expert model to achieve better and even comparable performance to an ensemble's. Thus, even if a single expert is used, it can be competent for prediction. Our contributions can be summarized as follows: \iffalse Inspired by this, the online knowledge distillation is employed for cooperation. Moreover, we further formulate a balanced form for the distillation for long-tailed learning. In addition to the collaborative learning, the individual learning is also important for each expert. Besides the common supervised loss, e.g., Cross Entropy (CE) loss or Balance Softmax Cross Entropy (BSCE) loss~\cite{ren2020balanced}, we propose a Hard Category Focus (HCF) to improve network's discriminative capability. It differs from traditional losses (e.g., CE loss) that focus on all categories, and it only pays attention to some important categories that are most difficult to distinguish. Based on the HCF, we further formulate the online knowledge distillation as Dual Balanced Online Distillation (DBOD), which distils the knowledge from dual levels, i.e., full category level and partial category level, to complementary and comprehensively conduct the collaborative learning. Finally, inspired by self-supervised learning~\cite{he2020momentum}, we further employ an additional moving average model for each expert to conduct self-supervision, which enhances features learning in a unsupervised manner. The goal of our multi-expert framework is to strengthen the capability of each expert via collaborative Learning. In this way, both a single network and an ensemble can be employed for evaluation, and the single model is promoted to achieve comparable performance to an ensemble's. \fi \iffalse Considering the advantages of multi-expert strategy, our method is also constructed following this scheme. Previous multi-expert methods~\cite{wang2020long,xiang2020learning,cai2021ace} force each expert to only learn the knowledge from a specific area, and there is a lack of interactions and guidance from each other. Different from those methods, our method employs a Multi-Expert Collaborative Learning (MECL) among experts and encourages them to learn from each other. The proposed MECL consists of following parts. The first part is called individual supervised learning, which employs the individual supervised loss (e.g., Cross Entropy (CE) loss or Balance Softmax Cross Entropy (BSCE) loss~\cite{ren2020balanced} ) to learn individual features for each expert. To let the learning be more effective, we further propose a Hard Category Focus (HCF), which facilitates the network to pay attention to the most difficult categories to distinguish. The proposed HCF is highly complementary with the traditional supervised loss, with one oriented to all categories and the other one to only partial categories. To collaboratively learn multiple experts, we propose a Dual Balanced Online Distillation (DBOD) to allow each expert model distillate knowledge from others. The proposed DBOD is different from previous distillation methods~\cite{zhang2018deep,guo2020online} in following aspects: 1) our DBOD is with balanced configuration targeted for long-tailed learning; 2) the distillation is conducted on dual levels, i.e., full category level and partial category level, to complementary and comprehensively exploit discriminative features. Moreover, inspired by self-supervised learning~\cite{he2020momentum}, we further employ an addition moving average model for each expert to conduct self-supervision, which enhances features learning in a unsupervised manner. The goal of the proposed MECL is to improve the discriminative capability of each expert model via the collaborative Learning, which promotes each model to achieve comparable performance to an ensemble's. In this way, only one model is enough for forward prediction. \fi \iffalse The method is motivated by some interesting experiments as shown in Fig.~\ref{}. The experiments show that the predictions of different networks varies greatly although they are trained with same settings. More interestingly, the performance on tail classes is dramatically improved when employing a simple ensemble of them, which shows the complementary representations among those models. Inspired with Deep Mutual Learning (DML)~\cite{zhang2018deep}, we propose an collaborative learning based on online knowledge distillation which enables experts to gain extra knowledge from each other. Moreover, ************ \fi \begin{itemize} \setlength{\itemsep}{1.0pt} \item We propose a Nested Collaborative Learning (NCL) to collaboratively learn multiple experts concurrently, which allows each expert model to learn extra knowledge from others. \item We propose a Nested Individual Learning (NIL) and Nested Balanced Online Distillation (NBOD) to conduct the learning from both a full perspective on all categories and a partial perspective of focusing on hard categories. \item We propose a Hard Category Mining (HCM) to greatly reduce the confusion with hard negative categories. \item The proposed method gains significant performance over the state-of-the-art on five popular datasets including CIFAR-10/100-LT, Places-LT, ImageNet-LT and iNaturalist 2018. \end{itemize} \section{Related Work} \label{sec:related} \textbf{Long-tailed visual recognition.} To alleviate the long-tailed class imbalance, lots of studies ~\cite{zhou2020bbn,cao2020domain,xiang2020learning,ren2020balanced,wang2020long,ye2020identifying,liu2020memory} are conducted in recent years. The existing methods for long-tailed visual recognition can be roughly divided into three categories: class re-balancing~\cite{he2009learning,buda2018systematic,cui2019class,huang2016learning,ren2018learning,wang2017learning}, multi-stage training~\cite{kang2019decoupling,cao2019learning} and multi-expert methods~\cite{xiang2020learning,wang2020long,li2020overcoming,cai2021ace,zhang2021test}. Class re-balancing, which aims to re-balance the contribution of each class during training, is a classic and widely used method for long-tailed learning. More specifically, class re-balancing consists of data re-sampling~\cite{chawla2002smote,kang2019decoupling}, loss re-weighting~\cite{lin2017focal,wang2021seesaw,ren2020balanced,tan2020equalization}. Class re-balancing improves the overall performance but usually at the sacrifice of the accuracy on head classes. Multi-stage training methods divide the training process into several stages. For example, Kang et al.~\cite{kang2019decoupling} decouple the training procedure into representation learning and classifier learning. Li et al.~\cite{li2021self} propose a multi-stage training strategy constructed on basis of knowledge distillation. Besides, some other works~\cite{menon2020long,zhang2021distribution} tend to improve performance via a post-process of shifting model logits. However, multi-stage training methods may rely on heuristic design. More recently, multi-expert frameworks receive increasing concern, e.g., LFME~\cite{xiang2020learning}, BBN~\cite{zhou2020bbn}, RIDE~\cite{wang2020long}, TADE~\cite{zhang2021test} and ACE~\cite{cai2021ace}. Multi-expert methods indeed improve the recognition accuracy for long-tailed learning, but those methods still need to be further exploited. For example, most current multi-expert methods employ different models to learn knowledge from different aspects, while the mutual supervision among them is deficient. Moreover, they often employ an ensemble of experts to produce predictions, which leads to a complexity increase of the inference phase. \textbf{Knowledge distillation.} Knowledge distillation is a prevalent technology in knowledge transferring. Early methods~\cite{hinton2015distilling,passalis2018learning} often adopt an offline learning strategy, where the distillation follows a teacher-student learning scheme~\cite{hinton2015distilling,furlanello2018born}, which transfers knowledge from a large teacher model to a small student model. However, the teacher normally should be a complex high-capacity model and the training process may be cumbersome and time-consuming. In recent years, knowledge distillation has been extended to an online way~\cite{zhang2018deep,guo2020online,chen2020online,dvornik2019diversity}, where the whole knowledge distillation is conducted in a one-phase and end-to-end training scheme. For example, in Deep Mutual Learning~\cite{zhang2018deep}, any one model can be a student and can distil knowledge from all other models. Guo et al.~\cite{guo2020online} propose to use an ensemble of soft logits to guide the learning. Zhu et al.~\cite{lan2018knowledge} propose a multi-branch architecture with treating each branch as a student to further reduce computational cost. Online distillation is an efficient way to collaboratively learn multiple models, and facilitates the knowledge transferred among them. \textbf{Contrastive learning.} Many contrastive methods~\cite{he2020momentum,chen2020improved,chen2020simple,grill2020bootstrap} are built based on the task of instance discrimination. For example, Wu et al.~\cite{wu2018unsupervised} propose a noise contrastive estimation to compare instances based on a memory bank of storing representations. Representation learning for long-tailed distribution also been exploit~\cite{kang2020exploring}. More recently, Momentum Contrast (MoCo)~\cite{he2020momentum} is proposed to produce the compared representations by a moving-averaged encoder. To enhance the discriminative ability, contrastive learning often compares each sample with many negative samples. SimCLR~\cite{chen2020simple} achieves this by using a large batch size. Later, Chen et al.~\cite{chen2020improved} propose an improved method named MOCOv2, which achieving promising performance without using a large batch size for training. Considering the advantages of MoCOv2, our self-supervision is also constructed based on this structure. \begin{figure*}[t] \centering {\includegraphics[width=0.9\linewidth]{framework.pdf}} \caption{ An illustration of our proposed NCL of containing three experts. The NIL enhances discriminative ability of a single expert, and NBOD allows knowledge transferring among multiple experts. NIL conducts the supervised learning from both a full and a partial view, which focus on all categories and some hard categories, respectively. Similarly, NBOD conducts the knowledge distillation also from both a full and a partial view. The contrastive loss is calculated by using an extra momentum encoder and MLP layers, which can be removed in evaluation. Probabilities employed in NIL and NBOD are balanced according to the data distribution. } \label{fig_framework} \end{figure*} \section{Methodology} \label{sec:method} The proposed NCL aims to collaboratively and concurrently learn multiple experts together as shown in Fig.~\ref{fig_framework}. In the following, firstly, we introduce the preliminaries, and then present Hard Category Mining (HCM), Nested Individual Learning (NIL), Nested Balanced Online Distillation (NBOD) and self-supervision part. Finally, we show the overall loss of how to aggregate them together. \subsection{Preliminaries} We denote the training set with $n$ samples as ${ {\mathcal D}} = \{ {\bf x}_i, y_i \}$, where ${\bf x}_i$ indicates the $i$-th image sample and $y_i$ denotes the corresponding label. Assume a total of $K$ experts are employed and the $k$-th expert model is parameterized with ${\bm \theta}_k$. Given image ${\bf x}_i$, the predicted probability of class-$j$ in the $k$-th expert is computed as: \begin{equation}\label{ce_prob} {\tilde {\bf p}}_j({\bf x}_i;{\bm \theta}_k) = \frac{exp({ {z}_{ij}^k }) }{\sum_{l=1}^C exp({{z}_{il}^k }) } \end{equation} where $z_{ij}^k$ is the k-th expert model's class-$j$ output and $C$ is the number of classes. This is a widely used way to compute the predicted probability, and some losses like Cross Entropy (CE) loss is computed based on it. However, it does not consider the data distribution, and is not suitable for long-tailed visual recognition, where a naive learned model based on ${\tilde {\bf p}}({\bf x}_i;{\bm \theta}_k)$ would be largely dominated by head classes. Therefore, some researchers~\cite{ren2020balanced} proposed to compute predicted probability of class-$j$ in a balanced way: \begin{equation}\label{bsce_prob} {\bf p}_{j} ({\bf x}_i;{\bm \theta}_k) = \frac{n_{j} exp({ {z}_{ij}^k }) }{\sum_{l=1}^C n_l exp({{z}_{il}^k }) } \end{equation} where $n_j$ is the total number of samples of class $j$. In this way, contributions of tail classes are strengthened while contributions of head classes are suppressed. Based on such balanced probabilities, Ren et al.~\cite{ren2020balanced} further proposed a Balanced Softmax Cross Entropy (BSCE) loss to alleviate long-tailed class imbalance in model training. However, BSCE loss is still not enough, where the uncertainty in training still cannot be eliminated. \subsection{Hard Category Mining} In representation learning, one well-known and effective strategy to boost performance is Hard Example Mining (HEM)~\cite{hermans2017defense}. HEM selects hard samples for training while discarding easy samples. However, directly applying HEM to long-tailed visual recognition may distort the data distribution and make it more skewed in long-tailed learning. Differing from HEM, we propose a more amicable method named Hard Category Mining (HCM) to exclusively select hard categories for training, which explicitly improves the ability of distinguishing the sample from hard categories. In HCM, the hard category means the category that is not the ground-truth category but with a high predicted score. Therefore, the hard categories can be selected by comparing values of model's outputs. Specifically, we have $C$ categories in total and suppose $C_{hard}$ categories are selected to focus on. For the sample ${\bf x}_i$ and expert $k$, the corresponding set ${\bm \Psi}_i^k$ containing the output of selected categories is denoted as: \begin{equation}\label{hard_select} {\bm \Psi}_i^k = TopHard\{ z_{ij}^k | j \neq y_i \} \cup \{z_{iy_i}^k \} \end{equation} where $TopHard$ means selecting $C_{hard}$ examples with largest values. In order to adapt to long-tailed learning better, we computed the probabilities of the selected categories in a balanced way, which is shown as: \begin{equation}\label{hard_p} {\bf p}^* ({\bf x}_i;{\bm \theta}_k) = \{ \frac{n_j exp( { {z}_{ij}^k }) }{\sum_{z_{il}^k \in {\bm \Psi}_i^k } n_l exp({{z}_{il}^k }) } | {z}_{ij}^k \in {\bm \Psi}_i^k \} \end{equation} \subsection{Nested Individual Learning} The individual supervised learning on each expert is also an important component in our NCL, which ensures that each network can achieve the strong discrimination ability. To learn thoroughly, we proposed a Nested Individual Learning (NIL) to perform the supervision in a nested way. Besides the supervision on all categories for a global and robust learning, we also force the network to focus on some important categories selected by HCM, which enhance model's meticulous distinguishing ability. The supervision on all categories is trivial and constructed on BSCE loss. Since our framework is constructed on multiple experts, the supervision is applied to each expert and the loss on all categories over all experts is the sum of the loss of each expert: \begin{equation}\label{nil_all} L_{nil}^{all} = -\textstyle{\sum\nolimits_k} log( { {\bf p}}_{y_i} ({\bf x}_i;{\bm {\bm \theta} }_k) ) \end{equation} For the supervision on hard categories, it also can be obtained in a similar way. Mathematically, it can be represented as: \begin{equation}\label{nil_hard} L_{nil}^{hard} = -\textstyle{\sum\nolimits_k} log( { {\bf p}^*}_{y_i} ({\bf x}_i;{\bm {\bm \theta} }_k) ) \end{equation} In the proposed NIL, the two nested supervisions are employed together to achieve a comprehensive learning, and the summed loss is written as: \begin{equation}\label{loss_dil} L_{nil} = L_{nil}^{all} + L_{nil}^{hard} \end{equation} \iffalse \subsection{Overview} The proposed Multi-Expert Collaborative Learning (MECL) collaboratively and concurrently learn multiple experts to address uncertain predictions in the long-tailed setting, which allows each expert to learn extra knowledge from other experts. An illustration of our MECL is shown in Fig.~\ref{fig_framework}. In MECL, we propose a Dual Balanced Online Distillation (DBOD) for online knowledge transferring. The proposed DBOD differs from previous works~\cite{chen2020online,guo2020online,zhang2018deep} from two aspects as following. First, DBOD distills the knowledge on the re-balanced probability distribution rather than the original probability distribution, which learns knowledge in a balanced way. Second, the knowledge distillation is performed on dual levels. Besides giving a full perspective on all categories, we also add an extra distillation supervision on some important categories from a partial perspective. The important categories are defined as hard categories, that is, categories that are easy to cause misclassification. To achieve this, we proposed a Hard categories Focus (HCF) to focus on hard categories for training. In addition to the cooperation among multiple experts, the individual learning on each expert is also important. Similar to DBOD, the individual learning is also conducted from two aspects, where one is the traditional supervised loss on all categories, like Cross-Entropy (CE) or Balanced Softmax Cross-Entropy (BSCE) loss, and the other is the loss function based on HCF to focus on hard categories. Furthermore, we employ a self-supervision to further enhance the feature learning. In the following, we shall first introduce CE and BSCE loss, and then present HCF, DBOD and the employed self-supervision. Finally, we present a training scheme of how to aggregate them together. \fi \iffalse The proposed MECL consists of four parts. The first part is called individual supervised learning, where each expert would be individually trained in supervised manner with a classification loss. In the first part, the supervised loss is performed over all categories, where some of them may be easy categories that contribute very little in the learning. Therefore, we propose the second part called Hard Category Focus (HCF), which draws the attention of the model to the most difficult categories to distinguish. In the third part, we propose a Dual Balanced Online Distillation (DBOD) to encourage each expert model collaboratively distillate knowledge from other models. As shown in Fig~\ref{***}, DBOD is performed on dual levels, i.e., full category level and partial category level, which comprehensively transfers the knowledge to each other. The last part is to employ the self-supervision to enhance the feature learning. In the following, we first introduce aforementioned four components, and then present the overall loss of how to aggregate them together. \subsection{CE and BSCE losses} We denote the training set with $n$ samples as ${ {\mathcal D}} = \{ {\bf x}_i, y_i \}$, where ${\bf x}_i$ indicates the $i^{th}$ image sample and $y_i$ denotes the corresponding label. Assume a total of $K$ experts are employed and the $k^{th}$ expert model is parameterized with ${\bm \theta}_k$. Each model is first trained in a supervised manner to learn their own features. Generally, a most common loss, namely Cross-Entropy (CE) loss, is employed as the loss function, which can be formulated as: \begin{equation}\label{ce_loss} L_{ce}^k = - log( {\tilde {\bf p}}_{y_i} ({\bf x}_i;{\bm {\bm \theta} }_k) ) \end{equation} where ${\tilde {\bf p}}_j({\bf x}_i;{\bm \theta}_k) = \frac{exp({ {z}_{ik} }) }{\sum_{j=1}^C exp({{z}_{ij} }) }$ represents the probability of classifying the image ${\bf x}_i$ to class $j$, $z_{ij}$ is the model's class-$j$ output and $C$ is the number of classes. The CE loss can deal well with the classification problem with a balanced data distribution. However, it is not suitable for long-tailed visual recognition, where a immaturely learned model would be largely dominated by head classes. To alleviate the effect of long-tailed distribution, we re-balance the classifying probability $p_{y_i} ({\bf x}_i;{\bm \theta}_k)$ as following: \begin{equation}\label{bsce_p} {\bf p}_{y_i} ({\bf x}_i;{\bm \theta}_k) = \frac{n_{y_i} exp({ {z}_{iy_i} }) }{\sum_{j=1}^C n_j exp({{z}_{ij} }) } \end{equation} where $n_j$ is the total number of samples of class $j$. The CE loss with the re-balanced probabilities is called Balanced Softmax Cross-Entropy (BSCE) loss~\cite{ren2020balanced}, which is denoted as $L_{bsce}^k = - log( { {\bf p}}_{y_i} ({\bf x}_i;{\bm \theta}_k) )$. Specifically, contributions of tail classes are strengthened while contributions of head classes are suppressed. To the end, the loss to train all expert models is the sum of all individual losses: \begin{equation}\label{bsce_all} L_{bsce} = -\textstyle{\sum\nolimits_k} L_{bsce}^k \end{equation} \subsection{Hard Category Focus} In representation learning, one well-known and effective strategy to boost performance is Hard Example Mining (HEM)~\cite{hermans2017defense}. HEM selects hard samples for training while discarding easy samples, which holds that easy samples contribute very little and are even detrimental to features learning. HEM may also be of value to long-tailed visual recognition. However, HEM of discarding easy samples may distort the data distribution and make it more skewed in long-tailed learning. Differing from HEM, we propose a more amicable method named Hard Category Focus (HCF) to exclusively select hard categories for training, which explicitly improves the ability of distinguishing between hard categories. In HCF, the hard category means the category that is not the ground-truth category but with a high predicted score. Therefore, the hard categories can be selected by comparing values of model's outputs. Specifically, we have $C$ categories in total and suppose $C_{hard}$ categories are selected to focus on. For the sample ${\bf x}_i$, the corresponding set ${\bm \Psi}_i$ of containing the outputs of selected categories is denoted as: \begin{equation}\label{hard_select} {\bm \Psi}_i = TopHard\{ z_{ij} | j \neq y_i \} \cup \{z_{iy_i} \} \end{equation} where $TopHard$ means selecting $C_{hard}$ examples with largest values. Then, the classification loss like BSCE also can be employed to compute the loss over the selected set ${\bm \Psi}_i$ , which facilitates the model to distinguish the input sample from those confusing categories. Here we take HCF with the BSCE loss as an example. Then, the probabilities over the selected categories are re-computed as: \begin{equation}\label{hard_p} {\bf p}^* ({\bf x}_i;{\bm \theta}_k) = \{ \frac{n_l exp( { {z}_{il} }) }{\sum_{z_{ij} \in {\bm \Psi}_i } n_j exp({{z}_{ij} }) } | {z}_{il} \in {\bm \Psi}_i \} \end{equation} Specifically, the BSCE loss over ${\bf p}^*$ on all experts can be represented as: \begin{equation}\label{bsce_p} L_{hcf} = -\textstyle{\sum\nolimits_k} log( { {\bf p}}_{y_i}^* ({\bf x}_i;{\bm \theta}_k) ) \end{equation} Our HCF also can apply to the classical CE loss, which can be extended to other classification tasks. \fi \subsection{Nested Balanced Online Distillation} To collaboratively learn multiple experts from each other, online distillation is employed to allow each model to learn extra knowledge from others. Previous methods~\cite{zhang2018deep,guo2020online} consider the distillation from a full perspective of all categories, which aims to capture global and robust knowledge. Different from previous methods, we propose a Nested Balanced Online Distillation (NBOD), where the distillation is conducted not only on all categories, but also on some hard categories that are mined by HCM, which facilitates the network to capture meticulous distinguishing ability. According to previous works~\cite{zhang2018deep,guo2020online}, the Kullback Leibler (KL) divergence is employed to perform the knowledge distillation. The distillation on all categories can be formulated as: \begin{equation}\label{eq_dis_all} L_{dis}^{all} = \frac{1}{K(K-1)} {\sum_{k}^{K} \sum_{q \neq k}^{K} } KL( {\bf p} ({\bf x}_i;{\bm \theta}_k) || {\bf p} ({\bf x}_i;{\bm \theta}_q) ) \end{equation} As we can see, the distillation is conducted among any two experts. Note here that we use balanced distributions instead of original distributions to compute KL distance, which aims to eliminate the distribution bias under the long-tailed setting. And this is also one aspect of how we distinguish from other distillation methods. Moreover, all experts employ the same hard categories for distillation, and we randomly select an expert as an anchor to generate hard categories for all experts. Similarly, the distillation on hard categories also can be formulated as: \begin{equation}\label{eq_dis_hard} L_{dis}^{hard} = \frac{1}{K(K-1)} {\sum_{k}^{K} \sum_{q \neq k}^{K} } KL( {\bf p}^* ({\bf x}_i;{\bm \theta}_k) || {\bf p}^* ({\bf x}_i;{\bm \theta}_q) ) \end{equation} The nested distillation on both all categories and hard categories are learned together, which is formulated as: \begin{equation}\label{eq_dis} L_{dis} = L_{dis}^{all} + L_{dis}^{hard} \end{equation} \iffalse The loss $L_{kl}({\bm \theta}_k,{\bm \theta}_q)$ and $L_{kl}^*({\bm \theta}_k,{\bm \theta}_q)$ are optimized concurrently to distill the knowledge from the perspective of both all categories and hard categories. Moreover, our framework consists of multiple experts, and the knowledge transferring between any two experts would be considered thoroughly. Very natural, the proposed DBOD among all experts can be computed as: \begin{equation}\label{mutual_all} L_{dis} = \frac{1}{K(K-1)} \textstyle{\sum_{k}^{K} \sum_{q \neq k}^{K} } \big( L_{kl} ({\bm \theta}_k,{\bm \theta}_q) + L_{kl}^*({\bm \theta}_k,{\bm \theta}_q) \big) \end{equation} \fi \subsection{Feature Enhancement via Self-Supervision} Self-supervised learning aims to improve feature representations via an unsupervised manner. Following previous works~\cite{he2020momentum,chen2020improved}, we adopt the instance discrimination as the self-supervised proxy task, in which each image is regarded as a distinct class. We leverage an additional temporary average model so as to conduct self-supervised learning, and its parameters are updated following a momentum-based moving average scheme~\cite{he2020momentum,chen2020improved} as shown in Fig.~\ref{fig_framework}. The employed self-supervision is also a part of our NCL, which cooperatively learns an expert model and its moving average model to capture better features. Take the self-supervision for expert $k$ as an example. Let ${\bf v}_i^k$ denote the normalized embedding of the $i^{th}$ image in the original expert model, and ${\bf {\tilde v} }_i^k$ denote the normalized embedding of its copy image with different augmentations in the temporally average model. Besides, a dynamic queue $\mathcal{Q}^k$ is employed to collect historical features. The samples in the queue are progressively replaced with the samples in current batch enqueued and the samples in oldest batch dequeued. Assume that the queue $\mathcal{Q}^k$ has a size of $N$ and $N$ can be set to be much larger than the typical batch size, which provides a rich set of negative samples and thus obtains better feature representations. The goal of instance discrimination task is to increase the similarity of features of the same image while reduce the similarity of the features of two different images. We achieve this by using a contrastive learning loss, which is computed as: \begin{small} \begin{equation}\label{contrastive_loss} L_{con}^k = -log( \frac{exp( {{\bf v}_i^k}^T {\bf {\tilde v}}_i^k /\tau )} { exp( { {\bf v}_i^k }^T {\bf {\tilde v}}_i^k /\tau) + \sum_{{\bf {\tilde v}}_j^k \in { \mathcal{Q}^k}} exp( { {\bf v}_i^k }^T {\bf {\tilde v}}_j^k /\tau) } ) \end{equation} \end{small} where $\tau$ is a temperature hyper-parameter. Similar to Eq.~\ref{nil_all} and Eq.~\ref{nil_hard}, the self-supervised loss over all experts can be represented as $L_{con} = \sum\nolimits_k L_{con}^k$. \subsection{Model Training} The overall loss in our proposed NCL consists of three parts: the loss $L_{nil}$ of our NIL for learning each expert individually, the loss $L_{dis}$ of our NBOD for cooperation among multiple experts, and the loss $L_{con}$ of self-supervision. The overall loss $L$ is formulated as: \begin{equation}\label{mcl_loss} L = L_{nil} + L_{con} + \lambda L_{dis} \end{equation} where $\lambda$ denotes the loss weight to balance the contribution of cooperation among multiple experts. For $L_{nil}$ and $L_{con}$, they play their part inside the single expert, and we equally set their weighs as 1 in consideration of generality. \section{Experiments} \subsection{Datasets and Protocols} We conduct experiments on five widely used datasets, including CIFAR10-LT~\cite{cui2019class}, CIFAR100-LT~\cite{cui2019class}, ImageNet-LT~\cite{liu2019large}, Places-LT~\cite{zhou2017places}, and iNaturalist 2018~\cite{van2018inaturalist}. \textbf{CIFAR10-LT and CIFAR100-LT}~\cite{cui2019class} are created from the original balanced CIFAR datasets~\cite{krizhevsky2009learning}. Specifically, the degree of data imbalance in datasets is controlled by an Imbalance Factor (IF), which is defined by dividing the number of the most frequent category by that of the least frequent category. The imbalance factors of 100 and 50 are employed in these two datasets. \textbf{ImageNet-LT}~\cite{liu2019large} is sampled from the popular ImageNet dataset~\cite{deng2009imagenet} under long-tailed setting following the Pareto distribution with power value $\alpha$=6. ImageNet-LT contains 115.8K images from 1,000 categories. \textbf{Places-LT} is created from the large-scale dataset Places~\cite{zhou2017places}. This dataset contains 184.5K images from 365 categories. \textbf{iNaturalist 2018}~\cite{van2018inaturalist} is the largest dataset for long-tailed visual recognition. iNaturalist 2018 contains 437.5K images from 8,142 categories, and it is extremely imbalanced with an imbalance factor of 512. According to previous works~\cite{cui2019class,kang2019decoupling} the top-1 accuracy is employed for evaluation. Moreover, for iNaturalist 2018 dataset, we follow the works~\cite{cai2021ace,kang2019decoupling} to divide classes into many (with more than 100 images), medium (with 20 $\sim$ 100 images) and few (with less than 20 images) splits, and further report the results on each split. \subsection{Implementation Details} For CIFAR10/100-LT, following~\cite{cao2019learning, zhang2021bag}, we adopt ResNet-32~\cite{he2016deep} as our backbone network and liner classifier for all the experiments. We utilize ResNet-50~\cite{he2016deep}, ResNeXt-50~\cite{xie2017aggregated} as our backbone network for ImageNet-LT, ResNet-50 for iNaturalist 2018 and pretrained ResNet-152 for Places-LT respectively, based on~\cite{liu2019large,kang2019decoupling,cui2021parametric}. Following~\cite{zhang2021distribution}, cosine classifier is utilized for these models. Due to the use of the self-supervision component, we use the same training strategies as PaCo~\cite{cui2021parametric}, i.e., training all the models for 400 epochs except models on Places-LT, which is 30 epochs. In addition, for fair comparison, following~\cite{cui2021parametric}, RandAugument~\cite{cubuk2020randaugment} is also used for all the experiments except Places-LT. The influence of RandAugument will be discussed in detail in Sec.~\ref{Component_Analysis}. These models are trained on 8 NVIDIA Tesla V100 GPUs. The $\beta = C_{hard} / C$ in HCM is set to 0.3. And the ratio of Nested Balanced Online Distillation loss $\lambda$, which plays its part among networks, is set to 0.6. The influence of $\beta$ and $\lambda$ will be discussed in detail in Sec.~\ref{Component_Analysis}. \setlength{\tabcolsep}{5pt} \begin{table}[t] \centering \resizebox{\linewidth}{!}{ \begin{tabular}{l|c|cc|cc} \toprule[1pt] \multirow{2}{*}{Method} & \multirow{2}{*}{Ref.} & \multicolumn{2}{c|}{ CIFAR100-LT } & \multicolumn{2}{c}{ CIFAR10-LT } \\ \cline{3-6} & & 100 & 50 & 100 & 50 \\ \hline CB Focal loss~\cite{cui2019class} & CVPR'19 & 38.7 & 46.2 & 74.6 & 79.3\\ LDAM+DRW~\cite{cao2019learning} & NeurIPS'19 & 42.0 & 45.1 & 77.0 & 79.3\\ LDAM+DAP~\cite{jamal2020rethinking} & CVPR'20 & 44.1 & 49.2 & 80.0 & 82.2\\ BBN~\cite{zhou2020bbn} & CVPR'20 & 39.4 & 47.0 & 79.8 & 82.2\\ LFME~\cite{xiang2020learning} & ECCV'20 & 42.3 & -- & -- & --\\ CAM~\cite{zhang2021bag} & AAAI'21 & 47.8 & 51.7 & 80.0 & 83.6\\ Logit Adj.~\cite{menon2020long} & ICLR'21 & 43.9 & -- & 77.7 & --\\ RIDE~\cite{wang2020long} & ICLR'21 & 49.1 & -- & -- & --\\ LDAM+M2m~\cite{kim2020m2m}& CVPR'21 & 43.5 & -- & 79.1 & --\\ MiSLAS~\cite{zhong2021improving} & CVPR'21 & 47.0 & 52.3 & 82.1 & 85.7 \\ LADE~\cite{hong2021disentangling} & CVPR'21 & 45.4 & 50.5 & -- & --\\ Hybrid-SC~\cite{wang2021contrastive} & CVPR'21 & 46.7 & 51.9 & 81.4 & 85.4 \\ DiVE~\cite{he2021distilling} & ICCV'21 & 45.4 & 51.3 & -- & -- \\ SSD~\cite{li2021self_iccv} & ICCV'21 & 46.0 & 50.5 & -- & --\\ ACE~\cite{cai2021ace}& ICCV'21 & 49.6 & 51.9 & 81.4 & 84.9\\ PaCo~\cite{cui2021parametric} & ICCV'21 & 52.0 & 56.0 & -- & --\\ \hline BSCE (baseline) & -- & 50.6 & 55.0 & 84.0 & 85.8 \\ Ours (single) & -- & \textbf{53.3} & \textbf{56.8} & \textbf{84.7} & \textbf{86.8} \\ Ours (ensemble) & -- & \textbf{54.2} & \textbf{58.2} & \textbf{85.5} & \textbf{87.3} \\ \bottomrule[1pt] \end{tabular}}\caption{Comparisons on CIFAR100-LT and CIFAR10-LT datasets with the IF of 100 and 50. } \label{results_cifar} \end{table} \iffalse \setlength{\tabcolsep}{8pt} \begin{table*}[t] \centering \resizebox{0.9\linewidth}{!}{ \begin{tabular}{l|c|c|ccc|c|c|ccc|c} \toprule[1pt] \multirow{2}{*}{Method} & \multirow{2}{*}{Ref.} & \multicolumn{5}{c|}{ ResNet-50 } & \multicolumn{5}{c}{ ResNeXt-50 } \\ \cline{3-12} & & GFlops & Many & Medium & Few & All & GFlops & Many & Medium & Few & All\\ \hline BBN~\cite{zhou2020bbn} & CVPR'20 & --& --& --& --& 48.3 & --& --& --& --& 49.3\\ NCM~\cite{kang2019decoupling} & ICLR'20 & -- & 53.1 & 42.3 & 26.5 & 44.3 & -- & 56.6 & 45.3 & 28.1 & 47.3\\ cRT~\cite{kang2019decoupling} & ICLR'20 & 4.11 (1.0x) & 58.8 & 44.0 & 26.1 & 47.3 & 4.26 (1.0x) & 61.8 & 46.2 & 27.4 & 49.6\\ $\tau$-norm~\cite{kang2019decoupling} & ICLR'20 & 4.11 (1.0x) & 56.6 & 44.2 & 27.4 & 46.7 & 4.26 (1.0x) & 59.1 & 46.9 & 30.7 & 49.4\\ LWS~\cite{kang2019decoupling} & ICLR'20 & 4.11 (1.0x) & 57.1 & 45.2 & 29.3 & 47.7 & 4.26 (1.0x) & 60.2 & 47.2 & 30.3 & 49.9\\ RIDE~\cite{wang2020long} & ICLR'21 & 5.15 (1.3x) & 66.2 & 52.3 & 36.5 & 55.4 & 5.19 (1.2x) & 68.2 & 53.8 & 36.0 & 56.8\\ DisAlign~\cite{zhang2021distribution} & CVPR'21 & -- & 61.3 & 52.2 & 31.4 & 52.9 & --& --& --& --& --\\ DiVE~\cite{he2021distilling} & ICCV'21 & -- & 64.06 & 50.41 & 31.46 & 53.10 & --& --& --& --& --\\ SSD~\cite{li2021self_iccv} & ICCV'21 & --& --& --& --& --& -- & 66.8 & 53.1 & 35.4 & 56.0\\ ACE~\cite{cai2021ace} & ICCV'21 & --& --& --& --& 54.7 & --& --& --& --& 56.6\\ PaCo~\cite{cui2021parametric} & ICCV'21 & -- & 65.0 & 55.7 & 38.2 & 57.0 & -- & 67.5 & 56.9 & 36.7 & 58.2\\ \hline Ours (single) & -- &&&&&\textbf{57.4}& \\ Ours (ensemble) & -- &&&&&\textbf{58.34}& \\ \bottomrule[1pt] \end{tabular} } \caption{Comparisons on ImageNet-LT dataset. } \label{results_imagenet} \end{table*} \fi \setlength{\tabcolsep}{6pt} \begin{table}[t] \centering \resizebox{1.0\linewidth}{!}{ \begin{tabular}{l|c|cc|c} \toprule[1pt] \multirow{2}{*}{Method} & \multirow{2}{*}{Ref.} & \multicolumn{2}{c|}{ImageNet-LT} & Places-LT \\ \cline{3-5} & & Res50 & ResX50 & Res152\\ \hline OLTR~\cite{liu2019large} & CVPR'19 & -- & -- & 35.9\\ BBN~\cite{zhou2020bbn} & CVPR'20 & 48.3 & 49.3 & --\\ NCM~\cite{kang2019decoupling} & ICLR'20 & 44.3 & 47.3 & 36.4\\ cRT~\cite{kang2019decoupling} & ICLR'20 & 47.3 & 49.6 & 36.7\\ $\tau$-norm~\cite{kang2019decoupling} & ICLR'20 & 46.7 & 49.4 & 37.9\\ LWS~\cite{kang2019decoupling} & ICLR'20 & 47.7 & 49.9 & 37.6\\ BSCE~\cite{ren2020balanced} & NeurIPS'20 & -- & -- & 38.7 \\ RIDE~\cite{wang2020long} & ICLR'21 & 55.4 & 56.8 & --\\ DisAlign~\cite{zhang2021distribution} & CVPR'21 & 52.9 & -- & --\\ DiVE~\cite{he2021distilling} & ICCV'21 & 53.1 & -- & --\\ SSD~\cite{li2021self_iccv} & ICCV'21 &--& 56.0 & --\\ ACE~\cite{cai2021ace} & ICCV'21 & 54.7 & 56.6 & --\\ PaCo~\cite{cui2021parametric} & ICCV'21 & 57.0 & 58.2 & 41.2\\ \hline BSCE (baseline) & -- &53.9&53.6&40.2\\ Ours (single) & -- &\textbf{57.4}& \textbf{58.4} & \textbf{41.5}\\ Ours (ensemble) & -- &\textbf{59.5}& \textbf{60.5}& \textbf{41.8}\\ \bottomrule[1pt] \end{tabular} } \caption{Comparisons on ImageNet-LT and Places-LT datasets. } \label{results_imagenet} \end{table} \setlength{\tabcolsep}{5pt} \begin{table}[t] \centering \resizebox{0.95\linewidth}{!}{ \begin{tabular}{l|c|ccc|c} \toprule[1pt] \multirow{2}{*}{Method} & \multirow{2}{*}{Ref.} & \multicolumn{4}{c}{ iNaturalist 2018} \\ \cline{3-6} & & Many & Medium & Few & All \\ \hline OLTR~\cite{liu2019large} & CVPR'19 & 59.0 & 64.1 & 64.9 & 63.9\\ BBN~\cite{zhou2020bbn} & CVPR'20 & 49.4 & 70.8 & 65.3 & 66.3\\ DAP~\cite{jamal2020rethinking}& CVPR'20 & -- & -- & -- & 67.6\\ NCM~\cite{kang2019decoupling} & ICLR'20 & \\ cRT~\cite{kang2019decoupling} & ICLR'20 & 69.0 & 66.0 & 63.2 & 65.2\\ $\tau$-norm~\cite{kang2019decoupling} & ICLR'20 & 65.6 & 65.3 & 65.9 & 65.6\\ LWS~\cite{kang2019decoupling} & ICLR'20 & 65.0 & 66.3 & 65.5 & 65.9\\ LDAM+DRW~\cite{cao2019learning} & NeurIPS'19 & -- & -- & -- & 68.0\\ Logit Adj.~\cite{menon2020long} & ICLR'21 & -- & -- & -- & 66.4\\ CAM~\cite{zhang2021bag} & AAAI'21 & -- & -- & -- & 70.9 \\ RIDE~\cite{wang2020long} & ICLR'21 & 70.9 & 72.4 & 73.1 & 72.6\\ SSD~\cite{li2021self_iccv} & ICCV'21 & \\ ACE~\cite{cai2021ace} & ICCV'21 & -- & -- & -- & 72.9\\ PaCo~\cite{cui2021parametric} & ICCV'21 & -- & -- & -- & 73.2\\ \hline BSCE (baseline) & -- &67.5&72.0&71.5&71.6 \\ Ours (single) & -- &\textbf{72.0}&\textbf{74.9}&\textbf{73.8}&\textbf{74.2} \\ Ours(ensemble) & -- &\textbf{72.7}&\textbf{75.6}&\textbf{74.5}&\textbf{74.9} \\ \bottomrule[1pt] \end{tabular} } \caption{Comparisons on iNaturalist 2018 dataset with ResNet-50. } \label{results_inatu} \end{table} \subsection{Comparisons to Prior Arts} We compare the proposed method NCL with previous state-of-the-art methods, like LWS~\cite{kang2019decoupling}, ACE~\cite{cai2021ace} and so on. Our NCL is constructed based on three experts and both the performance of a single expert and an ensemble of multiple experts are reported. Besides NCL, we also report the baseline results of a network with using BSCE loss for comparisons. Comparisons on CIFAR10/100-LT are shown in Table~\ref{results_cifar}, comparisons on ImageNet-LT and Places-LT are shown in Table~\ref{results_imagenet}, and comparisons on iNaturalist2018 are shown in Table~\ref{results_inatu}. Our proposed method achieves the state-of-the-art performance on all datasets whether using a single expert or an ensemble of all experts. For only using a single expert for evaluation, our NCL outperforms previous methods on CIFAR10-LT, CIFAR100-LT, ImageNet-LT, Places-LT and iNaturalist2018 with accuracies of 84.7\% (IF of 100), 53.3\% (IF of 100), 57.4\% (with ResNet-50), 41.5\% and 74.2\%, respectively. When further using an ensemble for evaluation, the performance on CIFAR10-LT, CIFAR100-LT, ImageNet-LT, Places-LT and iNaturalist2018 can be further improved to 85.5\% (IF of 100), 54.2\% (IF of 100), 59.5\% (with ResNet-50), 41.8\% and 74.9\%, respectively. More results on many, medium and few splits are listed in \textbf{Supplementary Material}. Some previous multi-expert methods were constructed based on a multi-branch network with higher complexity. For example, RIDE~\cite{wang2020long} with 4 experts brings 0.4 times more computation than the original single network. However, our method of only using a single expert for evaluation won't bring any extra computation but still outperforms them. Besides, despite that some previous methods employ a multi-stage training~\cite{li2021self_iccv,kang2019decoupling} or a post-processing~\cite{menon2020long,zhang2021distribution} to further improve the performance, our method still outperforms them. The significant performance over the state-of-the-art shows the effectiveness of our proposed NCL. \subsection{Component Analysis} \label{Component_Analysis} \textbf{Influence of the ratio of hard categories.} The ratio of selected hard categories is defined as $\beta = C_{hard} / C$. Experiments on our NIL model are conducted within the range of $\beta$ from 0 to 1 as shown in Fig.~\ref{fig_hcf} (a). The highest performance is achieved when setting $\beta$ to 0.3. Setting $\beta$ with a small and large values brings limited gains due to the under and over explorations on hard categories. \textbf{Effect of loss weight.} To search an appropriate value for $\lambda$, experiments on the proposed NCL with a series of $\lambda$ are conducted as shown in Fig.~\ref{fig_hcf} (b). $\lambda$ controls the contribution of knowledge distillation among multiple experts in total loss. The best performance is achieved when $\lambda=0.6$, which shows that a balance is achieved between single network training and knowledge transferring among experts. \begin{figure}[t] \centering {\includegraphics[width=1.0\linewidth]{HCF_b.pdf}} \vspace{-0.6cm} \caption{ Parameter analysis of (a) the ratio $\beta$ and (b) the loss weight $\lambda$ on CIFAR100-LT dataset with IF of 100. } \label{fig_hcf} \end{figure} \textbf{Impact of different number of experts.} As shown in Fig.~\ref{fig_multi_expert}, experiments using different number of experts are conducted. The ensemble performance is improved steadily as the number of experts increases, while for only using a single expert for evaluation, its performance can be greatly improved when only using a small number of expert networks, e.g., three experts. Therefore, three experts are mostly employed in our multi-expert framework for a balance between complexity and performance. \textbf{Single expert vs. multi-expert.} Our method is essentially a multi-expert framework, and the comparison among using a single expert or an ensemble of multi-expert is a matter of great concern. As shown in Fig.~\ref{fig_multi_expert}, As the number of experts increases, the accuracy of the ensemble over a single expert also tends to rise. This demonstrates the power of ensemble learning. But for the main goal of our proposed NCL, the performance improvement over a single expert is impressive enough at the number of three. \begin{figure}[!t] \centering {\includegraphics[width=0.8\linewidth]{expert_num_ana.pdf}} \vspace{-0.3cm} \caption{ Comparisons of using different expert numbers on CIFAR100-LT with an IF of 100. We report the performance on both a single network and an ensemble. Specifically, the performance on a single network is reported as the average accuracy on all experts, and the ensemble performance is computed based on the averaging logits over all experts. } \label{fig_multi_expert} \end{figure} \textbf{Influence of data augmentations.} Data augmentation is a common tool to improve performance. For example, previous works use Mixup~\cite{zhang2021bag,cai2021ace,zhong2021improving,zhang2018mixup} and RandAugment~\cite{cubuk2020randaugment} to obtain richer feature representations. Our method follows PaCo~\cite{cui2021parametric} to employ RandAugment~\cite{cubuk2020randaugment} for experiments. As shown in Table~\ref{auto_aug_analysis}, the performance is improved by about 3\% to 5\% when employing RandAugment for training. However, our high performance depends not entirely on RandAugment. When dropping RandAugment, our ensemble model reaches an amazing performance of 49.22\%, which achieves comparable performance to the current state-of-the-art ones. \setlength{\tabcolsep}{8pt} \begin{table}[t] \centering \resizebox{0.8\linewidth}{!}{ \begin{tabular}{c|c|c} \toprule[1pt] Method & w/o RandAug & w/ RandAug\\ \hline CE & 41.88 & 44.79 \\ BSCE & 45.88 & 50.60 \\ BSCE+NCL & 47.93 & 53.31 \\ BSCE+NCL$^\dagger$ & 49.22 & 54.42 \\ \bottomrule[1pt] \end{tabular} } \caption{Comparisons of training the network with ('w/') and without ('w/o') employing RandAugment. Experiments are conducted on CIFAR100-LT dataset with an IF of 100. $^\dagger$ Indicates the ensemble performance is reported. } \label{auto_aug_analysis} \end{table} \textbf{Ablation studies on all components.} In this sub-section, we perform detailed ablation studies for our NCL on CIFAR100-LT dataset, which is shown in Table~\ref{analysis_ablation}. To conduct a comprehensive analysis, we evaluate the proposed components including Self-Supervision ('SS' for short), NIL, NBOD and ensemble on two baseline settings of using CE and BSCE losses. Furthermore, for more detailed analysis, we split NBOD into two parts namely BOD$_{all}$ and BOD$_{hard}$. Take the BSCE setting as an example, SS and NIL improve the performance by 0.82\% and 0.64\%, respectively. And employing NBOD further improves the performance from 51.24\% to 53.19\%. When employing an ensemble for evaluation, the accuracy is further improved and reaches the highest. For the CE baseline setting, similar improvements can be achieved for SS, NIL, DBOD and ensemble. Generally, benefiting from the label distribution shift, BSCE loss can achieve better performance than CE loss. The steadily performance improvements are achieved for all components on both baseline settings, which shows the effectiveness of the proposed NCL. \setlength{\tabcolsep}{3pt} \begin{table}[t] \centering \resizebox{0.95\linewidth}{!}{ \begin{tabular}{ccccc|c|c} \toprule[1pt] NIL & SS & BOD$_{all}$ & BOD$_{hard}$ & Ensemble & Acc.@CE & Acc.@BSCE\\ \hline & & & & &44.79 &50.60 \\ \checkmark & & & & &48.18 &51.24 \\ &\checkmark & & & &46.05 &51.42 \\ \checkmark & &\checkmark & & &48.81 &52.64 \\ \checkmark & &\checkmark &\checkmark & &49.34 &53.19 \\ \checkmark &\checkmark &\checkmark &\checkmark & &49.89 &53.31 \\ \checkmark &\checkmark &\checkmark &\checkmark & \checkmark &51.04 &54.42 \\ \bottomrule[1pt] \end{tabular} } \vspace{-0.3cm} \caption{Ablation studies on CIFAR100-LT dataset with an IF of 100. 'SS' indicates self-supervision. 'BOD$_{all}$' and 'BOD$_{hard}$' represent the balanced online distillation on all categories and only hard categories, respectively. NBOD means the setting when both 'BOD$_{all}$' and 'BOD$_{hard}$' are employed. Experiments are conducted on the framework of containing three experts. } \label{analysis_ablation} \end{table} \begin{figure}[t] \centering {\includegraphics[width=1.0\linewidth]{hcfn_top10.pdf}} \vspace{-0.8cm} \caption{ (a) The distribution of the largest softmax probability of hardest negative category. (b) The average KL distance between two models' output probabilities on the test set. Analysis is conducted on CIFAR100-LT with an IF of 100. Best viewed in color. } \label{fig_top10} \end{figure} \subsection{Discussion and Further Analysis} \iffalse \textbf{Distribution of hard categories.} We count the distribution of top-10 hard categories of few split during training as shown in Fig.~\ref{fig_top10} (a). At the initial stage of the network training (e.g., the first ten epoches), the network is dominated by the head classes, which often confuses the tail classes and results into misclassification. With employing our method to train the network, the frequency that the head class become a difficult category for few split is reduced (see the distribution in the final ten epoches). This shows that the proposed HCF helps to reduce the long-tailed bias and pull the sample away from the most difficult categories. \fi \textbf{Score distribution of hardest negative category.} Deep models normally confuse the target sample with the hardest negative category. Here we visualize the score distribution for the baseline method ('BSCE') and our method ('BSCE+NCL') as shown in Fig~\ref{fig_top10} (a). The higher the score of the hardest negative category is, the more likely it is to produce false recognition. The scores in our proposed method are mainly concentrated in the range of 0-0.2, while the scores in the baseline model are distributed in the whole interval (including the interval with large values). This shows that our NCL can considerably reduce the confusion with the hardest negative category. \textbf{KL distance of pre/post collaborative learning.} As shown in Fig.~\ref{fig_top10} (b), when networks are trained with our NCL, the KL distance between them is greatly reduced, which shows that the uncertainty in predictions is effectively alleviated. Besides, the KL distance is more balanced than that of BSCE and CE, which indicates that collaborative learning is of help to the long-tailed bias reduction. \textbf{NBOD without balancing probability.} As shown in Fig.~\ref{balance_offdis} (a), when removing the balanced probability in NBOD (denoted as 'NOD') both the performance of the single expert and the ensemble decline about 1\%, which manifests the importance of employing the balanced probability for the distillation in long-tailed learning. \textbf{Offline distillation vs. NBOD.} To further verify the effectiveness of our NBOD, we employ an offline distillation for comparisons. The offline distillation (denoted as 'NIL+OffDis') first employs three teacher networks of NIL to train individually, and then produces the teacher labels by using the averaging outputs over three teacher models. The comparisons are shown in Fig.~\ref{balance_offdis} (b). Although NIL+OffDis gains some improvements via an offline distillation, but its performance still 1.5\% worse than that of NIL+NBOD. It shows that our NBOD of the collaborative learning can learn more knowledge than offline distillation. \iffalse \setlength{\tabcolsep}{6pt} \begin{table}[t] \centering \resizebox{0.8\linewidth}{!}{ \begin{tabular}{c|ccccc|c} \toprule[1pt] balanced probability & Single expert & Ensemble \\ \hline & 52.1 & 53.4 \\ \checkmark & 53.3 & 54.4 \\ \bottomrule[1pt] \end{tabular} } \caption{ Comparisons of with or without using the balanced probability in NBOD. Experiments are conducted on CIFAR100-LT dataset with an IF of 100. } \label{analysis_re-balancing} \end{table} \fi \begin{figure}[t] \centering {\includegraphics[width=0.8\linewidth]{balance_ana.pdf}} \vspace{-0.3cm} \caption{ (a) Comparisons of using NOD or NBOD for distillation. (b) Comparisons of using offline distillation or our NBOD. Analysis is conducted on CIFAR100-LT with an IF of 100. } \label{balance_offdis} \end{figure} \section{Conclusions} In this work, we have proposed a Nested Collaborative Learning (NCL) to collaboratively learn multiple experts. Two core components, i.e., NIL and NBOD, are proposed for individual learning of a single expert and knowledge transferring among multiple experts. Both NIL and NBOD consider the features learning from both a full perspective and a partial perspective, which exhibits in a nested way. Moreover, we have proposed a HCM to capture hard categories for learning thoroughly. Extensive experiments have verified the superiorities of our method. \textbf{Limitations and Broader impacts.} One limitation is that more GPU memory and computing power are needed when training our NCL with multiple experts. But fortunately, one expert is also enough to achieve promising performance in inference. Moreover, the proposed method improves the accuracy and fairness of the classifier, which promotes the visual model to be further put into practical use. To some extent, it helps to collect large datasets without forcing class balancing preprocessing, which improves efficiency and effectiveness of work. The negative impacts can yet occur in some misuse scenarios, e.g., identifying minorities for malicious purposes. Therefore, the appropriateness of the purpose of using long-tailed classification technology is supposed to be ensured with attention. \section*{Acknowledgements} This work was supported by the National Key Research and Development Plan under Grant 2020YFC2003901, the External cooperation key project of Chinese Academy Sciences 173211KYSB20200002, the Chinese National Natural Science Foundation Projects 61876179 and 61961160704, the Science and Technology Development Fund of Macau Project 0070/2020/AMJ, and Open Research Projects of Zhejiang Lab No. 2021KH0AB07, and the InnoHK program. {\small \bibliographystyle{ieee_fullname}
83b65634dee41cccbaf8cf7cba2627def4514f24
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:intro} A common approach to treating electrodes in atomistic simulations is to assume them to be uniformly charged walls, either structureless or atomically resolved. In the case of equilibrium electrolytes near planar electrodes at low charge densities, this approach is known to capture the electrochemical properties well. Several studies, however, have emphasized the importance of polarization of the electrodes by the ions and molecules in their vicinity \cite{Merlet2013,Breitsprecher2015ElectrodeCapacitors,Vatamanu2018ApplicationFields,Haskins2016EvaluationLayers,Gading2022ImpactLiquids}. In more realistic electrochemical scenarios, \ac{cpm} \ac{md} results are often significantly different from those obtained with uniformly charged electrodes\cite{Merlet2013b}. While the \ac{cpm}\cite{Siepmann1995InfluenceSystems, Reed2007ElectrochemicalElectrode} is a popular tool for modeling metal electrodes by dynamically updating individual charges on electrode atoms, alternatives such as image charge methods \cite{Tyagi2010, Petersen2012, Dwelle2019ConstantSimulation, Nguyen2019} are commonly used to enforce a constant potential for planar electrodes. While one of these methods can handle non-planar surface by inducing a charge density on the interface between two media most of them are limited to planar electrodes.\cite{Nguyen2019} Those approaches faithfully reproduce the behavior of electrolytes near electrodes, particularly the correlation between thermal fluctuations in the electrolyte near the electrode and the induced-charge polarization of the electrode, while obtaining a realistic picture of the electrical double-layer. A \ac{cpm} \ac{md} is able to capture the temporal response in the build-up and break-down of electric double-layer and thereby allows realistic capacitor charging and discharging curves to be generated \emph{in silico} \cite{Merlet2013b,Breitsprecher2020HowNanopores,Kondrat2014AcceleratingPores,Kondrat2016PressingSupercapacitors}. Interestingly, near highly charged planar electrodes \cite{Wang2014EvaluationCapacitors, Limmer2013ChargeCapacitors, Merlet2014TheOwn} and non-planar electrodes (such as curved substrates or nanoporous carbons) \cite{Merlet2012, Merlet2013b, Merlet2013HighlySupercapacitors, Lahrar2021Carbon-carbonCapacitance, Forse2016NewSupercapacitors, Seebeck2020a, Seebeck2022ElucidatingSupercapacitors, McDaniel2022CapacitanceSimulations}, \ac{cpm} \ac{md} and Monte Carlo simulations \cite{Caetano2021MonteMacroions} yield a spatially-specific charge polarization and a non-trivial electrolyte structure. Here, we present a package for treating electrodes in \ac{md} simulations which interfaces with \ac{lammps} \cite{Thompson2022LAMMPSScales}. Our ELECTRODE package uses the highly parallelized and efficient computational infrastructure of \ac{lammps} and allows interaction with many other packages and features already available in \ac{lammps}. This work builds in part on an earlier work in which we showed how a \ac{p3m}-based calculation makes the electrostatic calculations of a \ac{cpm} simulation more efficient\cite{Ahrens-Iwers2021}. In addition to some new enhancements to the \ac{cpm}, this implementation provides a \ac{ccm} and a \ac{tp}\cite{Deienbeck2021DielectricApproach}. To capture the electronic response of non-ideal metals, a \ac{tf} model\cite{Scalfi2020ASimulations} is included. Both an Ewald and a \ac{p3m} $\mathbf k$-space solver are available for various constraints of the periodicity of the systems, such as infinite slabs, cylinders or fully 3D periodic systems. The ELECTRODE package also contains the closely-related \ac{ff} \cite{Dufils2019SimulatingElectrode} and \ac{fd} \cite{Dufils2021ComputationalSimulations} methods, which extend \ac{cpm} \ac{md} with a slab geometry to fully periodic boundary conditions for increased computational efficiency.\cite{Tee_2022} A list of new features in the ELECTRODE package is presented in \refsec{sec:features} including a brief description of their theoretical background. In \refsec{sec:results}, we summarize the concept of \ac{cpm} \ac{md} using data from various \ac{cpm} \ac{md} runs and rationalize it based on the charging times of an electrical double-layer capacitor. We discuss briefly for which situation each approach is suitable and give in \refsec{sec:conclusions} an overview of future development directions and possible applications. \section{Features\label{sec:features}} \subsection{Constant potential method} \label{sec:feat-cpm} In atomistic electrochemical simulations, the system of interest is often a fluid electrolyte confined between two electrodes (cf. inset of \reffig{fig:tau}). This could serve as an \emph{in silico} nanoscale model of a capacitor, to optimize some metric, such as energy or power density, by modifying electrolyte composition or electrode structure. The distinctive feature of \ac{cpm} \ac{md} is the calculation of electrode charges which keep electrodes at a desired electrostatic potential. To achieve this, we first partition the potential energy, $U$, of an MD simulation into: \begin{equation} U = U_{\mathrm{non-Coul}} + U_{\mathrm{elyt}} + U_{\mathrm{elec}} \label{eqn:u_partition} \end{equation} Here $U_{\mathrm{non-Coul}}$ includes all non-Coulombic interactions, $U_{\mathrm{elyt}}$ includes all Coulombic interactions between electrolyte particles, and $U_{\mathrm{elec}}$ includes all Coulombic interactions involving electrode particles (both with electrolyte particles, and with other electrode particles). While the former are treated with regular force field approaches, the last term is treated somewhat special. $U_{\mathrm{elec}}$, i.e., without electrolyte-electrolyte interactions, is written in terms of an electrode charge vector $\mathbf{q}$ comprising all electrode charges as \begin{equation} U_{\mathrm{elec}}\left(\{\mathbf r\}, \mathbf q\right) = \frac{1}{2} \mathbf q^{\mathrm T} \mathbf A \mathbf q - \mathbf b^{\mathrm T} (\{\mathbf r\}) \mathbf q - \mathbf v^{\mathrm T} \mathbf q \label{eqn:coulomb} \end{equation} with a matrix $\mathbf{A}$, and vectors $\mathbf{b}$ and $\mathbf{v}$; where $\mathbf{b}$ depends on the electrolyte positions $\{\mathbf{r}\}$. The applied potential $\mathbf v$ has an entry for every electrode atom. The interactions between electrode atoms are represented by $\mathbf A$, called elastance matrix due to the analogy between a vacuum capacitor and a spring. If the electrode atoms do not move, $\mathbf{A}$ can be pre-computed, allowing significant computational savings. The electrolyte vector $\mathbf{b}(\{\mathbf{r}\})$ represents the electrostatic potential on each electrode atom due to the electrolyte atoms. At each step, $\mathbf{q}$ is updated to minimize the Coulombic energy contribution $U_\mathrm{elec}$, possibly subject to additional constraints. The desired energy-minimizing charge vector $\mathbf{q}^*$ is straightforward to calculate\cite{Scalfi2020}: \begin{equation} \mathbf q^* = \mathbf A^{-1} \left[\mathbf b(\{\mathbf r\}) +\mathbf v \right]. \label{eqn:cpm} \end{equation} Here, the elastance has been inverted to yield $\mathbf A^{-1}$, which is called the capacitance matrix in light of its role in equation \eqref{eqn:cpm}: the response of the charge vector $\mathbf{q}^*$ can calculated as the product of the capacitance matrix with the vector of external potentials, analogously to the well-known scalar equation $Q = CV$ linking the capacitance $C$ to the charge $Q$. Provided the electrode atom positions and thus the vacuum capacitance are constant, the main computational burden is the calculation of $\mathbf b(\{\mathbf r\})$ at every time step, which is necessary due to the motion of the electrolyte. The primary purpose of ELECTRODE is to compute the electrode-electrolyte interaction in $\mathbf b$ efficiently and update the electrode charges accordingly. Alternatively, the electrode charges could be obtained with the conjugate gradient method, which solves the minimization problem without a matrix inversion.\cite{Vatamanu2010MDSim,Li2021} Yet another approach is to treat the electrode charges as additional coordinates and perform mass-zero constrained dynamics for them\cite{Coretti2020Mass-zeroSystems}. In \ac{md} with periodic boundary conditions, the simulation cell ideally is charge neutral. \citet{Scalfi2020} showed that this constraint could be imposed by using the symmetric matrix \begin{equation} \label{eqn:S} \mathbf S \equiv \mathbf A^{-1} - \frac{\mathbf A^{-1} \mathbf e \mathbf e^ \mathrm T \mathbf A^{-1}}{\mathbf e^\mathrm T \mathbf A^{-1} \mathbf e}\; , \quad \mathbf e^\mathrm T = (1, \dots, 1) \end{equation} as capacitance matrix instead of $\mathbf A^{-1}$. Non-ideal metallic electrodes have been recently modeled by \citet{Scalfi2020ASimulations} using a semiclassical \ac{tf} approach. We have implemented this promising approach in our ELECTRODE package, as its implementation is very similar to the self-interaction correction of the Ewald summation\cite{Hu2014InfiniteInterfaces} and contains only a single summation over the electrode atoms. An interesting alternative to effectively model a wide range of materials between insulator and ideal metal was proposed by \citet{Schlaich2022ElectronicSurfaces} and involved using a virtual \ac{tf} fluid within the electrodes. However, the virtual \ac{tf} fluid approach appears computationally more expensive. Both models require free parameters, most crucially the \ac{tf} length, $l_\mathrm{TF}$, in \citet{Scalfi2020ASimulations} and (a rather artificial) parameterization of the virtual \ac{tf} fluid in the approach of \citet{Schlaich2022ElectronicSurfaces}. Further, assumptions such as atom-centered densities prohibit effects such as quantum spillover and delocalization of the image plane. It should be noted that ELECTRODE provides a more flexible implementation of the \ac{tf} model, allowing heterogeneous electrodes with different $l_\mathrm{TF}$ for different atom types. For more general information on \ac{cpm} \ac{md} approaches, the interested reader is referred to the excellent and thorough review of current electrode-electrolyte simulations by \citet{Scalfi2020MolecularInterfaces}, the well-written theory part of \textit{MetalWalls}\cite{mw-docu} or the thesis of \citet{Gingrich2010}. \subsection{Simulating an arbitrary number of electrodes} \label{sec:feat-n-electrodes} A \ac{cpm} \ac{md} is typically performed with two electrodes, which means there are only two possible values for each of the $n$ components of the potential in \refeq{eqn:coulomb}. In the ELECTRODE package, an arbitrary number $N$ of electrodes is allowed with every electrode atom belonging to exactly one electrode. We define an electrode-wise indicator vector $\mathbf g_\alpha$ for every electrode $\alpha$ with $n$ entries, which are equal to $1$ if the respective electrode particle belongs to that electrode and $0$ otherwise. The indicator matrix \begin{equation} \mathbf G = \begin{bmatrix} \mathbf g_1 & \mathbf g_2 & \cdots & \mathbf g_N \end{bmatrix} \end{equation} comprising the indicator vectors of all $N$ electrodes allows us to connect electrode-wise quantities to particle-wise quantities. From hereon, we use tildes for electrode-wise quantities. For instance, we define $\mathbf{\tilde v}$ as the electrode-wise potential and use it to write the potential $\mathbf v = \mathbf G \mathbf{\tilde v}$. Likewise, energy-minimizing charges $\mathbf{q^*}$ for a given set of electrode-potentials are \begin{equation} \mathbf{q^*} = \mathbf{S} (\mathbf{b} + \mathbf{v}) = \mathbf{S} \mathbf{b} + \mathbf{S} \mathbf{G} \mathbf{\tilde{v}}. \label{eqn:electrode-wise} \end{equation} \subsection{Simulating electrodes at specified total charge} \label{sec:feat-ccm} In the \ac{ccm}, the user sets the electrode-wise total charge $\mathbf{\tilde{q}^*}$ for each electrode. Such a fixed-charge setup corresponds to an open-circuit configuration\cite{Jeanmairet2022MicroscopicCapacitors}. This type of simulation has recently been attempted as a variation of the finite-field method\cite{Dufils2021ComputationalSimulations}. Therein, it was found that ramping the total charge up or down over time could be considered computational amperometry, and a faster non-equilibrium response was observed. Working with the capacitance matrix $\mathbf{A}^{-1}$ rather than the symmetrized matrix $\mathbf{S}$ (since charge neutrality is explicitly enforced by the appropriate choice of $\mathbf{\tilde{q}^*}$), we have: \begin{equation} \mathbf{\tilde{q}^*} = \mathbf{G}^\mathrm{T} \mathbf{q^*} = \mathbf{G}^\mathrm{T} \mathbf{A}^{-1} \mathbf{b} + \mathbf{G}^\mathrm{T} \mathbf{A}^{-1} \mathbf{G} \mathbf{\tilde{v}} \equiv \mathbf{\tilde{q}_b^*} + \mathbf{\tilde{C}} \mathbf{\tilde{v}}. \label{eqn:ewise-conq} \end{equation} $\mathbf{\tilde{q}_b^*}$ defines the total charge each electrode would carry at zero potential, and $\mathbf{\tilde{C}}$ is the electrode-wise capacitance matrix. To subsequently estimate $\mathbf{\tilde{q}_b^*}$, \refeq{eqn:ewise-conq} is solved for $\mathbf{\tilde v}$ which is then applied using the \ac{cpm}. This results in an energy minimization w.r.t. the charge distribution with a constraint on the total electrode charges. Analogous to how constant volume and constant pressure simulations can be thermodynamically equivalent, \ac{ccm} and \ac{cpm} simulations will give the same capacitances under suitable conditions. However, a thorough proof of that assertion is out of scope of this work and will be discussed in an upcoming work. \subsection{Simulating electrodes with a thermo-potentiostat} \label{sec:feat-tp} \citet{Deienbeck2021DielectricApproach} recently presented a \acf{tp} that takes into account the fluctuation-dissipation relation of electrode charges at a given voltage and temperature in an electronic circuit. They have also provided a \ac{tp} implementation based on a uniform charge distribution using the scripting capability of \ac{lammps}\cite{Thompson2022LAMMPSScales}. The ELECTRODE package provides an implementation that minimizes the energy with respect to the charge distribution and conforms to the formalism described by \citet{Deienbeck2021DielectricApproach}. Our \ac{tp} approach is currently limited to only two electrodes and instead of a vector of applied potentials $\mathbf{\tilde v}$, a potential difference \begin{equation} \Delta v_0 = v_\mathrm{top} - v_\mathrm{bot} \label{eqn:delta-v} \end{equation} between two electrodes is used. At every time step, the potential difference $\Delta v(t)$ between the two electrodes is evaluated to find the new capacitor charge according to \begin{align} q(t + \Delta t) = &q(t) - C_0\left[\Delta v(t) - \Delta v_0\right]\left(1 - \mathrm e ^{-\Delta t / \tau_v} \right) \nonumber \\ &+ X \sqrt{k_\mathrm{B} T_v C_0 \left(1 - \mathrm e ^{-2 \Delta t / \tau_v} \right)}. \label{eqn:deissenbeck} \end{align} Here, $k_\mathrm{B}$ is the Boltzmann constant, $\tau_v$ and $T_v$ are parameters of the \ac{tp} and $X$ is a normally distributed random number with a mean of 0 and a standard deviation of 1. The vacuum capacitance $C_0$ is obtained from the capacitance matrix\cite{Scalfi2020} and the effective potential $\Delta v(t)$ is computed from the electrode charges and the electrolyte configuration (cf. \refeq{eqn:ewise-conq}). Hence, all quantities required to evaluate \refeq{eqn:deissenbeck} are readily available in the \ac{cpm}. The obtained capacitor charge $\pm q(t+\Delta t)$ is applied using the \ac{ccm} on both electrodes, respectively. \subsection{Simulations with different periodicity} \label{feat-boundcorr} The Ewald summation commonly assumes periodic boundary conditions in all three directions and has to be modified for systems with slab and one-dimensional periodic geometries. As shown by \citet{Smith1981ElectrostaticCrystals}, a regular 3D Ewald summation for slab-like systems, which are periodic in the $xy$-plane but confined in $z$-direction, results in a dipole term \begin{equation} J^{\text{2D}}(\mathbf M)=\frac{2\pi}{V}M_z^2. \label{eqn:ew3dc_slab} \end{equation} $M_z$ is the $z$-component of the dipole of the simulation cell. This dipole term was subsequently used for correcting the infinite boundary artifact of slab-like systems\cite{Yeh1999}. This is known as the \acs{ew3d}c method, which is implemented in many \ac{md} codes including \ac{lammps}\cite{Thompson2022LAMMPSScales}. Several authors \cite{Hu2014InfiniteInterfaces,DeLeeuw1979ElectrostaticLattices,Heyes1977MolecularChloride,Parry1975TheCrystal} have shown that the infinite boundary contribution in slab-like geometries can also be solved in an exact form. This rarely implemented EW2D solver is another cornerstone of the ELECTRODE package. Just like slab-like geometries, systems with only one periodic dimension require an appropriate treatment of the long-range electrostatic interactions. As shown by \citet{Brodka2004Three-dimensionalDirection}, the approach of \citet{Smith1981ElectrostaticCrystals} can be extended for an infinitely extended one-dimensional summation: \begin{equation} J^{\text{1D}}(\mathbf M)=\frac{\pi}{V}\left(M_x^2 + M_y^2\right). \label{eqn:ew3dc_wire} \end{equation} Here, $z$ is the periodic dimension and $M_x$ and $M_y$ are the respective components of the total dipole of the unit cell. Contrasting established codes, the ELECTRODE package contains these corrections for one-dimensional periodic systems. And even more crucially, ELECTRODE is the first package (as far as we know) to implement these corrections in combination with a CPM. As an outlook, the electrostatic layer correction\cite{Arnold_2002} in combination with PPPM\cite{de_Joannis_2002} is also considered for implementation as an alternative to the \acs{ew3d}c approach. As demonstrated exemplarily for slab-like two-dimensional periodic systems, the boundary corrections can be easily incorporated into the \ac{cpm} formalism by splitting the dipole components into their electrode and electrolyte contributions: \begin{align} J^{\text{2D}} &= \frac{2 \pi}{V}\left[(M_z^\text{elec})^2 + 2 M_z^\text{elec}M_z^\text{elyt} + (M_z^\text{elyt})^2\right]\nonumber \\ &= \frac{2 \pi}{V}\left[\sum_{ij}z_i z_j q_i q_j + 2 M_z^\text{elyt}\sum_i z_i q_i +(M_z^\text{elyt})^2 \right]. \end{align} This way dipole corrections fit into the linear form of the Coulombic energy in \refeq{eqn:coulomb} that is used in the \ac{cpm} and the computational effort for the electrode-electrolyte interaction scales linearly with the number of particles. \subsection{Simulating electrodes with the \acl{ff} method}\label{chp:finite_field} In the \ac{ff} method \cite{Dufils2019SimulatingElectrode}, the potential difference between two electrodes is not directly specified using the applied potential $\mathbf{v}$. Instead, the simulation cell is periodic in the $z$ direction, i.e., without adding the artificial vacuum between the slabs required otherwise. The \ac{ff} method allows efficient simulations of infinite electrode slabs, since no additional vacuum is required. However, complexly shaped electrodes or electrodes with a one-dimensional periodicity cannot be simulated with the \ac{ff} method. A potential difference $\Delta v_0$ (cf. \refeq{eqn:delta-v}), is created in the \ac{ff} method by introducing a $z$-directed electric (polarization) field of magnitude $-\Delta v_0 / L_z$, creating a discontinuity of $\Delta v_0$ across the periodic $z$ boundary (and thus between the two electrodes on either side of the slab). In this formulation, the electrode Coulombic energy is \begin{equation} U_\mathrm{elec} = \frac{1}{2}\mathbf{q}^\mathrm{T} \mathbf{A} \mathbf{q} - \mathbf{b}^\mathrm{T}(\{ \mathbf{r}\}) \mathbf{q} + \Delta v_0 \pmb \zeta^\mathrm{T} \mathbf{q}. \end{equation} Here, $\pmb{\zeta}$ is a vector containing the normalized $z$-positions of each electrode atom, namely $\{\mathbf{z}/L_z\}$ with an offset for the bottom electrode to make the system symmetric along the $z$-direction, replicating the conductor-centered supercell in \refcite{Dufils2019SimulatingElectrode}. The energy-minimizing charge $\mathbf{q}^*$ in this model is \begin{equation} \mathbf{q}^* = \mathbf{S}[\mathbf{b}(\{ \mathbf{r} \}) - \Delta v_0 \pmb \zeta] \label{eqn:cpm-ffield} \end{equation} which is equivalent to the standard \ac{cpm}, replacing $\mathbf{v}$ with $-\Delta v_0 \pmb \zeta$. \section{Results and discussion} \label{sec:results} \subsection{Charging times} A simple capacitor model is adapted from an example in the \textit{MetalWalls} repository\cite{Marin-Lafleche2020} and comprises a saline solution between two gold electrodes with three layers each. To compare the equilibrium conditions of the \ac{cpm} and \ac{ccm} we calculated the capacitance per area from the averaged equilibrium charges and voltages at an applied voltage of 2\,V and charge of 4.4\,$e$, respectively. The obtained values of $2.94$\,{\textmu}F\,cm$^{-2}$ and $2.91$\,{\textmu}F\,cm$^{-2}$ for the \ac{cpm} and \ac{ccm} respectively differ by only 1\,\%, showing a good agreement between the methods at equilibrium. When a voltage is initially applied with the \ac{cpm}, the charge induced on both electrodes is very small since the capacitance of the electrode pair \emph{in vacuo} is small \cite{Scalfi2020, Ahrens-Iwers2021}. However, the electrode charges induce the formation of a dipole in the electrolyte, which in turn induces additional charge on the electrode. \ac{cpm} \ac{md} thus models the process of charging an electrical double layer capacitor physically correctly, and the charging-discharging curves obtained from \ac{cpm} \ac{md} can be used to fit parameters for equivalent macroscopic electrical circuits \cite{Sampaio2020ComparingSimulations}. Two charging times $\tau_1$ and $\tau_2$ are obtained by fitting a bi-exponential charging function \begin{equation} M_z(t) = M_z^\mathrm{eq} \left[1 - c \exp(-t / \tau_1) - (1-c)\exp(-t / \tau_2)\right] \label{eqn:dipole_fit} \end{equation} to the $z$-component of the electrolyte dipole\cite{Noh2019UnderstandingSimulations}. $M_z^\mathrm{eq}$ is the extrapolated equilibrium dipole reached at late times. Comparing the individual contributions to the total electrolytic dipole reveals that $\tau_1$ describes relatively fast water dipole relaxations and $\tau_2$ describes charging times related to the ion diffusion. To validate this statement, we show both individual components in \reffig{fig:separate-tau}. \begin{figure} \centering \includegraphics{images/charging_separate.jpg} \caption{% Individual fitting parameters of the bi-exponential function (cf. \refeq{eqn:dipole_fit}) applied to: (a) the total dipole $M_z^\text{tot}$, (b) the dipole of water molecules $M_z^\text{wat}$ and (c) to the dipole of ions in the electrolyte $M_z^\text{ion}$ from a standard \ac{cpm} simulation at 2\,V. % While only five of the 100 trajectories are shown for illustration, fits are made to the entire set of trajectories. } \label{fig:separate-tau} \end{figure} From the mixing parameters $c$ in the panels, it is clear that water dipole relaxation dominates at the beginning, while ion diffusion prevails at later times. $\tau_1$ of the water in \reffig{fig:separate-tau}b largely corresponds to that of the total dipole at the beginning of the charging. While the ions in \reffig{fig:separate-tau}c relax mainly on the slower timescale of $\tau_2$, the water dipole decreases as the ion dipole is slowly built up. \refFig{fig:tau} compares results using \ac{cpm}, \ac{ccm} and \ac{tp}, the latter with a time constant $\tau_v = 100$\,fs, to each other and to their uniformly-charged counterparts. We focus on the charging term with the faster timescale $\tau_1$ because of its large contribution to the total dipole. For the uniform variants, the charges are always evenly distributed across the inner layers of the electrodes. The uniform methods are in general very close to their heterogeneous counterparts, which is consistent with previous studies that found only small differences between a heterogeneous and uniform \ac{cpm} at low voltages for simple planar electrodes \cite{Wang2014EvaluationCapacitors}. \begin{figure} \centering \includegraphics{images/tau.pdf} \caption{% Charging time constants $\tau_1$ and empirical standard deviations employing different \ac{cpm} approaches as denoted on the $y$-axis. % Inset shows the model system used to compare the different approaches, consisting of an aqueous NaCl electrolyte in contact with two gold surfaces. % Note the different charging time constants $\tau_1$ for the \ac{ccm} and \ac{cpm} approaches. } \label{fig:tau} \end{figure} The charging times obtained with \ac{ccm} appear to be too fast, since $\tau_1$ is about two orders of magnitude smaller than obtained with the potential-based methods, which is a well-known effect \cite{Vatamanu2011, Merlet2013b} that could be related to rather unphysical high temperatures and voltages when applying an instantaneous charge with \ac{ccm} on the electrodes\cite{Merlet2013b}. \ac{ccm} also predicts two times smaller $\tau_2$ than other methods, while the contribution of the second exponential decay is almost negligible since $c=0.98$ in \refeq{eqn:dipole_fit}. However, these values should be interpreted with caution, given that the bi-exponential curve is a poor fit in the case of a \ac{ccm} (cf. \reffig{SI-fig:bi-exp}). Using the \ac{tp} little change in the slower timescale $\tau_2$ is observed compared to the \ac{cpm} and it only weakly depends on the time constant $\tau_v$ (cf. \reftab{SI-tab:fits}). In contrast, the applied voltage $v_0$ in a \ac{cpm} has an effect on the ionic charging times $\tau_2$ and for a smaller applied voltage of 0.3\,V, $\tau_2$ drops to 50\,ps (cf.~\reffig{SI-fig:voltage-tau}). Using a \ac{tf} model for representing real metals impacts both charging times and the total dipole. It is interesting to note that while a decrease for $\tau_1$ with increasing $l_\mathrm{TF}$ in \reffig{SI-fig:tau-tf-tps}a is observed, interpretation of $\tau_2$ is more complex when using a \ac{tf} (cf. \reftab{SI-tab:fits}). Especially when comparing this to a regular \ac{cpm}, i.e. $l_\mathrm{TF}=0$, at the same voltage. The quite significant difference between a regular \ac{cpm} and the \ac{tf} for small $l_\mathrm{TF}$ might be an artifact due to the rather thin metal slab model or is due to a complex interplay between charge screening in the metal and the water/ionic relaxation and/or the smaller total dipole obtained with \ac{tf} model. To understand the range of the second relaxation time $\tau_2\approx50-100$\,ps, it is instructive to consider the product $RC$ of the aforementioned areal capacitance $C=2.94$\,{\textmu}F\,cm$^{-2}$ and the areal electrolyte resistance $R$. Continuum models for ion dynamics have shown that the ionic relaxation time decently agrees with $RC$ for applied potentials up to around the thermal voltage $e/(k_\mathrm{B} T)\approx25$\,mV;\cite{Bazant2004diffuse,Janssen2019CurvatureElectrodes} a recent dynamical density functional theory for a dense electrolyte found that the ions relaxed with $RC$ even around 1\,V.\cite{Ma2022dynamics} In a bulk electrolyte at infinite dilution, the areal resistance between two electrodes spaced $L$ apart is given by $R=L\varrho$, where $\varrho=k_\mathrm{B} T/(2e^2 D c_\mathrm{b})$ is the ionic resistivity, $k_\mathrm{B} T$ is the thermal energy, $e$ is the elementary charge, $D$ is the ionic diffusion constant, and $c_\mathrm{b}$ is the salt number density.\cite{Avni_2022} In our simulations, the plate separation was $L=5$\,nm and the salinity in the bulk phase was approximately 0.95\,M, corresponding to $c_\mathrm{b}\approx0.57$\,nm$^{-3}$; the ion diffusivity $D\approx1.5\cdot10^{-9}$\,m\textsuperscript{2}/s was obtained from a separate bulk electrolyte simulation. Using these values, we obtained $RC=14$\,ps; roughly 7 times smaller than the largest fitted $\tau_2$. This discrepancy must be due partly to our underestimation of $\varrho$, which, at the salinity of our interest, is larger by a factor of about 1.7;\cite{Avni_2022} accounting for this effect yields a relaxation time of $RC=23$\,ps. Another cause of the remaining factor 4 discrepancy between the largest fitted $\tau_2$ and predicted ionic relaxation times is the nanoconfinement, which could affect the diffusivity $D$ and, in turn, the areal resistivity $R$. Finally, the mentioned increase of $\tau_2$ with the applied potential is in line with the potential dependence of the capacitance of the Gouy-Chapman model, though in disagreement with that of the Kilic-Bazant-Ajdari\cite{Kilic_2007} model. Although the analytical estimates of $RC$ times presented here are interesting and provide starting points for further research on the implications of nanoconfinement and finite salt concentration on charging times, these results should not be overinterpreted as the analytical models contain simplifications that may not apply to such nanoscopic systems. \subsection{Co-axial cylindrical capacitor} As a sanity check of our approach for systems which are periodic in just one dimension, we study the capacitance of two co-axial carbon nanotubes of radii $R_1$ and $R_2$, with $R_1<R_2$ (cf. inset of Fig.~\ref{fig:tube_in_tube}). The vacuum capacitance $C_0$ of the co-axial carbon nanotubes can be calculated from the electrode-wise capacitance $\mathbf{\Tilde C}$\cite{Scalfi2020}. At large radii, the atomic structure of the tubes should have a negligible effect, and thus the capacitance should approach that of structureless cylinders. The analytical line capacitance for a given ratio of the radii is $C_0/L = 2 \pi \epsilon_0 / \ln(R_2/R_1)$; in which $\varepsilon_0$ is the vacuum permittivity and $L$ is the length of the simulation box in the periodic dimension. As shown in \reffig{fig:tube_in_tube} for various fixed ratios of the inner and outer tubes, the capacitance indeed converges to that of a structureless cylindrical capacitor when the radii are large compared to the bond length $d_\text{CC}$ between carbon atoms. In the \ac{cpm} electrode atoms are assigned a Gaussian charge distribution $\rho_i(\mathbf r) = q_i \left( {\eta^2} / {\pi} \right) ^ {3 / 2} \exp{\left[ - \eta ^ 2 \left( \mathbf r - \mathbf R_i \right) ^2 \right]}$ at their position $\mathbf R_i$ with the reciprocal charge width $\eta$. In agreement with \citet{Serva2021} increased capacitances are observed for larger Gaussian width (i.e. smaller $\eta$) in \reffig{fig:tube_in_tube}. However, the impact is almost negligible. \begin{figure} \centering \includegraphics{images/wire_capacitance.pdf \caption{Dielectric capacitance of cylindrical capacitors for fixed ratios of $R_1/R_2$ with $R_1$ the inner and $R_2$ the outer tube radii. % Results for co-axial carbon nanotubes computed with \acs{md} are indicated as lines. % Marks denote analytical results for a structureless equivalent system. % The difference between the radii $\Delta r=R_2-R_1$ is given relative to the characteristic bond length $d_\text{CC}$ between carbon atoms in graphene.} \label{fig:tube_in_tube} \end{figure} \acresetall \section{Conclusions} \label{sec:conclusions} We presented the ELECTRODE package as an efficient implementation of the \ac{cpm} and closely related methods for the popular \acs{lammps} simulation environment. Initially, the main goal was to bundle many different approaches to electrochemical simulations into one package and ensure that they are handled in the most computationally efficient way. However, we also found interesting relationships between the two relevant charge-time contributions, i.e., water dipole relaxation and ion diffusion. We also implemented several new features, such as the EW2D summation and a correction for systems periodic in just one dimension, whose capabilities and full potential have been scarcely explored and which also work independently of the \ac{cpm}. Recent improvements to the \ac{cpm} such as the \ac{ff} method and a \ac{tf} model were included and compared for consistency to results found in the literature. Remarkably, using the \ac{tf} model with varying \ac{tf} lengths has a suprising and complex impact on the water and ionic relaxation times. These results demonstrate that the ELECTRODE package can efficiently simulate electrified interfaces, including unusual systems such as infinitely long charged nanotubes. For a capacitor composed of co-axial carbon nanotubes, the vacuum capacitance agrees well within the limit of the analytical result of a structureless cylindrical capacitor and enables the investigation of curvature-dependent effects\cite{Seebeck2022ElucidatingSupercapacitors,Janssen2019CurvatureElectrodes} more rigorously in the future by avoiding interactions between the nanotubes through the periodic images. Moreover, the charging process of a plate capacitor with an aqueous NaCl electrolyte in between illustrates vividly the differences between the range of methods introduced here and which are used to estimate the electrode charges. Interestingly, in these simulations, it was observed that the water dipole initially responds very quickly to the applied potential but then slowly drops off as the ionic dipole slowly builds up, as if the water dipoles were shielded from the ions. While the package is in a stable state, the development is ongoing and will include in the future features like a conjugate gradient solver or compatibility to TIP4P water models. \section*{Supplementary Material} The supplemental material provides more background on the \ac{tp}, boundary corrections and the \ac{ff} method. Further, a description of the package interface to \acs{lammps} and an overview of the implemented classes are given. More details on the simulations are provided, including plots of trajectories and of charging times as a function of the voltage, the \ac{tf} length and the time constant of the \ac{tp}. \begin{acknowledgments} Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) -- Projektnummer 192346071; 390794421 -- SFB 986 and GRK 2462. \end{acknowledgments} \section*{Data Availability Statement} The ELECTRODE package has been merged into the official release of \acs{lammps} which is available under \url{github.com/lammps/lammps/tree/release}. \bibliographystyle{jabbrv_apsrev4-1} \section{\deleted{Theory}} \section{Package overview} \label{sec:package-overview} \subsection{Interface} The ELECTRODE package is designed as an add-on to \ac{lammps} and integrates seamlessly with most \ac{md} simulations carried out with that package. The user must first select one of two long-range Coulombic solvers (``kspace styles'' in \ac{lammps} terminology) included in ELECTRODE, which implement either an Ewald summation \cite{Ewald1921} (\texttt{ewald/electrode}) or a mesh-based summation \cite{Hockney1973, Eastwood1980} (\texttt{pppm/electrode}) providing additional methods to compute long-range contributions for the matrix $\mathbf A$ and vector $\mathbf b$ required in the \ac{cpm}. The user can then include the following command in the simulation script: \begin{Verbatim} fix <ID> <group> electrode/<mode> <value> <eta> \end{Verbatim} followed by optional keywords. Mandatory inputs are as follows: \begin{itemize} \item \texttt{ID} is used for identification of the fix. The instantaneous applied potential for each electrode is available via \texttt{f\_<ID>[<x>]}. \item \texttt{group} specifies the \ac{lammps} group of particles to which the potential or charge \texttt{value} will be applied via \ac{cpm} or \ac{ccm}, respectively; additional groups could be specified with the \texttt{couple} keyword. \item \texttt{mode} chooses which of the following variants is performed: \begin{itemize} \item \texttt{conp}: constant potential \item \texttt{conq}: constrained charge \item \texttt{thermo}: \ac{tp} \cite{Deienbeck2021DielectricApproach} \end{itemize} \item \texttt{eta} specifies the reciprocal width of Gaussian smearing applied to the electrode charges. \end{itemize} The following optional keywords are available: \begin{itemize} \item \texttt{couple <group-x> <value>} allows additional groups to be specified as an electrode. This keyword can be used multiple times to specify more than two electrodes. \item \texttt{etypes <types>} allows users to specify atom types exclusive to the electrode, so that \ac{lammps} can provide optimized neighborlists for faster calculations. \item \texttt{symm [on/off]} allows users to enforce charge neutrality for the electrodes via matrix pre-projection (cf. \refeq{M-eqn:S}). \item \texttt{ffield [on/off]} allows users to turn on or off the finite-field implementation \cite{Dufils2019SimulatingElectrode, Dufils2021ComputationalSimulations}. ELECTRODE automatically creates the electric field required to polarize the simulation box. \item \texttt{[write/read]\_[mat/inv] <path>} specifies a file path for input or output of the elastance or capacitance matrix. \item \texttt{temp <T-v> <tau-v> <seed>} specifies the parameters $T_v$, $\tau_v$ and the seed for the random number $X$ in \refeq{M-eqn:deissenbeck}. This keyword is only available with \texttt{mode} \texttt{thermo}, i.e. the \ac{tp}. \end{itemize} In addition, parameters for the \ac{tf} model can be set via: \begin{Verbatim} fix_modify <ID> tf <type> <length> <volume> \end{Verbatim} with the parameters \texttt{length} and \texttt{volume} corresponding to the \ac{tf} length, $l_\mathrm{TF}$, and the reciprocal particle density, $d^{-1}$, as defined in \refcite{Scalfi2020ASimulations}, respectively. Parameters need to be specified for each atom type in the electrode. Further, the \texttt{pppm/electrode} long-range solver can be configured to calculate its part of the elastance matrix in two steps via: \begin{verbatim} kspace_modify amat [onestep/twostep] \end{verbatim} The \texttt{twostep} option can be faster for large electrodes and moderate mesh sizes but requires more memory\cite{Ahrens-Iwers2021}. The atomic charges of the relevant electrode groups will then be dynamically updated over time, resulting in a \ac{md} simulation with \ac{cpm}, \ac{ccm} or \ac{tp} dynamics as selected. The computed electrode charges are accessible using standard \ac{lammps} commands. \subsection{Implementation} \begin{figure}[tb] \centering \includegraphics{images/output-figure0.pdf} \caption{Overview of the package. Each box represents a parent class. Implementations of the respective class are listed with bullet points. Essential methods of each class are listed and their interactions are indicated with arrows. } \label{fig:overview} \end{figure} In contrast to previous versions, our implementation separates the class for charge updates from the computation of the elastance matrix and the electrolyte vector $\mathbf b$. The \texttt{FixElectrode} class is derived from the \ac{lammps} \texttt{Fix} class and is used to determine and set electrode charges. As shown in \reffig{fig:overview}, the computation of the short-range, long-range and self interaction as well as the boundary correction are distributed across four additional classes. The \texttt{ElectrodeMatrix} and \texttt{ElectrodeVector} classes handle the computation of the elastance matrix and electrolyte vector, respectively, with each class containing its own code for the short-range Coulombic interactions. For long-range interactions and boundary corrections, the two classes in turn delegate computations to implementations of the abstract \texttt{ElectrodeKSpace} class. The two implementations inherit from the \ac{lammps} \texttt{KSpace} classes for the Ewald summation and \ac{p3m} method, respectively. For the functions of \texttt{ElectrodeKSpace}, additional Fourier transforms for the electrolyte charges and the Green's function at the position of electrode particles have been implemented \cite{Ahrens-Iwers2021}. A \texttt{BoundaryCorrection} class was also added, which encapsulates the existing \ac{lammps} implementation of the \acs{ew3d}c method \cite{Smith1981ElectrostaticCrystals, Yeh1999} and adds new implementations for a 2D Ewald summation \cite{Parry1975TheCrystal, Hu2014InfiniteInterfaces} and a correction intended for 1D-periodic systems \cite{Brodka2004Three-dimensionalDirection, Smith1981ElectrostaticCrystals}. As developers, we have found that an object-oriented programming approach has offered significant advantages during our work in writing the ELECTRODE package. Splitting the code across distinct classes has significantly clarified information flows between the different parts of the ELECTRODE package, leading to easier maintenance and optimization. \subsection{Comparison with other implementations} \label{sec:metalwalls} Another open source implementation of the \ac{cpm} is found in \textit{MetalWalls}.\cite{Marin-Lafleche2020} In contrast to ELECTRODE it is a stand-alone \ac{md} code and is dedicated to electrochemical systems. \textit{MetalWalls} offers features such as the conjugate gradient and the mass-zero\cite{Coretti2020Mass-zeroSystems} method for the energy minimization, dipole interactions and the TIP4P water model, which are not yet available in ELECTRODE. Further, \textit{MetalWalls} offers tools for post processing that are particularly useful for electrochemical simulations. Fortunately, many of these scripts can also be used for \ac{lammps} trajectories. On the other hand, ELECTRODE is integrated into \ac{lammps} which supports a wide range of force fields and \ac{md} features which may not be available in \textit{MetalWalls}, including many-body and machine-learning interatomic potentials, interfaces with quantum calculation software, multi-replica simulations and non-equilibrium \ac{md}. ELECTRODE uses self-contained Coulombic solvers to determine electric potentials, including requesting an appropriate neighbor list from \ac{lammps}. Thus, ELECTRODE will work with any force field that includes long-range Coulombic interactions, including force field combinations enabled under the \ac{lammps} keyword `hybrid'. (The usual caveat applies: just because an \ac{md} simulation can run does not ensure it is physically valid.) ELECTRODE reuses many data structures native to \ac{lammps} (such as neighbor lists for nearby interactions and \ac{p3m} implementations), thus benefiting from the high scaling efficiency that has been documented in \ac{lammps} publications. Additionally, ELECTRODE can use the efficient \ac{p3m} method for long-range interactions required for a \ac{cpm}.\cite{Ahrens-Iwers2021} A notable omission from ELECTRODE as compared to \textit{MetalWalls} is that the charge update of ELECTRODE is not synchronized with other features which attempt to minimize energy mid-step, such as Drude model polarizable force-fields and charge equilibration of mobile particles in ReaxFF and other reactive force-fields. \textit{MetalWalls} includes an implementation of polarizable ion models represented by point dipoles, where electrode charges and point dipoles are simultaneously updated in a synchronized energy minimization (using conjugate gradients). By contrast, in an ELECTRODE simulation with (for example) Drude dipoles, electrode charges will not be re-optimized after Drude dipoles have been optimized (or vice versa), so in theory electrode charges may be out of sync with Drude dipole configurations, and simulation results will change based on the order in which commands are entered in the script. In practice, stable integration requires that both electrode charges and Drude dipoles do not change abruptly over the integration timestep. We therefore think that the absence of synchronized minimization is not a major obstacle to using ELECTRODE with polarizable force fields, but look forward to verifying this in future with detailed simulations. Another available implementation in \ac{lammps} is the `USER-CONP' code by \citet{Wang2014EvaluationCapacitors} This code appears to be no longer maintained and is poorly optimized compared to other implementations. A follow-on version entitled `USER-CONP2'\cite{Tee_2022} was written and maintained by one author of this paper, and most of its features have now been incorporated into the ELECTRODE package. An implementation of \ac{cpm} \ac{md} for the OpenMM software \cite{Eastman2013} can also be found at \url{https://github.com/jmcdaniel43/Fixed_Voltage_OpenMM}, and may be of interest to users with access to graphical processing units (GPUs) for computational acceleration. \section{Simulation details} A capacitor with an aqueous NaCl electrolyte between two gold electrodes has been adapted from an example provided in the \textit{MetalWalls} repository\cite{Marin-Lafleche2020}. For a consistent comparison, systems are equilibrated with the respective method at 0\,V for the \ac{cpm} and \ac{tp} methods and at 0\,e$^-$ for the \ac{ccm} methods. After an equilibration time of 5\,ns, a total number of 100 equilibrated structures are written at an interval of 10\,ps. For each of the resulting structures a charging process is modeled by applying a potential difference of 2\,V, or an equivalent of roughly 4.4\,e$^-$, depending on the method. \begin{figure}[tbp] \centering \includegraphics{images/charging_general.jpg} \caption{Bi-exponential function fit to 100 charging trajectories of the respective method.} \label{fig:bi-exp} \end{figure} Charging times $\tau_1$ and $\tau_2$ are obtained by fitting a bi-exponential charging function \begin{equation} M_z(t) = M_z^\mathrm{eq} \left[1 - c \exp(-t / \tau_1) - (1-c)\exp(-t / \tau_2)\right] \label{eqn:bi-exp} \end{equation} to the $z$-component of the average electrolyte dipole of the 100 uncorrelated and individual runs. Examples of the temporal evolution and the fitting are given in \reffig{fig:bi-exp} for the \ac{ccm}, \ac{cpm} and the \ac{tp}. A summary of the fit parameters for the various charging runs with different methods is given in \reftab{tab:fits}. \begin{table}[tbp] \begin{tabular}{ l|r|r|r|r} Method & \multicolumn{1}{c|}{$\tau_1$ / ps} & \multicolumn{1}{c|}{$\tau_2$ / ps} & \multicolumn{1}{c|}{$c$} & \multicolumn{1}{c}{$M_z^{\mathrm{eq}}$ / $e\,\text{\AA}$} \\ \hline CCM uniform & 0.04 $\pm$ 0.00 & 53.5 $\pm$ 2.8 & 0.98 $\pm$ 0.00 & -200.4 $\pm$ 0.0 \\ CCM & 0.05 $\pm$ 0.00 & 58.3 $\pm$ 3.1 & 0.98 $\pm$ 0.00 & -210.1 $\pm$ 0.0 \\ CPM uniform & 2.00 $\pm$ 0.03 & 93.4 $\pm$ 1.3 & 0.81 $\pm$ 0.00 & -241.1 $\pm$ 0.1 \\ CPM & 1.90 $\pm$ 0.03 & 99.1 $\pm$ 1.5 & 0.83 $\pm$ 0.00 & -234.3 $\pm$ 0.1 \\ TP uniform & 3.49 $\pm$ 0.04 & 93.4 $\pm$ 1.3 & 0.79 $\pm$ 0.00 & -241.2 $\pm$ 0.1 \\ TP, $\tau_v = 500\,\text{fs}$ & 9.60 $\pm$ 0.09 & 107.2 $\pm$ 1.7 & 0.79 $\pm$ 0.00 & -234.3 $\pm$ 0.1 \\ TP, $\tau_v = 100\,\text{fs}$ & 3.51 $\pm$ 0.04 & 100.7 $\pm$ 1.4 & 0.80 $\pm$ 0.00 & -233.8 $\pm$ 0.1 \\ TP, $\tau_v = 20\,\text{fs}$ & 2.12 $\pm$ 0.03 & 94.1 $\pm$ 1.4 & 0.82 $\pm$ 0.00 & -234.1 $\pm$ 0.1 \\ CPM, $l_{\mathrm{TF}} = 1.5\,\text{\AA}$ & 1.40 $\pm$ 0.03 & 103.0 $\pm$ 2.2 & 0.85 $\pm$ 0.00 & -153.7 $\pm$ 0.1 \\ CPM, $l_{\mathrm{TF}} = 1.0\,\text{\AA}$ & 1.64 $\pm$ 0.03 & 94.2 $\pm$ 2.0 & 0.86 $\pm$ 0.00 & -184.0 $\pm$ 0.1 \\ CPM, $l_{\mathrm{TF}} = 0.5\,\text{\AA}$ & 1.82 $\pm$ 0.03 & 89.9 $\pm$ 1.4 & 0.82 $\pm$ 0.00 & -216.8 $\pm$ 0.1 \\ CPM 1.0 V & 1.87 $\pm$ 0.05 & 90.0 $\pm$ 3.1 & 0.84 $\pm$ 0.00 & -115.0 $\pm$ 0.1 \\ CPM 0.5 V & 1.73 $\pm$ 0.10 & 63.9 $\pm$ 5.3 & 0.85 $\pm$ 0.01 & -57.3 $\pm$ 0.1 \\ CPM 0.3 V & 2.04 $\pm$ 0.18 & 50.3 $\pm$ 10.2 & 0.88 $\pm$ 0.02 & -34.4 $\pm$ 0.1 \\ \end{tabular} \caption{Parameters for the bi-exponential fit using \refeq{eqn:bi-exp} with residual standard deviations. \ac{cpm} simulations without specification of voltage are at 2.0\,V.} \label{tab:fits} \end{table} \begin{figure} \centering \includegraphics{images/tau_both.pdf} \caption{% Water dipole relaxation time constants $\tau_1$ and standard deviations for (a) the \ac{cpm} with varying Thomas-Fermi length $l_\mathrm{TF}$ and (b) the \ac{tp} with different \ac{tp} time constants $\tau_v$. % $l_\mathrm{TF} = 0$ is identical with the standard \ac{cpm} in \reffig{M-fig:tau}. % } \label{fig:tau-tf-tps} \end{figure} \reffig{fig:tau-tf-tps} features a \ac{cpm} setup with the \ac{tf} approach and various $l_\mathrm{TF}$. While not affecting $\tau_2$, increasing $l_\mathrm{TF}$ leads to a faster water dipole reorientation (cf. Fig.~\ref{fig:tau-tf-tps}a) and an up to 35\% smaller equilibrium dipole compared to a pure \ac{cpm} with $l_\mathrm{TF}=0$\,{\AA} due to the screening of the charge in the metal electrode. In \reffig{fig:tau-tf-tps}b different potentiostat couplings for the \ac{tp} are investigated. It is expected that the \ac{tp} alters charging times because it includes a dissipation term which leads to a delayed response in terms of a weaker coupling to the external (electron) reservoir via $\tau_v=R_0C_0$.\cite{Deienbeck2021DielectricApproach} Increasing $\tau_v$ leads thus to larger charging constants for the water dipole reorientation $\tau_1$, but does not affect the ionic diffusion relaxation time constant $\tau_2$ (cf.~\reftab{tab:fits}). \refFig{fig:voltage-tau} illustrates the dependence of the voltage $v_0$ on the two relaxation times $\tau_1$ and $\tau_2$. \begin{figure}[tbp] \centering \includegraphics{images/tau_voltage.pdf} \caption{$\tau_1$ and $\tau_2$ as function of voltage $v_0$ applied with the \ac{cpm}. Fitted values and residual standard deviations for fitted relaxation times are obtained from averaging over 100 uncorrelated runs.} \label{fig:voltage-tau} \end{figure} Interestingly, the voltage here only slightly affects $\tau_1$, but strongly changes the ionic relaxation time $\tau_2$ at voltages below 1\,V. \FloatBarrier \bibliographystyle{apsrev4-1}
7fb3320d37fb4dfc6270be273f5c4f08c35a1a4d
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Recent years have seen an explosion of interest in so-called moir\'e materials \cite{andrei2021marvels,he2021moire,macdonald2019bilayer,zeller2014possible,kennes2021moire}. These are materials in which two dimensional crystals are stacked in such a way that their lattices interfere to form moir\'e patterns. In the earliest works related to such a material - twisted bilayer graphene - the moir\'e patterns appear due to a relative twist between two graphene layers and have been found to lead to flat bands near a ``magic angle" \cite{bistritzer2011moire,morell2010flat,dosSantos2012}. It was speculated that this could lead to various strongly correlated phases, because flat bands imply tiny kinetic energy making any weak electron-electron interaction energy dominant \cite{Hu:prb11, Parameswaran2013816, Wu_CI:prb12, Wang:prb11, Sun:prl11, Neupert:prl11, Tang:prl11, Regnault:prx11, Kourtis:prl14}. In 2018 interaction driven phases in flat band systems were experimentally confirmed when superconductivity and insulating phases in twisted bilayer graphene (TBG)were reported\cite{cao2018unconventional}. Since then there have been theoretical predictions and experimental discoveries of a plethora of different strongly correlated phases\cite{cao2018unconventional,10.21468/SciPostPhys.11.4.083,xie2021fractional,cao2020tunable,wilhelm2021interplay,rademaker2018charge,yankowitz2019tuning,choi2019electronic,sherkunov2018electronic,xie2020nature,Codecidoeaaw9770,wong2019cascade,Lu2019efetov,Sharpe605,Seo_2019}. These phases can range from various magnetic states\cite{Sharpe605,Seo_2019,Lu2019efetov,wong2019cascade} to superconducting states\cite{Lu2019efetov,wong2019cascade}. This discovery naturally leads to the question of which related materials may harbor similarly exciting properties. One such material class that has recently risen to popularity is bilayer or few layer transition metal dichalogenides (TMDs) with a relative twist between layers\cite{Tran2019,Seyler2019,Alexeev2019,hu2021competing,PhysRevLett.121.026402,moralesduran2021nonlocal,2019wulovorn,tang2020simulation,PhysRevB.104.115154,andersen2021excitons}. Similar to TBG, theory has predicted \cite{PhysRevLett.121.026402,hu2021competing,moralesduran2021nonlocal,PhysRevB.104.115154,tang2020simulation} and experiment has confirmed\cite{wang2020correlated,andersen2021excitons} there exists a zoo of strongly correlated phases. Analogously to TBG, these phases can be tuned via the twist angle. Compared to TBG, the twisted TMD systems offer the addition degree of freedom of material choice used to build the moir\'e heterostructure which can be used to tune different phases of matter. Recently, it was shown theoretically that TMD heterobilayers possess very rich phase diagrams that include a multitude of different magnetically ordered phases \cite{hu2021competing}. While TMD heterostructures might seem more complicated than graphene based multilayer materials (each TMD layer corresponds to three atomic layers), effective descriptions for TMD heterostructures can be significantly simpler than TBG because the former allow for an effective single band description that mimics a two-dimensional non-relativistic single particle Schr\"odinger equation with a periodic potential originating in the moir\'e patterns \cite{moralesduran2021nonlocal,hu2021competing,PhysRevLett.121.026402,Angelie2021826118}. This is in stark contrast to the case of graphene based moir\'e materials such as TBG, where one needs a four component Hamiltonian similar to a massless Dirac equation to describe layer and sublattice pseudo-spin degrees of freedom. It is worth mentioning, however, that recently, the dimensionality of the twisted bilayer graphene Hamiltonian for a chiral limit has been reduced to a 2x2 Hamiltonian in an approach where the Hamiltonian is squared \cite{PhysRevB.105.115434,PhysRevB.103.245418}. Nevertheless, for TBG a mapping from position dependent interlayer hoppings to an effective potential and a single band description is problematic. In fact, such a mapping has only been made rigorously for a closely related effective one-dimensional case, where moir\'e patterns are due to a stretch of one of the layers \cite{PhysRevB.101.075413,fleischmann2019perfect,2017mvoglsemiclass}. Even in this case, the argument only applies semiclassically. It is the simplicity of effective Hamiltonians for the TMD heterobilayers that motivates us to focus on the engineering of phase transitions for this class of materials, rather than TBG. The TMD heterobilayer platform can be made even more manipulable by combining it with Floquet engineering which has been touted as a very powerful technique to modify the properties of quantum systems with light. In this technique, periodic drives are used to induce different material properties in a so-called prethermal phase that bears resemblence to an equilibrium phase. Recent years have witnessed incredible progress both on the theoretical as well as the experimental side of Floquet engineering. Specifically, on the theoretical side, there has been progress on estimating how long (given certain assumptions to driving strengths and frequencies) one can remain in the prethermal regime, which is often exponentially long \cite{PhysRevB.95.014112,polkovnikov2018repl}. There has been tremendous progress in the development of techniques that facilitate effective time-independent descriptions using so-called effective Floquet Hamiltonians\cite{blanes2009,rahav2003,rahav2003b,bukov2015,Eckardt_2015,Feldm1984,Magnus1954,PhysRevB.95.014112,PhysRevX.4.031027,PhysRevLett.115.075301,PhysRevB.93.144307,PhysRevB.94.235419,PhysRevLett.116.125301,Vogl_2019AnalogHJ,verdeny2013, PhysRevLett.110.200403,Vogl2020_effham,vogl2019,Rodriguez_Vega_2018,PhysRevLett.121.036402,Martiskainen2015,rigolin2008,weinberg2015,PhysRevB.96.155438,Kennes-Klinovaja-2019,PhysRevB.101.155417,novicenko2021flowequation}. Importantly, there has also been progress in our understanding of how to prepare prethermal Floquet phases\cite{Shirai_2016,10.21468/SciPostPhysCore.4.4.033,PhysRevB.104.134308}. For instance, it is now better understood what properties a bath has to fulfill for a system to relax into a so-called Floquet-Gibbs state\cite{Shirai_2016,10.21468/SciPostPhysCore.4.4.033,PhysRevLett.123.120602}, which can tell us much about how to prepare the ground state of a Floquet Hamiltonian. In addition to the work on the theoretical foundations of Floquet engineering, there have been predictions of a multitude of exciting light induced properties and phases of matter \cite{Basov2017,Oka_2019, rudner2020_review,Giovannini_2019,McIver2020,oka2009,lindner2011,rechtsman2013,Rudner2013,PhysRevLett.105.017401,PhysRevLett.123.016806,Huang_2020,PhysRevB.99.045441,PhysRevResearch.2.013124,PhysRevB.102.094305,chaudhary2019phononinduced,Haiping2020,PhysRevLett.120.127601,PhysRevX.4.041048,PhysRevLett.118.115301,PhysRevB.98.045127,PhysRevB.93.245145,kennes2019,PhysRevLett.108.056602,PhysRevLett.124.190601,PhysRevB.94.224202,Abanin_2016,PhysRevLett.114.140401,RevModPhys.91.021001,lindner2011,dallago2015,PhysRevB.91.241404,asboth2014,calvo2011,PhysRevB.104.245135,zhenghao2011,PhysRevB.88.241112,perez2014,kundu2014,Sentef2015,Roman-Taboada2017,Dehghani2015,kitagawa2011,Usaj2014,PhysRevA.91.043625,bhattacharya2020fermionic,mentink2014,mentink2015ultrafast,mentink2017manipulating,hejazi2018,hejazi2019,Quito2021,Quito2021b,Chaudhary2019orbital,chaudhary2020controlling} (see \cite{RODRIGUEZVEGA2021168434,bao2021light} for a recent review article). Recently, Floquet engineering is gaining popularity in moir\'e materials - albeit in the non-interacting limit\cite{RODRIGUEZVEGA2021168434,ibsal2021,floquetTMDV2021,sentef2021,sentef2019,luzeng2021,PhysRevResearch.2.033494,PhysRevB.101.235411,michaelvoglInterlayer2020,PhysRevB.102.155123,PhysRevResearch.2.043275,bao2021light,Chaudhary2019orbital,chaudhary2020controlling,ge2021floquet}. In this work, we make a first step towards Floquet engineering of different phases of matter in \emph{interacting} moir\'e materials. To maximize the accessibility of our results, we will focus on a simplified approach using a model description of a twisted TMD heterobilayer. This will allow us to focus on the universal features expected in experiment. A schematic depiction of the experimental scenario we envision can be seen in the Fig. \ref{fig:light_magn_state}. \begin{figure}[htb] \centering \includegraphics[width=\linewidth]{waveguide_scheme} \caption{ Schematic representation of how the magnetic ground state of a twisted TMD heterobilayer placed at the exit of a waveguide (illustrated as a dark rectangular prism) can be affected by light emanating from the waveguide. For example, the light might cause some of the spins to reorient themselves. Blue and orange spheres correspond to transition metal atoms, yellow ones to chalcogenides. The two layers have a relative twist, as shown. Spins are represented in light blue.}\label{fig:light_magn_state} \end{figure} Our paper is organized as follows. First, in Sec.\ref{sec:model} we give a brief review of the effective Hamiltonian used to model TMD heterobilayers. Then, in Sec.\ref{sec:engineering} we briefly describe the techniques used to derive interaction terms for an effective lattice model and discuss how a specific form of light, waveguide light possessing a longitudinal polarization, can be used to target specific parameters of the non-interacting limit. Similarly, we show that circularly polarized light can be employed to tune the effective mass of the active TMD layer, which also appears in the non-interacting limit. A central result of our work is that by tuning the properties and type of incident light one can reach a multitude of vastly different magnetic phases of matter in a twisted TMD without the need to change the specifics of the sample, such as the twist angle or constituent TMDs. One achieves dramatic control over the phase diagram. Finally, in Sec.\ref{sec:preparation} we finish with a discussion on how specifics of the environment determine how ``Floquet ground state" phases can be prepared in practice. We conclude in Sec.\ref{sec:conclusions}. \section{Model} \label{sec:model} We consider a generic non-interacting model \cite{moralesduran2021nonlocal,hu2021competing,PhysRevLett.121.026402} \begin{equation} H=-\frac{\hbar^2 \vect k^2}{2m^*}+2\Delta(\vect x), \label{eq:non_int_ham} \end{equation} for ``electrons" in a TMD heterobilayer such as WSe$_2$/MoSe$_2$ or WSe$_2$/MoS$_2$. In this model, electrons are constrained to move in only one of the transition metal layers--the so-called active layer. This means that additional layers that appear in such a TMD heterostructure are only taken into account via the effective potential $\Delta(\vect x)$ and mass $m^*$. Some interaction effects are taken into account on a density functional theory (DFT) level because these models are typically fit to DFT band structures. Furthermore, it is important to stress that the model is coarse-grained, losing some short distance features. It is most accurate at long wavelengths, specifically near the $\Gamma$ point of a single TMD layer \cite{PhysRevLett.121.026402}. Electronic excitations in this model have an effective mass of $m^*\sim 0.5 m_e$, where $m_e$ is the bare electron mass (details depend crucially on the type of heterobilayer, whether WSe$_2$/MoSe$_2$ or WSe$_2$/MoS$_2$ or something else). For a twisted bilayer with small twist angle the effective periodic potential $\Delta(\vect x)$ has a six-fold rotational symmetry due to moir\'e patterns that appear from the interference between the two lattices. It is given as \cite{moralesduran2021nonlocal,hu2021competing,PhysRevLett.121.026402} \begin{equation} \Delta(\vect x)= V_m\sum_{i=1}^3 \cos(\vect b_i \vect x+\psi), \label{eq:potential} \end{equation} where $V_m$ is the strength of this potential and typically $V_m\sim 10meV$. Here, the $\vect b_i$ are the three shortest reciprocal lattice vectors for the moir\'e lattice that are related by a $120^\circ$ rotation and $\psi$ is a phase shift that is determined by band structure fits. As described in Refs. \cite{hu2021competing,PhysRevB.102.201104}, strong correlation effects for twisted TMDs can be included in a simple approximation where Wannier wavefunctions are determined using the non-interacting model Eq.~\eqref{eq:non_int_ham} only. These Wannier wavefunctions can then be used to compute effective hopping terms on the moir\'e lattice, Hubbard-$U$-like interaction terms, etc. Therefore, much of the interacting structure is crucially influenced by the properties of the non-interacting underlying model. In some cases approximations can even be found by analytical means. For instance, it has been shown that one may approximate the potential Eq.~\eqref{eq:potential} by a harmonic potential \cite{moralesduran2021nonlocal}. Harmonic oscillator wavefunctions then act as reasonably accurate approximations to the actual Wannier functions\cite{moralesduran2021nonlocal} and computations of Hubbard-$U$-like interaction terms can be done analytically, offering much insight\cite{moralesduran2021nonlocal}. The most important point we would like to emphasize is that the interaction parameters will depend on the parameters of the non-interacting model--particularly the moir\'e potential strength $V_m$. This observation is especially lucid in the case of the work by Hu {\it et al.} \cite{hu2021competing}, where only one of the axes in their interacting phase diagram (see Fig.~\ref{fig:phasediagram_move}) depends on $V_m$. This observation serves as motivation for the next section. \section{Light induced engineering of phase transitions} \label{sec:engineering} In this section, motivated by the work of Hu {\it et al.} \cite{hu2021competing}, we focus on how to engineer magnetic phase transitions by using two types of light. First we consider light emanating from a waveguide and afterwards the more standard case of circularly polarized light. For light eminating from a waveguide the starting point of our discussion is a generic tight binding model. Here, the influence of light can be included through the hopping terms $t_{ij}$ according to the Peierls substitution \begin{equation} t_{ij}\to e^{\int_{\vect r_i}^{\vect r_j}\vect A(t)\cdot d\vect l}t_{ij}, \end{equation} where $\vect A$ is the vector potential. Note that if one shines \emph{normally incident longitudinally polarized light} onto a multilayered material only interlayer couplings are affected by this substitution (for in-plane hoppings the scalar product $\vect A(t)\cdot d\vect l$ vanishes). Such an exotic form of light can be found at the exit of a waveguide \cite{michaelvoglInterlayer2020}, where it is allowed due to cavity boundary conditions. It was shown in Ref.\cite{michaelvoglInterlayer2020} that in the high frequency limit (the light frequency is larger than the bandwidth of the bands of interest but smaller than be bandgap) the effective time-independent interlayer couplings $t_{ij}$ given by \begin{equation} t_{ij}\to J_0(a_L A)t_{ij}, \label{eq:Peierls} \end{equation} where $J_0$ is the zeroth Bessel function of the first kind that modulates the hopping amplitude. Here, $a_L$ is the interlayer distance and $A$ the strength of the incident light beam (constants like $\hbar$, etc are absorbed into $A$). The time-averaged Peierls result, Eq.\eqref{eq:Peierls}, can be exploited to modify couplings in Eq.~\eqref{eq:non_int_ham}. First, one realizes that the non-interacting bands are relatively flat as noted in Refs. \cite{hu2021competing,PhysRevLett.121.026402,moralesduran2021nonlocal}. The bands for which the harmonic oscillator wavefunctions hold as an accurate approximation of Wannier wavefunctions are especially flat, which can also be seen quite clearly in the Fig. \ref{fig:bandstruct} below. The flat band around the Fermi level energetically separated from other bands means that we can reasonably employ the high frequency approximation discussed above. \begin{figure}[H] \centering \includegraphics[width=0.7\linewidth]{band_struc_plot} \includegraphics[width=0.7\linewidth]{BZ_plot} \caption{Top: Plot of the non-interacting band-structure for $V_m=6.6$meV, $m^*=0.35 m_e$, $a_M=12$nm and $\psi=-94^\circ$. Bottom: The moire Brillouin zone along with the path that was taken for the bandstructure plot marked in orange.}\label{fig:bandstruct} \end{figure} Instead of taking Eq.~\eqref{eq:non_int_ham} as a starting point for the description of a twisted TMD one could also take a tight binding model that includes both TMD layers as a starting point. This type of model could be downfolded into an effective tight binding model that only includes the active layer (AL)--the inactive layers (ILs) would be integrated out--employing a quasi-degenerate perturbation theory such as a Schrieffer-Wolff transformation or Loewdin downfolding. In this case, the dominant (2nd order in perturbation theory) contribution from interlayer tunnelings would be hopping processes like $AL\to IL\to AL$, assuming that the dominant interlayer hopping strengths are small compared to the dominant intralayer hoppings. Since hopping terms typically decrease exponentially with distance, the most dominant process is where the initial point on the active layer is the same as (right ``above") the final point on the active layer. Hopping processes with different initial and final points on the AL would contribute as an effective or indirect intralayer hopping, which we will neglect because direct intralayer hoppings can be expected to be much larger. This means that the dominant effect of interlayer hopping leads to on-site potential terms like $\epsilon_i\hat c_i^\dagger c_i$, where the onsite energies $\epsilon_i\propto t_{ij}^2$. A slightly more rigorous treatment of these ideas for the example of a 1D chain can be found in appendix \ref{app:Downfold_into_active_layer}. In the language of the continuum model, on-site energies can be translated as a smoothed potential. In our case, this means that effective on-site energies that are due to second order interlayer hopping processes can be identified as the dominant origin of the moir\'e potential in Eq.~\eqref{eq:non_int_ham}. In the high frequency limit when the material is subjected to the waveguide light \begin{equation} V_m\to (J_0(a_L A))^2V_m, \label{eq:replacement_moirestrength} \end{equation} where $a_L$ is a parameter taken to be $0.85 a_{TT}$, the order of the distance between two transition metal layers $a_{TT}$. (See Appendix \ref{app:neglected_effects}.) Eq.~\eqref{eq:replacement_moirestrength} can now directly be used to move in the phase diagram shown in Fig.\ref{fig:phasediagram_move}. Specifically, one may introduce the following parameters \cite{hu2021competing} \begin{equation} \begin{aligned} &r_s^*=\frac{1}{\epsilon}\left(\frac{3}{4\pi^2}\right)^{1/4}\frac{a_M}{a_B}\frac{m^*}{m},\\ &\alpha^2=\frac{\hbar^2}{m^*\beta V_m a_M^2}, \end{aligned} \label{eq:rs_alpha} \end{equation} where $m$ is the bare electron mass, $m^*$ the effective mass, $a_B=\frac{\epsilon \hbar^2}{e^2m}$ the Bohr radius, $a_M$ the moir\'e lattice constant, $\beta=16\pi^2\cos(\psi)$ a material dependent numerical constant (material dependent through $\psi$ appearing in Eq.\eqref{eq:potential}--we assume the case $-\pi/3<\psi<\pi/3$) and $\epsilon$ the dielectric constant. The quantity $a_B r_s^*$ can be interpreted as the typical distance between electrons \cite{hu2021competing}. Approximating the wells of the moir\'e potential by a local harmonic potential, $\alpha$ can be related to a harmonic oscillator length scale. A typical twisted TMD might have parameters $a_M\approx 10\,nm$, $m^*=0.3m$, $\epsilon=10$, $V_m\approx 30\,meV$, from which we get $r_s^*\approx2.97$ and $\alpha^2\approx 5.98\times 10^{-3}$, placing one near the boundary of a stripe and FM region (see. Fig.~\ref{fig:phasediagram_move}). Therefore, it may be possible to tune different phases in a twisted TMD hetero bilayer with relative ease. Indeed, in our case one is able to change $V_m$ (without additional effects in the high frequency regime) by applying waveguide light. More precisely, one can directly tune $\alpha^2$, Eq.~\eqref{eq:rs_alpha}, increasing it in size, since $V_m$ is reduced according to Eq.~\eqref{eq:replacement_moirestrength}. The effect of this can be seen below in Fig. \ref{fig:phasediagram_move}. \begin{figure}[H] \centering \includegraphics[width=\linewidth]{modified_phase_diag} \caption{Adapted and modified redrawn version of the phase diagram from Ref.\cite{hu2021competing}. Different magnetic phases in a twisted TMD are shown in different colors. Black arrows to indicate how waveguide light can allow one to tune vertically across phase boundaries in the phase diagram. The parameter $\alpha^2$ appearing in Eq.\eqref{eq:rs_alpha} is increased as $V_m$ is decreased, according to Eq.\eqref{eq:replacement_moirestrength}. }\label{fig:phasediagram_move} \end{figure} While the phase boundaries are the same as in Ref. \cite{hu2021competing}, our original contribution is the addition of arrows that show how the coupling parameters $\alpha^2$ and $r_s^*$ are renormalized under the drives we consider. For instance, this allows us to show that tuning $V_m$ indirectly through the influence of light one can drive phase transitions, such as from a 120$^\circ$ Neel phase to a stripe ordered phase or to a ferromagnetic phase, for example. Note that shifting phases becomes easier as the harmonic oscillator length scale $\alpha$ is increased because for a small change to $V_m\to V_m-\delta V$ we have $\alpha^2\to(\alpha')^2\approx \alpha^2+\alpha^2\frac{\delta V}{V_m}$. We emphasize the crucial point that the drives we consider do not change the phase diagram, but allow one to experimentally tune between phases within it. Such a situation is rare in driven systems. Within our model, waveguide light only allows one to tune parameter the $\alpha$. However, one can gain greater control over the phase diagram of a twisted TMD by tuning the second parameter, $r^*_s$, which can be done with circularly polarized light modelled by a vector potential $\vect A=A(\cos(\omega t),\sin(\omega t))$. We note that $r^*_s$ can be tuned by such a choice of vector potential because it depends on the effective mass $m^*$ in the active TMD layer - a parameter that is primarily determined by values of in-plane hopping elements of a tight binding model. Circularly polarized light is a good choice if one aims to modify $m^*$ because it primarily influences the in-plane hopping elements. Typically, the most relevant out-of-plane hopping elements are almost directly perpendicular to the plane of the material and therefore they are influenced very little by circularly polarized light (recall the details of the Peierls substitution and that circularly polarized light only has in-plane vector potential components that are non-zero) - indeed hopping elements decay rapidly with distance. Before we discuss the effect of circularly light on the effective mass $m^*$ in Eq.\eqref{eq:non_int_ham}, we first note that the quadratic dispersion that appears in Eq.\eqref{eq:non_int_ham} can be an approximation valid near different high-symmetry points in the hexagonal Brillouin zone. Indeed, depending on the precise choice of TMD material, low energy electrons might either be close to the $K$ points\cite{Wu2018} or the $\Gamma$ point\cite{Angelie2021826118}. In both cases, near those points the band structure can be approximated by a quadratic dispersion. Since $\Gamma$ and $K$ points are separated by a large distance in $k$-space, electrons at each of these points can be treated as independent excitations as noted in the appendix of \cite{PhysRevLett.122.086402}. In what follows we will therefore investigate the impact of circularly polarized light on the effective masses of the lowest energy band near the $\Gamma$ and $K$ points. In addition, we will highlight the differences at the $\Gamma$ and $K$ points. Here, it suffices to restrict our investigation to the impact on the active TMD layer. First, we investigate the effect of circularly polarized light on excitations near the $\Gamma$ point. Our starting point is a third nearest neighbor three-band tight binding model \cite{Liu_2013} of a TMD that we discuss in more detail in appendix \ref{App:Downfold3Bandmodel}. From this model we find that circularly polarized light in the high frequency limit (frequencies larger than the bandwidth) modifies the effective mass $m^*$ as \begin{equation} m^*\to (1+\Lambda a^2A^2)m^*, \label{eq:massrenorm} \end{equation} where we assumed a relatively weak field strength $A$, and $a$ is the in-plane lattice constant. A mass renormalization parameter $\Lambda$ that describes how strongly the effective mass $m^*$ is increased due to the electromagnetic field strength $A$ depends on the particular choice of active TMD layer. Values of $\Lambda$ for a variety of active TMD layer choices are given below in table \ref{tab:TMDmassmodParam}. \begin{table}[H] \centering \begin{tabular}{|c|c|c|}\hline Active layer& $\Lambda$ (GGA)& $\Lambda$ (LDA)\\\hline\hline MoS$_2$ & 0.998& 1.338\\\hline WS$_2$ & 1.021&1.183\\\hline MoSe$_2$ & 1.556&1.334\\\hline WSe$_2$ & 0.332&1.530\\\hline MoTe$_2$ & 8.219&1.070\\\hline WTe$_2$ & 1.366&1.203\\\hline \end{tabular} \caption{Mass renormalization parameter $\Lambda$ near the $\Gamma$ point computed based on effective third nearest neighbor tight binding with parameters that were taken from Ref.\cite{Liu_2013}. We also compare results that were obtained using different approximations to the exchange correlation potential of DFT: generalized gradient (GGA) and local density approximation (LDA). These different approximations were used in Ref.\cite{Liu_2013} to fit a third nearest neighbor tight binding model, which we used in our computations. Details of the computation to determine those parameters are found in appendix \ref{App:Downfold3Bandmodel}} \label{tab:TMDmassmodParam} \end{table} We find that most computed values of the renormalization parameter $\Lambda$ are close to unity. However, $\Lambda$ seems to be more strongly dependent on a specific choice of tight binding model rather than the actual underlying material. Therefore, our results based on the tight binding parameters from Ref.\cite{Liu_2013} can be taken as an order of magnitude estimate. That is, we can only make the observation that circularly polarized light increases the effective mass near the $\Gamma$ point roughly as $m^*\to (a+a^2A^2)m^*$. Additional DFT based work might be necessary to find more reliable results for the mass renormalization parameter $\Lambda$. Such an analysis is beyond the scope of the present work. Despite the spread of values for $\Lambda$ we find that circularly polarized light allows one to manipulate $r^*_s$, and therefore gain gain a high level of control over the phase diagram of Ref.\cite{hu2021competing}. Particularly, in Fig. \ref{fig:phasediagram_move_Circ} one can see how one may move in the phase diagram by the application of circularly polarized light. \begin{figure}[htb] \centering \includegraphics[width=\linewidth]{phase_diag_mod_circ_pol} \caption{Adapted and modified redrawn version of the phase diagram from Ref.\cite{hu2021competing}. Different magnetic phases in a twisted TMD are shown in different colors. Black arrows indicate schematically how circularly polarized light can allow one to tune vertically across phase boundaries in the phase diagram. Due to the modifications that circularly polarized light enacts on the effective mass $m^*$, the parameter $\alpha^2\to \alpha^2(1-a^2A^2)$ decreases depending on its position in the plot and the parameter $r^*_s\to r^*_s(1+a^2A^2)$ increases based on its position in the plot, which we indicated by arrows pointing along $(r_s^*a^2A^2,-\alpha^2 a^2A^2)$. }\label{fig:phasediagram_move_Circ} \end{figure} From the phase diagram in Fig.\ref{fig:phasediagram_move_Circ} it becomes clear that circularly polarized light provides an additional knob that allows one to tune the magnetic phases of a twisted TMD heterobilayer independently from the tuning in the case of light emanating from a waveguide. We stress that while the phase diagram itself is unmodified from \cite{hu2021competing}, in our theoretical treatment we were able to capture renormalized couplings that allow one to tune an experimental system along the arrows we have added to the phases diagram. The arrows, an original contribution of this work, can be interpreted as the couplings $\alpha^2$ and $r_s^*$ flowing with increasing strength of the circularly polarized light. Next, we turn to the effect of circularly polarized light on excitations near the $K$ point. We investigate how it can also be used here to modify the effective mass $m^*$. Here, we worked with a simpler nearest neighbor three band model for a TMD that was found in Ref.\cite{Liu_2013} so that a more concise analytical expression could be obtained in Appendix \ref{App:Downfold3BandmodelK}. We were able to do so because the simpler model is a good fit to the band structure near the $K$ point - unlike the case of the $\Gamma$ point. The model and details of our computation are discussed in the appendix \ref{App:Downfold3BandmodelK}. Relevant for the main text is the case of weak field strengths $A$ and momenta near the $K$ point. Similar to momenta near the $\Gamma$ point, we find that mass is renormalized as in Eq.\ref{eq:massrenorm}. The renormalization parameters $\Lambda$ for a variety of materials are given in Table \ref{tab:TMDmassmodParamK}. \begin{table}[H] \centering \begin{tabular}{|c|c|c|}\hline Active layer& $\Lambda$ (GGA)& $\Lambda$ (LDA)\\\hline\hline MoS$_2$ & -0.0550& -0.0507\\\hline WS$_2$ & -0.0065&+0.0002\\\hline MoSe$_2$ & -0.1674&-0.1701\\\hline WSe$_2$ & -0.0937&-0.0858\\\hline MoTe$_2$ & -0.4771&-0.5122\\\hline WTe$_2$ & -0.3710&-0.3597\\\hline \end{tabular} \caption{Mass renormalization parameter $\Lambda$ near the $K$ point computed based on nearest neighbor tight binding models that were taken from Ref.\cite{Liu_2013}. Different DFT procedures such as generalized gradient (GGA) and local density approximation (LDA) were used to fit a nearest neighbor tight binding model. Details of the computation to determine parameter $\Lambda$ are given in appendix \ref{App:Downfold3BandmodelK}. } \label{tab:TMDmassmodParamK} \end{table} We find that unlike the case of the $\Gamma$ point, circularly polarized light reduces the effective mass near the $K$ point. The effect is generally not as pronounced as near the $\Gamma$ point, with a noticeably smaller $\Lambda<1$. The effect of circularly polarized light on effective masses seems to have a much stronger material dependence than in the case near the $K$ point. Lastly, results from different DFT approaches are in much better agreement with one another than in the case near the $\Gamma$ point. This might be attributed to less free parameters that appear in the nearest neighbor tight binding, which could guarantee a more consistent fit. Interestingly, the mass is renormalized differently near the $K$ and $\Gamma$ points. This observation could be used as an indirect probe to determine if certain material properties are dominated by the electrons near the $K$ or $\Gamma$ points. That is, if we are near a phase transition point circularly polarized light might cause a phase transition in a case dominated by the $\Gamma$ point but not the $K$ point or vice versa. This effect should be observable in magnetic response functions, most obviously the order parameter. For completeness we note that the phase diagram in Fig.~\ref{fig:phasediagram_move} (derived in Ref.\cite{hu2021competing}) made use of self-consistent Hartree-Fock theory for a further simplified lattice model. The full interacting Hamiltonian--including the Coulomb interaction $U(\vect r)$--was projected onto the highest band in Fig. \ref{fig:bandstruct}. Therefore, the interactions were modelled by a generalized Hubbard term \begin{equation} H_{int}=\frac{1}{2}\sum_{\tau,\tau^\prime,\vect R,\vect R^\prime}\tilde U(\vect R-\vect R^\prime)c_{\vect R,\tau}^\dag c_{\vect R^\prime,\tau^\prime}^\dag c_{\vect R^\prime,\tau^\prime} c_{\vect R,\tau} , \end{equation} where $\tilde U(\vect R-\vect R^\prime)$ corresponds to the Coulomb interaction evaluated using Wannier functions corresponding to moire lattice sites at positions $\vect R$ and $\vect R^\prime$ \cite{PhysRevLett.121.026402}. \section{Comments on Floquet state preparation} \label{sec:preparation} In the previous sections, we focused on how a periodic drive can modify exchange interactions in a TMD heterobilayer effective Hamiltonian. Our analysis was limited to studying the ground state magnetic properties of an effective time-independent Hamiltonian. However, the question about when the dynamics of the system can be fully described by this Floquet Hamiltonian is a very challenging one in itself and cannot be fully answered by direct studies of the properties of this Hamiltonian. Furthermore, it is an open problem, in general, how specific states of a Floquet Hamiltonian can be prepared experimentally. The answers to both these questions also depend on many other additional factors which include the methods used to turn on a periodic drive and also the details of a coupling of the system to its environment. This means that there are various time scales that enter the problem. We briefly discuss some of these time-scales relevant to our proposal. The first case we consider is one where an experimental setup allows preparation of an eigenstate of the Floquet Hamiltonian. It is well known that isolated Floquet systems due to interaction effects tend to heat to infinite temperature and thus it is challenging to keep an eigenstate of a Floquet Hamiltonian stable once it is attained. That is, the time evolution is only for a limited time governed by effective Floquet Hamiltonians - the so-called prethermal regime. After this regime a Floquet state will not be an eigenstate and therefore it will not be stable under time evolution. Nonetheless, generically, even interacting systems can sustain an exponentially long prethermal regime \cite{PhysRevB.95.014112} before heating dynamics take over. Sufficiently weak drives in the high frequency regime permit some rough estimates of prethermal regime times $t_{\mathrm{pre}}\propto \text{exp}(\omega/J)$, which can be made on the basis of interaction strength $J$ and drive frequency $\omega$~\cite{PhysRevB.95.014112}. However, not only is the length of the pre-thermal regime of experimental relevance, but also the length of time before the onset of the pre-thermal regime. The time required for the onset of the pre-thermal regime can be roughly estimated from the strength $J$ of interactions, and is roughly of order $1/J$~\cite{Bingtian2020} in this case. The second case we consider is the problem of Floquet state preparation. While there does not seem to be a general route to prepare a Floquet state, an adiabatic switch-on protocol can be used to prepare Floquet states \cite{Weinberg_adiabatic2017} if the initial state is adiabatically connected to the target state. An alternative route to the preparation of ground states of a Floquet Hamiltonian is via coupling to a heat bath. Particularly, it has been shown~\cite{Shirai_2016} that a periodically driven system under certain assumptions about the system-bath couplings will evolve into a so-called Floquet-Gibbs state. That is, the density matrix for relatively long times will evolve to be the density matrix for a Gibbs state $e^{-\beta H_F}$, where $H_F$ is the Floquet Hamiltonian~\cite{Shirai_2016}. This kind of state can be achieved under the condition that the heating rate of the driven system is smaller than the relaxation rate associated with the system-bath coupling. From this perspective the problem of Floquet state preparation can be shifted to a question about the engineering of appropriate system-bath couplings. However, there are also time scales involved with how long it takes to reach a Floquet-Gibbs state. To our knowledge there do not yet exist simple estimates for this time scale. We will therefore focus on the time scales that we can estimate with current techniques. The prethermal regime can be achieved within a few $100\,fs$ for $J\sim10\,meV$~\cite{Bingtian2020}. High-power ultrashort lasers with pulse widths of a few 100 fs are capable of generating electric field amplitudes in the range $0.1-1\,V/nm$~\cite{shan2021giant}. This results in sufficiently large driving strengths to induce a magnetic phase transition if the system is close to a phase boundary. We conclude this section by noting that while it is challenging to apply our approach to tune magnetic phases in a twisted TMD, it is within current experimental reach. \section{Conclusion} \label{sec:conclusions} In this work, we discussed how a periodic drive can be used to control and alter the magnetic properties of TMD heterobilayers. Many previous works~\cite{mentink2014,mentink2015ultrafast,mentink2017manipulating,hejazi2018,hejazi2019,Quito2021,Quito2021b,Chaudhary2019orbital,chaudhary2020controlling} have studied light-induced modification in exchange interactions. Most of these changes originate from the direct modulation of in-plane hopping arising from the transverse $\vect E$ field of a laser. However, in our case, we harness the additional layer degree of freedom possessed by moir\'e materials and use waveguide light to get an $\vect E$ field perpendicular to the TMD layers. In this case, we take an indirect route to modify exchange interactions. The longitudinal field of the laser renormalizes interlayer hoppings which in turn leads to a modification of the moir\'e potential. This change affects interaction parameters and in turn the magnetic properties. Our scheme differs from previous proposals in that it is based on modifications to interaction parameters that arise from interlayer hopping renormalizations. We have also studied the effect of circularly polarized light and found that it leads to a renormalization of the effective mass. This renormalization makes it possible to tune a separate parameter that determines the magnetic phase diagram. Circularly polarized light therefore serves as an additional tuning knob that allows one a high level of control over the phase diagram of a twisted TMD. We note that an interesting future direction would be to study the effect of linearly polarized transverse light on the phase diagram, which due to the breaking of rotational symmetry could lead to a wealth of new different magnetic phases. With the rapidly expanding zoo of moir\'e materials and their magnetic properties only scarcely understood at this point, we believe these methods would find many applications in this new class of materials. Furthermore, we believe that longitudinal light can find novel applications beyond Floquet engineering. For example, it would be interesting to explore the interplay of longitudinal waveguide light and moir\'e materials in the context of other light-matter phenomena such as optical responses, by generalizing the work of Refs.~\cite{chaudhary2021shiftcurrent,kaplan2021,liu2020anomalous}. \acknowledgements M.V. gratefully acknowledge the support provided by the Deanship of Research Oversight and Coordination (DROC) at King Fahd University of Petroleum \& Minerals (KFUPM) for funding this work through start up project No.SR211001 and subsequent continued funding through exploratory research grant No. ER221002. This research was primarily supported by the National Science Foundation through the Center for Dynamics and Control of Materials: an NSF MRSEC under Cooperative Agreement No. DMR-1720595, with additional support from Grant No. DMR-2114825. G.A.F also acknowledges support from the Alexander von Humboldt Foundation.
23371733a420b79d09857136012f45c876fe572b
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Representation learning methods have drastically evolved large scientific volume exploration strategies. The popular applications include summarization, construction of mentor-mentee network~\citep{ke2021dataset}, recommendation~\citep{ostendorff2020aspect,specter2020cohan,das2020information,hope-etal-2021-extracting}, QA over scientific documents~\citep{DBLP:conf/emnlp/SuXYSBF20}, and verification of scientific claims~\citep{Wadden2020FactOF}. The growing community's interest has led to the development of several scientific document embedding models such as OAG-BERT~\citep{liu2021oag}, SPECTER~\citep{specter2020cohan}, SciBERT~\citep{beltagy-etal-2019-scibert}, and BioBERT~\citep{lee2020biobert} over the past five years. OAG-BERT has been deployed in the Aminer production system. Given similar possibilities of future deployments of scientific document embeddings models in the existing scholarly systems, it is crucial to evaluate and identify limitations robustly. However, we do not find any existing work that critically analyzes the scientific language models to the best of our knowledge. To motivate the reader, we present a simple experiment. Queries \textit{`document vector'} and \textit{`document vectors'} fetch no common candidates among first page results on Google Scholar and Semantic Scholar (candidates in Appendix~\ref{sec:GSSSCandidates}). This illustrates the extremely brittle nature of such systems to minor alterations in query text, leading to completely different search outcomes. To motivate further, we experiment with textual queries encoded by the popular SciBERT model. A perturbed text \textit{`documen vector'} (relevant in AI) is closer to the Biomedical term \textit{`Virus vector'} in the embedding space. Similar observations were found for many other queries. As scholarly search and recommendation systems are complex systems and their detailed algorithms are not publicly available, we analyze the behavior of scientific language models, which are (or will be) presumably an integral component of each of these systems. Motivated by the usage of perturbed inputs to stress test ML systems in interpretability analysis, we propose to use \textit{`textual neighbors'} to analyze how they are represented in the embedding space of scientific LMs. Unlike previous works~\citep{ribeiro-etal-2020-beyond,rychalska2019models}, which analyze the effect of perturbations on downstream task-specific models, we focus on analyzing the embeddings which are originally inputs to such downstream models. With the explosion of perturbation techniques for various kinds of robustness and interpretability analysis, it is difficult to generalize the insights gathered from perturbation experiments. We propose a classification schema based on orthography and semantics, to organize the perturbation strategies. The distribution of various types of textual neighbors in a training corpus is non-uniform. Specifically, the low frequency of textual neighbors results in non-optimized representations, wherein semantically similar neighbors might end up distant in the space. These non-optimal representations have a cascading effect on the downstream task-specific models. In this work, we analyze whether all textual neighbors of input \textit{X} are also \textit{X}’s neighbors in the embedding space. Further, we also study if their presence in the embedding space can negatively impact downstream applications dependent on similarity-based document retrieval. Our main contributions are: \begin{enumerate}[noitemsep,nolistsep] \item We introduce (in Section~\ref{sec:tncategories}) five textual neighbor categories based on orthography and semantics. We further construct a non-exhaustive list of thirty-two textual neighbor types and organize them into these five categories to analyze the behavior of scientific LMs on manipulated text. \item We conduct (in Section~\ref{sec:short-text}) robust experiments to showcase the limitations of scientific LMs under a short-text query retrieval scheme. \item We analyze (in Section~\ref{sec:textual_neighbors}) embeddings of textual neighbors and their placement in the embedding space of three scientific LMs, namely SciBERT, SPECTER, and OAG-BERT. Our experiments highlight the capability and limitations of different models in representing different categories of textual neighbors. \end{enumerate} \section{Related Works} Several works utilize Textual Neighbors to interpret decisions of classifiers~\citep{lime,gardner-etal-2020-evaluating}, test linguistic capabilities of NLP models~\citep{ribeiro-etal-2020-beyond}, measure progress in language generation~\citep{DBLP:journals/corr/abs-2102-01672}, and generate semantically equivalent adversarial examples~\citep{ribeiro-etal-2018-semantically}. Similar to these works, we use textual neighbors of scientific papers to analyze the behavior of scientific LMs.~\citet{macavaney2020abnirml} analyze the behavior of neural IR models by proposing test strategies: constructing test samples by controlling specific measures (e.g., term frequency, document length), and by manipulating text (e.g., removing stops, shuffling words). This is closest to our work, as we also employ text manipulation to analyze the behavior of scientific language models using a simple Alternative-Self Retrieval scheme (Section~\ref{sec:exp_design}). However, our focus is not evaluation of retrieval-augmented models and we only use a relaxed document retrieval pipeline in our evaluation to analyze the behavior of scientific LMs trained on diverse domains, in encoding scientific documents. We organize the textual neighbors into categories which capture different capabilities of LMs. We also show that it is crucial to evaluate models on dissimilar texts rather than just semantically similar textual neighbors. Ours is a first work in analyzing the properties of scientific LMs for different inputs and can be utilized by future works to design and evaluate future scientific LMs. Due to space limitations, we present the detailed discussion on scientific LMs in Appendix~\ref{sec:app_scilm}. \section{Short Queries and Textual Neighbors} \label{sec:tncategories} In this paper, we experiment with short queries to fetch relevant scientific documents. The term \textit{`short'} signifies a query length comparable to the length of research titles. The candidates are constructed from either title (T) or title and abstract (T+A) text. We, further, make small alterations to the candidate text to construct \textit{`textual neighbors'}. The textual neighbors can be syntactically, semantically, or structurally similar to the candidate text. Unlike previous works that explore textual neighbors to analyze and stress test complex models (Q\&A, Sentiment, NLI, NER~\citep{rychalska2019models}), we experiment directly with representation learning models and analyze the placement of textual neighbors in their embedding space. While semantically similar neighbors are frequently used in previous works~\citep{ribeiro-etal-2018-semantically}; we also explore \textit{semantically dissimilar} textual neighbors to analyze scientific language models. While an LM is expected to represent semantically similar texts with high similarity, some orthographically similar but semantically dissimilar texts can have highly similar embeddings, which is undesirable behavior. Note that we restrict the current query set to titles for two main reasons: (i) most real-world search queries are shorter in length, and (ii) flat keyword-based search lacks intent and can lead to erroneous conclusions. \begin{table}[!t] \centering \resizebox{\columnwidth}{!}{ \small{ \begin{tabular}{lp{0.13\columnwidth}l} \rowcolor{Gray} \multicolumn{1}{l}{\textbf{O-S}} & \multicolumn{1}{l}{\textbf{Neighbor Code}} & \multicolumn{1}{l}{\textbf{Form}} \\ \hline LL-PS & T\_ARot & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Rotate\end{tabular} \\ \hline LL-PS & T\_AShuff & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Shuffle\end{tabular} \\ \hline LL-PS & T\_ASortAsc & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Sort Ascending\end{tabular} \\ \hline LL-PS & T\_ASortDesc & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Sort Descending\end{tabular} \\ \hline LO-PS & T\_ADelRand & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Random word deletion 30\%\end{tabular} \\ \hline LO-PS & T\_ADelADJ & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all ADJs\end{tabular} \\ \hline LO-DS & T\_ADelNN & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all NNs\end{tabular} \\ \hline LO-PS & T\_ADelVB & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all Verbs\end{tabular} \\ \hline LO-PS & T\_ADelADV & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all ADVs\end{tabular} \\ \hline LO-PS & T\_ADelPR & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all PRs\end{tabular} \\ \hline LO-HS & T\_ADelDT & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all DTs\end{tabular} \\ \hline LO-PS & T\_ADelNum & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all Numbers\end{tabular} \\ \hline LO-DS & T\_ADelNNPH & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all NN Phrases\end{tabular} \\ \hline LO-PS & T\_ADelTopNNPH & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete top 50\% NPs\end{tabular} \\ \hline LO-HS & TDelADJ\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all ADJs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline LO-HS & TDelNN\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all NNs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline LO-HS & TDelVB\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all VBs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline LO-HS & TDelDT\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all DTs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline LO-DS & TDelNN & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all NNs\\ Abs $\rightarrow$ Delete\end{tabular} \\ \hline LO-PS & T\_ADelQ1 & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete quantile 1\end{tabular} \\ \hline LO-PS & T\_ADelQ2 & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete quantile 2\end{tabular} \\ \hline LO-PS & T\_ADelQ3 & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete quantile 3\end{tabular} \\ \hline LL-HS & TNNU\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Uppercase NNs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline LL-HS & TNonNNU\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Uppercase non NNs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline LL-HS & T\_ANNU & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Uppercase NNs\end{tabular} \\ \hline LL-HS & T\_ANonNNU & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Uppercase non NNs\end{tabular} \\ \hline LO-PS & T\_A\_DelNNChar & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete chars from NNs\\ Abs $\rightarrow$ Delete chars from NNs\end{tabular} \\ \hline LO-HS & TRepNNT\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Add a NN from title\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline LO-HS & TRepNNA\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Add a NN from abs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline LO-DS & T\_ADelNonNNs & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all non NNs\end{tabular} \\ \hline LO-DS & T\_ARepADJ & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Replace ADJs with antonyms\end{tabular} \\ \hline LL-HS & T\_A\_WS & \begin{tabular}[c]{@{}l@{}}Randomly replace 50\% whitespace \\ chars with 2-5 whitespace chars\\ in the title \& abstract\end{tabular} \\ \hline \end{tabular} }} \caption{Neighbor code is in format Txx\_Ayy\_zz, where xx and yy denote the perturbation to the paper title (T) and the abstract (A) respectively. zz denotes perturbation to both T and A. Missing T or A denotes that the corresponding input field is deleted completely.} \label{tab:tneighbors} \end{table} Textual neighbors have a similar word form or similar meaning. We observe that Textual neighbors possess the following properties based on two aspects: (i) Orthography (surface-level information content of text in terms of characters, words, and sentences), and (ii) Semantics. These two aspects are integral for a pair of texts to be textual neighbors. The properties of these aspects are: \begin{enumerate} \item \textbf{Orthography}: Orthographic-neighbors are generated by making small surface-level transformations to the input. Based on the textual content, neighbors can be generated by: \begin{enumerate}[noitemsep,nolistsep] \item \textbf{\textit{Lossy Perturbation (LO)}}: `Lossy' behavior indicates that the information from the original text is lost, either due to addition or deletion of textual content. E.g., random deletion of 2--3 characters from a word. \item \textbf{\textit{Lossless Perturbation (LL)}}: `Lossless' behavior indicates that the original information content is unaltered. E.g., shuffling sentences of a paragraph. \end{enumerate} \item \textbf{Semantics}: Textual neighbors can either be semantically similar or not. While semantic categories are subjective, we try to define them objectively: \begin{enumerate}[noitemsep,nolistsep] \item \textbf{\textit{Dissimilar (DS)}}: Semantically dissimilar neighbors are generated by deletion of nouns (NNs) or noun phrases (NPs), or by changing the directionality of text such as replacing adjectives (ADJs) with antonyms. \item \textbf{\textit{Partially Similar (PS)}}: Partially similar neighbors are constructed by sentence level modifications such as sentences scrambling (while preserving the word order in each sentence), word deletion of non-NNs (or NPs), or character deletion in words (including NNs) such that the textual neighbor preserves at least 70\% of the words in the original text. \item \textbf{\textit{Highly Similar (HS)}}: Highly similar neighbors are constructed by (i) non-word-semantic changes such as changing the case of words or altering the whitespace characters, (ii) word deletions or additions such that the textual neighbor preserves at least 90\% of the words in the original text. Note that deletion of NNs only from the title while preserving the abstract will qualify to be the \textit{HS} category. \end{enumerate} \end{enumerate} Since SPECTER and OAG-BERT utilize paper titles and abstracts to learn embeddings, we generate textual neighbors by altering texts of these two input fields. We present 32 textual neighbor types in Table~\ref{tab:tneighbors}. Each of these 32 neighbor types is categorized into one of the five categories: LO-HS, LO-PS, LO-DS, LL-HS, and LL-PS. We exclude the LL-DS category (e.g., scrambling all words in the text) as it is infrequent and less probable to occur in a real-world setting. Examples of the textual neighbors are presented in Appendix~\ref{sec:app_tneigh} (Table~\ref{apptab:examples_tneig}). \begin{table}[!tb] \newcolumntype{L}{>{\centering\arraybackslash}p{0.11\linewidth}} \newcolumntype{K}{>{\centering\arraybackslash}p{0.38\linewidth}} \centering \resizebox{\columnwidth}{!}{ \small{ \begin{tabular}{lLKr} \hline \rowcolor{Gray} \textbf{Dataset} & \textbf{Domain} & \textbf{SubDomain} & \textbf{\#Papers} \\ \hline \textbf{ACL-ANTH} & CS & NLP & 35,482 \\ \hline \textbf{ICLR} & CS & Deep Learning & 5,032 \\ \hline \textbf{Arxiv-CS-SY} & CS & Systems and Control & 10,000\\ \hline \textbf{Arxiv-MATH} & MT & Algebraic Topology & 10,000\\ \hline \textbf{Arxiv-HEP} & HEP & HEP Theory & 10,000\\ \hline \textbf{Arxiv-QBIO} & QB & Neurons and Cognition & 6,903 \\ \hline \textbf{Arxiv-ECON} & ECO & Econometrics, General \& Theoretical Economics & 4,542 \\ \hline \end{tabular}} } \caption{Dataset Statistics} \label{tab:dataset} \end{table} \begin{figure}[!t] \centering \begin{tabular}{l} \includegraphics[width=1.0\columnwidth]{figures/exp_config.png} \end{tabular} \caption{Alternative-Self Retrieval schemes for (a) Sec.~\ref{sec:short-text} Task I, (b) Sec.~\ref{sec:short-text} Task II, and (c) Sec.~\ref{ssec:altret_tneigh}. Green represents the relevant candidate document for the query. The query is a subset of the relevant candidate document in schemes (a) and (b), and a textual neighbor of the relevant candidate in scheme (c).} \label{fig:altret_scheme} \end{figure} \section{Experiment Design} \label{sec:exp_design} \noindent \textbf{The Alternative-Self Retrieval:} We propose an embarrassingly simple binary retrieval scheme which contains only one relevant document in the candidate set. Alternative-Self Retrieval refers to the characteristic that the query is an altered version of the relevant candidate document. E.g., the candidate documents are the embeddings of paper title and abstract (henceforth T+A) and the query is embedding of title. We present a schematic of three Alternative-Self Retrieval schemes in Figure~\ref{fig:altret_scheme}. The retrieval is simple and we measure performance with accommodating metrics discussed in this section further. Our purpose is to analyze scientific LM embeddings under the most relaxed conditions. \noindent \textbf{The Datasets:} We evaluate the scientific LMs on seven datasets (statistics in Table~\ref{tab:dataset}) to understand their effectiveness in encoding documents from diverse research fields. Each dataset contains the titles and abstracts of papers. We curate the ACL Anthology dataset\footnote{https://aclanthology.org/} and the ICLR dataset from OpenReview\footnote{https://openreview.net/group?id=ICLR.cc}. To control the size of the ACL Anthology dataset, we exclude papers from workshops and non-ACL venues. We also curate five datasets from arXiv for the domains Mathematics (MT), High Energy Physics (HEP), Quantitative Biology (QB), Economics (ECO), and Computer Science (CS). We make available our code and dataset for public access\footnote{https://github.com/shruti-singh/scilm\_exp}. \noindent \textbf{The Notations:} \textbf{$\mathcal{D}$} is the set of seven datasets described in Table~\ref{tab:dataset}. \textbf{$\mathcal{X}$} is the set of original input texts to the scientific LMs consisting of the paper title (T) and the abstract (A). For d $\in \mathcal{D}$, $\mathcal{X}$ = \{$x_j: x_j = \mbox{(T+A)}(p)$, where $\mbox{(T+A)}(p)=$ concat(title($p$), abstract($p$), $\forall \mbox{ paper }p \in$ d\}. $f$ represents the type of textual neighbor (represented by the neighbor code presented in Table~\ref{tab:tneighbors}). $\mathcal{Q}$ and $\mathcal{R}$ are the query and candidate set for the IR task. \noindent \textbf{Evaluation Metrics:} We report performance scores on the following retrieval metrics: \newline \underline{\emph{Mean Reciprocal Rank (MRR)}}: All our tasks use binary relevance of documents to compute MRR. \newline \underline{\emph{T100}}: It represents the percentage of queries which retrieve the one and only relevant document among the top-100 documents. \newline \underline{\emph{NN\textit{k}\_Ret}}: \% of queries in textual neighbor category whose k nearest neighbors (k-NN) retrieve the original document. \newline \underline{\emph{AOP-10}}: Average overlap percentage among 10-NN of x and y, where x = T+A($x_j$) and y = $f(x_j)$. $f$ is a text manipulation function, represented by the textual neighbor codes presented in Table~\ref{tab:tneighbors}. \newline \begin{table*}[!tb] \centering \small{ \begin{tabular}{l||cc|cc|cc||cc|cc|cc} \hline & \multicolumn{6}{c||}{\textbf{Task I:} $\mathcal{R} = \mathcal{X}$} & \multicolumn{6}{c}{\textbf{Task II:} $\mathcal{R} = \mathcal{X}$ $\cup$ T($\mathcal{X}$)} \\ \hline & \multicolumn{2}{c|}{\textbf{SciBERT}} & \multicolumn{2}{c|}{\textbf{SPECTER}} & \multicolumn{2}{c||}{\textbf{OAG-BERT}} & \multicolumn{2}{c|}{\textbf{SciBERT}} & \multicolumn{2}{c|}{\textbf{SPECTER}} & \multicolumn{2}{c}{\textbf{OAG-BERT}} \\ \hline & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} \\ \hline \rowcolor{Gray} \textbf{Arxiv-MATH} & 0.007 & 5.7 & \textbf{0.596} & \textbf{90.5} & 0.143 & 25.1 & 0 & 0 & \textbf{0.276} & \textbf{64.2} & 0.133 & 31.2 \\ \hline \textbf{Arxiv-HEP} & 0.006 & 5.8 & \textbf{0.693} & \textbf{92.4} & 0.182 & 29.7 & 0 & 0 & \textbf{0.354} & \textbf{75.7} & 0.193 & 39.0 \\ \hline \rowcolor{Gray} \textbf{Arxiv-QBIO} & 0.008 & 6.6 & \textbf{0.789} & \textbf{97.5} & 0.187 & 33.0 & 0 & 0.2 & \textbf{0.507} & \textbf{90.6} & 0.194 & 36.1 \\ \hline \textbf{Arxiv-ECON} & 0.009 & 10.4 & \textbf{0.783} & \textbf{96.2} & 0.177 & 32.5 & 0 & 0.1 & \textbf{0.519} & \textbf{87.5} & 0.176 & 37.2 \\ \hline \rowcolor{Gray} \textbf{Arxiv-CS\_SY} & 0.011 & 5.0 & \textbf{0.859} & \textbf{99.2} & 0.186 & 32.1 & 0 & 0.2 & \textbf{0.553} & \textbf{92.9} & 0.163 & 34.0 \\ \hline \textbf{ICLR} & 0.004 & 5.5 & \textbf{0.586} & \textbf{91.5} & 0.140 & 29.8 & 0 & 0 & \textbf{0.221} & \textbf{66.5} & 0.128 & 33.0 \\ \hline \rowcolor{Gray} \textbf{ACL-ANTH} & 0.002 & 2.3 & \textbf{0.739} & \textbf{94.3} & 0.138 & 26.5 & 0 & 0 & \textbf{0.315} & \textbf{77.0} & 0.101 & 27.3 \\ \hline \end{tabular}} \caption{For both Task I and Task II, SPECTER consistently performs the best on all datasets. For Task II, drop in MRR and T100 scores for SPECTER is significant in comparison to Task I.} \label{tab:exp1exp2} \end{table*} \begin{figure*}[!thb] \centering \begin{subfigure}[b]{0.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/tsne_plots/tsne2d_ICLR_scibert.png} \caption{SciBERT} \end{subfigure} \hfill \begin{subfigure}[b]{0.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/tsne_plots/tsne2d_ICLR_specter.png} \caption{SPECTER} \end{subfigure} \hfill \begin{subfigure}[b]{0.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/tsne_plots/tsne2d_ICLR_oagbert.png} \caption{OAG-BERT} \end{subfigure} \caption{t-SNE plots for T and T+A embeddings for the ICLR dataset. Completely non-overlapping embeddings for T and T+A by SciBERT model highlight differences in encoding texts of varying lengths.} \label{fig:e2_tsne} \end{figure*} \begin{figure}[!t] \centering \begin{subfigure}[b]{0.48\columnwidth} \centering \includegraphics[width=\textwidth]{figures/exp4_2/HS_ACL.png} \end{subfigure} \hfill \begin{subfigure}[b]{0.48\columnwidth} \centering \includegraphics[width=\textwidth]{figures/exp4_2/HS_ArxivECON.png} \end{subfigure} \caption{Percentage of pair of documents for each Textual Neighbor whose similarity is greater than the average similarity. OAG-BERT has high inter similarity ($>$ 50\%), i.e. more than 50\% document pairs have cosine similarity greater than average similarity.} \label{fig:per_hs} \end{figure} \begin{figure}[!tb] \centering \begin{subfigure}[b]{0.95\columnwidth} \centering \includegraphics[trim={0.1cm 0 0.1cm 0},clip,width=\textwidth]{figures/exp4_1/ACL.png} \end{subfigure} \caption{Inter Similarity of Textual Neighbor Vectors. Bold lines represent the $\mu$ and the $\sigma$ of pairwise similarities. Arrow heads represent min and max values. Pairwise similarities are spread out in a broad range for OAG-BERT, suggesting vectors for textual neighbors are more spread out in the vector space. } \label{fig:geo} \end{figure} \section{Analysing Embeddings for Scientific Document Titles and Abstracts} \label{sec:short-text} In this section, we experiment with the inputs to the scientific language models. Due to free availability and ease of parsing paper title and abstract, majority scientific LMs learn embeddings from the title and the abstract of the paper. However, multiple downstream applications such as document search involve short queries (often keywords). We present two Alternative-Self retrieval experiments to compare the embeddings of paper title (T) with the embeddings of paper titles and abstract (T+A). In both experiments, $|\mathcal{Q}|$ = 1000 queries for each dataset. \newline \newline \textbf{Task I: Querying titles against original candidate documents} \label{sec:exp1} In this Alternative-Self Retrieval setup, given a query q constructed only from the paper title, the system recommends relevant candidate document embeddings constructed from title and abstract both (T+A). This setting is similar to querying in a scientific literature search engine as the search queries are usually short. The motivation behind this experiment is to analyse the similarity among the T and the T+A embedding of a paper (Figure~\ref{fig:altret_scheme}(a)). The experiment details are:\newline \textit{\textbf{Query}}: $\mathcal{Q}$ = \{$q_j$: $x_j \in \mathcal{X}, f$= T, $q_j$=$f(x_j)$\}\newline \textit{\textbf{Candidate Documents}}: $\mathcal{R}$ = \{$x_k$: $x_k \in \mathcal{X}$\}\newline \textit{\textbf{Task}}: For $q_j \in \mathcal{Q}$, rank the candidates based on cosine similarity.\newline \textit{\textbf{Evaluation}}: MRR and T100. For each $q_j$, there is only one relevant document in the candidate set which is the corresponding T+A embedding.\newline We present the results for various models on different domains in Table~\ref{tab:exp1exp2}. The results suggest that SciBERT performs poorly for all domains. OAG-BERT on an average ranks the original document in the range 5-7th position. However, we also observe that even in the best case, only 33\% queries retrieve the original document in the top-100 retrieved candidates. SPECTER, on the other hand performs consistently better than both SciBERT and OAG-BERT. The MRR score suggests that on average, the original document is ranked in the top-2 documents, also has a good T100 score across all domains. However, for around 10\% of the queries in the Arxiv-MATH, Arxiv-HEP, and ICLR datasets, SPECTER does not rank the original relevant document in the top-100 retrieved candidates. \newline \textbf{Task II: Introducing all Titles in the Candidate Set} \label{sec:exp2} To increase the complexity of the previous task, we add all the title embeddings (T) in the candidate set (Figure~\ref{fig:altret_scheme}(b)). We test if the T embeddings are more similar to other titles, or to their corresponding T+A embeddings. \\ \textit{\textbf{Query}}: $\mathcal{Q}$ = \{$q_j$: $x_j \in \mathcal{X}$, $f=$ T, $q_j$=$f(x_j)$\}\newline \textit{\textbf{Candidate Documents}}: For query $q_j$, the candidate set $\mathcal{R}_j$ is defined as, \\ $\mathcal{R}_j$=\{$f(x_i): x_i\in \mathcal{X}, f=\mbox{T, }i\ne j$\} $\bigcup$ \{$x_k$: $x_k \in \mathcal{X}$\} \newline The task and evaluation metrics are same as Task I. Extremely poor values for SciBERT (Table~\ref{tab:exp1exp2}) lead us to examine the vector space of embeddings presented in Figure~\ref{fig:e2_tsne} (t-SNE plots for T and T+A embeddings), revealing that T and T+A embeddings form two non overlapping clusters. Even though the title text is a subset of T+A, SciBERT embeddings are significantly different, suggesting that input length influences SciBERT. This highlights the issue in retrieval for varying length query and candidates. We present the t-SNE plots for other datasets in the Appendix~\ref{sec:app_embscidoc}. SPECTER still performs the best, but a significant drop in MRR and T100 suggests that both T and T+A embeddings tightly cluster together in partially overlapping small groups (can be verified from Figure~\ref{fig:e2_tsne}). However, comparable T100 for OAG-BERT to the previous experiment suggests that the model does not falter when the input text length is small. Ideally, we expect T and T+A embeddings to overlap, indicating that the embeddings of the same paper are closer. The pretraining of these models could be the reason for such distribution of T and T+A embeddings. SciBERT is trained on sentences from full text of research papers, leading to different representations for short (T) and longer (T+A) texts. As SPECTER and OAG-BERT are trained on title and abstract fields both, such non-overlapping behavior is not observed. \section{Analysing Scientific LMs with Textual Neighbors} \label{sec:textual_neighbors} In the previous section, we experimented with different input fields (T vs T+A). In this section, we experiment with the 32 textual neighbors classes (which alter different input fields: T, A, or T+A). We present our results for the following experiments for the five broad categories: LL-HS, LL-PS, LL-DS, LO-HS, and LO-DS. Due to space constraints, we present plots for selective datasets for each of the experiment in the paper. The rest of the plots are presented in Appendix~\ref{sec:app_scilmtneigh}. \subsection{Distribution of Textual Neighbors in the Embedding Space} We measure how textual neighbor embeddings are distributed in the embedding space in each dataset when encoded by the SciBERT, SPECTER, and OAG-BERT model. For each textual neighbor class listed in Table~\ref{tab:tneighbors}, we compute pairwise similarities among all input pairs. A plot of the similarity values for different textual neighbor categories is presented in Figure~\ref{fig:geo} (additional plots in Appendix~\ref{sec:app_simtneighorg}). It can be observed that the pairwise similarities among documents are spread out in a significantly broader range for OAG-BERT than SciBERT and SPECTER on all datasets. The average similarity for all datasets by all models is above 0.5. We do not observe any significant difference in the average similarity for different textual neighbor classes. Interestingly, for the SPECTER model, the minimum similarity is greater than zero for all datasets across all neighbor categories. Document pair similarity via OAG-BERT embeddings have a low average similarity for the LO-DS category. We present the percentage of pair of documents for each Textual Neighbor whose similarity is greater than the average similarity in Figure~\ref{fig:per_hs} (additional plots in Appendix~\ref{sec:app_simtneighorg}). OAG-BERT shows high inter similarity (greater than 50\%) for majority of textual neighbors suggesting that more than 50\% document pairs have a cosine similarity greater than average similarity. For SPECTER vectors, all types of textual neighbors have around 50\% documents pairs having a similarity greater than mean similarity. However, extremely high values of percentage of document pairs having similarity greater than average similarity for the SciBERT model on the ACL dataset, and the OAG-BERT on almost all dataset suggests that majority of the documents in the embedding space are represented compactly for all textual neighbor categories. \\ \begin{figure}[!t] \centering \begin{subfigure}[b]{0.48\columnwidth} \centering \includegraphics[trim={0.2cm 0.2cm 0.1cm 0},clip,width=\textwidth]{figures/exp5/ArxivMATHAT.png} \end{subfigure} \hfill \begin{subfigure}[b]{0.48\columnwidth} \centering \includegraphics[trim={0.2cm 0.2cm 0.1cm 0},clip,width=\textwidth]{figures/exp5/ArxivQBIONC.png} \end{subfigure} \caption{The bottom and the stacked bars represent NN1\_Ret and NN10\_Ret respectively. Results suggest that SciBERT embeddings for textual neighbors of scientific text are the most optimal. } \label{fig:exp5} \end{figure} \begin{figure}[!t] \centering \begin{subfigure}[b]{0.48\columnwidth} \centering \includegraphics[trim={0.1cm 0.1cm 0 0},clip,width=\textwidth]{figures/exp5_2/ArxivMATHAT.png} \end{subfigure} \hfill \begin{subfigure}[b]{0.48\columnwidth} \centering \includegraphics[trim={0.1cm 0.1cm 0 0},clip,width=\textwidth]{figures/exp5_2/ArxivQBIONC.png} \end{subfigure} \caption{Distribution of NN1\_Ret for each textual neighbor category. SciBERT embeddings preserve the hierarchy of NN1\_Ret, i.e. PS categories (LO-PS and LL-PS) have lower values than HS categories (LO-HS and LL-HS). } \label{fig:exp52} \end{figure} \subsection{Similarity of Textual Neighbors with Original Documents} \label{ssec:altret_tneigh} Let $\mathcal{F}$ = \{$f^1$, $f^2$, ..., $f^n$\} be the set of textual neighbor functions described in Table 1. We query different types of textual neighbor classes against the documents embeddings (T+A). We compute the percentage of queries that successfully rank the original document in the top-1 and top-10 ranked list. We expect \textit{HS} and \textit{PS} categories to rank the original document higher in the rank list, and \textit{DS} to rank it lower. If any of the textual neighbor classes or categories don't show the expected behavior, it can be asserted that the LM is brittle in representing the specific type of textual neighbor. \newline \textit{\textbf{Query}}:$\mathcal{Q}$ = $\bigcup\limits_{f \in \mathcal{F}}\mathcal{Q}_{f}$ = $\bigcup\limits_{f \in \mathcal{F}}$\{$q_j$: $x_j \in \mathcal{X}$, $q_j$=$f(x_j)$\}\\ \textit{\textbf{Candidate Documents}}: $\mathcal{R}$ = \{$x_k$: $x_k \in \mathcal{X}$\}\\ \textit{\textbf{Task}}: For $q_j \in \mathcal{Q}$, retrieve the most similar documents based on cosine similarity.\\ \textit{\textbf{Evaluation}}: NN1\_Ret and NN1\_10. There is only one relevant document in the candidate set for each $q_j$, which is the corresponding T+A embeddings.\newline \begin{table*}[!thb] \centering \small{ \resizebox{\hsize}{!}{ \begin{tabular}{|c|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|} \hline \rowcolor{Gray} \textbf{TN Cat} & \multicolumn{3}{c|}{\textbf{LO-HS}} & \multicolumn{3}{c|}{\textbf{LO-PS}} & \multicolumn{3}{c|}{\textbf{LO-DS}} & \multicolumn{3}{c|}{\textbf{LL-HS}} & \multicolumn{3}{c|}{\textbf{LL-PS}} \\ \hline \rowcolor{Gray} \textbf{Model} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} \\ \hline \textit{ACL-ANTH} & 51.8 & \textbf{68.9} & 4.4 & 20.5 & \textbf{61.8} & 4.3 & 12.0 & 35.6 & \textbf{2.2} & 73.0 & \textbf{81.2} & 5.1 & 13.4 & \textbf{72.0} & 5.2 \\ \hline \textit{ICLR} & 52.2 & \textbf{74.6} & 4.7 & 18.6 & \textbf{61.8} & 4.7 & 10.9 & 33.2 & \textbf{2.3} & 71.2 & \textbf{82.2} & 5.5 & 10.8 & \textbf{75.0} & 6.0 \\ \hline \textit{Arxiv-CS\_SY} & 52.8 & \textbf{74.8} & 5.2 & 23.2 & \textbf{66.0} & 5.1 & 11.6 & 40.9 & \textbf{2.6} & 71.7 & \textbf{83.4} & 6.0 & 14.5 & \textbf{77.6} & 6.6 \\ \hline \textit{Arxiv-MATH} & 52.2 & \textbf{67.4} & 5.3 & 23.0 & \textbf{62.1} & 5.3 & 14.5 & 34.5 & \textbf{3.2} & 71.1 & \textbf{80.5} & 6.1 & 31.3 & \textbf{75.4} & 6.6 \\ \hline \textit{Arxiv-ECON} & 59.0 & \textbf{75.3} & 5.8 & 27.0 & \textbf{66.4} & 5.6 & 14.1 & 40.9 & \textbf{2.8} & 71.2 & \textbf{83.2} & 6.4 & 21.4 & \textbf{76.8} & 6.8 \\ \hline \textit{Arxiv-QBIO} & 55.2 & \textbf{74.1} & 5.4 & 23.5 & \textbf{65.1} & 4.9 & 12.1 & 38.7 & \textbf{2.6} & 71.0 & \textbf{82.9} & 5.9 & 17.1 & \textbf{76.4} & 6.3 \\ \hline \textit{Arxiv-HEP} & 53.1 & \textbf{66.2} & 5.9 & 22.9 & \textbf{61.0} & 5.9 & 13.5 & 34.2 & \textbf{3.6} & 71.0 & \textbf{80.0} & 6.8 & 25.4 & \textbf{73.4} & 7.2 \\ \hline \end{tabular}} \caption{AOP-10 values for different categories. The best results for LO-DS category are from OAG-BERT (OB), however that is because the model performs poorly on all categories of textual neighbors. Similarly, best results for the rest four categories are from SPECTER (SP), following which it also has a high overlap percentage for the LO-DS category. SciBERT (SB) embeddings perform the best for HS and DS but falter on PS semantic categories. } \label{tab:nn_overlap} } \end{table*} We present the results in Figure~\ref{fig:exp5}. SciBERT and OAG-BERT for the LO-DS category show less than 50\% NN10\_Ret, which is desirable as LO-DS neighbors are semantically dissimilar, and hence should not be neighbors in the embedding space. SciBERT shows improvement via NN10\_Ret over NN1\_Ret for \textit{PS} categories. High NN1\_Ret for \textit{HS} categories indicates SciBERT successfully encodes highly similar texts closer than partially similar texts. OAG-BERT performs poorly for both metrics, indicating that it doesn't encode textual neighbors optimally. SPECTER embeddings perform poorly on the LO-DS category. They however achieve the maximum values showing no difference between LO vs LL, or HS vs PS categories. To analyse the high values for SPECTER, we present the individual NN1\_Ret for each of the 32 textual neighbor classes in Figure~\ref{fig:exp52} and observe only two classes `TDelNN' and `T\_A\_DelNNChar' which lead to less than 90\% NN1\_Ret. Unlike SPECTER and OAG-BERT, SciBERT preserve the hierarchy, with \textit{Highly Similar} classes ranked higher than \textit{Partially Similar} classes. An interesting case with SciBERT embeddings is that the T\_A\_WS neighbor class belonging to the LL-HS category, has a low NN1\_Ret value across all datasets, suggesting that the SciBERT model is extremely brittle to white space character perturbations (because of the constraint on sequence length). Another breaking point for the SciBERT is the textual neighbor class T\_ARepADJ (replacing adjectives with antonyms) of LO-DS category, which shows high values (around 80\%) for NN1\_Ret which is undesirable. We observe that among the three specific LO-PS categories `T\_ADelQ1', `T\_ADelQ2', and `T\_ADelQ3', SciBERT performs worst for the `T\_ADelQ3', indicating that the last quantile of the abstract contains relevant information encoded by SciBERT. OAG-BERT shows a reverse trend to SPECTER by achieving low values for all neighbors classes indicating brittleness to text manipulation. \begin{figure}[!t] \centering \begin{subfigure}[b]{0.48\columnwidth} \centering \includegraphics[width=\textwidth]{figures/exp6/ArxivCSSY.png} \end{subfigure} \hfill \begin{subfigure}[b]{0.48\columnwidth} \centering \includegraphics[width=\textwidth]{figures/exp6/ArxivECON.png} \end{subfigure} \caption{AOP-10 distribution of all categories of textual neighbors. SciBERT performs poorly for LL-PS (consists of neighbors that scramble abstract sentences). If we ignore LO-DS category, SPECTER embeddings perform decently overall. } \label{fig:exp6} \end{figure} \subsection{Overlap amongst Nearest Neighbors} We compute the overlap amongst the nearest neighbors of each textual neighbor class and the original document embeddings. We randomly sample a query set of 2000 queries for each textual neighbor class (and their corresponding T+A embedding) and compute nearest neighbor (NN) overlap for these. In this task, we are interested in evaluating if NN-based retrieval retrieves the same documents for a textual neighbor class and T+A embedding. \newline \textit{\textbf{Query}}: $\mathcal{Q}$ = $\mathcal{Q}_f \cup{} \mathcal{Q}_{T+A}$ \\ $\mathcal{Q}_f$ = \{$q_j$: $x_j \in \mathcal{X}_{2000}$, $q_j = f(x_j)$\} \\ $\mathcal{Q}_{T+A}$ = \{$q_j$: $x_j \in \mathcal{X}_{2000}$, $q_j = T+A(x_j)$\} \\ \textit{\textbf{Candidate Documents}}: $\mathcal{R}$ = \{$q_j$: $x_j \in \mathcal{X}$, $q_j$=$f(x_j)$\} $\cup{}$ \{$q_j$: $x_j \in \mathcal{X}$, $f=T+A$, $q_j$=$f(x_j)$\} \\ \textit{\textbf{Task}}: For each pair of $q_j, q_k \in \mathcal{Q}$, such that $q_j \in \mathcal{Q}_f$ and $q_k \in \mathcal{Q}_{T_A}$, compute the overlap among ten nearest neighbors (NN-10) of $q_j$ and $q_k$. \\ \textit{\textbf{Evaluation}}: AOP-10.\\ We present the results arranged by Textual Neighbor categories in Table~\ref{tab:nn_overlap}. The individual AOP-10 distribution of all categories of textual neighbors is presented in Figure~\ref{fig:exp6}. While overall results look good for SPECTER, it should be noted that SPECTER performs poorly for embedding LO-DS textual neighbors indicating that it has a shallow understanding of semantics. AOP-10 values for SPECTER show a positive trend: LL-HS $>$ LO-HS and LL-HS $>$ LL-PS. SciBERT performs decently for the \textit{HS} category, but its performance drops for the \textit{PS} categories. OAG-BERT has the lowest AOP-10 for all textual neighbor categories. When put in perspective against the previous NN1\_Ret and NN10\_Ret, we believe that SciBERT performs decently in encoding the HS and PS neighbors closer to the original T+A embedding. However, low value of AOP-10 for SciBERT for PS neighbors reflects that while the PS neighbors are closer to the original document in comparison to others, the original document has other nearest neighbors than the PS neighbor. We present a matrix to summarize the capability of the models in Table~\ref{tab:tneigh_matrix} in encoding the five textual neighbor categories. The five categories arranged in increasing order of semantic similarity are: LL-HS $\geq$ LO-HS $>$ LL-PS $>$ LO-PS $>$ LO-DS. We use heuristic-based values to define optimality. For each of the five categories, we define AOP-20 thresholds to classify if the textual neighbor representations for the corresponding are optimal or not. It is expected that AOP-20 values for semantic categories should be in order: HS $>$ PS $>$ DS. AOP-20 values for orthographic categories should follow: LL $>$ LO. \begin{table}[!t] \centering \resizebox{\columnwidth}{!}{ \small{ \begin{tabular}{|l|c|c|c|c|c|} \hline \rowcolor{Gray} & \textbf{LL-HS} & \textbf{LO-HS} & \textbf{LL-PS} & \textbf{LO-PS} & \textbf{LO-DS} \\ \hline \textbf{Threshold} & $>$ 75 & $>$ 70 & \multicolumn{2}{l|}{50 $<$ AOP-20 $<$ 70} & $<$ 20 \\ \hline \textbf{SciBERT} & \cellcolor{Gray}\textbf{75.04} & 59.62 & 22.6 & 26.28 & 14.35 \\ \hline \textbf{SPECTER} & \cellcolor{Gray}\textbf{86.77} & \cellcolor{Gray}\textbf{77.55} & 80.93 & \cellcolor{Gray}\textbf{69.03} & 41.32 \\ \hline \textbf{OAG-BERT} & 6.84 & 6.24 & 7.31 & 5.95 & \cellcolor{Gray}\textbf{3.17} \\ \hline \end{tabular} }} \caption{Capability of the models in encoding textual neighbor categories optimally in the embedding space. Gray cells represent optimal representations for each model based on AOP-20.} \label{tab:tneigh_matrix} \end{table} \section{Conclusion} We propose five categories of textual neighbors to organize the increasing number of textual neighbor types: LL-HS, LO-HS, LL-PS, LO-PS, and LO-DS. We evaluate SciBERT, SPECTER, and OAG-BERT models on thirty-two textual neighbor classes organized into the previous five categories. We show that evaluation of language models on `Semantically Dissimilar' texts is also important rather than just evaluation on `Semantically Similar' texts. We show that the SciBERT model is highly sensitive to the input length. SPECTER embeddings for all types of textual neighbors are highly similar irrespective of whether the textual neighbor is semantically dissimilar or not. SPECTER embeddings show sensitivity to the presence of specific keywords. Lastly, OAG-BERT embeddings of all categories of textual neighbors are highly dissimilar to the original title and abstract (T+A) embeddings. We believe that our insights could be used to develop better pretraining strategies for scientific document language models and also to evaluate other language models. One example for MLM (or replaced token identification) could be utilizing a weighted-penalty based loss, i.e. partially similar tokens if predicted should be penalized less in comparison to the prediction of unrelated (or dissimilar) tokens. Additionally, these insights could also be utilised by several systems that use these scientific document language models to incorporate informed strategies in downstream systems such as recommendation systems.
d05a74c6279cfecb59b5671db2dcce6f545b2844
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:Intro} Machine Learning (ML) models are nowadays employed in various domains with excellent performance. When the performance is key to having a competitive advantage, ML models are widespread even when the algorithmic procedure is too complicated to be understood by humans (so called ``black box" algorithms). However, in fields where the stakes for a single decision are high (healthcare, banking, etc.)~\cite{Cutillo2020} there is still scepticism in adopting such models. Professionals are accountable for any costly mistake, and in such cases they want to fully understand and trust the outcomes of a ML model. An important element that leads to trust in ML models is to achieve more explainability in ML~\cite{Dzindolet2003}. In recent years, the ML community has therefore been developing tools that help ML practitioners and end-users to understand the predictions of black box models, leading to a booming of the field of Explainable AI (X-AI). As a result, X-AI methods nowadays make up a vast literature and can be categorised in several ways. One way is to distinguish the type of output explanations: \emph{global} explanations~\cite{Friedman2001, Goldstein2015}, where the aim is to identify trends in the data and explain the model as a whole, or \emph{local} explanations \cite{Ribeiro2016, Lundberg2017}, where the aim is to understand why a certain prediction is made for a given instance. Another common differentiation is made based on whether the method has access to the internal components of the model and its architecture. If that is the case, we talk about a \emph{model-specific} approach, as opposed to a \emph{model-agnostic}~(e.g.~\cite{Ribeiro2016, Lundberg2017}) approach. In this study, we propose Bellatrex: a local, model-specific method that condenses the predictions made by a random forest (RF)~\cite{Breiman2001} into a few rules. By doing so, our method uses information directly extracted from the original RF. Furthermore, the procedure is optimised to follow closely the RF predictions for every instance, and maintains the original RF high performance. In addition to high performance, Bellatrex provides different insights by selecting rules that are dissimilar from each other. Furthermore, given its local method, the extracted rules are different for each instance. The choice to specifically explain RF predictions is driven by the fact that RF has a great predictive performance and is easier to train than other highly performing methods, such as deep neural networks. Moreover, RF has been extended to a wide range of learning tasks, including binary classification, multi-label classification, regression and time-to-event prediction. We should highlight that our method is designed in such a way that it is independent of the learning task at hand, and consequently, it is capable of handling all these scenarios. Bellatrex is built on top of a trained RF and consists of four main steps. First, for a given input instance, a subset of rules is selected based on how close their prediction is with respect to the original ensemble. Second, a vector representation is built by extracting information from the rule structure. Third, dimensionality reduction of such representations is performed and lastly, we apply clustering on the projected vector representations, extracting this way only a few prototype rules. These final rules are then presented to the end user as an explanation for the forest prediction. By keeping the number of prototype rules low, we provide a few diverse explanations, which can be inspected by the user. Preliminary results of this work were presented in an earlier workshop paper~\cite{Dedja2021} and were restricted to binary and time-to-event predictions. Here, we extend this work to regression (both single- and multi-target) and multi-label classification. Furthermore, we also provide a thorough experimental evaluation of our method against competitor methods from the literature in predictive performance, explanation complexity and explanation diversity, followed by an ablation study which validates the steps in our method. Overall, our contributions to the field of X-AI can be summarised as follows: \begin{itemize} \item We propose a local approach for explaining RF predictions, with a method that extracts a few meaningful decision paths from a trained RF. Importantly, the extracted rules are tailored to the instance to be explained, which represents, to the best of our knowledge, a novelty in the field of explaining RF predictions. \item We evaluate our local explainer in five different scenarios: binary classification, single- and multi-target regression, multi-label classification and time-to-event prediction, where the latter three are seldom explored in existing explainability methods. The inclusion of the time-to-event analysis in particular, highlights a novelty of our work since, to the best of our knowledge, no existing model-specific interpretability method is compatible with an adaptation of RF to time-to-event scenarios. \item We make our method available to the ML community by providing a Python implementation through GitHub\footnote{https://github.com/Klest94/Bellatrex}, compatible with the scikit-learn and scikit-survival Python libraries. \end{itemize} The remainder of the manuscript is organised as follows: Section~\ref{sec:Related-work} positions our work within the framework of post-hoc, RF-specific explainers, and underlines the differences with the existing literature; Section~\ref{sec:Background} provides the background information for the method section (Section~\ref{sec:Method}), where our model is introduced. These are followed by Section~\ref{sec:Experiments}, dedicated to the experimental set-up and Section~\ref{sec:Results}, where the predictive performance of the method, the average complexity of the extracted rules, and the average dissimilarity of the latter are reported together with the outcomes of the ablation study. Next, we provide two examples of explanations generated by Bellatrex in Section~\ref{sec:Examples}. Finally, we draw our conclusions and share future directions of this work (Section~\ref{sec:Conclusion}). \section{Related work} \label{sec:Related-work} As previously mentioned, Bellatrex falls in the category of local, model-specific methods, and in particular, Bellatrex explains the outcomes of a trained random (survival) forest model in a post-hoc fashion. Such family of RF-specific methods has produced a rich literature as shown in~\cite{Aria2021, Haddouchi2019}, and can be categorised in three sub-categories, namely: \emph{size reduction}, \emph{rule extraction}, and \emph{local explanation}. In this section, we discuss other model-specific approaches that use RFs as the underlying black-box model. The earliest example of such is~\cite{Chipman1998}. This work proposed a procedure for analysing a RF in binary classification tasks, and concepts such as \emph{tree-metric}, a distance metric defined on the space of tree learners, are also introduced. Trees are then represented in a two-dimensional space by using Multi Dimensional Scaling~\cite{Mead1992} on the tree-distance matrix. The authors then perform a qualitative study and mention the possibility of clustering the resulting tree representations. A more recent work by~\cite{Sies2020} followed the path traced by~\cite{Chipman1998} by suggesting a range of tree similarity metrics and by performing clustering on such tree representations. Furthermore, the authors implicitly propose a vector representation of trees based on the covariates used to build them and it consists of an adaptation of the approach from~\cite{Banerjee2012}. Given such representation, the authors clustered and extracted a few trees out of a random forest and illustrate the validity of their framework ``C443" on simulated and real world datasets. The resulting method has some features in common with ours, namely, the idea of representing tree- (or rule-) distances for clustering purposes. However, the focus in C443 lays more on giving an overview of the possible approaches rather than optimising the performance of a surrogate model. Furthermore, the C443 method aims at global explanations (e.g. by looking at trends and sources of heterogeneity), rather than focusing at an instance-base level. Later work by~\cite{Zhao2019} (``iForest") made use of a tree-distance metric intuition to project tree paths via t-SNE~\cite{hinton2002}, and made also use of visual analytics to improve interpretability. These visuals include a ``feature view" that shows the relationship between a selected covariate and a prediction (similarly to a Partial Dependency plot~\cite{Friedman2001}) as well as a control panel that just lets the user see the decision paths that lead to the prediction of a group of instances. Unlike Bellatrex, there is no rule extraction or forest approximation mechanism and none of the original learners are shown to the end user. Other relevant approaches include~\cite{Moore2018}, where the authors presented a method for computing how a covariate within a value range influences the final prediction of a model, while an optimisation-based approach that exploits the bijective relationship between a tree leaf and a subspace of the input space is proposed by~\cite{Hara2018}. Similarly, recent work~\cite{LionForest, multilabel-LionForest} proposes a method called ``LionForest", where rules are generated in a local approach fashion, and path reduction approaches are run in order to provide shorter rules with more ``conclusive" (i.e., stable) explanations. A toolbox named ``SIRUS" is proposed in~\cite{Benard2021}, where a set of rules is extracted from an RF and shown as an explanation. More specifically, rules are first generated by large RF and a pre-selection step picks the most commonly occurring ones. After that, a ``post-treatment" step narrows down the selection by eliminating rules associated to a linear combination of other rules of higher frequency. The procedure stops when the desired number of final rules is reached and is then shown to the end user. These final rules serve as an explanation of the original RF and their average prediction can be used as a the prediction of the obtained surrogate model. The resulting explanation is global and consists of a limited number of rules that are stable under different subsets of data, and whose outcome can be averaged to get a prediction. More recently, ``RuleCOSI+"~\cite{RuleCOSI+} has been proposed as another global, rule-extraction (according to the categorisation by~\cite{Aria2021}) method that greedily combines and simplifies the corresponding base trees. More specifically, the algorithm builds a decision list by iteratively creating new rules by merging or pruning the ones generated by the tree ensemble. At the end of each iteration step, the generated rule is added to the existing list under the condition that it is beneficial to the generalisation performance. When no extra rules can be added, an empty rule (playing the part of an ``else" instance) is appended, and the final model consists of the set of rules found, structured as members of a decision list. That is, for a given instance to be explained, the rules are evaluated in order of appearance until one of them is found to hold and is used as the models' prediction. If no rules are fired, the final (``empty") rule is used to make the prediction. Finally, a size-reduction, global approach is represented by ``Hierarchical Shrinkage"~\cite{HS2022} (HS) algorithm. The idea is to increase performance and robustness of tree learners by shrinking the predictions of any leaf node towards the predictions of its ancestors. The shrinking operation is performed repeatedly and is controlled by a regularisation parameter. The resulting tree has a size that can be controlled and offers a global explanation to the model. It is worth mentioning that the aforementioned RF-specific, post-hoc explainability methods follow a global approach and therefore show the same explanation regardless of the input instance. Bellatrex, on the other side, follows a local approach that adapts its explanations to the instance of interest. This leads to an increased flexibility of the output explanation and allows Bellatrex to closely follow the predictions of the underlying RF. \section{Background} \label{sec:Background} Random forest~\cite{Breiman2001} (RF) is a computationally efficient ML method that delivers excellent predictive performance, and since its appearance, RFs have been extremely successful in performing classification and regression tasks. Moreover, RFs have been extended to a variety of other learning tasks, including multi-label classification~\cite{Vens2008} and survival analysis~\cite{Ishwaran2008}. Most of the extensions that have been proposed over the years are associated with the node splitting mechanism as well as the prototype function (i.e., the function that provides predictions in the leaves), while less modifications have been proposed for other RF characteristics, such as the bootstrapping. A common splitting criterion for RFs in binary classification is the Gini impurity index, whereas a common prototype function returns the most frequent class label among training instances falling in the leaf. For single-output regression tasks, the splitting rule that maximally reduces within-node variance in the target values is usually chosen, and the average target value is returned as prediction. In multi-label classification, a single instance may belong to multiple classes and, hence, the task is to predict the correct subset of class labels for each instance. Multi-label classification has many applications, including text classification, image annotation, protein function prediction, etc. Several machine learning methods have been adapted to multi-label classification, including random forests~\cite{Kocev2013, Pedregosa2011}. In order to take into account the multiple labels, the splitting criterion is adapted by maximising either the average impurity reduction~\cite{Pedregosa2011} or average variance reduction~\cite{Vens2008}, across all the (binary) labels. These criteria implicitly take into account label dependence and are often preferred to methods that train output labels independently~\cite{Kocev2013}. In both cases, the leaves return a vector, where each component represents the proportion of instances annotated with the corresponding label. Similarly, RF have been adapted to multi-target regression tasks, where multiple continuous targets are predicted at once. In this case, the reduction in within-node variance is computed for all targets and the average is taken. Survival analysis is a branch of statistics that has only recently been explored in the machine learning community~\cite{Wang2019}. The goal of such analysis is to predict the time until an event occurs (hence, this task is also known as time-to-event prediction). Applications include clinical studies, where the outcome of interest is the time until a patient dies, suffers from complications, is discharged from hospital, etc. A key challenge in this field is the so called \emph{censoring} effect, that is when the exact time of the event is not observed, resulting in partial information. For instance, in the case of right censoring, which is the type of censoring included in our study, the recorded event time is an underestimate of the true time. This may for instance occur when a patient drops out from the study or has not reached the outcome event before the study ends. Decision trees and random forests (as well as other machine learning methods) have been adapted to survival data, they are called (Decision) Survival Trees~\cite{LeBlanc1993} and Random Survival Forests (RSF)~\cite{Ishwaran2008}, respectively. The main splitting criterion being used is the \emph{logrank} score~\cite{Peto1972}, a criterion that guarantees good generalisation for censored time-to-event data~\cite{Ishwaran2008}. This criterion aims at splitting the population in maximally different subgroups with maximally different hazard functions. At each leaf node, a Kaplan-Meyer~\cite{KaplanMeyer1958} estimate of the survival function for the population that falls in that node is built. \section{Proposed Method} \label{sec:Method} Let $\mathcal{T}$ be a random forest and let $\bm{x}$ be an instance for which we want to find an explanation. Bellatrex uses these inputs to generate an explanation, and an overview of the procedure is illustrated in Figure~\ref{fig:method}. \begin{figure*}[ht] \centering \includegraphics[width=0.9\textwidth]{Method_main_figure.pdf} \caption{Schematic representation of the steps in Bellatrex. Given a trained RF and an instance (top left), a pre-selection is performed (top), followed by the vectorisation step. Such vectors are projected (top right) and clustered (bottom right), the final selected rules are shown to the end-user (bottom left).} \label{fig:method} \end{figure*} We first extract $\tau$ trees $\mathcal{T}_i \in \mathcal{T}$ that generate the most similar predictions $\mathcal{T}_i(\bm{x})$ compared to the ensemble model prediction $\hat{y} = \mathcal{T}(\bm{x})$. Next, we represent each of the selected trees $\mathcal{T}_i$ as a vector; this vector can be a function of the tree structure, or solely depend on the path traversed by $\bm{x}$. Only a few studies~\cite{Chipman1998, Sies2020} have addressed the issue of representing decision trees as a numerical vector, and they only focus on global representations. Given the local nature of Bellatrex, we propose two path-based approaches, where we follow the instance of interest $\bm{x}$ as it traverses the tree and record the input covariates used to perform each split. In the first approach, which we call \emph{simple}, the vector representation $[f_1, f_2, \dots, f_p]$ consists of the number of times each of the $p$ covariates is selected to perform a split along the path traversed by~$\bm{x}$. In formulas: \begin{equation} \label{eq:path-based} \begin{split} \mathcal{T}_i, \bm{x} \mapsto & \bm{f} =[ f_{1}, f_{2}, \dots, f_{p}], \text{ where} \\ f_i = & \sum_{k \in \text{path$(\bm{x})$}} \mathbbm{1} \{\text{split on covariate $i$}\}. \end{split} \end{equation} Unlike the tree-based approach that arises from~\cite{Sies2020}, the path-based vector representation of $\mathcal{T}_i$ depends on the instance of interest $\bm{x}$ and is therefore more tailored to the local nature of Bellatrex. A drawback of this representation is that splits have the same contribution regardless of the importance they have in the final predictions, whereas splits performed close to the root node should be considered as more important than the ones close to a leaf. To tackle this, we also propose a \emph{weighted} version of the previous approach, where the contribution of each node-split $k$ is weighted by the proportion of instances $\omega_k$ traversing the node. In formulas, the representation becomes: \begin{equation} \label{eq:weighted-path-based} \begin{split} \mathcal{T}_i, \bm{x} \mapsto & \bm{g} =[g_{1}, g_{2}, \dots, g_p], \text{ where} \\ g_i = & \sum_{k \in \text{path$(\bm{x})$}} \omega_k \cdot \mathbbm{1}\{ \text{split on covariate $i$}\}. \end{split} \end{equation} It is worth noting that the resulting weights are positive and upper bounded by 1, which is the weight assigned to the root node split, furthermore, the assigned weights decrease as the depth increases. By doing so, rules that differ (only) in the root node splitting covariate will be further apart in Euclidean distance compared to the ones whose decision paths differ (only) in the deeper nodes, which is in agreement with common intuition. Next, we project such vector representations to a low-dimensional space using Principal Component Analysis (PCA)~\cite{Pearson1901}. The idea is to remove the noise, to improve computational efficiency for later steps, and to enable a better visualisation of the subsequent clustering. The representations are real-valued vectors of length $d$ at this stage, where $d$ is the number of output dimensions of the PCA. In order to obtain a diverse set of explanations, as the next step, we perform clustering on the vector representations using a standard clustering method, such as K-Means++~\cite{vassilvitskii2006} (see an example in Figure~\ref{fig:plot-clusters}). By doing so, we group the vectors into $K$ clusters, we identify the vector closest to each cluster centre and pick the corresponding rule as a representative for explaining the outcome of the model. The rules extracted with this procedure correspond to what we call \emph{final rules}, and the nature of the partitioning step guarantees the distance among the vector representations of the selected final rules is maximal. It is worth noting that similar results can be obtained with other partitioning algorithms such as K-median~\cite{park2009}, as long as the aim of the algorithm is to maximise between-cluster distance. Finally, given the $K$ clusters, the corresponding final rules $\mathcal{T}_{\tau_k}$, and the instance $\bm{x}$, we build a surrogate model prediction $\bar{y}$ as follows: \begin{equation} \label{eq:weighted-avg} \bar{y} = \sum_{k=1}^K w_k \mathcal{T}_{\tau_k}(\bm{x}) \end{equation} where $w_k$ represents the weight given to the cluster $k$. We define $w_k$ as the proportion of the $\tau$ rules (selected in the first step) that are part of the cluster. It follows that $\sum w_k = 1$, and that the surrogate model predicts a weighted average of the selected rules. \begin{figure}[ht] \centering \includegraphics[width=0.95\columnwidth]{plot_blood_i65_v2.png} \caption{Left side: Example of the clustering step following rule pre-selection, vectorisation and PCA for the ``blood" dataset (Section~\ref{sec:performances} for details) and a test instance $\bm{x}$. The centroids of the K-Means++ algorithm are shown in grey, and the final representative rules are plotted with a star shape. Right side: individual rule predictions and Bellatrex final prediction for $\bm{x}$.} \label{fig:plot-clusters} \end{figure} Our method requires three hyperparameters: the number of trees $\tau$ to keep in the pre-selection phase, the number of output components $d$ for PCA, and the number of clusters $K$. The optimal values can be tuned for each test instance separately, by calculating the \textit{fidelity} of the surrogate model to the original ensemble. This measure is an indicator of how closely the original ensemble prediction is being imitated by our surrogate model, and has recently been listed~\cite{Guidotti2018} as a desirable property for interpreting black-box models. Given an instance $\bm{x}$, the prediction made by the original R(S)F $\hat{y}$ and the new surrogate prediction $\bar{y}$, we define and compute fidelity $\mathcal{F}(\bm{x})$ as: \begin{equation} \label{eq:fidelity} \mathcal{F}(\bm{x}) = 1 - \Vert \hat{y} - \bar{y} \Vert_2. \end{equation} Depending on the predictive scenario, $\hat{y}$ and $\bar{y}$ are either scalars for predicted probabilities (binary classification), estimated scalar values (regression), vectors of predicted class probabilities (multi-label classification) or real valued-vectors (multi-target regression), or scalar predicted risk scores (survival analysis). Note that $\mathcal{F}(\bm{x}) = 1$ for a given instance $\bm{x}$ indicates perfect fidelity of Bellatrex to the original model. As a result, the hyper-parameter combination $(\bar{K}, \bar{d}, \bar{\tau})$ that maximises $\mathcal{F}$ can be chosen. An important advantage of our method is that it does not require an external validation set to tune these hyperparameters; the proposed method looks instead at the \emph{predicted} labels from the underlying RF model which at this stage serves as an oracle, in a procedure similar to the one described in~\cite{Zhou2016}. The hyperparameters that, for a given test instance, yield the prediction closest to the underlying RF prediction are the ones selected. By doing so, we increase the fidelity of the surrogate model to the underlying black box, and we concurrently allow a more efficient use of data, since a greater fraction of it can be used to train the underlying model instead of being left aside for the purpose of hyperparameter tuning. Alternatively, the parameter values can be determined by the user. In the latter case, end-users have the option to choose, for example, the number of clusters and thus, explore the trade-off between having a simple (single) explanation against obtaining multiple (different) explanations for a given example. \subsection{Computational complexity} We now analyse the computational complexity of Bellatrex. Given the number of data instances $n$, the number of covariates $p$, and the number of learners $m$, the computational complexity of Bellatrex can be estimated by looking at the complexity of its four main steps: \begin{itemize} \item The sorting algorithm for rule pre-selection, with complexity $\mathcal{O}(m\log m)$; \item The vectorisation process of the pre-selected rules: $\mathcal{O}(m \log n)$; \item The dimensionality reduction step, performed with PCA, with $\mathcal{O}(n_{max}^2 n_{min})$~\cite{PCA}, where $n_{max}=\max(m,p)$ and $n_{min}=\min(m,p)$. \item partitioning algorithm, namely K-Means++, with $\mathcal{O}(p m)$, followed by a nearest neighbour search, performed with KDTree~\cite{KDTree}, with $\mathcal{O}(p m \log(m))$. \end{itemize} We conclude that the computational complexity of Bellatrex is mainly driven by the dimensionality reduction step. Translating the above analysis into practice, we observe that querying Bellatrex for an explanation is quite fast and takes a couple of seconds to run on a laptop. Moreover, we notice that Bellatrex is sensitive to dataset size, but not so much to the number of trees $m$ of the underlying RF learner, which is typically $m=100$. \section{Experiments} \label{sec:Experiments} We evaluate our method (with simple and weighted vector representations) across multiple datasets; unless otherwise specified, the datasets are selected from publicly available repositories such as UCI\footnote{https://archive.ics.uci.edu/ml/datasets.php} and MULAN\footnote{http://mulan.sourceforge.net/datasets-mlc.html} or downloaded from \textsf{sklearn}'s library. Overall, we include as many as 89 datasets spanning five different prediction scenarios, more specifically: \begin{itemize} \setlength{\itemsep}{0pt} \item 24 datasets for binary classification; \item 14 datasets for survival analysis (time-to-event prediction); \item 19 datasets for regression; \item 13 datasets for multi-label classification; \item 19 datasets for multi-target regression. \end{itemize} \subsection{Data and pre-processing} We report an overview of the datasets used for our study, where information about the number of data instances, the number of covariates, and the format of the output labels is included. For the binary classification case, the frequency of the positive class is reported, whereas for the time-to-event data we report the censoring rate. For tasks involving a vector prediction (multi-label classification and multi-target regression), we report the number of labels (or targets) to be predicted. A number of pre-processing steps were performed before running the experiments in Section~\ref{sec:Experiments-set-up}. More specifically, categorical variables were one-hot encoded, instances and covariates with more than 30\%~missing values were dropped, and the remaining missing values were imputed with MICE~\cite{MICE, VanBuuren2007}. The resulting cleaned datasets properties are shown in Tables~\ref{tab:binary-info}-\ref{tab:mtr-info}. Table~\ref{tab:binary-info} shows the binary classification scenario, whereas Table~\ref{tab:multi-label-info} shows its multi-label counterpart, where each instance can be associated to multiple labels at the same time. \begin{table}[!ht] \scriptsize \begin{center} \captionsetup{width=.9\linewidth} \caption{Overview of the datasets for binary classification tasks}\label{tab:binary-info} \begin{tabular}{l|cc} \toprule & \makecell{data size \\ $(n , p)$} & \makecell{\% positive \\ class} \\ \midrule blood &(748 , 4) &24 \\ breast cancer diagn. &(569, 30) &37 \\ breast cancer &(699, 10) &34 \\ breast cancer progn. &(198, 33) &24 \\ breast cancer coimba &(116, 9) &55 \\ colonoscopy Green &(98, 62) &68 \\ colonoscopy Hinselm. &(97, 62) &85 \\ colonoscopy Schiller &(92, 62) &73 \\ divorce &(170, 54) &49 \\ Flowmeters &(87, 36) &60 \\ haberman &(306, 3) &26 \\ hcc-survival &(165, 49) &62 \\ ionosphere &(351, 34) &36 \\ LSVT voice &(126, 310) &67 \\ mamographic &(961, 5) &46 \\ musk &(476, 166) &43 \\ parkinson &(756, 753) &75 \\ risk factors &(858, 35) &6 \\ crashes &(540, 18) &91 \\ sonar &(208, 60) &53 \\ SPECT &(267, 22) &79 \\ SPECTF &(267, 44) &79 \\ vertebral &(310, 6) &68 \\ wholesale &(440, 7) &32 \\ \bottomrule \end{tabular} \footnotetext[1]{short for ``breast cancer"} \footnotetext[2]{short for ``colonoscopy"} \end{center} \end{table} \begin{table}[ht] \scriptsize \begin{center} \captionsetup{width=.9\linewidth} \caption{Overview of the datasets for multi label classification tasks}\label{tab:multi-label-info} \begin{tabular}{l|cc} \toprule & \makecell{data size \\ $(n , p)$} & \makecell{number \\ of labels} \\ \midrule birds &(645, 260) &19 \\ CAL500 &(502, 68) &174 \\ emotions &(593, 72) &6 \\ enron &(1702, 1001) &53 \\ flags &(193, 19) &7 \\ genbase &(662, 1185) &27 \\ langlog &(1460, 1004) &75 \\ medical &(978, 1449) &45 \\ ng20 &(4379, 1006) &20 \\ scene &(2407, 294) &6 \\ slashdot &(3782, 1079) &22 \\ stackex chess &(1675, 585) & 227 \\ yeast &(2417, 103) &14 \\ \bottomrule \end{tabular} \end{center} \end{table} The datasets used in the framework of the time-to-event scenario are shown in Table~\ref{tab:survival-info} \begin{table}[!ht] \scriptsize \begin{center} \caption{Overview of the time-to-event datasets.}\label{tab:survival-info} \begin{tabular}{l|cc} \toprule & \makecell{data size \\ $(n , p)$} & \makecell{censoring \\ rate (\%)} \\ \midrule addicts &(238, 3) &37 \\ breast cancer survival &(198, 80) &74 \\ DBCD &(295, 4919) &73 \\ DLBCL &(240, 7399) &43 \\ echocardiogram &(130, 9) &32 \\ FLChain &(7874, 8) &72 \\ gbsg2 &(686, 8) &56 \\ lung &(228, 8) &28 \\ NHANES I\tablefootnote{https://www.cdc.gov/nchs/nhanes/about\_nhanes.html} &(9931, 18) &65 \\ PBC &(403, 19) &56 \\ rotterdam (excl. \textsf{recurr}\tablefootnote{the \textsf{reccur} covariate is highly correlated with the final time to event}) &(2982, 11) &57 \\ rotterdam (incl. \textsf{recurr}) &(2982, 12) &57 \\ veteran &(137, 9) &7 \\ whas500 &(500, 14) &57 \\ \bottomrule \end{tabular} \footnotetext[2]{https://www.cdc.gov/nchs/nhanes/about\_nhanes.html} \footnotetext[3]{the \textsf{reccur} covariate is highly correlated with the final time to event} \end{center} \end{table} Finally, we consider the single target and multi-target regression scenarios. For a better comparison of prediction errors, all target covariates have been normalised to the $[0, 1]$ interval. The employed datasets are shown in Tables~\ref{tab:regression-info}-\ref{tab:mtr-info}. \begin{table}[ht] \scriptsize \centering \caption{Overview of datasets with regression tasks.}\label{tab:regression-info} \begin{tabular}{l|cc} \toprule & \makecell{data size \\ $(n , p)$} \\ \midrule airfoil &(1503, 5) \\ Ames Housing &(2915, 283) \\ auto mpg &(398, 7) \\ bike sharing &(731, 12) \\ boston housing &(506, 14) \\ california &(20640, 8) \\ car imports &(201, 63) \\ Computer&(209, 6) \\ concrete compress &(1030, 8) \\ concrete slump &(103, 9) \\ ENB2012 cooling &(768, 8) \\ ENB2012 heating &(768, 8) \\ forest fires &(517, 12) \\ PRSA data &(41757, 13) \\ slump dataset &(103, 9) \\ students maths &(395, 43) \\ wine quality all &(6497, 12) \\ wine quality red &(1599, 11) \\ wine quality white &(4898, 11) \\ \bottomrule \end{tabular} \end{table} \begin{table}[ht] \scriptsize \caption{Overview of datasets with multi-target regression tasks.}\label{tab:mtr-info} \begin{tabular}{l|cc} \toprule & \makecell{data size \\ $(n , p)$} & \makecell{number \\ of targets} \\ \midrule andro &(49, 30) &6 \\ atp1d &(337, 370) &6 \\ atp7d &(296, 370) &6 \\ edm &(154, 16) &2 \\ enb &(768, 8) &2 \\ ENB2012 &(768, 8) &2 \\ jura &(359, 15) &3 \\ oes10 &(403, 298) &16 \\ oes97 &(334, 263) &16 \\ osales &(639, 401) &12 \\ rf1 &(9125, 64) &8 \\ rf2 &(4332, 576) &8 \\ scm1d &(9803, 280) &16 \\ scm20d &(8966, 61) &16 \\ scpf &(1137, 23) &3 \\ sf1 &(323, 10) &3 \\ sf2 &(1066, 9) &3 \\ slump &(103, 7) &3 \\ wq &(1060, 16) &14 \\ \bottomrule \end{tabular} \end{table} \subsection{Competing methods} \label{sec:Competing-methods} The proposed algorithm is compared against several competing methods. More specifically we include: \begin{itemize} \item Four tree-based models, of various degree of performance and interpretability. \item Two linear models that are ante-hoc interpretable \item Four methods from literature that provide post-hoc explanations to RF predictions \end{itemize} \subsubsection*{Tree-based methods} \label{sec:tree-based} The first family of models that we compare against includes tree-based learners such as DT and RF. These methods represent the two extremes of the performance-interpretability trade-off. In addition, we propose two approaches, namely ``Small R(S)F" and ``OOB (Survival) Trees", that position themselves somewhere in between The Small R(S)F method consists of training a Random (Survival) Forest with $K$ base tree learners, where the value of $K$ is chosen for each test instance to be equal to the one used by Bellatrex\footnote{For reporting predictive performance, in the interest of space, $K$ is set as in the weighted path-based Bellatrex, and similar values are observed if the unweighted path-based set-up was used instead.}. The OOB (Survival) Trees method consists of averaging the prediction of $K$ selected trees from a full R(S)F, where the $K$ trees with smallest out-of-bag (OOB) error are selected. The value $K$ is again set to the same value as the number of final rules extracted by Bellatrex (in its weighted set-up). \subsubsection*{Linear, ante-hoc explainable methods} Next, we perform a performance comparison with competing methods that are \emph{ante-hoc} explainable, that is, models that are interpretable by design. We include a regularised regression model (LR) with elastic net penalty for binary classification, multi-label classification, regression, and multi-target regression. Additionally, we consider a regularised Cox-Proportional Hazard (Cox-PH)~\cite{cox1972} for time-to-event data \subsubsection*{Post-hoc competitors} Finally, we compare our method against recent work in literature. For this purpose we select from the related work Section~\ref{sec:Related-work} the methods that have a publicly available source code. The selection narrows down to C443~\cite{Sies2020}, SIRUS~\cite{Benard2021}, RuleCOSI+~\cite{RuleCOSI+} and HS~\cite{HS2022}. It is worth mentioning that only SIRUS and HS fully support regression tasks, and that only the latter is adapted to multi-target regression and multi-label classification. Moreover, none of the selected competing methods is adapted to a survival analysis scenario. To begin with, to set up a comparison between C443 (available for binary classification tasks only, within the homonym package in \textsf{R}) and Bellatrex, we train the underlying RF black-box model with the same number of learners and stopping criterion as in Section~\ref{sec:Experiments-set-up}. Next, we run C443, collect the output trees, and average their prediction (weighted proportionally to cluster size) for a close comparison. As for the number of clusters we run C443 with $K=3$, which is the upper bound for the number of rules extracted by Bellatrex. To run the comparison with SIRUS, we keep the parameters suggested by the authors. More specifically, the underlying RF model is trained with 5000 trees and the number of final rules to be extracted is set to 10. For RuleCOSI+, we run the proposed method after increasing the maximum rule length to 5 and the rule confidence to be at least 0.9, we do so to achieve better performance. We therefore report RuleCOSI+ results for this particular choice of hyperparameters. Finally, we consider Hierarchical Shrinkage~\cite{HS2022} (HS) method in its default configuration. Such configuration sets the maximum number of leaves of the underlying DT learner to 20. \subsection{Evaluation metrics} We consider several metrics to validate our method's performance and interpretability, as well as to compare it against similar methods in literature. Firstly, we look at predictive performance, whoch is also a desirable property for model interpretability~\cite{Guidotti2018, Doshi-Velez-2017}. Next, we look at the complexity of the explanations generated by our method. Finally, we check against redundancy of the explanations by looking at the dissimilarity of the generated rulesets. \subsubsection*{Performance} The predictive performance of the models is computed by means of commonly used measures in each of the five tasks. More specifically, we evaluate the AUROC for binary classification, the weighted average AUROC in multi-label classification (averaged over each label with weight proportional to the number of positive instances of the label), mean absolute error (MAE) for single target and multi-target regression tasks (in the latter case averaged over the targets), and concordance index (C-index) for the survival analysis data. \subsubsection*{Complexity} \label{sec:complexity} Next to predictive performance, we investigate the complexity of the generated explanations, a concept that is inversely related to model interpretability. The notion of interpretability is itself difficult to measure objectively as no general definition of interpretability exists~\cite{Molnar2020, Doshi-Velez-2017}, and many metrics have been proposed~\cite{Hoffman2018}. However, when it comes to specifically interpreting tree-based models, it is common to report the total number of rule-splits shown by the model explainer as a measure of interpretability~\cite{RuleCOSI+, Hara2018, inTrees}, where a lower number of rule-splits (complexity) corresponds to a higher interpretability. Formally, consider an explanation made of rules $\mathcal{R} = \{ r_1, \dots, r_m\}$, and let $\{\text{len}(r_1), \dots, \text{len}(r_m)\}$ be their respective length (that is, number of split tests), then the \emph{complexity} of the explanation is computed as: \begin{equation} \label{eq:avg-complexity} \mathcal{C} = \sum_{r_i \in \mathcal{R}} \text{len}(r_i) \end{equation} In practice, which set of rules $\mathcal{R}$ constitute an explanation is not always well defined and can depend on the user needs. In the context of our study, since we are focusing on local explanations, we include in $\mathcal{R}$ only the rules that are effectively used for the final instance prediction. More specifically: \begin{itemize} \label{text:complexity} \item In case one or more decision trees are shown to the end-user as an explanation, we estimate $\mathcal{C}$ by counting only the rule(s) $r_{t_1}, \dots , r_{t_n}$ that lead to a leaf node, and we define $\mathcal{R} = \{ r_{t_1}, \dots r_{t_n} \}$. This is the case of HS, DT, C443, OOB Trees, and Small RF. \item In case, such as in RULECOSI+, the end-user is presented an ordered decision list with $m-1$ disjoint rules and a final rule $r_m$ that serves as an ``else" clause, then one of the two scenarios holds: \begin{itemize} \setlength{\itemsep}{0pt} \item the activated rule is ${r_n} \neq r_m$. In this case, we consider that the activated rule is a sufficient explanation, hence we set $\mathcal{R} = \{ r_n\}$; \item the activated rule is $r_m$, which is not a sufficient explanation since it has no antecedent and its prediction is used because none of the previous rules is activated. The explanation for the end-user is complete only if all rules are shown, therefore we set $\mathcal{R} = \{r_1, \dots r_m\}$. \end{itemize} \item In case of a collection of decision rules $\{ r_1, \dots, r_m\}$ such as in Bellatrex and SIRUS, we have $\mathcal{R} = \{ r_1, \dots, r_m\}$. \end{itemize} The above definition suggests that the complexity of an explanation increases as the rules get longer or as the cardinality of $\mathcal{R}$ increases, which is in agreement with human intuition. Regarding this, we notice that, let $d$ be the maximum depth of a tree and $K$ the number of extracted rules by Bellatrex for a given instance, we have $\mathcal{C} \leq K d$. This means that the complexity of the final explanation can be tuned by either adjusting the maximum depth of the underlying RF, or by tuning the maximum value of $K$ in the rule extraction step of Bellatrex. Such two-fold tuning can also be performed with C443, but cannot be as effective with other methods such as SIRUS (where rules are already extremely short), or DT and HS (where $K=1$ already). \subsubsection*{Dissimilarity} Finally, we consider the dissimilarity of the extracted rules. For this purpose, we define a distance on the tree-representation space. We use a generalised version of the Jaccard similarity index~\cite{Sies2020}, where the ratio between the element-wise minimum and maximum of two vectors is taken. Namely, given the vector representations $\bm{v_i}$ and $\bm{v_j}$ of two rules, we compute their similarity $\mathcal{S}$ as: \begin{equation} \label{eq:Jaccard} \mathcal{S}(\bm{v_i},\bm{v_j}) = \frac{\sum_{k=1}^{p} \min(v_{i k}, v_{j k})}{\sum_{k=1}^{p} \max(v_{i k}, v_{j k})}. \end{equation} Given an instance $\bm{x}$ and the vector representation of the associated final rules $\bm{v}_{i_1}, \dots, \bm{v}_{i_K}$, we obtain the rule dissimilarity $\mathcal{D}$ for $\bm{x}$ by computing the average pairwise dissimilarity $1- \mathcal{S}$ between the $K$ final rule vector representations: \begin{equation} \label{eq:avg-dissimilarity} \mathcal{D} = \frac{1}{K (K - 1)} \sum_{l \neq j}^{l, j \in \{ i_1, \dots i_K \}} 1-\mathcal{S}(\bm{v_l}, \bm{v_j}) \end{equation} Finally, $\mathcal{D}$ is computed for every test instance, and the average is reported in the results (Section~\ref{sec:Results}). When $K=1$, dissimilarity in Equation~\eqref{eq:avg-dissimilarity} is not defined, therefore such instances are not included in the computation. \subsection{Experimental set-up} \label{sec:Experiments-set-up} In all experiments, we trained the original RF with 100 base learners. As stopping criterion, we required that split-nodes included at least 5 instances, or at least 10 for the time-to-event scenario. No post-pruning techniques were applied. The average predictive performance, complexity, as well as dissimilarity along a 5-fold cross validation is reported. The test sample size for datasets exceeding 500 instances is limited to 100 for computational reasons\footnote{Note that the algorithmic procedure of rule extraction, including hyperparameter tuning, is performed for every test instance separately.}. In the multi-label classification scenario, we drop labels that do not occur in the training or testing folds, since AUROC would otherwise not be defined. With regards to hyperparameter tuning for the steps of our method (rule pre-selection, dimensionality reduction, clustering), the values are tested in a grid search fashion and are shown in Table~\ref{tab:hyperparameters}. \begin{table}[ht] \footnotesize \centering \begin{tabular}{|c|c|c|} \hline name & description & values \\ \hline $\tau$ & \makecell{nb. of pre- \\ selected trees} & \{20, 50, 80\} \\ \hline $d$ & \makecell{nb. of dimensions \\ after PCA} & \{2, 5, no PCA\} \\ \hline $K$ & \makecell{nb. of clusters \\ and final rules} & \{1, 2, 3\} \\ \hline \end{tabular} \caption{Possible choices for the hyperparameters in Bellatrex. For every instance the combination with the highest achieved fidelity $\mathcal{F}$ is chosen.} \label{tab:hyperparameters} \end{table} As explained earlier, these values are optimised for each test instance individually according to fidelity (Equation~\ref{eq:fidelity}). The rationale behind this grid is that the possible values for $\tau$ and $d$ cover a wide range while using at most 3 different values and limit computation time. Furthermore, the values for $K$ are chosen so that at most 3 final rules are selected, keeping the model fairly explainable. \section{Results}\label{sec:Results} In this Section, we report the average predictive performance, complexity, and dissimilarity of the explanations generated by our method across the different datasets. On the predictive performance side, we compare the weighted and the unweighted path-based approach of Bellatrex against the competing methods introduced in Section~\ref{sec:Competing-methods}, with the RF model be treated as an upper, black-box benchmark. Once the best performing rule representation approach for Bellatrex is identified, its explainability and dissimilarity are compared against relevant competitors. More specifically, the complexity (Eq.~\eqref{eq:avg-complexity}) of the output explanations is compared against rule extracting algorithms where the total number of splits can be counted Finally, the average dissimilarity (Eq.~\eqref{eq:avg-dissimilarity}) of the rulesets extracted by Bellatrex is compared against methods that extract a similar number of rules from a RF Tables with dataset-specific results are presented for the binary classification data, whereas, to avoid excessive repetition, only average results are reported for the remaining scenarios. The reader can find the dataset-specific results in the Appendix. Additionally, we test the statistical significance of the observed differences (in performance, in dissimilarity and in complexity of the explanations) among methods, and we do so by conducting a post-hoc Friedman-Nemenyi test, setting the significance level to 0.05, as recommended in~\cite{Demsar2006}. Results are visualised with critical difference diagrams, which connect methods that are not statistically significantly different by horizontal line segments. Following the same approach as before, we report the results of the Friedman-Nemenyi for the binary classification tasks in the text, and we share the results of the remaining scenarios in the Appendix. Finally, we present an ablation study; that is, we verify whether the main steps of the proposed procedure are of added value to the method. The study is repeated for the five tasks evaluated \subsection{Predictive performance} \label{sec:performances} We compute the average test-set performance for every considered dataset over 5-fold cross validation. We report the average across datasets for each of the five types of prediction tasks, and we include the dataset-specific performance results for the binary classification classification case in Table~\ref{tab:binary-perf}. \subsubsection*{Prediction performance in binary classification} \begin{figure*} \scriptsize \centering \caption{Average predictive performance (AUROC) across binary classification datasets. Our proposed methods is shown under the name ``Bellatrex" in its two approaches. The highest achieved performances except for the ``black box" RF are shown in bold.} \label{tab:binary-perf} \begin{tabular}{l|cccccccccc} \toprule & RF & \textbf{\makecell{Bella- \\ trex}} & \makecell{OOB \\ Trees} & \makecell{Single \\ DT} & \makecell{Small \\ RF} & LR & SIRUS & C443 & \makecell{Rule \\ COSI+} & HS \\ \midrule blood & 0.7080 & 0.7041 & 0.6474 & 0.7048 & 0.6413 & \textbf{0.7394} & 0.7327 & 0.6256 & 0.6419 & 0.7209 \\ breast cancer diagn. & 0.9836 & \textbf{0.9867} & 0.9393 & 0.9601 & 0.9526 & 0.9645 & 0.9806 & 0.9748 & 0.9400 & 0.9655 \\ breast cancer & 0.9958 & 0.9954 & 0.9665 & 0.9626 & 0.9696 & 0.9970 & \textbf{0.9974} & 0.9923 & 0.9749 & 0.9625 \\ breast cancer progn. & 0.5015 & 0.5348 & 0.5689 & 0.5893 & 0.5230 & \textbf{0.6370} & 0.5896 & 0.5504 & 0.5374 & 0.6333 \\ breast cancer coimba & 0.7569 & 0.7508 & 0.6846 & 0.7108 & 0.6085 & \textbf{0.8108} & 0.7415 & 0.6762 & 0.5938 & 0.7200 \\ Colon. Green & 0.9333 & \textbf{0.9449} & 0.8128 & 0.6962 & 0.7526 & 0.6718 & 0.7974 & 0.8333 & 0.7154 & 0.7897 \\ Colon. Hinselm. & 0.5917 & 0.6229 & 0.5875 & 0.6146 & 0.4667 & 0.4833 & \textbf{0.6458} & 0.5813 & 0.5812 & 0.5792 \\ Colon. Schiller & 0.6277 & 0.5923 & 0.5369 & 0.5600 & 0.5385 & 0.6615 & 0.6662 & \textbf{0.6969} & 0.6000 & 0.5246 \\ divorce & 0.9941 & 0.9471 & 0.9412 & 0.9349 & 0.9405 & \textbf{1.0000} & 0.9920 & 0.9716 & 0.9325 & 0.9294 \\ Flowmeters & 0.9943 & \textbf{0.9771} & 0.9271 & 0.9086 & 0.7800 & 0.4771 & 0.9286 & 0.9157 & 0.9514 & 0.9314 \\ haberman & 0.6897 & 0.6786 & 0.6400 & 0.6185 & 0.6269 & 0.6856 & \textbf{0.6883} & 0.6763 & 0.5550 & 0.6175 \\ hcc-survival & 0.8331 & \textbf{0.8250} & 0.6688 & 0.7162 & 0.7377 & 0.4192 & 0.7831 & 0.6369 & 0.6008 & 0.7138 \\ ionosphere & 0.9828 & \textbf{0.9812} & 0.9204 & 0.9276 & 0.9067 & 0.9020 & 0.9406 & 0.9420 & 0.8251 & 0.9386 \\ LSVT voice & 0.8824 & \textbf{0.8882} & 0.7404 & 0.7699 & 0.7228 & 0.6191 & 0.7993 & 0.7846 & 0.7022 & 0.7566 \\ mamographic & 0.8523 & 0.8510 & 0.8247 & 0.8355 & 0.8249 & 0.8316 & 0.8439 & 0.8352 & 0.8072 & \textbf{0.8539} \\ musk & 0.9511 & \textbf{0.9475} & 0.8300 & 0.7716 & 0.8088 & 0.9132 & 0.7562 & 0.8633 & 0.7158 & 0.7983 \\ parkinson & 0.9349 & \textbf{0.9128} & 0.7912 & 0.7819 & 0.7766 & 0.3051 & 0.7424 & 0.8099 & 0.7663 & 0.7789 \\ risk factors & 0.9709 & 0.9339 & 0.9050 & 0.9379 & 0.8745 & \textbf{0.9801} & 0.9420 & 0.7176 & 0.8179 & 0.9408 \\ simulation crashes & 0.9284 & 0.9012 & 0.8335 & 0.7594 & 0.8027 & \textbf{0.9654} & 0.8663 & 0.5799 & 0.7939 & 0.7700 \\ sonar & 0.9163 & \textbf{0.9117} & 0.7591 & 0.7498 & 0.7347 & 0.8455 & 0.8045 & 0.7493 & 0.7617 & 0.7622 \\ SPECT & 0.7695 & 0.7489 & 0.7411 & 0.6957 & 0.7037 & \textbf{0.7870} & 0.7305 & 0.7682 & 0.7169 & 0.7502 \\ SPECTF & 0.8203 & \textbf{0.7920} & 0.6193 & 0.6485 & 0.7273 & 0.7442 & 0.7838 & 0.7087 & 0.6656 & 0.6816 \\ vertebral column & 0.9550 & 0.9477 & 0.9002 & 0.8907 & 0.8530 & \textbf{0.9562} & 0.8954 & 0.8423 & 0.8962 & 0.8762 \\ wholesale & 0.9554 & \textbf{0.9525} & 0.9056 & 0.9322 & 0.9141 & 0.9023 & 0.9382 & 0.9364 & 0.9163 & 0.9390 \\ \midrule Average & 0.8554 & \textbf{0.8470} & 0.7788 & 0.7782 & 0.7578 & 0.7625 & 0.8161 & 0.7779 & 0.7504 & 0.7889 \\ \bottomrule \end{tabular} \end{figure*} We observe that Bellatrex considerably outperforms all competing methods and its performance is often on par, and sometimes better, than the original RF. In most of the cases, Bellatrex performs better than the other competing methods. Some exceptions to this trend are provided by the LR learner which, despite achieving non-remarkable performance on average, appears to be the best model in some datasets (e.g. ``blood" and ``Colon. Schiller"). This phenomenon might be explained by the intrinsically different (linear) nature of LR predictions as opposed to the other tree-based models. In the middle range of the performance spectrum, we encounter competing methods from literature such as HS, with C443 and SIRUS scoring a couple of ``wins" and performing better than LR on average. On the lower end, we have the remaining methods: RuleCOSI+, Small RF, OOB Trees and DT. The trends from this qualitative analysis are confirmed by the Friedman-Nemenyi test $(\alpha = 0.05)$ and the resulting diagram is shown in Figure~\ref{fig:binary-FN-perform}. \begin{figure}[ht] \centering \includegraphics[width=0.8\columnwidth]{BIN_Performance.pdf} \caption{Friedman-Nemenyi test, results regarding performance on binary classification data} \label{fig:binary-FN-perform} \end{figure} We can observe that the difference between RF and Bellatrex is not statistically significant, meaning that we manage to provide interpretability without significant loss in predictive performance. It is also remarkable that Bellatrex is ranked on top of all the competitor methods and is also statistically significantly different to RuleCOSI+, Small RF, OOB Trees, as well as the single DT. This is to be expected as the competing methods offer a global approach for explanations, whereas Bellatrex follows a local approach. Furthermore, the Bellatrex instance-specific procedure is optimised towards increasing the fidelity to the original black-box model, which is a necessary condition for achieving interpretability~\cite{Guidotti2018}. \subsubsection*{Prediction performance in TTE, regression, MLC, MTR} Similar trends are highlighted when running Bellatrex on time-to event (TTE), regression, multi-label classification (MLC), and multi-target regression (MTR) data, with the average results being shown in Table~\ref{tab:avg-perf-all}. The competitiveness of Bellatrex against all competing methods is confirmed as Bellatrex outperforms all considered competitors. Furthermore, Bellatrex performance is on par compared to the black-box R(S)F in TTE tasks, furthermore Bellatrex is outperforming the original black-box in regression and MTR tasks; finally, a lower performance is observed for MLC tasks. \begin{table}[ht] \centering \tiny \begin{tabular}{l|cccc} \multirow{2}{*}{Method} & \multicolumn{4}{c}{predictive scenario} \\ & survival & multi-label & regression & multi-target \\ \midrule \makecell{R(S)F} & 0.7274 & 0.8473 & 0.0679 & 0.0531 \\ \midrule \makecell{Bellatrex \\ weighted} & \textbf{0.7275} & \textbf{0.7894} & 0.0674 & \textbf{0.0511} \\ \midrule \makecell{Bellatrex \\ simple} & 0.7265 & 0.7888 & \textbf{0.0673} & 0.0516 \\ \midrule \makecell{OOB (S) \\ Trees} & 0.6719 & 0.7524 &0.0772 & 0.0562 \\ \midrule \makecell{Small \\ R(S)F} & 0.6724 & 0.7441 & 0.0788 & 0.0591 \\ \midrule \makecell{Single \\ (S)DT} & 0.6696 & 0.7378 & 0.0832 & 0.0593 \\ \midrule \makecell{Linear \\ Predictor\tablefootnote{Cox-PH for time-to-event tasks, LR for the other cases}} & 0.7040 & 0.5076 & 0.0942 & 0.0758 \\ \midrule \makecell{SIRUS} & - & - & 0.1090 & - \\ \midrule \makecell{HS} & - & 0.7585 & 0.0890 & 0.0715 \\ \bottomrule \end{tabular} \footnotetext[1]{regularised Cox PH for survival scenario, regularised LR for the other scenarios} \caption{Average performance across remaining datasets. In bold, the best achieved performance excluding the black-box R(S)F} \label{tab:avg-perf-all} \end{table} This trend is to be expected, since methods like HS are based on a single DT and are therefore offering an extremely simplified prediction process, whereas methods based on LR fail to capture non-linearity and label correlations. Finally, SIRUS has been implemented for binary classification and regression problems, but has not been tested for the latter. The results of the Friedman-Nemenyi statistical tests of these four scenarios are shown in Figure~\ref{fig:perf-nemenyi-all}. Given that in Bellatrex the weighted path-based approach has a slightly better performance (and a more intuitive vector representation) compared to the simple one, we report from now on only the results of the former, unless otherwise specified. \subsection{Complexity} \label{sec:complexities} Next, we consider the complexity of explanations and compare Bellatrex against other competing methods. It is worth reminding that our definition of complexity in Eq.~\eqref{eq:avg-complexity} counts the number of split-rules performed across (possibly multiple) extracted rules. This allows to compare Bellatrex not only against tree-based methods such as DTs, Small RF and OOB Trees, but also against methods from literature that output rule-based explanation in a different format. More specifically, we can compare Bellatrex against SIRUS , HS , RuleCOSI+ , and C443 . We do not report the complexity $\mathcal{C}$ from RF given its black-box nature and given that its complexity is much higher than the other reported methods. \subsubsection*{Explanation complexity in binary classification} Specifically for binary classification tasks, we compare Bellatrex against all aforementioned methods. To determine which rules are considered as part of an explanation, we refer to our guidelines in Section~\ref{sec:complexity}. We report average complexity $\mathcal{C}$ in Table~\ref{tab:binary-complexity}, and we also include the average number of rules extracted by Bellatrex. \begin{figure*}[ht] \centering \scriptsize \caption{Average complexity of the explanations across binary classification datasets.}\label{tab:binary-complexity} \begin{tabular}{l|cccccccccc} \toprule data & \makecell{Bellatrex \\ \tiny (rules)} & \makecell{OOB \\ Trees} & \makecell{Small \\ RF} & DT & {\tiny SIRUS} & \makecell{\tiny Rule \\ \tiny COSI+} & C443 & HS \\ \midrule blood & 15.13 (1.9) & 14.94 & 14.40 & 6.39 & 12.00 & 4.09 & 22.59 & \textbf{3.39} \\ breast cancer diagn. & 5.49 (1.3) & 5.79 & 5.93 & 4.13 & 13.40 & \textbf{3.48} & 13.10 & 4.05 \\ breast cancer & 5.53 (1.2) & 6.13 & 5.00 & 4.01 & 11.60 & \textbf{3.45} & 13.48 & 4.85 \\ breast cancer progn. & 9.79 (2.0) & 10.56 & 11.19 & \textbf{4.13} & 10.00 & 9.13 & 15.61 & 4.33 \\ breast cancer coimba & 9.37 (2.2) & 9.57 & 9.36 & \textbf{3.39} & 11.20 & 8.17 & 13.89 & 4.32 \\ colonoscopy Green & 7.03 (1.9) & 8.44 & 8.23 & \textbf{3.76} & 10.20 & 5.98 & 13.07 & 4.82 \\ colonoscopy Hinselm. & 6.28 (1.7) & 6.94 & 6.31 & \textbf{2.71} & 10.20 & 4.23 & 10.92 & 4.28 \\ colonoscopy Schiller & 6.70 (1.9) & 7.97 & 7.08 & \textbf{3.03} & 10.20 & 4.83 & 11.08 & 3.41 \\ divorce & 1.47 (1.0) & 1.45 & 1.73 & \textbf{1.29} & 10.40 & 1.53 & 4.64 & 1.39 \\ Flowmeters & 4.89 (1.7) & 5.44 & 4.76 & \textbf{2.61} & 11.60 & 2.76 & 8.27 & 2.78 \\ haberman & 13.48 (1.9) & 12.88 & 13.12 & 5.73 & 13.20 & 7.25 & 19.71 & \textbf{5.22} \\ hcc-survival & 9.56 (2.2) & 10.87 & 11.00 & 4.56 & 10.00 & 7.32 & 15.64 & \textbf{4.32} \\ ionosphere & 8.01 (1.5) & 10.37 & 9.27 & \textbf{5.08} & 14.60 & 7.40 & 17.54 & 5.27 \\ LSVT voice & 6.60 (1.9) & 7.20 & 7.06 & \textbf{3.22} & 10.20 & 5.51 & 10.48 & 3.72 \\ mamographic & 16.21 (1.7) & 16.34 & 14.89 & 7.82 & 12.00 & 8.36 & 21.33 & \textbf{4.08} \\ musk & 12.48 (1.9) & 13.72 & 13.79 & 6.09 & 12.80 & 11.59 & 21.32 & \textbf{5.76} \\ parkinson & 13.39 (1.7) & 14.14 & 13.59 & 9.42 & 10.80 & 8.58 & 23.54 & \textbf{4.10} \\ risk factors & 7.27 (1.2) & 8.73 & 9.25 & 5.49 & 15.60 & \textbf{5.22} & 23.54 & 6.57 \\ simulation crashes & 6.48 (1.3) & 6.71 & 6.58 & \textbf{3.61} & 13.00 & 3.78 & 15.86 & 4.46 \\ sonar & 8.29 (2.0) & 9.33 & 9.62 & \textbf{3.74} & 10.40 & 9.42 & 14.04 & 4.02 \\ SPECT & 11.55 (1.8) & 12.04 & 12.04 & \textbf{4.17} & 15.00 & 5.40 & 11.87 & 4.77 \\ SPECTF & 7.85 (1.8) & 8.62 & 8.78 & \textbf{4.17} & 10.80 & 7.27 & 13.48 & 5.32 \\ vertebral & 7.25 (1.6) & 7.42 & 7.46 & \textbf{3.70} & 11.80 & 6.17 & 14.20 & 4.37 \\ wholesale & 6.74 (1.4) & 6.65 & 6.31 & 4.35 & 13.00 & \textbf{2.96} & 14.87 & 4.52 \\ \midrule average & 8.62 (1.7) & 9.26 & 9.03 & 4.44 & 11.83 & 6.00 & 15.17 & \textbf{4.34} \\ \bottomrule \end{tabular} \end{figure*} The results show that Bellatrex needs $8.62$ splits on average to generate an explanation. This finding, combined with the fact that $1.7$ rules are extracted on average suggests that the final rules are usually fairly short and can be considered more interpretable than a single rule of similar total complexity. Furthermore, we also notice that the datasets for which Bellatrex extracts the least amount of rules (such as ``divorce", ``breast cancer original" and ``risk factors") are also the ones whose binary label is easy to predict (AUROC above $0.90$) for Bellatrex (cfr. Table~\ref{tab:binary-perf}). This is coherent with the principle of non-redundancy of extracted rules that Bellatrex seems to achieve: if a single rule is enough to make accurate predictions, there should be no advantage into extracting more rules. When comparing Bellatrex with RuleCOSI+, C443, DT, and HS, we observe that the latter two generate shorter explanations. This is to be expected since these methods use a single rule to perform predictions for a given instance. It is worth noting however, that shorter explanations come at the expense of losing performance: we are therefore witnessing another instance of interpretability-performance trade-off (see Figure~\ref{fig:trade-off-binary}). The aforementioned trade-off is also present when comparing the results of SIRUS against HS and RuleCOSI+: SIRUS outputs rules with higher total complexity, and at the same time shows a slightly higher performance. It is worth noting that SIRUS extracts 10 rules by default, and since its average number of rulesplits (complexity) is $11.83$, it means that the vast majority of the extracted rules has depth 1, consistent with what is reported in the original paper~\cite{Benard2021}. As for C443, the achieved performance is similar to HS, whereas its total complexity is comparable to SIRUS and higher than Bellatrex. The latter results is to be expected given that C443 always extracts 3 trees and therefore 3 rules are contributing to the computation of $\mathcal{C}$, as opposed to the average 1.69 rules in Bellatrex. Finally, OOB Trees and Small RF achieve similar complexity compared to Bellatrex, which is to be expected given that the same number of rules is extracted from a similarly constructed underlying RF. Such differences are not significant according toto the Friedman-Nemenyi statistical test, whereas SIRUS generates statistically significantly more rule-splits compared to Bellatrex, RuleCOSI+ and HS. The full results can be visualised in Figure~\ref{fig:complex-nemenyi-all}. \begin{figure}[ht] \centering \includegraphics[width=0.9\columnwidth]{Trade-off_BIN.pdf} \caption{Visualisation of the performance vs. interpretability trade-off, where interpretability is approximated as $1/\mathcal{C}$. The performance-interpretability Pareto optimal frontier is shown in red.} \label{fig:trade-off-binary} \end{figure} \subsubsection*{Explanation complexity in TTE, regression, MLC, MTR} Continuing on the comparison of the (proxy for) interpretability, we compare the complexity of explanations $\mathcal{C}$ on the remaining four scenarios. We compare Bellatrex against HS for regression, multi-label, and multi-target regression scenarios, whereas SIRUS is, for the moment being, only suitable for use in (single target) regression tasks. An overview of the comparison is given in Table~\ref{tab:avg-complexity-all}, whereas the full results can be found in Tables~\ref{tab:survival-complexity}-\ref{tab:mtr-complexity}. \begin{table}[ht] \centering \tiny \begin{tabular}{l|cccc} \multirow{2}{*}{Method} & \multicolumn{4}{c}{predictive scenario} \\ & survival & multi-label & regression & multi-target \\ \midrule \makecell{Bellatrex \\ weighted} & 19.23 & 63.00 & 22.53 & 23.10 \\ \midrule \makecell{OOB (S) \\ Trees} & 18.73 & 61.77 & 22.32 & 23.48 \\ \midrule \makecell{Small \\ R(S)F} & 18.80 & 60.82 & 22.30 & 23.54 \\ \midrule \makecell{Single \\ (S)DT} & 10.69 & 15.56 & 8.61 & 8.00 \\ \midrule \makecell{SIRUS} & - & - & 13.53 & - \\ \midrule \makecell{HS} & - & \textbf{5.14} & \textbf{4.27} & \textbf{4.15} \\ \bottomrule \end{tabular} \caption{Average number of rule-splits used as explanation, comparison across datasets. In bold, the shortest average explanation per scenario.} \label{tab:avg-complexity-all} \end{table} The complexity of the rules extracted by Bellatrex and OOB (Survival) Trees and Small R(S)F is similar across all scenarios, in line with what is observed with the binary classification datasets. We also observe that Bellatrex generates on average longer explanations when run on multi-label datasets, and this can be due to the fact that multi-label datasets are more difficult to learn and need larger trees to fit. A confirmation of this can be found by inspecting the data: longest explanations are associated to larger datasets, with either a high number of instances or a high number of targets to predict (see Table~\ref{tab:multi-label-info}). For this case, we suggest the end user to select one (or a few) label of interest in the training phase, and the Bellatrex explanations on the reduced label set will be shorter. Finally, it is worth mentioning that the increase in average rule length observed in multi-label datasets is common to Bellatrex, DT, OOB Trees and Small RF, whereas it does not affect HS, whose rules are significantly shorter. Detailed results of the Friedman-Nemenyi test are shared in Figure~\ref{fig:complex-nemenyi-all}. \subsection{Dissimilarity} \label{sec:dissimilarities} Finally, we compare the average dissimilarity $\mathcal{D}$ of the final rules extracted by Bellatrex against the ones generated by Small RF, the ones picked according to the OOB Trees method, and the ones extracted by the C443 method. These methods are indeed the only ones that extract a comparable number of independent learners; HS on the other hand builds a single decision tree whereas SIRUS extracts at least 10 rules. Finally, RULECOSI+ does not offer a meaningful comparison since the rules that it generates are not independent: exactly one of them can be activated, under the condition that the previous ones have not been used. \subsubsection*{Rule dissimilarity in binary classification} The detailed results for the binary classification scenario are shown in Table~\ref{tab:binary-dissim}. \begin{table}[ht] \centering \tiny \begin{tabular}{l|cccc} \toprule & \makecell{OOB \\ Trees} & \makecell{Small \\ RF} & Bellatrex & C443 \\ \midrule blood & 0.5398 & 0.5743 & \textbf{0.6366} & 0.6080 \\ B.C. diagnostic & 0.8799 & 0.8966 & 0.9569 & \textbf{0.9797} \\ B.C. original & 0.7563 & 0.7349 & 0.8534 & \textbf{0.9027} \\ B.C. prognostic & 0.9266 & 0.9251 & 0.9635 & \textbf{0.9696} \\ B.C. coimba & 0.7862 & 0.7894 & 0.8769 & \textbf{0.8923} \\ Col. Green & 0.9241 & 0.9561 & 0.9882 & \textbf{0.9955} \\ Col. Hinselm. & 0.8747 & 0.9636 & 0.9739 & \textbf{0.9866} \\ Col. Schiller & 0.9462 & 0.9659 & \textbf{0.9933} & 0.9892 \\ divorce & 0.8936 & 0.9349 & \textbf{1.0000} & 0.9959 \\ Flowmeters & 0.8513 & 0.9477 & 0.9901 & \textbf{1.0000} \\ haberman & 0.5380 & 0.5686 & 0.6589 & \textbf{0.7616} \\ hcc-survival & 0.9439 & 0.9381 & 0.9683 & \textbf{0.9998} \\ ionosphere & 0.8948 & 0.9068 & 0.9450 & \textbf{0.9741} \\ LSVT voice & 0.9826 & 0.9901 & \textbf{0.9971} & 0.9811 \\ mamographic & 0.5175 & 0.5605 & 0.6185 & \textbf{0.6367} \\ musk & 0.9773 & 0.9679 & 0.9894 & \textbf{0.9979} \\ parkinson & 0.9867 & 0.9922 & 0.9963 & \textbf{0.9996} \\ risk factors & 0.8167 & 0.8778 & 0.9414 & \textbf{0.9832} \\ simul. crashes & 0.7532 & 0.8415 & 0.9400 & \textbf{0.9896} \\ sonar & 0.9281 & 0.9555 & 0.9848 & \textbf{0.9983} \\ SPECT & 0.8617 & 0.8656 & 0.8979 & \textbf{0.9389} \\ SPECTF & 0.9231 & 0.9424 & 0.9608 & \textbf{0.9823} \\ vertebral & 0.6531 & 0.6970 & 0.7868 & \textbf{0.8439} \\ wholesale & 0.6871 & 0.7425 & 0.8277 & \textbf{0.8813} \\ \midrule average & 0.8268 & 0.8556 & 0.9044 & \textbf{0.9286} \\ \bottomrule \end{tabular} \caption{Average dissimilarity index across binary classification datasets. The dissimilarities achieved by our proposed methods are shown under the name ``Bellatrex".} \label{tab:binary-dissim} \end{table} When analysing average dissimilarity, we observe that C443 and Bellatrex achieve the highest dissimilarity, with C443 scoring most of the wins. These two methods consistently achieve higher dissimilarity compared to Small RF and OOB Trees. This means that the Bellatrex algorithm is successful at picking dissimilar enough rulesets, and that these are not redundant. We can verify how this dissimilarity in rules translates in practice in Section~\ref{sec:Examples}. The Friedman-Nemenyi tests show that C443 and Bellatrex show a statistically significantly higher dissimilarity compared to OOB Trees and to Small RF, whose dissimilarities are driven by the intrinsic randomness of the RF algorithm. Detailed results are shared in Figure~\ref{fig:dissim-nemenyi-all}. Finally, the difference in dissimilarity between rulesets in C443 and rulesets in Bellatrex is not statistically significant. \subsubsection*{Rule dissimilarity in TTE, regression, MLC, MTR} The dissimilarity enforced on the final rules can be again compared against Small R(S)F and OOB (Survival) Trees in the other four types of prediction tasks, with the full results being available in the Appendix in Tables~\ref{tab:survival-dissimil}-\ref{tab:mtr-dissim}, and the respective post-hoc statistical tests in Figure~\ref{fig:dissim-nemenyi-all}. \begin{table}[ht] \tiny \centering \caption{Average dissimilarities comparison across datasets. In bold, the highest average dissimilarity per scenario} \label{tab:avg-dissimil-all} \begin{tabular}{l|cccc} \multirow{2}{*}{\makecell{ \\ Method}} & \multicolumn{4}{c}{predictive scenario} \\ \cmidrule{2-5} & survival & multi-label & regression & multi-target \\ \midrule \makecell{Bellatrex \\ weighted} & \textbf{0.8420} & \textbf{0.9569} & \textbf{0.5459} & \textbf{0.7145} \\ \midrule \makecell{OOB (S) \\ Trees} & 0.8219 & 0.9240 & 0.4171 & 0.5977 \\ \midrule \makecell{Small \\ R(S)F} & 0.7945 & 0.9380 & 0.4483 & 0.6326 \\ \bottomrule \end{tabular} \end{table} Bellatrex again outperforms Small R(S)F and OOB (Survival) Trees for every considered scenario. Running the Friedman-Nemenyi statistical tests shows that such differences are always significant except when considering the time-to-event datasets. It is also worth noticing that high dimensional datasets generate the most dissimilar trees on average, and all datasets with $p > 100$ covariates are associated to average dissimilarity close to $1$, indicating almost no overlap in the splitting covariates across candidates. This trend is visible in all five considered scenarios, and is well illustrated in datasets like \textsf{parkison} ($\mathcal{D} = 0.9963$) for binary classification tasks, or \textsf{DLBCL} ($\mathcal{D} = 0.9994$) for time-to-event data. \subsection{Ablation study} \label{sec:ablations} As thoroughly described above, the Bellatrex method consists of four main steps: 1) pre-selection of the most relevant decision rules within the random forest, 2) mapping of the selected rules to a vector representation, 3) projection of the vector representations to a low-dimensional space and 3) the clustering step followed by the final rule extraction. The vector representation and the clustering steps are fundamental for our approach and cannot possibly be removed. To this end, in this ablation study we evaluate the added value of the rule pre-selection mechanism and of the dimensionality reduction step. Hence, we have performed an ablation study where each step is separately employed measuring each time the end performance of our method. More specifically, we have compared four scenarios: \begin{itemize} \item We apply our proposed method in full, including all steps described above; \item We apply dimensionality reduction but no pre-selection (i.e., no step~1); \item We apply the rule pre-selection step but no dimensionality reduction (i.e. no step~3); \item We apply neither dimensionality reduction (PCA) nor rule pre-selection (i.e., a baseline version of our method where both steps 1 and 3 are removed); \end{itemize} Here, we present the results related to binary classification datasets (Table \ref{tab:ablation-binary}) while the results related to the other tasks are provided in the Appendix (Tables~\ref{tab:ablation-survival}\,-\ref{tab:ablation-multitarget}). As shown, the best average performance is achieved when all steps of the proposed approach are included, affirming the added value of each of them. Furthermore, we observe the most substantial decrease in average performance when we remove both steps 1 and 3, whereas the intermediate scenarios (one step removed) fall somewhere in between. \begin{table}[ht] \centering \tiny \begin{tabular}{lrrrr} \toprule & \makecell{\textbf{Bellatrex} \\ (original)} & \makecell{no pre\\ selection} & \makecell{no dim. \\ reduction} & \makecell{none of \\the two} \\ \midrule blood & 0.7041 & \textbf{0.7050} & 0.7005 & 0.6975 \\ B.C. diagn. & 0.9867 & \textbf{0.9872} & 0.9865 & 0.9823 \\ B.C. original & \textbf{0.9954} & 0.9934 & 0.9953 & 0.9922 \\ B.C. progn. & 0.5348 & 0.5226 & \textbf{0.5441} & 0.4822 \\ B.C. coimba & 0.7508 & 0.7677 & \textbf{0.7723} & 0.7600 \\ Col. Green & \textbf{0.9449} & 0.8987 & 0.8385 & 0.9205 \\ Col. Hinselm. & 0.6229 & 0.4708 & 0.6042 & \textbf{0.6396} \\ Col. Schiller & 0.5923 & \textbf{0.6754} & 0.6077 & 0.6569 \\ divorce & \textbf{0.9471} & 0.9457 & 0.9412 & 0.9401 \\ Flowmeters & \textbf{0.9771} & 0.9514 & 0.9500 & 0.9286 \\ haberman & 0.6786 & 0.6726 & 0.6769 & \textbf{0.6832} \\ hcc-survival & \textbf{0.8250} & 0.7638 & 0.8058 & 0.7412 \\ ionosphere & \textbf{0.9812} & 0.9768 & 0.9737 & 0.9444 \\ LSVT voice & \textbf{0.8882} & 0.8654 & 0.8243 & 0.8618 \\ mamographic & \textbf{0.8510} & 0.8467 & 0.8494 & 0.8396 \\ musk & \textbf{0.9475} & 0.9298 & 0.9230 & 0.8757 \\ parkinson & \textbf{0.9128} & 0.8824 & 0.9005 & 0.8340 \\ risk factors & 0.9339 & 0.9309 & \textbf{0.9351} & 0.9339 \\ simul. crashes & \textbf{0.9012} & 0.8875 & 0.8629 & 0.7775 \\ sonar & \textbf{0.9117} & 0.8928 & 0.8864 & 0.8141 \\ SPECT & 0.7489 & 0.7524 & 0.7500 & \textbf{0.7680} \\ SPECTF & 0.7920 & \textbf{0.8177} & 0.7918 & 0.7478 \\ vertebral & 0.9477 & \textbf{0.9501} & 0.9499 & 0.9414 \\ wholesale & 0.9525 & \textbf{0.9549} & 0.9529 & 0.9455 \\ \midrule average & \textbf{0.8470} & 0.8351 & 0.8343 & 0.8212 \\ \bottomrule \end{tabular} \caption{Ablation study results on the binary datasets. In bold, the best achieved performance.} \label{tab:ablation-binary} \end{table} \section{Illustration of Bellatrex} \label{sec:Examples} In this Section, we show how Bellatrex works in practice, and to do so we pick two examples from the ``boston housing" regression dataset~\cite{BostonDataset}. This dataset contains $506$ neighbourhoods (``towns"), each described by 14 covariates. The target variable is the median house value, normalised to the $[0,1]$ interval. Our first example consists of a test instance with a relatively low house value of $0.206$, for which Bellatrex predicts a value of $0.244$. More specifically, Bellatrex reaches the prediction by discarding 20 rules in the pre-selection step and projecting the vector representation of the remaining 80 rules in 2 dimensions; such representations are grouped in a single cluster and the rule closest to the centre is selected as the final representative. Further insights are shown in Figure~\ref{fig:boston-example41}, where the rule representations are shown. \begin{figure}[ht] \centering \includegraphics[width=0.95\columnwidth]{plot_boston_i41_v2.png} \caption{Bellatrex performed on a test instance of the \textsf{boston housing} dataset. On the left, the grey circle corresponds to the centre of the cluster; on the right, rules are coloured according to their predicted value. On both sides, the final extracted rule, closest to the centre of the cluster, is shown in a star shape.} \label{fig:boston-example41} \end{figure} The left plot of the Figure shows that a single cluster is selected, and that the four rules on the right side of the plot are being treated as outliers. On the right-side plot, the same rules are coloured according to their prediction, and these are shown to vary between $0.20$ and $0.29$. The final representative rule is situated in the central position and is associated to a prediction close to the average value of $0.24$. Inspection of such rule is shown in Example~\ref{tab:boston-example-path}, where we show how, starting from an initial estimated equal to the average (bootstrapped) value of the root node, moves until a final value indicated by the corresponding leaf. \begin{example}[ht] \centering \tiny \begin{tabular}{lcl} rule & (weight=1) & \makecell[l]{initial \\ estimate $=0.390$} \\ \midrule Instance & split test & prediction\\ \midrule (n. rooms = 5.64) & n. rooms $\leq 6.80$ & $\rightarrow 0.317$ \\ (low status = 18.34) & low status $> 14.30$ & $\rightarrow 0.209$ \\ (low status = 18.34) & low status $\leq 19.08$ & $\rightarrow 0.271$ \\ (age = 94.70) & age $> 93.90$ & $\rightarrow 0.238$ \\ (crime rate = 0.88) & crime rate $\leq 2.15$ & $\rightarrow 0.275$ \\ (low status = 18.34) & low status $> 17.07$ & $\rightarrow$ \textbf{0.244} (leaf) \\ \bottomrule \end{tabular} \caption{Extracted rule.} \label{tab:boston-example-path} \end{example} The extracted rule is aligned with human intuition: the root node-split shows that a smaller average number of rooms (\textsf{n. rooms}) per dwelling is associated to a lower house value, with the prediction dropping from an initial estimate of $0.390$ to $0.317$. Similarly, the splits involving \textsf{low status} show that houses situated in a poorer neighbourhood (that is, with high values of \textsf{low status}), are associated to lower prices. According to this rule, the median house price of the town increases with a low \textsf{crime rate}, and decreases with high proportion of houses being built before 1940 (high value for the \textsf{age} variable). Our second example involves a test instance of high value $y=0.660$, whose Bellatrex prediction is $0.625$ (and underlying RF prediction is $0.633$), and two rules are selected as the final prediction, as shown in Figure~\ref{fig:boston-example45} below. \begin{figure}[ht] \centering \includegraphics[width=0.95\columnwidth]{plot_boston_i45_v2.png} \caption{Bellatrex performed on a test instance of the \textsf{boston housing} dataset. The final extracted rules are shown with a star shape.} \label{fig:boston-example45} \end{figure} The plot shows that two final rules are extracted, one from the large cluster on the left side, and one for the small cluster on the right side. In both cases, the predictions are close to the average, and in general, we obtain similar predictions from rules following different splits and structures. The extracted rules are shown in Example~\ref{tab:boston-example-path2}. The first rule follows human intuition when assigning higher house value for higher \textsf{n. rooms} and for lower \textsf{crim. rate} rates. Furthermore, it also reflects the racial bias of the 1970 US Census~\cite{BostonDataControversy} when assigning higher value to ethnically homogeneous neighbourhoods (high values of \textsf{black} covariate). \begin{example} \begin{center} \tiny \begin{tabular}{lcl} rule 1 & ($w_1=0.90$) & \makecell[l]{initial \\ estimate $=0.399$} \\ \midrule Instance & split test & prediction\\ \midrule (n. rooms = 7.18) & n. rooms $> 6.98$ & $\rightarrow 0.774$ \\ (n. rooms = 7.18) & n. rooms $\leq 7.44$ & $\rightarrow 0.647$ \\ (black = 393) & black $> 386$ & $\rightarrow 0.6642$ \\ (n. rooms = 7.18) & n. rooms $\leq 7.26$ & $\rightarrow 0.679$ \\ (crime rate = 0.03) & crime rate $\leq 0.03$ & $\rightarrow \textbf{0.625}$ (leaf)\\ \end{tabular} \begin{tabular}{lcl} \toprule rule 2& ($w_2=0.10$) & \makecell[l]{initial \\ estimate $=0.379$} \\ \midrule Instance & split test & prediction\\ \midrule (low status = 4.03) & low status $\leq 9.71$ & $\rightarrow 0.549$ \\ (n. rooms = 7.18) & n. rooms $\leq 7.44$ & $\rightarrow 0.500$ \\ (n. rooms = 7.18) & n. rooms $> 6.73$ & $\rightarrow 0.603$ \\ (pupils ratio = 17.8) & pupils ratio $< 18.9$ & $\rightarrow 0.624$ \\ (age = 61.10) & age $\leq 87.00$ & $\rightarrow 0.612$ \\ (black = 393) & black $> 392$ & $\rightarrow 0.641$ \\ (age = 61.10) & age $> 41.95$ & $\rightarrow 0.608$ \\ (n. rooms = 7.18) & n. rooms $> 6.93$ & $\rightarrow 0.630$ \\ (pupils ratio = 17.8) & pupils ratio $> 15.50$ & $\rightarrow \textbf{0.628}$ (leaf) \\ \bottomrule \end{tabular} \end{center} \caption{Extracted rules.} \label{tab:boston-example-path2} \end{example} The second rule shows a similar perspective by using a different set of tests: the trend highlighted by \textsf{n. rooms} is consistent with previous findings, whereas conditions including \textsf{low status}, \textsf{pupils ratio}, and \textsf{age} appear for the first time in this example. Consistently with human intuition lower values of pupils-to-teacher ratio (\textsf{pupils ratio}) are associated with higher house value, whereas the \textsf{age} value for this instance has a small negative effect on house pricing. Finally, consistently with the previous example, a lower value for \textsf{low status} is associated to higher median house value. \section{Conclusions and future work} \label{sec:Conclusion} In this article, we proposed a novel method (Bellatrex) that interprets random forest predictions by extracting, for a given instance, a surrogate model consisting of the most representative decision trees in the forest. Although we have focused on the random forest ensemble model, our proposed approach is able to accommodate other tree-ensemble models such as Extremely Randomized Trees~\cite{ExtraTrees}. Furthermore, Bellatrex is compatible with other variations of random forests such as Random Survival Forest and Random Forest Regression and has been evaluated across 89 datasets belonging to five different predictive tasks: binary classification, time-to-event prediction, multi-label classification, regression, and multi-target regression. To our knowledge, no other related work is as versatile as Bellatrex in providing explanations in so many different scenarios, or at least, no such experimental results have been reported. Bellatrex achieves high levels of predictive performance by extracting a small number of rules, which we limited to three in our experiments. Its performance is often on par with that of random forests, and even outperforms this benchmark in two out of five scenarios. We can therefore conclude that our method achieves its intended goal of explaining the prediction of a random forest with a few rules, without giving up on predictive performance. Furthermore, when compared against ante-hoc explainable methods that do not rely on a tree structure, such as LR and Cox-PH, Bellatrex comes on top. Finally, the comparisons with state-of-the-art methods outline that Bellatrex outperforms, and often significantly, all considered methods from literature that aim at extracting explanations from a trained RF, namely C443~\cite{Sies2020}, HS~\cite{HS2022} and SIRUS~\cite{Benard2021}. The analysis of the explanation complexity shows that Bellatrex extracts on average 2 rules with a total combined complexity (i.e. test-splits used) that is normally below 25. Such numbers suggest that our extracted rules are fairly short on average, even more so since two rules of length $\ell$ are more interpretable than a single rule of length $2\ell$. Rule post-pruning can further reduce total complexity and increase interpretability. The comparison against other methods such as HS and RuleCOSI+ shows that the latter two generate shorter rules as explanations while performing significantly worse (performance-interpretability trade-off). Finally, the SIRUS method generates explanations of comparable complexity to Bellatrex, but consists in many extremely short rules that are not as convenient to inspect. We also studied the dissimilarity of the trees (or paths) extracted by Bellatrex. We showed that Bellatrex has (often significantly) greater dissimilarity compared to picking the same number of random trees from the ensemble, or picking the same number of best performing trees. This dissimilarity in Bellatrex is remarkable, as it proves to be successful despite the fact that the optimal number of clusters $K$ is not optimised for increasing dissimilarity, but rather for increasing fidelity to the original random forest. Furthermore, the high average dissimilarity suggests that the final extracted rules are not redundant, and that they give diverse possible explanations to the end user. Our method also has some limitations, which are similar to other methods that extract learners from a tree ensemble. Firstly, the interpretability of the rules extracted by Bellatrex is challenged when such rules are too long, and to tackle this limitation, the end-user can set more stringent stopping criteria to the RF. Alternatively, in case of multi-label tasks, the end user can select a subset of labels of interest in the training phase and the resulting RF will lead to shorter rules. Another possible limitation lies in the computational complexity of the method: although a single prediction can be explained in a short time, running the procedure on a full dataset can become computationally expensive. Directions for future work include exploring new vector representations, as well as evaluating Bellatrex on an even broader set of tasks, such as multi-event survival analysis~\cite{Multi-event-SA}, online learning~\cite{river}, or network inference \cite{Biclustering}. Post-pruning techniques can be applied on top of the extracted rules of Bellatrex as a further improvement step, thanks to which we expect an increase of interpretability with shorter rules, and little to no price paid for predictive performance.
b1e6fca1b08c8fa651763400576c76c5ea4c92d1
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:intro} Sign languages are rich visual languages with large lexical vocabularies \cite{stokoe1980sign} and intricate co-articulated movements of both manual (hands and body) and non-manual (facial) features. \acf{slp}, the automatic translation from spoken language sentences to sign language sequences, must be able to produce photo-realistic continuous signing for large domains of discourse to be useful to the deaf communities. Prior deep-learning approaches to \ac{slp} have either produced concatenated isolated sequences that disregard the natural co-articulation between signs \cite{stoll2018sign,zelinka2020neural} or continuous sequences end-to-end \cite{saunders2021continuous,saunders2020progressive,zelinka2020neural,huang2021towards} which suffer from under-articulation \cite{saunders2020adversarial}. Furthermore, these methods have struggled to generalise beyond the limited domain of weather \cite{forster2012rwth}. In this paper, we propose an \ac{slp} method to produce photo-realistic continuous sign language videos direct from unconstrained spoken language sequences. Firstly, we translate from spoken language to gloss\footnote{Glosses are a written representation of sign that follow sign language ordering and grammar, defined as minimal lexical items \cite{stokoe1980sign}.} sequences. We next learn the temporal co-articulation between gloss-based dictionary signs, modelling the temporal prosody of sign language \cite{brentari2018production}. To model sign co-articulation, we propose a novel Frame Selection Network{} (\textsc{FS-Net}{}) that learns the optimal subset of frames that best represents a continuous signing sequence (Fig. \ref{fig:Model_Overview} middle). We build a transformer encoder with cross-attention \cite{vaswani2017attention} to predict a temporal alignment path supervised by \ac{dtw}. The resulting skeleton pose sequences are subsequently used to condition a video-to-video synthesis model capable of generating photo-realistic sign language videos, named \textsc{SignGAN}{} (Fig. \ref{fig:Model_Overview} right). Due to the natural presence of motion blur in sign language datasets from fast moving hands \cite{forster2014extensions}, a classical application of a hand discriminator leads to an increase in blurred hand generation. To avoid this, we propose a novel keypoint-based loss that significantly improves the quality of hand image synthesis in our photo-realistic signer generation module. To enable training on diverse sign language datasets, we propose a method for controllable video generation that models a multi-modal distribution of sign language videos in different styles. Our deep-learning based \ac{slp} model is able to generalise to large domains of discourse, as it is trivial to increase vocabulary with a few examples of this new sign in a continuous signing context. We conduct extensive deaf user evaluation on a translation protocol of \ac{mdgs} \cite{hanke2010dgs}, showing that \textsc{FS-Net}{} improves the natural signing motion of interpolated dictionary sequences and is overwhelmingly preferred to baseline \ac{slp} methods \cite{saunders2021mixed}. Additionally, we achieve state-of-the-art back translation performance on \ac{ph14t} with a 43\% improvement over baselines, highlighting the understandable nature of our approach. Furthermore, we evaluate \textsc{SignGAN}{} using the high quality \ac{c4a} dataset \cite{camgoz2021content4all}, outperforming state-of-the-art synthesis methods \cite{chan2019everybody,stoll2020text2sign,wang2018video,wang2018high} for quantitative evaluation and human perception studies. Finally, we conduct a further deaf user evaluation to show that \textsc{SignGAN}{} is more understandable than the skeletal sequences previously used to represent sign \cite{saunders2020progressive}. \noindent The contributions of this paper can be summarised as: \begin{itemize} \item The first SLP model to produce large-scale sign language sequences from an unconstrained domain of discourse to a level understandable by a native deaf signer \item A novel Frame Selection Network, \textsc{FS-Net}, that learns to co-articulate between dictionary signs via a monotonic alignment to continuous sequences \item A method to generate photo-realistic continuous sign language videos, \textsc{SignGAN}{}, with a novel hand keypoint loss that improves the hand synthesis quality \item Extensive user evaluation of our proposed approach, showing preference of our proposed method, alongside state-of-the-art back translation results \end{itemize} \begin{figure*}[t!] \centering \includegraphics[width=0.9\linewidth]{new_figures/CVPR22-Overview_GAN.pdf} \caption{Overview of our proposed large-scale \ac{slp} method. An initial Text to Gloss (left) animates an interpolated dictionary sequence, $\mathcal{I}$, with a Frame Selection Network (\textsc{FS-Net}{}), learning the temporal alignment (middle) to a continuous signing sequence, $\mathcal{Y}$. Finally, \textsc{SignGAN}{} generates a photo-realistic sign language video, $\mathcal{V}$, (right) from the continuous skeleton pose and a given style image, $\mathcal{S}^{\mathcal{I}}$.} \label{fig:Model_Overview} \end{figure*}% \section{Related Work} \label{sec:related_work} \paragraph{Sign Language Production} The initial focus of computational sign language technology was \ac{slr} \cite{cui2017recurrent,grobel1997isolated,koller2020quantitative} with few works tackling unconstrained \ac{slr} \cite{kadir2004minimal,cooper2007large,koller2015continuous}. More recently, focus has shifted to \ac{slt} \cite{camgoz2018neural,camgoz2020sign,ko2019neural}. \acf{slp}, the translation from spoken to sign language, has been historically tackled using animated avatars \cite{cox2002tessa,karpouzis2007educational,mcdonald2016automated} with rules-based co-articulation that does not generalise to unseen sequences \cite{segouat2009study}. Initial deep learning-based \ac{slp} methods concatenated isolated signs with no regards for natural co-articulation \cite{stoll2018sign,zelinka2020neural}. Recently, continuous \ac{slp} methods have directly regressed sequences of multiple signs \cite{saunders2020progressive,saunders2021continuous,huang2021towards,saunders2021mixed,saunders2021skeletal}, but exhibit under-articulated signing motion due to regression to the mean. To overcome under-articulation, we avoid generating pose directly and learn the optimal temporal alignment between dictionary and continuous sign sequences. In addition, prior work has represented sign language as skeleton pose sequences, which have been shown to reduce the deaf comprehension compared to a photo-realistic production \cite{ventura2020can}. Previous works have attempted photo-realistic signer generation \cite{stoll2020text2sign,cui2019deep,saunders2021anonysign}, but of low-resolution isolated signs. In this work, we produce high-resolution photo-realistic continuous sign language videos directly from spoken language input, from unrestricted domains of discourse. \paragraph{Pose-Conditioned Human Synthesis} \acfp{gan} \cite{goodfellow2014generative} have achieved impressive results in image \cite{isola2017image,radford2015unsupervised,wang2018high,zhu2017unpaired} and, more recently, video generation tasks \cite{mallya2020world,tulyakov2018mocogan,vondrick2016generating,wang2019few,wang2018video}. Specific to pose-conditioned human synthesis, there has been concurrent research focusing on the generation of whole body \cite{balakrishnan2018synthesizing,ma2017pose,men2020controllable,siarohin2018deformable,tang2020xinggan,zhu2019progressive}, face \cite{deng2020disentangled,kowalski2020config,zakharov2019few} and hand \cite{liu2019gesture,tang2018gesturegan,wu2020mm} images. However, there has been no research into accurate hand generation in the context of full body synthesis, with current methods failing to generate high-quality hand images \cite{ventura2020can}. Due to the hands being high fidelity objects, they are often overlooked in model optimisation. Chan \etal introduced FaceGAN for high resolution face generation \cite{chan2019everybody}, but no similar work has been proposed for the more challenging task of hand synthesis in the context of sign language, where hand to hand interaction is ubiquitous. In this work, we propose a keypoint-based loss to enhance hand synthesis. The task of human motion transfer, transferring motion from source to target videos via keypoint extraction, is relevant to our task \cite{chan2019everybody,wei2020gac,zhou2019dance}. However, there has been limited research into the generation of novel poses, which we produce from a given spoken language sentence. Additionally, works have attempted to produce unseen appearances in a few-shot manner \cite{wang2019few,zakharov2019few}, but continue to produce only a single style at inference. \paragraph{Sign Language Co-Articulation} Sign language co-articulation can be defined as ``the articulatory influence of one phonetic element on another across more than one intervening element" \cite{grosvald2009long} and is an important distinction between isolated and natural continuous signing \cite{naert2017coarticulation}. Co-articulation involves both the motion and duration of signs, with a particular focus on the transition between signs \cite{naert2017coarticulation}. The boundaries of a sign are also modified depending on the context, with continuous signing typically produced faster than their isolated counterparts \cite{segouat2009study}. In this work, we model temporal co-articulation by learning the optimal alignment between isolated signs and continuous signing sequences, predicting the duration, boundary and transition of each sign in context. \section{Large-Scale Photo-Realistic \ac{slp}} \label{sec:methodology} The true aim of a large-scale \ac{slp} model is to translate a spoken language sequence from an unconstrained domain of discourse, \hbox{$\mathcal{X} = (x_{1},...,x_{\mathcal{U}})$} with $\mathcal{U}$ words, to a continuous photo-realistic sign language video, \hbox{$\mathcal{V}^{\mathcal{S}} = (v_{1},...,v_{\mathcal{T}})$} with $\mathcal{T}$ frame. This is a challenging task due to the large vocabulary of unconstrained signing and the intricate spatial nature of sign, with a requirement for temporal co-articulation indicative of natural continuous signing. We approach this problem as a multi-stage sequence-to-sequence task. Firstly, spoken language is translated to sign gloss, \hbox{$\mathcal{Z} = (z_{1},...,z_{\mathcal{W}})$}, as an intermediate representation (Sec. \ref{sec:text_to_gloss}). Next, our \textsc{FS-Net}{} model co-articulates between gloss-based dictionary signs to produce a full continuous signing sequence, \hbox{$\mathcal{Y} = (y_{1},...,y_{\mathcal{T}})$} (Sec. \ref{sec:gloss_to_sign}). Finally, given $\mathcal{Y}$ and a style image, $\mathcal{S}^{\mathcal{I}}$, our video-to-video signer generation module generates a photo-realistic sign language video, $\mathcal{Z}^{\mathcal{S}}$ (Sec. \ref{sec:sign_to_video}). An overview of our approach can be seen in Fig. \ref{fig:Model_Overview}. In the remainder of this section, we shall describe each component of our approach in detail. \subsection{Text to Gloss} \label{sec:text_to_gloss} Given a spoken language sequence, $\mathcal{X}$, we first translate to a sign language grammar and order, represented by a gloss sequence, \hbox{$\mathcal{Z} = (z_{1},...,z_{\mathcal{W}})$} with $\mathcal{W}$ glosses (Fig. \ref{fig:Model_Overview} left). We formulate this as a sequence-to-sequence problem, due to the non-monotonic relationship between the two sequences of different lengths. We use an encoder-decoder transformer \cite{vaswani2017attention} to perform this translation, formalised as: \begin{equation} \label{eq:T2G_encoder} f_{t} = E_{T2G}(x_{t} | x_{1:\mathcal{T}}) \end{equation} \begin{equation} \label{eq:T2G_decoder} g_{w+1} = D_{T2G}(g_{w} | g_{1:w-1} , f_{1:\mathcal{T}}) \end{equation} where $f_{t}$ and $g_{w}$ are the encoded source and target tokens respectively and $g_{0}$ is the encoding of the special $\mathrm{<bos>}$ token. The output gloss tokens can be computed as $z_{w} = \operatorname*{argmax}_{i} (g_{w})$ until the special $\mathrm{<eos>}$ token is predicted. \subsection{Gloss to Pose} \label{sec:gloss_to_sign} Next, motivated by the monotonic relationship between glosses and signs, we produce a continuous signing pose sequence, $\hat{\mathcal{Y}} = (y_{1},...,y_{\mathcal{T}})$ with $\mathcal{T}$ frames, from the translated gloss sequence, $\mathcal{Z}$, using a learnt co-articulation of dictionary signs. We first encode the gloss sequence using a transformer encoder with self-attention, as: \begin{equation} h_{w} = E_{G2S}(z_{w} | z_{1:\mathcal{W}}) \end{equation} where $h_{w}$ is the encoded gloss token for step $w$. We next collect a dictionary sample, $\mathcal{D}^{w}$, for every sign present in the gloss vocabulary. By definition, dictionary signs contain accurate and articulated sign content. Furthermore, it is trivial to expand to larger domains of discourse, simply collecting dictionary examples of the expanded vocabulary. \paragraph{Interpolated Dictionary Representation} Given the translated gloss sequence, $\mathcal{Z}$, we create a stack of ordered dictionary signs, $[\mathcal{D}^{1},...,\mathcal{D}^{w},\mathcal{D}^{\mathcal{W}}]$ (Bottom left of Fig. \ref{fig:Model_Overview}). As in previous works \cite{saunders2021continuous}, we represent each dictionary sign as a sequence of skeleton pose, $\mathcal{D}^{w} = (s^{w}_{1},...,s^{w}_{\mathcal{P}^{w}})$ with $\mathcal{P}^{w}$ frames. We first convert the stack of dictionary signs into a continuous sequence by linearly interpolating between neighbouring signs for a predefined fixed $\mathcal{N}_{LI}$ frames. The final interpolated dictionary sequence, $\mathcal{I} = (\mathcal{I}_{1},...,\mathcal{I}_{\mathcal{Q}})$ with $\mathcal{Q}$ frames, is the combination of skeleton pose and the respective linear interpolation. We next build a continuous dictionary sequence representation to be used as input to \textsc{FS-Net}{}. Alongside the skeleton pose of $\mathcal{I}$, we learn a gloss embedding, $\mathcal{G}^{w}$, unique to each gloss in the vocabulary, with a separate shared embedding for all interpolation frames, $\mathcal{G}^{LI}$. Additionally, we use a counter embedding proposed by Saunders \etal \cite{saunders2020progressive}, expanded to both a specific counter, $\mathcal{C}^{w}_{p}$, relating to the progression of each dictionary sign and a global counter, $\mathcal{C}_{q}$, relating to the progress of the full sequence, $\mathcal{I}$. The final continuous dictionary representation, $\mathcal{R} = (\mathcal{R}_{1},...,\mathcal{R}_{\mathcal{Q}})$ with $\mathcal{Q}$ frames, is constructed by concatenating the corresponding skeleton, gloss and counter embeddings per frame, as: \begin{equation} \mathcal{R}_{q} = [s^{w}_{p},\mathcal{G}^{w},\mathcal{C}^{w}_{p},\mathcal{C}_{q}] \label{eq:sign_representation} \end{equation} where frame $q$ represents a time step $p$ frames into gloss $w$. \paragraph{Frame Selection Network} To co-articulate between dictionary signs, we propose a Frame Selection Network{} (\textsc{FS-Net}{}) that learns to predict the temporal alignment to a continuous signing sequence, $\mathcal{Y} = (y_{0},...,y_{\mathcal{T}})$ with $\mathcal{T}$ frames (Fig. \ref{fig:Model_Overview} middle). We note that this is a monotonic sequence-to-sequence task, due to the matching order of signing and the different sequence lengths ($\mathcal{Q} \neq \mathcal{T}$). Formally, \textsc{FS-Net}{} predicts a discrete sparse monotonic temporal alignment path, \hbox{$\hat{\mathcal{A}} \in \mathbb{R}^{\mathcal{Q} \times \mathcal{Q}}$}: \begin{equation} \hat{\mathcal{A}} = \textsc{FS-Net}{}(\mathcal{R}, h_{1:\mathcal{W}}) \end{equation} where $\hat{\mathcal{A}}$ contains binary decisions representing either frame selection or skipping. Fig. \ref{fig:Model_Overview} shows an example alignment that skips the production of frames $3,5$ and $8$ in the output sequence, removing redundant frames to create a smoother co-articulated continuous sequence. We build \textsc{FS-Net}{} as a transformer encoder \cite{vaswani2017attention} with an additional cross-attention to the encoded gloss sequence. To produce the co-articulated continuous signing pose sequence, $\hat{\mathcal{Y}}$, a matrix multiplication can be applied between $\mathcal{I}$ and $\hat{\mathcal{A}}$, as: \begin{equation} \label{eq:continuous_output} \hat{\mathcal{Y}} = \mathcal{I} \times \hat{\mathcal{A}} \end{equation} This enables the mapping between varied length sequences, with the end of sequence prediction determined as the alignment selection of the final dictionary frame. \paragraph{Dynamic Time Warping Supervision} In practice, directly predicting the 2D alignment, $\hat{\mathcal{A}}$, provides weak gradients due to the sparse nature of the alignment. We therefore propose to train \textsc{FS-Net}{} using a \acf{dtw} supervision signal \cite{berndt1994dtw} designed to learn the optimal monotonic temporal alignment. We pre-compute the \ac{dtw} path, $\mathcal{A}^{*} = \textsc{DTW}(\mathcal{Q},\mathcal{T})$, between the interpolated dictionary sequence, $\mathcal{I}$, and the target continuous sequence, $\mathcal{Y}$. Due to the intractability of 2D alignment path prediction, we collapse the alignment down to a 1D sequence during training, \hbox{$\hat{\textrm{A}} \in \mathbb{R}^{\mathcal{Q}} = \argmax_q ( \hat{\mathcal{A}})$}. This enables a temporal mask prediction over $\mathcal{I}$, selecting which frames of the interpolated dictionary sequence to animate in turn to create a continuous sequence. We argue that for the majority of sequences (88\% for \ac{mdgs}), \hbox{$\mathcal{Q} >> \mathcal{T}$}, due to the faster tempo of continuous sign \cite{naert2017coarticulation}. We thus assume that no frames are added during temporal alignment, only removed. To train \textsc{FS-Net}{}, we compute a cross entropy loss $\mathcal{L}_{CE}$ between the predicted 1D temporal alignment, \hbox{$\hat{\textrm{A}} \in \mathbb{R}^{\mathcal{Q}}$}, and the ground truth \ac{dtw} alignment, $\textrm{A}^{*} \in \mathbb{R}^{\mathcal{Q} \times 1}$, as: \begin{equation} \mathcal{L}_{CE} (\hat{\textrm{A}},\textrm{A}^{*}) = - \frac{1}{\mathcal{Q}} \sum_{q=1}^{\mathcal{Q}} \textrm{A}^{*}_{q} \cdot{} \log (\hat{\textrm{A}}_{q}) \end{equation} The final continuous sign pose sequence, \hbox{$\hat{\mathcal{Y}} = (y_{1},...,y_{\mathcal{T}})$}, is produced as shown in Eq. \ref{eq:continuous_output}. \subsection{Pose to Video} \label{sec:sign_to_video} To generate a photo-realistic sign language video, $\mathcal{V}^{\mathcal{S}}$, conditioned on the produced sign pose sequence, $\hat{\mathcal{Y}}$, we propose a method for video-to-video signer generation, \textsc{SignGAN}{} (Fig. \ref{fig:Model_Overview} right). Taking inspiration from \cite{chan2019everybody}, in the conditional \ac{gan} setup, a generator network, $G$, competes in a min-max game against a multi-scale discriminator, $D = (D_{1}, D_{2}, D_{3})$. The goal of $G$ is to synthesise images of similar quality to ground-truth images, in order to fool $D$. Conversely, the aim of $D$ is to discern the ``fake'' images from the ``real'' images. For our purposes, $G$ synthesises images of a signer, $v^{\mathcal{S}}$ given a human pose, $y_{t}$, and a style image, $\mathcal{S}^{\mathcal{I}}$. Following \cite{isola2017image}, we introduce skip connections to the architecture of $G$ in a \textit{U-Net} structure \cite{ronneberger2015u} between each down-sampling layer $i$ and up-sampling layer $n-i$, where $n$ is the total number of up-sampling layers. Skip connections propagate pose information across the networks, enabling the generation of fine-grained details. Specifically, we add skip connections between each down-sampling layer $i$ and up-sampling layer $n-i$, where $n$ is the total number of up-sampling layers. \paragraph{Controllable Video Generation} To enable training on diverse sign language datasets, we use a style-controllable video generation approach \cite{saunders2021anonysign}. A style image, $\mathcal{S}^{\mathcal{I}}$, is provided to condition synthesis alongside the pose sequence, as seen in Figure \ref{fig:Model_Overview}. \textsc{SignGAN}{} learns to associate the given style, $\mathcal{S}$, with the person-specific aspects of the corresponding target image, $v^{\mathcal{S}}_{t}$, such as the clothing or face, but disentangle the signer-invariant skeleton pose. Controllable generation allows \textsc{SignGAN}{} to make use of the variability in signer appearance in the data. A multi-modal distribution of sign language videos in different styles, $\mathcal{V}^{S}$, can be produced, where \hbox{$S \in \{1,N_{S}\}$} represents the styles seen during training \footnote{For qualitative examples (e.g. in Fig \ref{fig:Qual_Eval}), we share a single signer appearance, as we have consent from this signer to use their appearance for publication purposes.}. \begin{figure}[t!] \centering \includegraphics[width=0.9\linewidth]{new_figures/ESN-Keypoint_Barbara.pdf} \caption{Hand keypoint loss overview. A keypoint discriminator, $D_{H}$, compares keypoints extracted from generated hands, $\hat{k}_{H}$, and real hands, ${k}^{*}_{H}$.} \label{fig:keypoint_loss} \end{figure}% \begin{figure*}[t!] \centering \includegraphics[width=0.8\linewidth]{new_figures/CVPR22_Qual-Fig_2_Skel.pdf} \caption{Example photo-realistic frames with skeleton pose produced using \textsc{FS-Net}{} and photo-realistic video generated using \textsc{SignGAN}{}.} \label{fig:Qual_Eval} \vspace{-0.4cm} \end{figure*}% \paragraph{Hand Keypoint Loss} Previous pose-conditioned human synthesis methods have failed to generate realistic and accurate hand images \cite{ventura2020can}. To enhance the quality of hand synthesis, we introduce a novel loss that operates in the keypoint space, as shown in Figure \ref{fig:keypoint_loss}. A pre-trained 2D hand pose estimator \cite{ge20193d}, $H$, is used to extract hand keypoints, $k_{H}$, from cropped hand regions (\textit{i.e.} a 60x60 patch centered around the middle knuckle), $v_{H}$, as \hbox{$k_{H} = H(v_{H})$}. We avoid operating in the image space due to the existence of blurry hand images in the dataset, whereas the extracted keypoints are invariant to motion-blur. A hand keypoint discriminator, $D_{H}$, then attempts to discern between the ``real'' keypoints, \hbox{$k^{\star}_{H} = H(v_{H})$}, and the ``fake'' keypoints, \hbox{$\hat{k}_{H} = H(G(y_{H}))$}, leading to the objective: \begin{align} \label{eq:loss_HandKey} \mathcal{L}_{\mathrm{\textsc{Key}}}(G,D_{H}) & = \mathbb{E}_{y_{H},z_{H}} [\log D_{H}(k^{\star}_{H})] \nonumber \\ + \mathbb{E}_{y_{H}} & [\log (1-D_{H}(\hat{k}_{H}))] \end{align} \paragraph{Full Objective} In standard image-to-image translation frameworks \cite{isola2017image,wang2018high}, $G$ is trained using a combination of adversarial and perceptual losses. We update the multi-scale adversarial loss, $\mathcal{L}_{GAN}(G,D)$, to reflect the controllable generation with a joint conditioning on sign pose, $y_{t}$, and style image, $\mathcal{S}^{\mathcal{I}}$: \begin{align} \label{eq:loss_gan} \mathcal{L}_{GAN}(G,D) & = \sum^{k}_{i=1} \; \mathbb{E}_{y_{t},z_{t}} [\log D_{i}(z_{t} \mid y_{t},\mathcal{S}^{\mathcal{I}})] \nonumber \\ + \mathbb{E}_{y_{t}} [\log & (1-D_{i}(G(y_{t},\mathcal{S}^{\mathcal{I}}) \mid y_{t},\mathcal{S}^{\mathcal{I}}))] \end{align} where $k = 3$ reflects the multi-scale discriminator. The adversarial loss is supplemented with two feature-matching losses; $\mathcal{L}_{FM}(G,D)$, the discriminator feature-matching loss presented in pix2pixHD \cite{wang2018high}, and $\mathcal{L}_{VGG}(G,D)$, the perceptual reconstruction loss \cite{johnson2016perceptual} which compares pretrained VGGNet \cite{simonyan2014very} features at multiple layers of the network. Our full \textsc{SignGAN}{} objective, $\mathcal{L}_{Total}$, is a weighted sum of these, alongside our proposed hand keypoint loss (Eq. \ref{eq:loss_HandKey}), as: \begin{align} \label{eq:loss_FM} \mathcal{L}_{Total} & = \min_{G} (( \max_{D_{i}} \sum^{k}_{i=1} \; \mathcal{L}_{GAN}(G,D_{i})) \nonumber \\ + \lambda_{FM} & \sum^{k}_{i=1} \; \mathcal{L}_{FM}(G,D_{i}) + \lambda_{VGG} \; \mathcal{L}_{VGG} (G(y_{t},I^{S}),z_{t}) \nonumber \\ + \lambda_{\textsc{Key}} & \; \mathcal{L}_{\mathrm{\textsc{Key}}}(G,D_{H})) \end{align} \noindent where $k = 3$ and $\lambda_{FM},\lambda_{VGG},\lambda_{\textsc{Key}}$ weight the contributions of each loss. \section{Experiments} \label{sec:experiments} In this section, we evaluate our large-scale photo-realistic \ac{slp} approach. We outline our experimental setup then perform quantitative, qualitative \& user evaluation. \subsection{Experimental Setup} To train our large-scale \ac{slp} approach, we set a new translation protocol on the Meine DGS (\ac{mdgs}) corpus\footnote{With permission from the University of Hamburg.} \cite{hanke2010dgs}, a large \ac{dgs} linguistic resource capturing free-form signing from 330 deaf participants, with a vocabulary of 10,042 glosses. To adapt the corpus for translation, we segment the free-flowing discourse into 40,230 segments of German sentences, sign gloss translations and sign language videos. We pre-process the \ac{mdgs} gloss annotations \cite{konrad2018public} and create two protocols, with either gloss variants included (\acs{mdgsv}) or removed (\ac{mdgs}). We publicly release these translation protocols\footnote{https://github.com/BenSaunders27/meineDGS-Translation-Protocols} to facilitate the future growth in large-scale \ac{slp} and \ac{slt} research, with further details provided in the appendix. A license must be obtained from the University of Hamburg to use \ac{mdgs} for computational research. For additional experiments, we use the benchmark \ac{ph14t} dataset \cite{camgoz2018neural} from the constrained weather broadcast domain, with setup and skeletal pose configuration as in \cite{saunders2020progressive}. We collect exhaustive dictionary examples of every \ac{dgs} sign present in \ac{mdgs} and \ac{ph14t}, trimmed to remove the sign onset and offset. For samples without expressive mouthings, we insert the facial features present in a example of the respective gloss from the continuous training set. For photo-realistic video generation, we use the \ac{c4a} dataset \cite{camgoz2021content4all} due to its high video quality and diverse interpreter appearance. We use a heat-map representation as pose condition, with each skeletal limb plotted on a separate feature channel. We build our Text to Gloss models with 2 layers, 4 heads and hidden size of 128 and our \textsc{FS-Net}{} with 2 layers, 4 heads and 64 hidden size. We set the interpolation frames, $\mathcal{N}_{LI}$, to 5 and the learning rate to $10^{-3}$. Our code is based on JoeyNMT \cite{JoeyNMT}, and implemented using PyTorch \cite{paszke2017automatic}. \subsection{Quantitative Evaluation} \label{sec:quant_experiments} \subsubsection{Text to Gloss} \label{sec:Text_to_Gloss_Results} We first evaluate our Text to Gloss translation described in Sec. \ref{sec:text_to_gloss}. Table \ref{tab:SLT_Baselines} shows a performance of 21.93 BLEU-4 on \ac{ph14t}, outperforming \cite{saunders2020progressive} (20.23) but falling short of \cite{moryossef2021data} (23.17) who use larger training data. Translation performance is considerably lower on both \ac{mdgsv} and \ac{mdgs} due to the larger domain, showing that further research is required to scale the task to larger vocabularies. \begin{table}[!h] \centering \resizebox{0.75\linewidth}{!}{% \begin{tabular}{@{}p{0.0cm}cc|cc@{}} \toprule & \multicolumn{2}{c}{DEV SET} & \multicolumn{2}{c}{TEST SET} \\ \multicolumn{1}{c}{Dataset:} & BLEU-4 & \multicolumn{1}{c}{ROUGE} & BLEU-4 & ROUGE \\ \midrule \multicolumn{1}{r|}{\ac{mdgsv}} & 1.96 & 24.51 & 1.16 & 25.34 \\ \multicolumn{1}{r|}{\ac{mdgs}} & 3.17 & 32.93 & 3.08 & 32.52 \\ \multicolumn{1}{r|}{\ac{ph14t}} & {\fontseries{b}\selectfont 21.93} & {\fontseries{b}\selectfont 57.25} & {\fontseries{b}\selectfont 20.08} & {\fontseries{b}\selectfont 56.63} \\ \bottomrule \end{tabular}% } \caption{Text to Gloss results on \ac{mdgs} and \ac{ph14t}.} \label{tab:SLT_Baselines} \vspace{-0.6cm} \end{table} \begin{table}[!b] \centering \resizebox{0.9\linewidth}{!}{% \begin{tabular}{@{}p{2.8cm}cc|cc@{}} \toprule & \multicolumn{2}{c}{DEV SET} & \multicolumn{2}{c}{TEST SET} \\ \multicolumn{1}{c}{Approach:} & BLEU-4 & ROUGE & BLEU-4 & ROUGE \\ \midrule \multicolumn{1}{r|}{Progressive Transformers \cite{saunders2020progressive}} & 11.93 & 34.01 & 10.43 & 32.02 \\ \multicolumn{1}{r|}{Adversarial Training \cite{saunders2020adversarial}} & 13.16 & 36.75 & 12.16 & 34.19 \\ \multicolumn{1}{r|}{Mixture Density Networks \cite{saunders2021continuous}} & 13.14 & 39.06 & 11.94 & 35.19 \\ \multicolumn{1}{r|}{Mixture of Motion Primitives \cite{saunders2021mixed}} & 13.32 & 37.58 & 12.67 & 35.61 \\ \multicolumn{1}{r|}{Interpolated Dictionary Sequence} & 16.28 & 38.11 & 16.27 & 36.95 \\ \multicolumn{1}{r|}{\textbf{\textsc{FS-Net}{} (Ours})} & \textbf{19.14} & \textbf{40.94} & \textbf{18.78} & \textbf{40.60} \\ \bottomrule \end{tabular}% } \caption{Back translation results on the \ac{ph14t} dataset for the \textit{Gloss to Pose} task.} \label{tab:gloss_to_pose} \end{table} \subsubsection{Gloss to Pose} \paragraph{Back Translation} Back translation has developed as the state-of-the-art \ac{slp} evaluation metric \cite{saunders2020progressive}. We train an \ac{slt} model \cite{camgoz2020sign} on \ac{ph14t} with skeleton pose sequences generated using our \textsc{FS-Net}{} approach. Table \ref{tab:gloss_to_pose} shows considerable performance gains (43\%) compared to baseline methods on the Gloss to Pose task \cite{saunders2020progressive,saunders2020adversarial,saunders2021continuous,saunders2021mixed}. This highlights the increased comprehension provided by \textsc{FS-Net}{} compared to baseline end-to-end regression methods, with an ability to overcome the poor quality of the \ac{ph14t} dataset. Furthermore, it can be seen that interpolated dictionary sequences (Comparable to that of \cite{stoll2018sign}) achieve worse back translation results, highlighting the effect of \textsc{FS-Net}{} co-articulation for comprehension. Additionally, Table \ref{tab:text_to_pose} shows further state-of-the-art results on the full pipeline of text to pose, with an initial text to gloss translation and a subsequent sign animation. This highlights the effectiveness of the full spoken language to photo-realistic video pipeline required for true \ac{slp}. \begin{table}[!t] \centering \resizebox{0.9\linewidth}{!}{% \begin{tabular}{@{}p{2.8cm}cc|cc@{}} \toprule & \multicolumn{2}{c}{DEV SET} & \multicolumn{2}{c}{TEST SET} \\ \multicolumn{1}{c}{Approach:} & BLEU-4 & ROUGE & BLEU-4 & ROUGE \\ \midrule \multicolumn{1}{r|}{Progressive Transformers \cite{saunders2020progressive}} & 11.82 & 33.18 & 10.51 & 32.46 \\ \multicolumn{1}{r|}{Adversarial Training \cite{saunders2020adversarial}} & 12.65 & 33.68 & 10.81 & 32.74 \\ \multicolumn{1}{r|}{Mixture Density Networks \cite{saunders2021continuous}} & 11.54 & 33.40 & 11.68 & 33.19 \\ \multicolumn{1}{r|}{Mixture of Motion Primitives \cite{saunders2021mixed}} & 14.03 & \textbf{37.76} & 13.30 & 36.77 \\ \multicolumn{1}{r|}{\textbf{\textsc{FS-Net}{} (Ours})} & \textbf{16.92} & 35.74 & \textbf{21.10} & \textbf{42.57} \\ \bottomrule \end{tabular}% } \caption{Back translation results on the \ac{ph14t} dataset for the \textit{Text to Pose} task.} \label{tab:text_to_pose} \end{table} \paragraph{Sign User Evaluation} We next perform extensive user evaluation with native signers, animating our skeleton pose outputs using \textsc{SignGAN}{}. All baselines are also generated by \textsc{SignGAN}{}, to alleviate visual differences in comparison. In total, 10 participants completed our sign user evaluation, of which all were fluent signers and 20\% were deaf. We provide all the generated user evaluation videos in the supplementary materials. We first compare the comprehension of \textsc{FS-Net}{} compared to the state-of-the-art deep learning based \ac{slp} method \cite{saunders2021mixed}. We show participants pairs of generated videos from the same sequence, asking to select which video was more understandable. Table \ref{tab:understandable_baselines} shows how our productions were unanimously preferred to baselines for both \ac{mdgs} and \ac{ph14t}. This overwhelming result highlights both the increased comprehension of \textsc{FS-Net}{}, alongside the inability of previous methods to scale to unconstrained domains of discourse. \begin{table}[b!] \centering \resizebox{0.70\linewidth}{!}{% \begin{tabular}{@{}p{2.0cm}|ccc@{}} \toprule Dataset & \textsc{FS-Net}{} & Baseline \cite{saunders2021mixed} & Equal \\\midrule \multirow{1}{*}{\ac{mdgs}} & \textbf{95\%} & 0\% & 5\% \\ \midrule \multirow{1}{*}{\ac{ph14t}} & \textbf{95\%} & 0\% & 5\% \\ \bottomrule \end{tabular}% } \caption{Comprehension user evaluation results, showing the percentage of participants who chose productions from \textsc{FS-Net}{} or a baseline \cite{saunders2021mixed} to be more understandable, or equal.} \label{tab:understandable_baselines} \end{table} We next evaluate how understandable our large-scale sign productions are in isolation. We show each participant a produced video alongside a list of 10 signs, of which 5 are signed in the video, and ask them to select which signs they believe are being signed. For \textsc{FS-Net}{} productions, an average of 4.8 signs were recognised for each video. This shows our productions are easily understandable by native signers, an essential result for accurate large-scale \ac{slp}. Our final user evaluation evaluates how co-articulated our \textsc{FS-Net}{} productions are. We show participants two videos of the same sequence, one isolated dictionary sequence and one co-articulated continuous video generated by \textsc{FS-Net}{}, and ask them to select which they believed had the most smooth transitions between signs. We first evaluate dictionary signs without trimming the sign onset and offset, with Table \ref{tab:coarticulated_signing} showing our productions were unanimously preferred. Moving to trimmed dictionary signs, \textsc{FS-Net}{} productions were preferred 40\% of the time, with 13\% equal preference. This highlights the effectiveness of \textsc{FS-Net}{} at improving co-articulation between dictionary signs and temporally aligning to continuous signing sequences. \begin{table}[t!] \centering \resizebox{0.70\linewidth}{!}{% \begin{tabular}{@{}p{2.5cm}ccc@{}} \toprule & \textsc{FS-Net}{} & Isolated & Equal \\\midrule \multicolumn{1}{r|}{Non-Trimmed} & \textbf{100}\% & 0\% & 0\% \\ \multicolumn{1}{r|}{Trimmed} & 40\% & \textbf{47}\% & 13\% \\ \bottomrule \end{tabular}% } \caption{Co-articulation user evaluation results, showing the percentage of participants who believed the video with the smoothest transitions was from \textsc{FS-Net}{}, isolated concatenation or equal.} \label{tab:coarticulated_signing} \end{table} \begin{table}[b!] \centering \resizebox{0.9\linewidth}{!}{% \begin{tabular}{@{}p{3.0cm}cccc@{}} \toprule & \multicolumn{1}{c}{SSIM $\uparrow$} & \multicolumn{1}{c}{Hand SSIM $\uparrow$} & \multicolumn{1}{c}{Hand Pose $\downarrow$} & \multicolumn{1}{c}{FID $\downarrow$} \\ \midrule \multicolumn{1}{r|}{EDN \cite{chan2019everybody}} & 0.737 & 0.553 & 23.09 & 41.54 \\ \multicolumn{1}{r|}{vid2vid \cite{wang2018video}} & 0.750 & 0.570 & 22.51 & 56.17 \\ \multicolumn{1}{r|}{Pix2PixHD \cite{wang2018high}} & 0.737 & 0.553 & 23.06 & 42.57 \\ \multicolumn{1}{r|}{Stoll \etal \cite{stoll2020text2sign}} & 0.727 & 0.533 & 23.17 & 64.01 \\ \multicolumn{1}{r|}{\textsc{SignGAN}{} (Ours)} & \textbf{0.759} & \textbf{0.605} & \textbf{22.05} & \textbf{27.75} \\ \bottomrule \end{tabular}% } \caption{Baseline model comparison results of photo-realistic sign language video generation.} \label{tab:baselines_diverse} \end{table} \subsubsection{Pose to Video} Finally, we evaluate our photo-realistic sign language video approach, \textsc{SignGAN}{}. We compare the performance of \textsc{SignGAN}{} against state-of-the-art image-to-image and video-to-video translation methods \cite{chan2019everybody,wang2018video,wang2018high,stoll2020text2sign}, conditioned on skeletal pose images. We measure the quality of synthesized images using the following metrics; 1) SSIM: Structural Similarity \cite{wang2004image} over the full image. 2) Hand SSIM: SSIM metric over a crop of each hand. 3) Hand Pose: Absolute distance between 2D hand keypoints of the produced and ground truth hand images, using a pre-trained hand pose estimation model \cite{ge20193d}. 4) FID: Fr\'echet Inception Distance \cite{heusel2017gans} over the full image. \paragraph{Baseline Comparison} We first compare \textsc{SignGAN}{} to baseline methods for photo-realistic generation given a sequence of ground truth poses as input. Table \ref{tab:baselines_diverse} shows results on the \ac{c4a} data, with \textsc{SignGAN}{} outperforming all baselines particularly for the Hand SSIM and FID. We believe this is due to the improved quality of synthesized hand images by using the proposed hand keypoint loss. \paragraph{Ablation Study} We perform an ablation study of \textsc{SignGAN}{}, with results in Table \ref{tab:ablation}. As suggested in Sec. \ref{sec:sign_to_video}, the hand discriminator performs poorly for both SSIM and hand SSIM, due to the generation of blurred hands. However, our proposed hand keypoint loss increases model performance considerably and particularly for Hand SSIM, emphasizing the importance of an adversarial loss invariant to blurring. \begin{table}[t!] \centering \resizebox{0.9\linewidth}{!}{% \begin{tabular}{@{}p{3.0cm}ccccc@{}} \toprule & \multicolumn{1}{c}{SSIM $\uparrow$} & \multicolumn{1}{c}{Hand SSIM $\uparrow$} & \multicolumn{1}{c}{Hand Pose $\downarrow$} & \multicolumn{1}{c}{FID $\downarrow$} \\ \midrule \multicolumn{1}{r|}{Baseline} & 0.743 & 0.582 & 22.87 & 39.33 \\ \multicolumn{1}{r|}{Hand Discriminator} & 0.738 & 0.565 & 22.81 & 39.22 \\ \multicolumn{1}{r|}{Hand Keypoint Loss} & \textbf{0.759} & \textbf{0.605} & \textbf{22.05} & \textbf{27.75} \\ \bottomrule \end{tabular}% } \caption{Ablation study results of \textsc{SignGAN}{}} \label{tab:ablation} \vspace{-0.4cm} \end{table} \begin{table}[b!] \centering \resizebox{0.5\linewidth}{!}{% \begin{tabular}{@{}p{3.0cm}cc@{}} \toprule & \multicolumn{1}{c}{Body} & \multicolumn{1}{c}{Hand} \\ \midrule \multicolumn{1}{r|}{EDN \cite{chan2019everybody}} & 100\% & 97.8\% \\ \multicolumn{1}{r|}{vid2vid \cite{wang2018video}} & 85.9\% & 84.8\% \\ \multicolumn{1}{r|}{Pix2PixHD \cite{wang2018high}} & 98.9\% & 100\% \\ \multicolumn{1}{r|}{Stoll \etal \cite{stoll2020text2sign}} & 100\% & 100\% \\ \bottomrule \end{tabular}% } \caption{Perceptual study results, showing the percentage of participants who preferred \textsc{SignGAN}{} to the baseline model.} \label{tab:perceptual} \end{table} \paragraph{Perceptual Study} We perform an additional perceptual study of our photo-realistic generation, showing participants pairs of 10 second videos generated by \textsc{SignGAN}{} and a corresponding baseline method. Participants were asked to select which video was more visually realistic, with a separate focus on the body and hands. In total, 46 participant completed the study, of which 28\% were signers, each viewing 2 randomly selected videos from each baseline. Table \ref{tab:perceptual} shows the percentage of participants who preferred the outputs of \textsc{SignGAN}{} to the baseline method. It can be seen that \textsc{SignGAN}{} outputs were unanimously preferred for both body (96.2\% average) and hand (95.6\% average) synthesis. Vid2vid \cite{wang2018video} was the strongest contender, with our productions preferred only 85\% of the time. \paragraph{Deaf User Evaluation} Our final user evaluation compares the comprehension of photo-realistic videos against the previously-used skeletal pose representation \cite{saunders2020progressive}. We provided 5 30-second videos of ground-truth skeletal sequences and corresponding photo-realistic videos to deaf participants, asking them to rate each video out of 5 for understandability. Synthesised videos were rated higher for comprehension, at 3.9 compared to 3.2 for skeletal sequences. This suggests that photo-realistic content is more understandable to a deaf signer than a skeleton sequence. \subsection{Qualitative Evaluation} \label{sec:qual_experiments} We show example generated photo-realistic frames in Fig. \ref{fig:Qual_Eval}, highlighting the production quality. We provide further qualitative evaluation in supplementary materials. \section{Potential Negative Societal Impact} \label{sec:societal_impact} We acknowledge the potential use of \ac{slp} technology to remove the reliance on human interpreters. However, we see this work as enabling a larger provision of signed content, especially where interpretation doesn't exist \cite{dickinson2017sign}. We also recognise the potential harm if this technology produced incorrect sign language content, particularly in emergency settings. Although this paper significantly advances the \ac{slp} field, we would like to state that \ac{slp} technology is still under development and should not yet be relied upon. \section{Conclusion} \label{sec:conclusion} Large-scale photo-realistic \ac{slp} is important to provide high quality signing content to deaf communities. In this paper, we proposed the first \ac{slp} method to achieve both large-scale signing and photo-realistic video generation. We proposed \textsc{FS-Net}{}, which learns to co-articulate between dictionary signs by modelling the optimal temporal alignment to continuous sequences. Furthermore, we proposed \textsc{SignGAN}{} to produce photo-realistic sign language videos. We proposed a novel keypoint-based loss function that improves the quality of hand synthesis, operating in the keypoint space to avoid issues caused by motion blur. We showed how our approach can scale to unconstrained domains of discourse and be understood by native signers, with considerable state-of-the-art \ac{ph14t} back translation performance. Additionally, we performed extensive user evaluation showing our approach increases the realism of interpolated dictionary signs, can be understood by native deaf signers and is overwhelmingly preferred to baseline methods. Finally, we showed that \textsc{SignGAN}{} outperforms all baseline methods for quantitative metrics, human evaluation and native deaf signer comprehension. Our approach is limited by the current performance of text to gloss translation for large-scale domains. Available gloss annotations are limited, making sign language translation tasks a low-resource machine translation task \cite{moryossef2021data}. Improvements on both architectures and datasets are required to compete with spoken language \ac{nmt} methods. For future work, we plan to tackle spatial co-articulation between dictionary signs. \section*{Acknowledgments} This project was supported by the EPSRC project ExTOL (EP/R03298X/1), SNSF project SMILE-II (CRSII5 193686) and EU project EASIER (ICT-57-2020-101016982). This work reflects only the authors view and the Commission is not responsible for any use that may be made of the information it contains. We thank Thomas Hanke and University of Hamburg for use of the \ac{mdgs} data. We thank SWISSTXT for the use of interpreter appearance data. {\small \bibliographystyle{ieee_fullname}
b051fd757bfa5bffcd79e5ce9cf8241e2ee6368f
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Strategy-proofness -- the idea that it is in an agent's interest to reveal their true preferences -- is a fundamental desideratum in mechanism design. All the other properties a mechanism may have become suspect if we can not assume that an agent will play according to the rules. Unfortunately, in the field of voting, this is a property we have to live without -- per the Gibbard-Satterthwaite theorem (\cite{Gibbard1973}; \cite{Satterthwaite1975}), the only strategy-proof rule with a range consisting of more than two candidates is dictatorship. This negative result, however, did not mean that scholars were willing to give up on either voting or resistance to strategy. Instead, the search was on for a workaround. It was already known that the impossibility does not hold on restricted domains \cite{Dumett1961}, and if the preferences of the voters are separable \cite{Barbera1991} or single-peaked \cite{Moulin1980}, then natural families of strategy-proof voting rules exist. For those committed to the universal domain, there was the statistical approach -- all rules may be manipulable, but it could be the case that some are more manipulable than others. This lead to a voluminous literature on manipulation indices, that sought to quantify how likely a voting rule is to be manipulable (\cite{Nitzan1985}; \cite{Kelly1993}; \cite{Aleskerov1999}). With the incursion of computer science into social choice, an approach based on computational complexity came into prominence -- the idea being, if a strategic vote is computationally infeasible to find, that is almost as good as there being no strategic vote in the first place (\cite{Bartholdi1989}; \cite{Conitzer2007}; \cite{Walsh2011}). None of these approaches were entirely convincing. Domain restrictions are by nature arbitrary, and there is little point in arguing as to how natural single-peaked preferences may be, if no real-world example actually is \cite{Elkind2017}. Manipulation indices are sensitive to the choice of the statistical culture, and are usually obtained by means of computer simulations for particular choices of the number of voters and candidates; so while an index could tell us which voting rule is more manipulable under, say, impartial culture with four voters and five candidates, it would be a stretch to extrapolate from this to statements about the manipulability of a voting rule in general. Computational complexity focuses on the worst case of finding a strategic vote, and a high worst-case complexity does not preclude the possibility of the problem being easy in any practical instance \cite{Faliszewski2011}. In the closely related field of matching, \cite{Pathak2013} proposed a method to compare the manipulability of mechanisms that seemed to sidestep all these issues -- mechanism $f$ is said to be more manipulable than $g$ if the set of profiles on which $g$ is manipulable is included in the set of profiles on which $f$ is manipulable. No restrictions on domain, statistical culture, or computational ability is required. In the appendix to their paper, Pathak and S\"onmez theorised how the approach could be extended to other areas of mechanism design. This was taken up by the matching community (\cite{Decerf2021}; \cite{Bonkoungou2021}), but to our knowledge the only authors to apply this approach to voting were Arribillaga and Mass\'o (\cite{Arribillaga2016}; \cite{Arribillaga2017}). However, the notion used by Arribillaga and Mass\'o differed from that of Pathak and S\"onmez. A l\`a Pathak and S\"onmez, we would say that a voting rule $f$ is more manipulable than $g$ just if: $$\forall P: \text{$g$ is manipulable at $P$}\Rightarrow\text{$f$ is manipulable at $P$}.$$ In other words, if a voter can manipulate $g$ in profile $P$, then a voter can also manipulate $f$ in the same profile. Arribillaga and Mass\'o's notion is a bit harder to parse: $$\forall P_i: (\exists P_{-i}: \text{$g$ is manipulable at $(P_i,P_{-i})$})\Rightarrow (\exists P_{-i}': \text{$f$ is manipulable at $(P_i,P_{-i}')$}).$$ That is, if there exists a possible \emph{preference order} of voter $i$, $P_i$, such that there exists \emph{some} profile extending $P_i$, in which the voter can manipulate $g$, then there also exists a \emph{possibly different} profile extending $P_i$, in which the voter can manipulate $f$. To see why this could be an issue, recall that a voting rule is neutral if for any permutation of candidates $\pi$, $f(\pi P)=\pi f(P)$. A neutral voting rule is \emph{always} manipulable under the definition above -- by the Gibbard-Satterthwaite theorem, there exists some profile $P$ where a voter can manipulate. If we pick an appropriate permutation of candidate names, we will obtain a manipulable profile where voter $i$'s preference order is any order we want. Indeed, the papers of Arribillaga and Mass\'o deal with the manipulability of median voter schemes \cite{Moulin1980} and voting by committees \cite{Barbera1991}, both of which are fundamentally non-neutral procedures. Most voting rules, however, are intended to capture democratic values, and so are neutral at their core; neutrality is typically relaxed only for the purposes of tie-breaking. The notion of Arribillaga and Mass\'o is inappropriate in this setting. The purpose of this paper is to see whether the original notion of Pathak and S\"onmez is any better. \subsection{Our contribution} We apply the manipulability notion of Pathak and S\"onmez to the families of $k$-approval and truncated Borda voting rules. We find that all members of the $k$-approval family are incomparable with respect to this notion, while in the truncated Borda family, in the special case of two voters, $(k+1)$-Borda is more manipulable than $k$-Borda; all other members are incomparable. \section{Preliminaries} Let $\mathcal{V}$, $|\mathcal{V}|=n$, be a set of voters, $\mathcal{C}$, $|\mathcal{C}|=m$, a set of candidates, and $\mathcal{L}(\mathcal{C})$ the set of linear orders over $\mathcal{C}$. Every voter is associated with some $\succeq_i\in\mathcal{L}(\mathcal{C})$, which denotes the voter's preferences. A profile $P\in\mathcal{L}(\mathcal{C})^n$ is an $n$-tuple of preferences, $P_i$ is the $i$th component of $P$ (i.e.\ the preferences of voter $i$), and $P_{-i}$ the preferences of all the other voters. A voting rule is a mapping: $$f:\mathcal{L}(\mathcal{C})^n\rightarrow \mathcal{C}$$ Note two consequences of the definition above. First, the number of voters and candidates is integral to the definition of a voting rule. I.e., for the purposes of this paper the Borda rule with $n=3, m=4$ is considered to be a different voting rule from the Borda rule with $n=4, m=3$. This is why our results meticulously consider every combination of $n$ and $m$ in detail. Second, since we are requiring the voting rule to output a single candidate, we are assuming an inbuilt tie-breaking mechanism. For the purposes of this paper, all ties will be broken lexicographically. Capital letters will be used to denote candidates with respect to this tie-breaking order. That is, in a tie between $A$ and $B$ the tie is broken in favour of $A$. In the case of subscripts, ties are broken first by alphabetical priority then by subscript. That is, in the tie $\set{A_3,A_5,B_1}$, the winner is $A_3$ since $A$ has priority over $B$ and $3$ is smaller than 5. In cases where we do not know a candidate's position in the tie-breaking order, we denote the candidate with lower case letters. Thus, if the tie is $\set{a,b,c}$, we cannot say who the winner is, and must proceed by cases. We study two families of voting rules: \begin{definition} $k$-approval, denoted $\alpha_k$, is the voting rule that awards one point to a candidate each time that candidate is ranked in the top $k$ positions of a voter. The highest scoring candidates are the tied winners, ties are broken lexicographically. $k$-Borda, denoted $\beta_k$, is the voting rule that awards $k-i+1$ points to a candidate each time that candidate is ranked $i$th, $i\leq k$. The highest scoring candidates are the tied winners, ties are broken lexicographically. The corner case of $\alpha_1=\beta_1$ is also known as the plurality rule, while $\beta_{m-1}$ is known as the Borda rule. Both families are special cases of \emph{scoring rules}, under which a candidate gains $s_i$ points each time it is ranked $i$th. Under $k$-approval, $s_1=\dots=s_k=1$, while under $k$-Borda $s_i=\max(0,k-i+1)$. \end{definition} We will be comparing the $k$-approval and $k$-Borda families of voting rules via the notion of manipulability pioneered by \cite{Pathak2013}. \begin{definition}[Pathak and S\"onmez, 2013] Let $f,g$ be two voting rules. We say that $f$ is manipulable at profile $P$ just if there exists a voter $i$ and a preference order $P_i'$ such that: $$f(P_i',P_{-i})\succ_i f(P_i,P_{-i}).$$ We say that $f$ is more manipulable than $g$, denoted $f\geq_{\mathcal{PS}} g$, just if, for every profile $P$, if $g$ is manipulable at $P$ then so is $f$. $f>_{\mathcal{PS}} g$ is shorthand for $f\geq_{\mathcal{PS}} g$ and $g\ngeq_{\mathcal{PS}} g$, and $f\times_{\mathcal{PS}} g$ is shorthand for $f\ngeq_{\mathcal{PS}} g$ and $g\ngeq_{\mathcal{PS}} f$. \end{definition} \section{$k$-Approval family} In this section we fix $i<j$. Our end result (\autoref{thm:approval}) is that for any $n,m$, $\alpha_i\times_{\mathcal{PS}}\alpha_j$. \begin{proposition}\label{lemLaij} For all $n,m$: $\alpha_{i} \ngeq_{\mathcal{PS}} \alpha_{j}$. \end{proposition} \begin{proof} Consider a profile with $i$ $B$ candidates, $j-i$ $A$ candidates, and $m-j$ $C$ candidates. \[ \begin{array}{|c|c|c|c|} \hline n-1\text{ voters of type 1} & B_{1} \ldots B_{i} & A_{1} \ldots A_{j-i}& C_{1} \ldots C_{m-j} \\ \hline 1\text{ voter of type 2} & B_{1} \ldots B_{i} & A_{j-i} \ldots A_{1}& C_{1} \ldots C_{m-j} \\ \hline \end{array} \] In $\alpha_{j}$ all $A$ and $B$ candidates are tied by score, and $A_{1}$ wins the tie. The voter of type 2 can swap $A_{1}$ for $C_{1}$. This will lower the score of $A_1$ from $n$ to $n-1$, while the other $A$ and $B$ candidates still have $n$. If $j-i>1$, the winner will be $A_2$. If $j-i=1$, the winner will be $B_1$. In either case, the outcome will be better for the manipulator. In $\alpha_{i}$ $B_1$ wins, so every voter gets his best outcome. No one has an incentive to manipulate. \end{proof} \begin{lemma}\label{lem:alphabigm} For $n=2q, m\geq 2j-1$: $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$. \end{lemma} \begin{proof} The profile consists of $j-1$ $B$ candidates, $j-1$ $C$ candidates, one $A$ candidate, and $m-2j+1$ $D$ candidates. The condition that $m\geq 2j-1$ guarantees that the top $j$ candidates of voters of types 1 and 2 intersect only at $A$: \[ \begin{array}{|c|c|c|c|} \hline q\text{ voters of type 1} & B_{1} \ldots B_{i} & B_{i+1} \ldots B_{j-1}A & C_1\dots C_{j-1}D_1\dots D_{m-2j+1}\\ \hline q-1\text{ voters of type 2} & AC_1\dots C_{i-1} & C_{i} \ldots C_{j-1} & B_1\dots B_{j-1}D_1\dots D_{m-2j+1}\\ \hline 1\text{ voter of type 3} & C_{1} \ldots C_{i} & C_{i+1} \ldots C_{j-1}A & B_1\dots B_{j-1}D_1\dots D_{m-2j+1}\\ \hline \end{array} \] Under $\alpha_i$, $A$ has $q-1$ points, $B_1$ through $B_{i}$ and $C_1$ through $C_{i-1}$ have $q$, $C_i$ has 1. The winner is $B_1$. The voter of type 3 can manipulate by swapping $A$ for $C_1$. $A$ will have $q$ points and will beat $B_1$ in the tie. Under $\alpha_j$, $A$ has $n$ points and is the winner. Voters of type 2 get their best choice elected. A voter of type 1 would rather have a $B$ candidate win, but $A$ has a lead of at least one point on these. Moving $A$ below the $j$th position will only drop the score by one, and $A$ will win the tie. The voter of type 3 would rather see a $C$ candidate win, but $A$ has a lead of at least one. Dropping $A$'s score will at most force a tie, which $A$ will win. \end{proof} \begin{lemma}\label{aoddsmall} For $n=2q+1, m\geq 2j-1$: if $i\geq 2$, then $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$. \end{lemma} \begin{proof} The profile consists of $j$ $B$ candidates, $j-1$ $A$ candidates, and $m-2j+1$ $C$ candidates. The condition that $m\geq 2j-1$ guarantees that the top $j$ candidates of voters of types 1 and 2 intersect only at $B_1$: \[ \begin{array}{|c|c|c|c|} \hline q\text{ voters of type 1} & \overbrace{A_{1} \ldots A_{i}}^{\geq 2} & B_{1}A_{i+1}\dots A_{j-1}& B_2\dots B_jC_1\dots C_{m-2j+1} \\ \hline q\text{ voters of type 2} & B_{i} \ldots B_{1} &B_{i+1}\ldots B_{j} & A_1\dots A_{j-1}C_1\dots C_{m-2j+1} \\ \hline 1\text{ voter of type 3} & B_{1} \ldots B_{i} & B_{i+1}\ldots B_{j} &A_1\dots A_{j-1} C_1\dots C_{m-2j+1} \\ \hline \end{array} \] Under $\alpha_i$, the winner is $B_1$ with $q+1$ points. An voter of type 2 can swap $B_1$ with $B_j$, and $B_2$ will win (since $i\geq 2$, $B_1$ and $B_2$ are necessarily distinct). Under $\alpha_j$, $B_1$ wins with $n$ points. The other $B$ candidates have at most $n-1$ points, and the $A$ candidates have at most $n-2$. A voter of type 2 would rather see another $B$ candidate win, but such a voter can only lower the score of $B_1$ by 1, and $B_1$ will win the tie against any $B$ candidate. A voter of type 1 would rather see an $A$ candidate win, but $B_1$ has a lead of at least two points, so will beat the $A$ candidates by points even if ranked last. \end{proof} \begin{lemma}\label{lem:aione} For all $n,m$: if $i=1$, then $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$. \end{lemma} \begin{proof} The profiles consist of candidates $A,B,C$, and $D_1$ through $D_{m-3}$. Case one: $n$ even, $n=2q$. \[ \begin{array}{|c|c|c|c|} \hline q\text{ voters of type 1} & B&AD_1\dots D_{j-2}&C D_{j-1}\dots D_{m-3} \\ \hline q-1\text{ voters of type 2} & A&BD_1\dots D_{j-2} &CD_{j-1}\dots D_{m-3} \\ \hline 1\text{ voter of type 3} & C &AD_1\dots D_{j-2}&BD_{j-1}\dots D_{m-3} \\ \hline \end{array} \] Under $\alpha_i$, $B$ has $q$ points, $A$ has $q-1$, and $C$ has 1. If $q\geq 2$, $B$ wins by score, and if $q=1$, $B$ wins the tie. The voter of type 3 can swap $C$ with $A$ to force a tie, which $A$ will win. Under $\alpha_j$, $A$ is the winner with $n$ points. Voters of type 2 have no incentive to manipulate. A voters of type 1 would rather see $B$ win, but $B$ has at most $n-1$ points, so a voter of this type can at most force a tie, which $A$ will win. Likewise, the voter of type 3 would rather $C$ win, who has 1 point. Decreasing $A$'s score will at most force a tie. Case two: $n$ odd, $n=2q+1$. \[ \begin{array}{|c|c|c|c|} \hline q\text{ voters of type 1} & B&CD_1\dots D_{j-2}& A D_{j-1}\dots D_{m-3} \\ \hline q\text{ voters of type 2} & A&BD_1\dots D_{j-2} &CD_{j-1}\dots D_{m-3} \\ \hline 1\text{ voter of type 3} & C &BD_1\dots D_{j-2} &AD_{j-1}\dots D_{m-3} \\ \hline \end{array} \] Under $\alpha_i$, $A$ wins by tie-breaking. The voter of type 3 can swap $C$ with $B$ to give $B$ a points victory. Under $\alpha_j$, $B$ wins with $n$ points. A voter of type 2 would rather see $A$ win, but $B$ has at least a two point lead, so he cannot force a tie. The voter of type 3 would rather $C$ win, but $C$ is behind by at least one point, so he can at best force a tie, which $B$ will win. \end{proof} \begin{corollary}\label{lem:ambig} For all $n,m \geq 2j$: $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$. \end{corollary} \begin{proof} \autoref{lem:alphabigm}, \autoref{aoddsmall}, and \autoref{lem:aione}. \end{proof} \begin{lemma}\label{lem:ammiddle} For all $n, m<2j$: if $i\geq 2$, then $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$. \end{lemma} \begin{proof} Case one: $m\geq i+j$. Since $m\geq i+j = 2i + (j-i)$, we can guarantee the existence of $2i$ $A$ candidates and $(j-i)$ $B$ candidates. The remaining $m-(i+j)$ candidates are the $C$ candidates. Observe that since $m < 2j$, the number of the $C$ candidates is smaller than the number of the $B$ candidates $(m-j-i < j-i)$. \[ \begin{array}{|c|c|c|c|} \hline \floor{n/2}\text{ voters of type 1} & \overbrace{A_{1} \ldots A_{i}}^{\geq2}&B_1\dots B_{j-i}&A_{2i}\dots A_{i+1}\overbrace{C_1\dots C_{m-(i+j)}}^{<j-i} \\ \hline \ceil{n/2}\text{ voter of type 2} & A_{i+1} \dots A_{2i}& B_{1} \ldots B_{j-i} & A_{i}\dots A_1 C_1\dots C_{m-(i+j)}\\ \hline \end{array} \] Under $\alpha_i$, if $n$ is even the winner is $A_1$. A voter of type 2 can manipulate by swapping $A_{2i}$ with $A_{i}$, giving $A_i$ $n/2+1$ points. Since $i\geq 2$, $A_i\neq A_1$. If $n$ is odd, the winner is $A_{i+1}$ with $\ceil{n/2}$ points. A voter of type 1 can swap $A_1$ with $A_{2i}$ to give $A_{2i}$ $\ceil{n/2}+1$ points. Since $i\geq 2$, $A_{2i}\neq A_{i+1}$. Under $\alpha_j$, all the $B$ candidates have $n$ points, and the winner is $B_1$. A voter of type 1 would rather see one of $A_1,\dots, A_i$ win. Since he cannot raise the score of these, he will have to lower the score of the $B$ candidates. However, there are more $B$ candidates than $C$ candidates, so if the voter were to rank all the $B$ candidates below the $j$th position, he would necessarily raise the score of one of $A_{i+1},\dots,A_{2i}$ to $\ceil{n/2}+1$. That candidate would then win by score, and he is even worse for the manipulator than $B_1$. Likewise, a voter of type 2 would rather see one of $A_{i+1},\dots, A_{2i}$ win. He can attempt to rank all the $B$ candidates below $j$, but then one of $A_1,\dots,A_i$ will get $\floor{n/2}+1\geq\ceil{n/2}$ points and win the election (possibly by tie-breaking). Case two: $m< i+j$. In the profile below we have $i$ $C$ candidates, $j-i$ $B$ candidates, and $m-j$ $A$ candidates. Since $m<i+j$, $m-j<i$, so the voters of type 1 can rank all the $A$ candidates in the top $i$ positions, as well as at least one $B$ candidate. \[ \begin{array}{|c|c|c|c|} \hline n-1\text{ voters of type 1} & \overbrace{B_1\dots B_{i-(m-j)}}^{\geq1}\overbrace{A_{1} \ldots A_{m-j}}^{\geq1}&\text{any order} &\text{any order} \\ \hline 1\text{ voter of type 2} & C_{1} \dots C_{i}& B_{1} \ldots B_{j-i} & A_{1}\dots A_{m-j}\\ \hline \end{array} \] Under $\alpha_i$, the winner is $A_1$. The voter of type 2 can manipulate by ranking $B_1$ first. Under $\alpha_j$, the winner is $B_1$ (either by score, or winning a tie against a $C$ candidate). The voters of type 1 get their best choice elected. The voter of type 2 would rather see a $C$ candidate win, but to do so he would have to lower the score of the $B$ candidates. If he ranks any $B$ candidate below the $j$th position, he would have to rank one of the $A$ candidate above -- that candidate would then win the election with $n$ points, and the outcome would be worse than $B_1$. \end{proof} \begin{corollary}\label{lem:amsmall} For all $n, m < 2j$: $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$. \end{corollary} \begin{proof} \autoref{lem:aione} and \autoref{lem:ammiddle}. \end{proof} \begin{theorem}\label{thm:approval} For all $n, m$: $\alpha_{i} \times_{PS} \alpha_{j}$. \end{theorem} \begin{proof} By \autoref{lemLaij}, $\alpha_i\ngeq_{\mathcal{PS}}\alpha_j$. By \autoref{lem:ambig} and \autoref{lem:amsmall}, $\alpha_j\ngeq_{\mathcal{PS}}\alpha_i$. \end{proof} \section{The $k$-Borda Family} As before, we fix $i<j$. In this section we will show that for $n=2,j\neq m-1$, $\beta_j>_{\mathcal{PS}}\beta_i$ (\autoref{cor:main}), but in all other cases the rules are incomparable (\autoref{thm:bordainc}, \autoref{cor:betaibetaj}, \autoref{prop:betakborda}). We make use of a standard result about the manipulability of scoring rules: \begin{lemma}\label{lem:normalform} Consider a profile $P$, and scoring rule $f$. Let $w$ be the winner under sincere voting, $f(P)=w$. Call all the candidates voter $i$ perceives to be at least as bad as $w$ (including $w$) the bad candidates. The others, the good candidates. Order the good candidates $g_1,\dots, g_q$ and the bad candidates $b_1,\dots,b_r$ from the highest to the lowest scoring in $P_{-i}$. In case of equal scores, order candidates by their order in the tie-breaking. We claim that if $i$ can manipulate $f$ at $P$, he can manipulate with the following vote: $$P_i^*=g_1\succ\dots\succ g_q\succ b_r\succ\dots\succ b_1.$$ \end{lemma} \begin{proof} Let $\text{score}(c,P)$ be the score of candidate $c$ at profile $P$. Suppose voter $i$ can manipulate at $P$. That is, there is a $P_i'$ such that $f(P_i',P_{-i})=g_j$. In order to be the winner, $g_j$ must have the highest score. \begin{equation}\label{eqngiwins} \text{score} (g_j, P_{i}', P_{-i}) \geq \max_{c\neq g_j}(\text{score} ( c, P_{i}', P_{-i})). \end{equation} Observe that $\text{score} (g_j, P_{i}', P_{-i})=\text{score} (g_j, P_{-i})+s_k$, where $k$ is the position in which $g_j$ is ranked in $P_i'$. By ranking $g_1$ first in $P_i^*$ it follows that $\text{score} (g_1, P_{i}^{*}, P_{-i})=\text{score} (g_1, P_{-i})+s_1$, and observe that $\text{score} (g_1, P_{-i})\geq \text{score} (g_j, P_{-i})$, and $s_1\geq s_k$. Thus: \begin{equation}\label{eqng1hasmore} \text{score} ( g_1, P_{i}^{*}, P_{-i})\geq \text{score} (g_j, P_{i}', P_{-i}). \end{equation} We now claim that the score of the highest scoring bad candidate in $(P_i',P_{-i})$ is no higher than in $(P_i^*,P_{-i})$. For contradiction, suppose that $b_p$ is the highest scoring bad candidate in $(P_i^*,P_{-i})$, and his score is higher than any bad candidate in $(P_i',P_{-i})$. Observe that $\text{score} ( b_p, P_{i}^{*}, P_{-i}) = \text{score} ( b_p, P_{-i}) + s_{m-p+1}$. Since $\text{score} ( b_1, P_{-i}),\dots, \text{score} ( b_p, P_{-i})\geq \text{score} ( b_p, P_{-i})$, this means that bad candidates $b_1,\dots,b_p$ must all get strictly less than $s_{m-p+1}$ points in $P_i'$. However there are $p$ such candidates, and only $p-1$ positions below $m-p+1$. Since the highest scoring candidate in $(P_i',P_{-i})$ has at least as many points as the highest scoring bad candidate, it follows that: \begin{equation}\label{eqnbjhasless} \max_{c\neq g_j}(\text{score} ( c, P_{i}', P_{-i}))\geq \max_{b\in\set{b_1,\dots,b_r}}(\text{score} ( b, P_{i}^{*}, P_{-i})). \end{equation} Combining \ref{eqngiwins}, \ref{eqng1hasmore}, and \ref{eqnbjhasless}, we conclude that $g_1$ is among the highest scoring candidates in $(P_i^*,P_{-i})$. If at least one of the inequalities is strict, $g_1$ has more points than any bad candidate and we are done. Suppose then that all the inequalities are equal. Observe that this implies that if $g_1\neq g_j$, then $g_1$ must come before $g_j$ in the tie-breaking order. To see this, observe that if we assume $\text{score} ( g_1, P_{i}^{*}, P_{-i})= \text{score} (g_j, P_{i}', P_{-i})$, then it follows that $\text{score} ( g_1, P_{-i}) + s_1= \text{score} (g_j, P_{-i}) + s_k$, where $k$ is the position in which $g_j$ is ranked in $P_i'$. Since $\text{score} (g_1, P_{-i})\geq \text{score} (g_j, P_{-i})$, and $s_1\geq s_k$, the only way this is possible is if $\text{score} (g_1, P_{-i})= \text{score} (g_j, P_{-i})$. By definition, in the case of equal scores in $P_{-i}$, the candidate that is labelled $g_1$ must have priority in the tie-breaking. If $g_1$ also wins the tie against any bad candidate, we are done. For contradiction, suppose a bad candidate $b_p$ wins the tie given $P_i^*$. This means that $b_p$ beats $g_1$ and $g_j$ in the tie-breaking. Observe that $b_p$ is ranked in position ${m-p+1}$ in $P_i^*$. Since $b_p$ loses in $(P_i',P_{-i})$, $b_p$ must have been ranked lower than ${m-p+1}$ in $P_i'$. This means $b_p$ was ranked lower than at least $m-p+1$ candidates. Since $m=q+r$, and there are $q$ candidates, this means $b_p$ was ranked lower than at least $r-p+1$ bad candidates. In $P_i^*$, $b_p$ is ranked below exactly $r-p$ bad candidates, so there must exist a bad candidate that was ranked above $b_p$ in $P_i'$, but is ranked below $b_p$ in $P_i^*$. Call this candidate $b_t$. By definition of $P_i^*$, it must be the case that $\text{score}(b_t,P_{-i}) >\text{score}(b_p,P_{-i})$ or $\text{score}(b_t,P_{-i}) =\text{score}(b_p,P_{-i})$ and $b_t$ wins the tie. But that is impossible, because then $b_t$ would have gained at least as many points in $(P_i',P_{-i})$ as $b_p$ did in $(P_i*,P_{-i})$, and since the score of $b_p$ in $(P_i*,P_{-i})$ is equal to $g_1$, it means $b_t$ has at least as many points in $(P_i',P_{-i})$ as $g_j$, so wins either by points or by tie-breaking. \end{proof} \begin{lemma}\label{prop:2qij} For $n=2q$, all $m$: $\beta_i\ngeq_{\mathcal{PS}}\beta_{j}$. \end{lemma} \begin{proof} Consider a profile with one $A$ candidate, one $B$ candidate, and $m-2$ $C$ candidates: \[ \begin{array}{|c|c|c|c|} \hline 1\text{ voter of type 1} & A C_{1} \ldots C_{i-1}& C_{i} \dots C_{j-2} B& C_{j-1}\dots C_{m-2}\\ \hline 1\text{ voter of type 2} & B A C_{m-2} \ldots C_{m-i+1}& C_{m-i}\dots C_{m-j+1} & C_{m-j}\dots C_1\\ \hline q-1\text{ voters of type 3} & A C_{1} \ldots C_{i-1} & C_i\dots C_{j-1} & C_{j-2}\dots C_{m-2}B\\ \hline q-1\text{ voter of type 4} & B C_{m-2} \ldots C_{m-i}& C_{m-i-1}\dots C_{m-j} & C_{m-j-1}\dots C_1A\\ \hline \end{array} \] Under $\beta_{j}$, $A$ has $qj+(j-1)$ points. $B$ has $qj+1$. $C_1$ is the highest scoring $C$ candidate with $q(j-1)$. The winner is $A$. However, the voter of type 2 can rank $A$ last and shift the $C$ candidates up one. This gives $A$ a score of $qj$, $B$'s score is still $qj+1$, and a $C$ candidate's is at most $q(j-1)+1$. $B$ wins a points victory. Under $\beta_i$, $A$ has $qi +(i-1)=qi+i-1$ points. $B$ has $qi$. $C_1$ has $q(i-1)$, the other $C$ candidates no more. Voters of type 1 and three have no incentive to manipulate. The voter of type 2 would rather see $B$ win, but by \autoref{lem:normalform} this would mean ranking $A$ last, and $A$ would still have $qi$ points and win the tie. A voter of type 4 would rather see anyone win, and by \autoref{lem:normalform} this involves putting either $B$ or $C_1$ first. $B$ is already ranked first and does not win, and putting $C_1$ first would give $C_1$ $q(i-1)+i=qi-q+i$ points, which is less than $A$. \end{proof} \begin{lemma}\label{prop:oddij} For $n=2q+1$, all $m$: $\beta_i\ngeq_{\mathcal{PS}}\beta_{j}$. \end{lemma} \begin{proof} Consider a profile with one $A$ candidate, one $B$ candidate, and $m-2$ $C$ candidates: \[ \begin{array}{|c|c|c|c|} \hline 1\text{ voter of type 1} & BC_1\dots C_{i-1}&C_{i}\dots C_{j-2}A&C_{j-1}\dots C_{m-2}\\ \hline q\text{ voters of type 2} &BAC_1\dots C_{i-2}&C_{i-1}\dots C_{j-2}&C_{j-1}\dots C_{m-2}\\ \hline q\text{ voters of type 3} &AB C_{m-2}\dots C_{m-i+1}& C_{m-i}\dots C_{m-j+1}&C_{m-j}\dots C_1\\ \hline \end{array} \] Under $\beta_i$, $A$ has $qi+q(i-1)=2qi-q$ points. $B$ has $(q+1)i+q(i-1)=2qi-q+i$. All the $C$ candidates are Pareto dominated by $B$, so the winner is $B$. A voter of type 3 would like to see $A$ win, but if he ranks $B$ last, $A$ will have $2qi-q$ points to $B$'s $2qi-q+i-(i-1)=2qi-q+1$, so $B$ would still win. Under $\beta_j$, $A$ has $qj+q(j-1)+1=2qj-q+1$, $B$ has $(q+1)j+q(j-1)=2qj-q+j$. If a voter of type three ranks $B$ last and shifts the $C$ candidates up one, $B$ will have $2qj-q+j-(j-1)=2qj-q+1$, tying with $A$, and $A$ wins the tie. It remains to check that $A$ will have more points than the highest scoring $C$ candidate, which is clearly $C_1$. After the manipulation, $C_1$'s score will increase by at most one. $C_1$'s score before manipulation is $j-1+q(j-2)$, so $A$ will beat $C_1$ if: \begin{align*} 2qj-q+1&\geq j + qj-2q,\\ qj-q&\geq j -1 -2q,\\ qj-j&\geq -1 -q,\\ (q-1)j&\geq -1 -q. \end{align*} Which is always satisfied. \end{proof} \begin{corollary}\label{cor:betaibetaj} For all $n, m$: $\beta_i\ngeq_{\mathcal{PS}}\beta_{j}$. \end{corollary} \begin{proof} \autoref{prop:2qij} and \autoref{prop:oddij}. \end{proof} \begin{lemma}\label{prop:betajibordaodd} For $n=2q+1$, all $m$: $\beta_{j}\ngeq_{\mathcal{PS}} \beta_i$. \end{lemma} \begin{proof} Consider the following profile: \[ \begin{array}{|c|c|c|c|c|c|} \hline q\text{ voters of type 1} & ABC_{m-2}\dots C_{m-i+1}&C_{m-i}\dots C_{m-j+1}& C_{m-j}\dots C_1 \\ \hline q-1\text{ voters of type 2} & BAC_1\dots C_{i-2}& C_{i-1}\dots C_{j-2}&C_{j-1}\dots C_{m-2} \\ \hline 1\text{ voters of type 3} & BC_1\dots C_{i-1}& C_i\dots C_{j-1}&C_j\dots C_{m-2} A\\ \hline 1\text{ voter of type 4} & C_1\dots C_i& B C_{i+1} \dots C_{j-1}&C_{j}\dots C_{m-2} A \\ \hline \end{array} \] Under $\beta_i$, $A$ has $qi+(q-1)(i-1)=2qi-q-i+1$ points. $B$ has $qi+q(i-1)=2qi-q$. $C_1$ is clearly the highest scoring $C$ candidate, and has $i+(i-1)+(q-1)(i-2)=qi+i-2q+1$ points. If $i>1$, $B$ wins a points victory, but a voter of type 1 can rank $B$ last to force a tie, which $A$ will win. If $i=1$, then $A$ wins by tie-breaking, but the voter of type 4 can rank $B$ first to make $B$ the winner. Under $\beta_j$, $A$ has $qj+(q-1)(j-1)$. $B$ has $qj+q(j-1)+(j-i)$. A voter of type 1 would like to manipulate in favour of $A$, but if he ranks $B$ last, $B$'s score will only drop by $j-1$, and $B$ will still win. The voter of type 4 would rather see one of $C_1$ through $C_i$ win. Observe that an upper bound on the score a $C$ candidate can get from the voters of type 1 through 3 is $q(j-1)$ -- for $q-1$ voters of types 1 and 2, each time the first group gives the candidate $j-2-k$ points, the other gives at most $k$ points, for an upper bound of $(q-1)(j-2)$. The voter of type 3 ranks all $C$ candidates one position higher, so combined with the remaining voter of type 1 the contribution to the candidate's score is at most $j-1$, which gives a total of $(q-1)(j-2)+(j-1) <q(j-1)$. If the voter ranks $B$ last and the $C$ candidate first, $B$ will still have $qj+q(j-1)$ points to the $C$'s candidate $j+q(j-1)$, so $B$ will still win. \end{proof} \begin{lemma}\label{prop:betajiqbigbordaeven} For $n=2q$, all $m$: if $q>2$, $\beta_{j}\ngeq_{\mathcal{PS}} \beta_i$. \end{lemma} \begin{proof} Consider the following profile: \[ \begin{array}{|c|c|c|c|c|c|} \hline q-1\text{ voters of type 1} & ABC_{m-2}\dots C_{m-i+1}& C_{m-i} \dots C_{m-j+1}& C_{m-j}\dots C_1 \\ \hline q-2\text{ voters of type 2} & BA C_{1}\dots C_{i-2}& C_{i-1} \dots C_{j-2}& C_{j-1}\dots C_{m-2} \\ \hline 1\text{ voter of type 3} & BC_{1}\dots C_{i-1}& C_{i} \dots C_{j-1}& C_{j}\dots C_{m-2} A \\ \hline 1\text{ voter of type 4} & C_{1}\dots C_{i}&B C_{i+1} \dots C_{j-1}& C_{j}\dots C_{m-2} A \\ \hline 1\text{ voter of type 5} & C_{m-2}\dots C_{m-i-1}&B C_{m-i-2} \dots C_{m-j}& C_{m-j-1}\dots C_{1} A \\ \hline \end{array} \] Case one: $m>3$, and hence $C_1\neq C_{m-2}$. Under $\beta_i$, $A$ has $(q-1)i+(q-2)(i-1)$ points and $B$ has $(q-1)i+(q-1)(i-1)$. A $C$ candidate has at most $(q-2)(i-2)+(i-1)+(i+1)$ -- observe that if the candidate gets $i-2-k$ points from a voter of type 1, he gets at most $k$ from a voter of type 2, which gives us at most $(q-2)(i-2)$ from $q-2$ of each type of voter; the voter of type 3 gives one more point to the candidate, so paired with the remaining voter of type 1, the contribution is $i-1$; as for the voters of voters of type 4 and 5, if one gives the candidate $i-k$ points, the other gives at most $k+1$, for the remaining $(i+1)$. Since $q>2$, $A$ and $B$ have more points than the $C$ candidates. If $i>1$, $B$ also beats $A$ by points, but a voter of type 1 can rank $B$ last and shift the $C$ candidates up one to force a tie between $A$ and $B$. This operation will raise the score of a $C$ candidate by at most 1, so such a candidate will at worst enter the tie, which $A$ wins. If $i=1$, $A$ wins by tie-breaking, but a voter of type 4 can rank $B$ first to give him one more point. Under $\beta_j$, $A$ has $(q-1)j+(q-2)(j-1)$ points, $B$ has $(q-1)j+(q-1)(j-1)+2(j-i)$. $B$ has more points than $A$, and a voter of type 1 can no longer change this by ranking $B$ last. A voter of type 4 would like to manipulate in favour of one of $C_1$ through $C_i$. As we have argued above, such a candidate would get no more than $(q-2)(j-2)+(j-1)$ from voters of types 1 through 3, which we round up to $(q-1)(j-1)$. If the manipulator ranks this candidate first, he will get at most $2j$ from the voters of type $4,5$ for an upper bound of $2j+(q-1)(j-1)$. In comparison, $B$ gets $(q-1)j+(q-1)(j-1)$ from the voters of type 1 through 3. Since $q>2$, $B$ would still win. The argument for the voter of type 5 is analogous. Case two: $m=3$. The same profile we had above collapses to the following: \[ \begin{array}{|c|c|c|c|c|c|} \hline q-1\text{ voters of type 1} & A&B&C \\ \hline q-2\text{ voters of type 2} & B&A& C\\ \hline 1\text{ voter of type 3} & B&C& A \\ \hline 1\text{ voter of type 4} & C&B& A \\ \hline 1\text{ voter of type 5} & C&B&A \\ \hline \end{array} \] The argument with respect to $A$ and $B$ is unchanged. We need only verify that $C$ cannot win under $\beta_i$ or $\beta_j$. Under $\beta_i$, $C$ has exactly 2 points. $A$ and $B$ are tied with $q-1$, and the voter of type 4 can only manipulate in favour of $B$ by ranking $B$ first. Under $\beta_j$, $C$ has exactly 5 points. $B$ has at least 8, and a voter of type 4 or 5 can only lower $B$'s score by one point. \end{proof} \begin{lemma}\label{prop:betajiqbigbordafour} For $n=4$, all $m$: $\beta_{j}\ngeq_{\mathcal{PS}} \beta_i$. \end{lemma} \begin{proof} Case one: $i>1$. \[ \begin{array}{|c|c|c|c|c|c|} \hline 2\text{ voters of type 1} & BC_{m-2}\dots C_{m-i}& C_{m-i-1} \dots C_{m-j}& C_{m-j-1}\dots C_1A \\ \hline 1\text{ voter of type 2} & ABC_{1}\dots C_{i-2}& C_{i-1} \dots C_{j-2}& C_{j-1}\dots C_{m-2} \\ \hline 1\text{ voter of type 3} & AC_{1}\dots C_{i-1}& C_{i} \dots C_{j-2}B& C_{j-1}\dots C_{m-2} \\ \hline \end{array} \] Under $\beta_i$, $B$ wins with $2+i-1$ points. The voter of type 2 can manipulate by ranking $B$ last. Under $\beta_j$, $B$ wins with $3j$ points. If the voter of type 2 ranks $B$ last, $B$ will still have $2j+1$, beating $A$. The voter of type 3, likewise, cannot manipulate in favour of $A$, but could try to manipulate in favour of a $C$ candidate. If he ranks $B$ last and $C_{i-1}$ first, then $B$ will have a score of $3j-1$. We can bound $C_{i-1}$'s score by $j$ (from one voter of type 1 and type 2) $+j$ (the manipulator ranks $C_{i-1}$ first) $+x$ (the points from the remaining voter of type 1). In order for $C_{i-1}$ to win, we must have $2j+x > 3j-1$, which is clearly impossible. Case two: $i=1$. \[ \begin{array}{|c|c|c|c|c|c|} \hline 2\text{ voters of type 1} & B&AC_{m-2} \dots C_{m-j+1}& C_{m-j}\dots C_1 \\ \hline 1\text{ voter of type 2} & A&C_{1}\dots C_{j-1}& C_{j-1}\dots C_{m-2}B \\ \hline 1\text{ voter of type 3} & C_{1}&AC_2\dots C_{j-1}& C_{j}\dots C_{m-2}B \\ \hline \end{array} \] Under $\beta_1$, $B$ is the winner, but the voter of type 3 can manipulate in favour of $A$. Under $\beta_j$, $A$ has $4j-3$ points to $B$'s $2j$. Since $j\geq 2$, $A$ is the winner. A voter of type 1 would rather see $B$ win, but even if he ranks $A$ last, $A$ will still have $3j-2\geq 2j$ points. A voter of type 3 would rather see $C_1$ win, but $C_1$ has $2j-1$ points, so would lose to $B$ no matter what the voter does. \end{proof} \begin{corollary}\label{corbetaji} For $n>2$, all $m$: $\beta_{j}\ngeq_{\mathcal{PS}} \beta_i$. \end{corollary} \begin{proof} \autoref{prop:betajibordaodd}, \autoref{prop:betajiqbigbordaeven}, and \autoref{prop:betajiqbigbordafour}. \end{proof} \begin{theorem}\label{thm:bordainc} For $n>2$, all $m$: $\beta_i\times_{\mathcal{PS}}\beta_j$. \end{theorem} \begin{proof} \autoref{cor:betaibetaj} and \autoref{corbetaji}. \end{proof} Thus far the story resembles that of $k$-approval. However, in the case of $n=2$, a hierarchy of manipulability is observed: \begin{theorem}\label{thm:bordan2} For $n=2$, $m>k+2$: $\beta_{k+1} \geq_{\mathcal{PS}} \beta_{k}$. \end{theorem} \begin{proof} Let voter 1's preferences be $c_1\succ_1\dots\succ_1c_m$ and voter 2's $b_1\succ_2\dots\succ_2b_m$. Note that $c_1\neq b_1$, else manipulation would not be possible. Let $\beta_k(P_1,P_2)=d$ and $\beta_{k+1}(P_1,P_2)=e$. We consider whether or not $d=e$ by cases. Case one: $d=e$. Assume voter 1 can manipulate $\beta_k$ in favour of $c_q\succ_1 d$. By \autoref{lem:normalform}, this means $c_q$ is the winner in the following profile: \[ \begin{array}{|c|c|c|c|} \hline P_1^* & c_q b_{m}\dots b_{m-k+1}&b_{m-k} &b_{m-k-1}\dots b_1 \\ \hline P_2 & b_1 \ldots b_k& b_{k+1} & b_{k+1}\dots b_m \\ \hline \end{array} \] Let us consider who the winner must be under $\beta_{k+1}(P_1^*,P_2)$. Observe that the score of a candidate under $\beta_{k+1}$ is at most two points higher than under $\beta_k$ -- it will increase by one point for each voter who ranks the candidate in the top $k+1$ positions. If $c_q$'s points increase by 2 points then we are done -- whenever $c_q$ has more points than $f$ under $\beta_k$, $c_q$ still has more points under $\beta_{k+1}$; and if $c_q$ is tied with $f$ under $\beta_k$ then that must mean $c_q$ beats $f$ in the tie, under $\beta_{k+1}$ $c_q$ will either tie with $f$ and win the tie, or have more points outright. Thus voter 1 can manipulate in favour of $c_q\succ_1 d$. If $c_q$'s points increase by 1, then that must mean that voter 2 does not rank $c_q$ in the top $k+1$ positions, and a fortiori in the top $k$ positions. Thus under $\beta_k(P_1^*,P_2)$ $c_q$ has $k$ points, $b_1$ has $k$ points, and the other candidates strictly less. Under $\beta_{k+1}$ $c_q$ and $b_1$ will still tie at $k+1$, and, since $m>k+2$, the other candidates will still have strictly less. Case two: $d\neq e$. As we have argued before, the score of a candidate can increase by at most two points when going from $\beta_k$ to $\beta_{k+1}$. Since $d$ wins under $\beta_k$ but $e$ wins under $\beta_{k+1}$, this means that $e$'s score must increase by 2 and $d$'s by 1. This means that one voter does not rank $d$ in the top $k+1$ positions, and, since $d$ must still win under $\beta_k$, this means the other voter must rank $d$ first (at least one candidate will have a score of $k$, so the winner's score must be at least $k$). Since voter 1 is the one with an incentive to manipulate, this means the sincere profile must be the following: \[ \begin{array}{|c|c|c|c|} \hline \text{Voter }1 & c_1 \ldots c_{i-1} e c_{i+1} \dots c_m \\ \hline \text{Voter }2 & d b_2 \ldots b_{j-1} eb_{j+1} \dots b_m \\ \hline \end{array} \] Under $\beta_k$ $d$ either has one point more than $e$, or they are tied and $d$ wins the tie. Under $\beta_{k+1}$ $e$ wins, which means $d$'s score increases by 1 and $e$'s by two -- thus $d$ cannot be in the top $k+1$ positions of voter 1. But this means in the sincere profile both $d$ and $c_1$ have $k$ points under $\beta_k$, and $d$ wins the tie. Voter 2 can thus manipulate $\beta_{k+1}$ as follows: \[ \begin{array}{|c|c|c|c|} \hline \text{Voter }1 & c_1 \ldots c_{i-1} e c_{i+1} \dots c_m \\ \hline \text{Voter }2 & d c_m \dots c_1 \\ \hline \end{array} \] Both $d$ and $c_1$ have $k+1$ points, since $m>k+2$ the other candidates have strictly less, and $d$ wins the tie. \end{proof} \begin{corollary}\label{cor:main} For $n=2$, $k<m-2$: $\beta_{j}>_{\mathcal{PS}}\beta_i$. \end{corollary} \begin{proof} Transitivity of $\geq_{\mathcal{PS}}$, \autoref{thm:bordan2}, and \autoref{cor:betaibetaj}. \end{proof} To finish, we observe that the proviso that $m>k+2$ really is necessary -- the Borda rule proper ($\beta_{m-1}$) is incomparable with $\beta_k$. \begin{proposition}\label{prop:betakborda} For $n=2$, all $m$: $\beta_{m-1}\ngeq_{\mathcal{PS}} \beta_k$. \end{proposition} \begin{proof} Consider the following profile, with a $B$ candidate, a $C$ candidate, and $m-2$ $A$ candidates: \[ \begin{array}{|c|c|c|c|} \hline \text{Voter }1 & B C A_{1}\dots A_{k-2}&A_{k-1} \dots A_{m-2}\\ \hline \text{Voter }2 & C A_1 \dots A_{k-1}&A_{k}\dots A_{m-2} B\\ \hline \end{array} \] Under $\beta_k$, if $k>1$ then $C$ is the winner with $2k-1$ points. Voter one can manipulate by voting $B\succ A_m\succ\dots\succ A_1\succ C$. This way $B$ will have $k$ points, and the other candidates strictly less. If $k=1$ then $B$ is the winner by tie-breaking. Voter 2 can manipulate by voting for $A_1$. Under $\beta_{m-1}$, $C$ is the winner. Voter 2 has no incentive to manipulate, voter 1 would rather see $B$ win. By \autoref{lem:normalform}, if this is possible then it is possible in the following profile: \[ \begin{array}{|c|c|c|c|} \hline \text{Voter }1 & B A_{m-2} \dots A_1 C \\ \hline \text{Voter }2 & C A_1 \dots A_{m-2} B \\ \hline \end{array} \] However, in this profile all candidates are tied with $m-1$ points, and $A_1$ wins the tie, which is worse than $C$ for the manipulator. \end{proof} \section{Conclusion} In this paper we have shown: \begin{enumerate} \item For any choice of $n,m$: $\alpha_i\ngeq_{\mathcal{PS}}\alpha_j$; \item For $n=2,i<j,j\neq m=1$: $\beta_j>_{\mathcal{PS}}\beta_i$; \item In every other instance, $\beta_i\ngeq_{\mathcal{PS}}\beta_j$. \end{enumerate} These results are negative in nature. Even in the case of two natural, hierarchical families of scoring rules, the notion of Pathak and S\"onmez fails to make a meaningful distinction between their manipulability. The quest for a useful framework for comparing the manipulability of voting rules continues.
3526fea44e9177cf398a3d874ced1289147e2e03
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{intro} The Cassegrain U-Band Efficient Spectrograph (CUBES) instrument is a new spectrograph in development for one of the Cassegrain foci of the Very Large Telescope (VLT) at the European Southern Observatory (ESO). The goal is to maximise the efficiency at a spectral resolving power ($R$) of greater than 20000, over the bluest part of the spectrum accessible from the ground (\SIrange{300}{400}{nm}). Given its performance at short wavelengths, CUBES will provide an unprecedented blue eye on the sky alongside the Extremely Large Telescope (ELT) that is now under construction on Cerro Armazones \cite{Ref-Evans_2018}. A tenfold improvement in sensitivity compared to existing instruments in the near-UV will open-up exciting new observations across a broad range of scientific topics, as highlighted by many of the contributions in this Special Issue. These range from searches of water in the asteroid belt \cite{Ref-Opitom}, a broad range of applications in studies of stellar evolution and nucleosynthesis (ranging from light elements such as beryllium up to iron-peak and heavier elements, e.g. \cite{Ref-Ernandes_2020}), to extragalactic observations such as the contribution of galaxies and active galactic nuclei to the cosmic UV background \cite{Ref-Vanzella}. The successful design, integration and commissioning of an instrument like CUBES requires a staged development (in phases). This allows trade-offs between requirements and possible hardware configurations to maximise the performance and arrive at a final layout that satisfies the scientific requirements and enables the desired range of science applications. In the context of the conceptual design phase (Phase~A) of CUBES we developed two software tools to aid both the technical and scientific teams, an End-to-End (E2E) simulator and an Exposure Time Calculator (ETC). Briefly, E2E instrument simulators are software systems that simulate the instrument behaviour during astronomical observations, from the flux distribution of the scientific sources through to the raw data produced as output by the instrument detector. The synthetic raw frames from the E2E simulations can also be used to aid the development of the Data Reduction Software (DRS), allowing first evaluation of the scientific goals of the project and to give feedback to the technical team during design phases and trade-off studies. ETCs allow astronomers to accurately plan the time required for potential observing programmes by predicting the signal-to-noise ratio (SNR) for a given exposure time. ETCs are quick and user-friendly tools to evaluate instrument performance for a range of scientific cases under study, making them a valuable complement to studies with the E2E simulator. We developed and used these tools during the CUBES Phase~A design study to evaluate different possible configurations for the instrument, and to investigate the performance of a possible low-resolution mode. We then focused on particular science cases where CUBES will outperform existing instruments in the ground-UV to quantify its performance; many of these scientific applications are explored in the other contributions in this Special Issue. The paper is organized as follows. In Sect.~2 we briefly review the overall design of CUBES while in Sect.~3 we present the instrument model and discuss its application for the trade-off analyses and performance evaluation in Sect.~4. We present the ETC tool and an example application in Sect~5, with concluding remarks in Sect.~6. \section{The CUBES instrument} \label{sec_CUBES_General} CUBES will be mounted at the VLT Cassegrain focus and the Phase~A instrument baseline includes the following subsystems: \begin{itemize} \item A fore-optics subsystem that includes an atmospheric dispersion corrector (ADC), the pre-slit and an Acquisition and Guiding (A\&G) subsystem, \item Two image slicers (to enable different resolutions), \item A fibrelink to UVES, \item A calibration unit, \item Two spectrograph arms: arm\,1 (blue-optimized) and arm\,2 (red-optimized), both equipped with transmission gratings with a high groove density, working at the first order, and with 9k\,$\times$\,9k scientific detectors. \end{itemize} \begin{figure*}[!t] \centering \includegraphics[width=0.75\textwidth]{CUBES_functional_overview.png} \caption{CUBES functional overview. Taken from \cite{Ref-Zanutta_2021}.} \label{fig:CUBES_functional_overview} \end{figure*} The instrument design has two operational modes, either using CUBES alone or in combination with VLT-UVES \cite{Ref-UVES} for simultaneous observations via an optical fibrelink. A detailed description of the CUBES instrument is outside the scope of this paper and is given by \cite{Ref-Zanutta_2021}. Here we briefly outline its main characteristics and subsystems, as shown in the functional schematic of Fig.~\ref{fig:CUBES_functional_overview}. \subsection{Fore-optics and A\&G subsystems} The fore-optics subsystem provides a collimated beam for the ADC and the magnifying optics to feed the image slicer. The image slicer reformats the science object into narrower slits at the input to the spectrograph, enabling higher resolution with respect to a traditional slit. The Phase~A design includes two image slicers (for details see \cite{Ref-Zanutta_2021} and \cite{Ref-Calcines_2021}), to provide the option of high- and low-resolution modes (HR and LR, respectively). The A\&G subsystem provides initial acquisition of the science target and secondary guiding capabilities during the exposure. Finally, a dichroic mirror can be used to pick-off light to be relayed to the FibreLink subsystem for simultaneous observations with UVES. \subsection{Fibrelink to UVES} The FibreLink subsystem provides the option of relaying light to the UVES instrument on the Nasmyth platform for simultaneous observations at longer wavelengths ($\lambda$\,$>$\,420\,nm). The FibreLink subsystem includes an ADC and a fibre-guiding system. \subsection{Calibration Unit} The Calibration Unit provides light sources to perform calibration procedures, such as flat fielding, wavelength calibration, simultaneous wavelength calibration, alignment and flexure correction (in case an Active Flexure Compensation, AFC, System is required). It also provides calibration sources for UVES when used for simultaneous observations with CUBES. \subsection{The spectrograph} The spectrograph subsystem is composed of two arms. Each arm collimates the beam, disperses the light using a transmission grating (see \cite{Ref-Gratings_2021} for details) and refocuses the image with a camera on a 9k x 9k scientific detector. The possibility of including actuators for the AFC System (if required), has been foreseen from the beginning and will be carefully studied in next project phases. \section{The CUBES E2E simulator} \label{sec_E2E_sim} Following the work presented by \cite{Ref-Genoni_2020}, we adapted the existing E2E simulator architecture from other instruments and implemented the same modular approach for the CUBES simulator. Indeed, it is composed of different modules (each with specific tasks), units and interfaces, mimicking the functional architecture of the CUBES instrument, as described in the schematic workflow of Fig.~\ref{fig:E2E_Tech_01}. Further details of such a software architecture and its properties can be found in \cite{Ref-Genoni_2020}. \begin{figure*} \centering \includegraphics[width=0.8\textwidth]{E2E_Tech_01_Schematic_v2.PNG} \caption{E2E simulator workflow schematic description for the CUBES instrument (adapted from \cite{Ref-Genoni_2020}). The solid arrows represent the light path, while the dashed arrows show the simulation data-flow, how the different modules and units are interfaced and their connection to the simulator core, which is the Image Simulation Module. The synthetic frame produced by the simulator is ingested by the data reduction system (DRS) pipeline. Green blocks are units of the Instrument Module, while blue blocks are related to simulation modules independent of the instrument.} \label{fig:E2E_Tech_01} \end{figure*} Three versions of the CUBES E2E have been developed for different user applications, featuring different capabilities (or functionalities) that were used during the Phase~A design study. These are: \begin{itemize} \item \textit{Basic Version:} aimed at science users, to assess the performance of the instrument with respect to the science objectives, depending on the adopted instrument design. \item \textit{Parametric Version:} provides fast parametric simulations of the different possible design solutions and configurations, as an aid for the design development. \item \textit{Full Version:} produces high-level simulated frames based on a detailed physical model of the instrument (including optical effects as the contribution of blurring of the point spread function (PSF), distortions and detector diffusion effects), to be used for the development and testing of the data reduction pipeline. \end{itemize} The \textit{Basic Version} of the simulator is implemented as a Python 3 library \cite{10.5555/1593511} and accessed through a Jupyter notebook \cite{jupyter}. The notebook includes both the basic code to perform the simulation and instructions on how to execute it\footnote{A compact version of the notebook, omitting all instructions, is also available.}. Users can freely configure the parameters of the simulation and run it. Advanced users may also inspect the library and possibly edit its functions through the Jupyter interface. The library and the notebook are available as a Git repository through GitHub\footnote{\url{https://github.com/gcupani/cubes}.} for download on local machines. It is also hosted on Binder \cite{binder}, an online tool to execute Jupyter notebooks on a remote server interactively\footnote{\url{https://bit.ly/cubes_e2e}. Note that the Binder version is limited in memory usage and is therefore not guaranteed to be executed with arbitrary choices of the simulation parameters.}. The \textit{Full Version} is currently written in MATLAB and uses libraries for specific functionalities, as well as an ad-hoc software wrapper we developed to interface with other software, such as the commercial optical ray tracing Zemax-OpticStudio. The \textit{Parametric Version} is also developed in MATLAB; it shares some modules and parts of code with the \textit{Full Version} (e.g. the Science Object Module), while it employs an ad-hoc parametric description of the spectrograph to run parametric simulations. Given the different purposes and functionalities, the first version is available on-line for the scientific community, while the other two are used by the technical team. \subsection{E2E Modules description and functionalities} \label{subsec_E2E_Modules} We now describe the module functionalities implemented for the specific needs of the CUBES instrument (building on the functionalities described by \cite{Ref-Genoni_2020}): \paragraph{Science Object Module:} generates a synthetic 1D spectrum of an astronomical source for a user-defined set of parameters (e.g. flux distribution, magnitude), at a resolution higher than the selected instrument mode (i.e. HR or LR). A user-defined spectrum (in ASCII format) can also be uploaded as the input spectrum, where the user must ensure that the resolution is again greater than that of the selected HR or LR mode. \paragraph{Sky radiance and atmospheric transmission:} spectra are modelled by the Sky-Atmosphere module invoking a dedicated library built using the ESO {\sc skycalc} tool (REFF-SkyCalc). These spectra are loaded from the library according to the adopted observing conditions for the simulation, i.e. moon phase, airmass and precipitable water vapour. A typical output of these modules is shown in Fig.~\ref{fig:E2E_Sci_01_ObjSky}, including general information about the target and sky background, their photon balance, and their spectra. \begin{figure*} \includegraphics[width=1\textwidth]{E2E_Sci_01_ObjSky_v3.pdf} \caption{Example of the input spectra in the \textit{Basic Version} E2E notebook (for a flat spectrum of $U$\,$=$\,18\,mag). The integrated flux from the target and the sky is computed assuming the collecting area of the primary mirror of a VLT unit telescope and a detector integration time of \SI{3600}{s}. \textit{Left:} photon balance between the target and the sky background. \textit{Right:} spectra of target (with extinction) and background.} \label{fig:E2E_Sci_01_ObjSky} \end{figure*} \paragraph{Instrument Module:} composed of the fore-optics, slicer and spectrograph units. The slicer unit computes the slit efficiency, i.e. the fraction of light passing through the pseudo-slit reformatted at the spectrograph entrance slit. This is related to the design configuration and/or resolution mode, where the HR slicer provides an on-sky field-of-view of \ang{;;1.5}$\times$\ang{;;10} and the LR slicer has a larger field of \ang{;;6}$\times$\ang{;;10} (as described by \cite{Ref-Zanutta_2021} and \cite{Ref-Calcines_2021}). The calculation of the slit efficiency is implemented taking into account the instrument entrance aperture sizes (width and length), the optical quality (PSF FWHM) of the optical path up to the slicer focal plane and the seeing (FWHM at \SI{500}{nm}). Optionally, the PSF can be convolved with a given spatial profile, which is useful to simulate the appearance of extended targets. An example of the target PSF is shown in Fig.~\ref{fig:E2E_Sci_02}. \begin{figure} \includegraphics[width=0.5\textwidth]{E2E_Sci_02_Slices_v3.pdf} \caption Simulated image of the target point spread function (PSF) on the (high-resolution) slicer focal plane, with the slice boundaries superimposed in red.} \label{fig:E2E_Sci_02} \end{figure} The spectrograph unit predicts the spectral format at the focal plane of the two CUBES arms, the instrument throughput and a database of PSF maps for a set spectral resolution element (which are used by the Image Simulation Module to render the synthetic frames). The \textit{Parametric Version}, as explained in \cite{Ref-Genoni_2020} and \cite{Ref-Genoni_PPM}, implements the parametric equations of the different optical elements to derive the spectral format, resolving power, sampling and linear dispersion variation across the wavelength range of both arms. Tabulated solutions of the parametric equations are also used by the \textit{Basic Version} to interpolate the sampling and linear dispersion across the simulated detector pixels and to model the spectral format (see Fig.~\ref{fig:E2E_Sci_03_Maps}). In the \textit{Full Version}, this unit extracts the slice traces (in terms of position and orientation along the main dispersion direction) and the slice PSF maps from the Spectrograph Optical File(s) designed in Zemax/OpticStudio, thus the accuracy of the aberrations, distortion and diffraction effects is defined by the parameters with which the specific optical design files tools were run. \paragraph{Detector Module:} generates a series of maps of the effects produced by the detector, which are added to the photons distribution at pixel level by the Image Simulation Module. For the baseline Phase~A design with 9K-\SI{10}{\micro\meter} detectors, the expected dark current (DC) is \SI{0.5}{e^-\per pix\per\hour} (assuming a temperature of \SI{165}{K}), the adopted read-out noise (RON) is \SI{2.5}{e^-} rms (at \SI{50}{\kilo\hertz}), and a pixel-response non-uniformity of 3\% is assumed (from the manufacturer's datasheet). The detector diffusion, which spreads out photo-electrons into neighbouring pixels, is assumed to be modelled as a Gaussian kernel with a FWHM of 0.9 pixels. \paragraph{Image Simulation Module:} renders the photon distribution for each spectral resolution element for each slice at the level of the focal plane of the spectrograph arms. The photons collected by each slice are mapped into separate spectral traces on the detector, applying the input template for the target and the sky to reconstruct the spectral features. In the \textit{Basic Version} this is done without consideration of any misalignment of the slices or any tilting along the main dispersion direction: all detector pixels along a given column are assumed to have the same wavelength in all the slices. In the \textit{Full Version}, as detailed in \cite{Ref-Genoni_2020}, this module first interpolates all of the instrumental data produced by other modules on a sub-pixel scale (of which the oversampling can be set according to the required simulation accuracy). It then produces the photon distribution for each wavelength at sub-pixel scale by convolving each slice image with the corresponding PSF map; each spectral PSF map is computed by interpolating a grid of PSF maps, extracted by the \textit{Instrument Module} from optical ray-tracing software. The spectral slice images are properly sized and tilted according to the sampling and tilt variation along the main dispersion direction, and scaled for the integrated spectral flux and efficiency. Finally, the synthetic frame is re-binned to the pixel scale of the detectors and the noise maps from the Detector module are added. In the current development read-out noise (RON), dark current (DC), bias levels, pixels response non-uniformity (PRNU) and pixel cross-talk (due to charge diffusion) are implemented; RON, DC and diffusion parameters are the ones reported in Table~\ref{Tab_1_Trade_Off}, while a PRNU of 4$\%$ (1$\sigma$) is assumed as educated guess at UV wavelengths. An example of a synthetic raw frame produced by the \textit{Full Version} is shown in Fig.~\ref{fig:E2E_Sci_07_Full_Frame_Arm1}. The traces of the six slices can be seen, in which it is also possible to see the decreasing flux of the object towards the blue end of the spectral range (left-hand side of the figure). In the baseline design the traces are projected onto the upper half of the detector because the lower half is used to record the AFC fibre (if required). In the reference condition for the HR mode the detector noise dominates over the sky background and the sky flux in the pixels cannot be easily distinguished. These frames include the pre- and over-scan regions based on the same detector model installed in other instruments (e.g. ESPRESSO on the VLT). \begin{figure} \includegraphics[width=0.5\textwidth]{E2E_Sci_03_Maps_v2.pdf} \caption{Interpolation of resolving power, linear dispersion and sampling per resolution element in the high-resolution mode (from the static tables used by the \textit{Basic Version} of the E2E simulator). Note that the spectral sampling is above the Nyquist limit over the full 300-\SI{405}{nm} range.} \label{fig:E2E_Sci_03_Maps} \end{figure} \begin{figure*} \centering \includegraphics[width=0.75\textwidth]{E2E_Tech_07_PSF_Full_frame_Arm1_v2.png} \caption{Example simulated raw frame for Arm 1. The six slice traces are projected onto the upper half of the detector to allow the lower half to be read out separately to record the active flexure compensation (AFC) system (if analysis in the next phases shows it is required).} \label{fig:E2E_Sci_07_Full_Frame_Arm1} \end{figure*} \paragraph{Extraction of the 1D spectrum:} The traces of the individual slices, as imaged by the two detectors, are extracted by a dedicated software module into a single 1D spectrum. The extraction module is currently implemented as a part of the \textit{Basic Version} of the simulator, but is actually the first simple incarnation of what will become the data reduction pipeline of the instrument. In its current form, the extraction module simply sums the simulated pixel counts along columns, assuming that all pixels in a column have the same wavelength (which is the case for the \textit{Basic Version} implementation of the spectral format). Extraction windows are centered at the peak of the spatial profile of the simulated target in each slice and their width is defined as 1.2 times the FWHM of the profile. The extracted spectrum with its propagated error is used to estimate the SNR as a function of wavelength, given the instrument setup and adopted observing conditions. In its final form, the extraction module will become a part of the instrument DRS and will implement a more sophisticated extraction procedure, under the assumption that all pixels are calibrated at a different wavelength (see Section \ref{subsec_E2E_DRS}). \section{The E2E role in the design phases} \label{sec_E2E_app} In this section we focus on the experimental application of the E2E simulator to evaluate the instrument design performance and functionalities while fulfilling the top-level requirements (TLRs) on the instrument, as well as driving initial development of pipeline recipes for the DRS. Given the scientific cases assembled for the development of CUBES, we identified a set of key performance TLRs that must be satisfied, including: \begin{itemize} \item CUBES shall provide a spectrum of the target over the entire wavelength range from \SIrange{305}{400}{nm} in a single exposure. (Goal: 300-\SI{420}{nm}). \item In any part of the spectrum, the resolving power ($R$) shall be greater than 19000. The average value of $R$ shall be greater than 20000. $R$ is defined as the FWHM of unresolved spectral lines of a hollow cathode lamp in the spectral slice. \item In a one-hour exposure the spectrograph shall be able to obtain $\textrm{SNR}=20$ for an A0-type star with $U=17.5$\,mag., for a wavelength pixel of \SI{0.007}{nm} at \SI{313}{nm} (at an airmass of 1.16). For different pixel sizes and airmasses, the SNR shall scale accordingly. \end{itemize} We applied the versatility of the E2E simulator to carry out trade-off analyses of different potential designs for the HR mode, and to also assess the performance of a LR mode for the instrument. In addition, the tool was applied by other groups to assess specific science cases (e.g. \cite{Ref-Alcala_2021}). \subsection{Trade-Off Analysis} \label{subsec_TradeOff} To aid the opto-mechanical design we performed detailed trade-off analyses with the E2E \textit{Parametric Version} to evaluate the performance of different design configurations of the HR mode compared to the TLRs. We explored five different configurations, as summarized in Table~\ref{Tab_1_Trade_Off}. These considered different detector geometries, wavelength coverage and grating parameters, with the objective of assessing the instrument performance in terms of SNR and resolving power. We now briefly describe the configurations considered and our main findings. \paragraph{Configuration 6K:} this design used 6K-\SI{15}{\micro\meter} detectors, which were considered to minimize the spatial sampling (thus trying to maximize the SNR). The \ang{;;1.5} aperture is sampled with six slices, resulting in a \SI{0.2}{mm} input slit width to the spectrograph. The collimated beam size is \SI{150}{mm} and the grating parameters are well within current manufacturing capabilities. The geometrical spectral resolution element (SRE) sampling at the central wavelength for both arms is $\approx$2.12 pixels, while the minimum is 2 pixels (so at the Nyquist limit). The blurring term of optics PSF, flexure and detector diffusion broadens the SRE image such that the FWHM of the Gaussian fit of the resulting line spread function (LSF) at the minimum wavlength is $\approx$2.05 pixels. The related minimum $R$ is 18500, thus just below the requirement, while the average is 20500. The wavelength range provided is 305-\SI{400}{nm}, just fulfilling the minimum coverage. The estimated SNR for the reference object and sky conditions from the TLRs (and scaled to \SI{0.007}{nm\per pix}) satisfies the requirement (i.e. SNR\,$\ge$\,20) for both 1\,$\times$\,1 and 1\,$\times$\,2 binning (where first and second values are the spectral and spatial binning, respectively). \paragraph{Configurations 9K:} Adopting a 9K-\SI{10}{\micro\meter} detector and reducing the geometrical projection of the spectral resolution element allows us to extend the wavelength range to 300-\SI{405}{nm}. Within the 9K detector geometry we considered four different configurations, named H1-H2-H3-H4. Simulations showed that increasing the grating parameters (line density and angle of incidence) while maintaining an optical PSF below one pixel enables an increase in the spectral resolving power. This is shown by the entries for configurations H1, H2 and H3 in Table~\ref{Tab_1_Trade_Off}, where the grating line-density is close to the current limit of manufacturing (for details see \cite{Ref-Gratings_2021}\footnote{A small difference in the grating parameters between the two contributions is due to the different times along the project when this analysis was performed and the final grating parameters were frozen.}) and $R_{\rm min}$\,$>$\,20000. The differences between configurations H1 and H2 are the spectrograph input slit, where it is reduced in H2 to \SI{0.191}{mm} to help increase $R$ and the related spectral sampling. As the linear dispersion and the total number of integer pixels counted in the spatial direction for the SNR computation are the same for these two design options, the SNR values computed per pixel bin are also the same. Configuration H3 simulates an entrance aperture of \ang{;;1.35}$\times$\ang{;;10} so the slit width and sampling are reduced by 10 $\%$ compared to H1 and the geometrical $R$ is higher by 10 $\%$. As the minimum sampling is lower than configurations H1 and H2, the blurring terms have a larger impact on the resulting LSF such that the effective gain in $R_{\rm min}$ is only 5$\%$ higher than H1 and H2. The reduced entrance aperture of \ang{;;1.35} decreases the slit efficiency, thus reducing the object counts integrated in the SNR (albeit also reducing the sky noise contribution), resulting in lower SNR values than H1 and H2. Configuration H4 simulates the entrance aperture of \ang{;;1.5} with five slices instead of six. The collimated beam size is \SI{180}{mm}, which would translate to a significant mass increase (possibly exceeding the mass limit requirement of \SI{2.5}{ton}). Moreover, the grating parameters are more challenging with respect to other configurations. This gives $R_{\rm min}$\,$=$\,19200, so below the minimum requirement of 20000, and the $F/1.95$ camera could imply even larger optical aberrations with respect to the assumed value of 0.87 pixels FWHM of the optical PSF. The real gain of this design option is that the SNR is larger than other configurations because of the reduced number of slices. \bigskip From the trade-off considerations above, configuration H2 was the preferred design as it maximizes the entrance aperture with R\,$>$20000 for the whole wavelength range, while keeping the instrument within the mass limit requirement and the optics within reach of current manufacturing capabilities. Finally, adopting this configuration, the design is able to reach a SNR $>$20 in the defined observing conditions and for the required wavelength bin. \begin{table*} \caption{Trade-off results. Instrumental and performance parameters reported for the 6K-\SI{15}{\micro\meter} detector design option, and the H1-H2-H3-H4 options with 9K-\SI{10}{\micro\meter} detectors. The sampling related to the Line Spread Function (LSF) FWHM is computed as the Gaussian fit of the profile resulting from convolution of the geometrical sampling profile with the optics PSF, blurring due to flexure and detector diffusion among neighbouring pixels; all these blurring distributions are modelled as Gaussians with FWHMs as reported. The Resolving Power is that of the LSF FWHM. The SNR is computed at \SI{313}{nm}, close to the beryllium doublet, for a wavelength pixel of \SI{0.007}{nm}, and for both 1\,$\times$\,1 and 1\,$\times$\,2 (2 in spatial direction) pixel binning. } \label{Tab_1_Trade_Off} \begin{tabular}{lllllll} \hline\noalign{\smallskip} \textbf{\textit{Parameter}} & Units & \textbf{Config 6K} & \textbf{Config H1} & \textbf{Config H2} & \textbf{Config H3} & \textbf{Config H4} \\ \noalign{\smallskip}\hline\noalign{\smallskip} \textbf{\textit{Instrumental}} & & & & & & \\ \noalign{\medskip} \textit{$\lambda$ range} & \SI{}{nm} & 305-352 & 300-352 & 300-352 & 300-352 & 300-352 \\ & & 346-400 & 346-405 & 346-405 & 346-405 & 346-405 \\ \noalign{\smallskip} \textit{Entrance Aperture} & \SI{}{arcsec^2} & 1.5$\times$10 & 1.5$\times$10 & 1.5$\times$10 & 1.35$\times$10 & 1.5$\times$10 \\ \noalign{\smallskip} \textit{N. of slices} & [-] & 6 & 6 & 6 & 6 & 5 \\ \noalign{\smallskip} \textit{Input Slit Width} & \SI{}{mm} & 0.2 & 0.2 & 0.191 & 0.18 & 0.2 \\ \noalign{\smallskip} \textit{Beam size} & \SI{}{mm} & 150 & 154 & 160 & 154 & 180 \\ \noalign{\smallskip} \textit{Gratings AOI} & \SI{}{deg} & 34.045 & 36.07 & 36.07 & 36.07 & 37.02\\ & & 34.045 & 35.82 & 35.82 & 35.82 & 37.02\\ \noalign{\smallskip} \textit{Gratings line-density} & \SI{}{l \per mm} & 3370 & 3600 & 3600 & 3600 & 3687\\ & & 3000 & 3107 & 3107 & 3107 & 3198 \\ \noalign{\smallskip} \textit{Camera $F/\#$} & [-] & $F/3.20$ & $F/2.60$ & $F/2.54$ & $F/2.60$ & $F/1.95$\\ \noalign{\smallskip} \textit{RON} & \SI{}{e^-} rms & 2 & 2.5 & 2.5 & 2.5 & 2.5 \\ \noalign{\smallskip} \textit{DC} & \SI{}{e^- \per pix \per\hour} & 3 & 0.5 & 0.5 & 0.5 & 0.5 \\ \noalign{\smallskip} \textit{Sampling GEO at min $\lambda$} & \SI{}{pix} & 2 & 2.4 & 2.3 & 2.13 & 2.13 \\ \textit{Sampling GEO central $\lambda$} & \SI{}{pix} & 2.12 & 2.56 & 2.5 & 2.3 & 2.3 \\ \noalign{\smallskip} \textit{Gauss FWHM Optics PSF} & \SI{}{pix} & 0.6 & 0.65 & 0.65 & 0.65 & 0.87 \\ \noalign{\smallskip} \textit{Flexure Blur FWHM} & \SI{}{pix} & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 \\ \noalign{\smallskip} \textit{CCD Diffusion} & \SI{}{pix} & 0.9 & 0.9 & 0.9 & 0.9 & 0.9 \\ \noalign{\smallskip} \noalign{\smallskip}\hline\noalign{\smallskip} \textbf{\textit{Performance}} & & & & & & \\ \noalign{\medskip} \textit{Sampling LSF FWHM at min $\lambda$} & \SI{}{pix} & 2.05 & 2.4 & 2.35 & 2.25 & 2.30 \\ \noalign{\smallskip} \textit{Resolving Power min} & [-] & 18500 & 20500 & 21000 & 22000 & 19200 \\ \noalign{\smallskip} \textit{SNR at 313 nm (0.007 nm/bin) 1x1} & [-] & 25.5 & 26 & 26 & 24.5 & 26.6 \\ \noalign{\smallskip} \textit{SNR at 313 nm (0.007 nm/bin) 1x2} & [-] & 27.5 & 28 & 28 & 27.6 & 29.2 \\ \noalign{\smallskip}\hline \end{tabular} \end{table*} \subsection{Low-resolution mode} \label{subsec_LRmode} The investigation of possible design configurations for the LR mode of CUBES was also done using the \textit{Parametric Version} of the E2E, with similar assumptions as described for the HR trade-off above. After some preliminary evaluations, in collaboration with the Science Team, two possible LR modes were explored: \begin{itemize} \item Total input aperture of \ang{;;6} and six slices (i.e. \ang{;;1} per slice). The average geometrical $R$ is then $\sim$6000 given the H2 design configuration. \item Total input aperture of \ang{;;3} and four slices (i.e. \ang{;;0.75} per slice). The average geometrical $R$ is then $\sim$8000 given the H2 design configuration. \end{itemize} The noise terms were calculated using the same reference input parameters as for the HR simulations above, with the exception that only the two central slices were considered for the noise calculation (as these will capture the majority of the light in LR mode for a seeing of \ang{;;0.87}). The noise-terms plots for the LR mode with a total input aperture of \ang{;;6} and six slices are shown in Fig.~\ref{fig:E2E_Tech_10_LR_mode_6asec} (left-hand panel: 1\,$\times$\,1 binning, right-hand panel: 1\,$\times$\,2 binning). Similar plots are shown in Fig.~\ref{fig:E2E_Tech_10_LR_mode_3asec} for the case of a total input aperture of \ang{;;3} and four slices. \begin{figure*} \includegraphics[width=1\textwidth]{E2E_Tech_10_LR_mode_6asec.PNG} \caption{Noise terms for the low-resolution mode with a total input aperture of \ang{;;6} and six slices. {\it Left:} 1\,$\times$\,1 binning. {\it Right:} 1\,$\times$\,2 binning.} \label{fig:E2E_Tech_10_LR_mode_6asec} \end{figure*} \begin{figure*} \includegraphics[width=1\textwidth]{E2E_Tech_11_LR_mode_3asec.PNG} \caption{Noise terms for the low-resolution mode with a total input aperture of \ang{;;3} and four slices. {\it Left:} 1\,$\times$\,1 binning. {\it Right:} 1\,$\times$\,2 binning.} \label{fig:E2E_Tech_10_LR_mode_3asec} \end{figure*} The conclusion from the noise-term evaluation is that the LR mode, with a \ang{;;6} aperture and six slices, will allow us to be sky-noise dominated for both detector binning options down to 313/\SI{320}{nm}. The other LR mode is sky-noise dominated only with 1\,$\times$\,2 binning. Other binning options (e.g., 2\,$\times$\,2) could provide further advantages, if acceptable for the scientific objectives. In summary, by employing slices that are four times wider for the LR slicer, the instrument remains background limited for the faintest sources, combined with delivering a spectral resolving power that is compared to X-Shooter ($R\sim6000$, see \cite{Ref-XSH}). This is a powerful combination for some science cases (where sensitivity is more critical than resolution), as outlined by e.g. \cite{Ref-Opitom}. \subsection{E2E and DRS connection} \label{subsec_E2E_DRS} The E2E will play a pivotal role in the development of the DRS, which will remove the instrumental signature from the CUBES raw spectra and calibrate them into physical units. In the software design phase, the spectral format simulated by the E2E will provide a reliable reference to prototype the algorithms responsible for extracting the spectra of the targets in an optimal way, taking into account the slice layout and the possible tilt of the lines of equal wavelength along the slices with respect to the detector pixel grid. In the coding phase, the E2E will produce simulated calibration frames alongside the science frames, to provide a complete dataset for the development and testing of the DRS recipes. \begin{figure*} \begin{minipage}[c]{.99\textwidth} \centering \includegraphics[width=0.6\textwidth]{E2E_Tech_12_tilt.png} \end{minipage} \hspace{10mm} \caption{Mock-up of the slice layout. Several sky lines are visible (with the most prominent located at $\sim$60 pixels in the main dispersion direction) over the continuum trace of the science target across the six slices.} \label{fig:E2E_Tech_Tilt} \end{figure*} A preliminary mock-up of the slice layout, based on the current optical configuration (H2) is shown in Fig.~\ref{fig:E2E_Tech_Tilt}. The position of the sky lines in the different slices show how the slices are misaligned with respect to each other and tilted with respect to the detector axes (especially the outermost lines). Due to these distortions, the pixels along a given detector column are not mapped to the same wavelength, and a simple summation along columns (like those described in Sect.~\ref{subsec_E2E_Modules}) is not feasible. As a consequence, the DRS will implement a more sophisticated extraction procedure, under the assumption that all pixels are calibrated at a different wavelength. The details of such an algorithm are discussed by \cite{2016SPIE.9913E..1TC}. The procedure is effectively an extension of the optimal extraction algorithm described by \cite{Horne1986}, in which the contributions of the detector pixels (each one calibrated with a specific wavelength) are also weighted by how much they overlap with the wavelength bins of the final extracted spectrum. The procedure allows creation of a single spectrum from several slices in one go, minimizing the correlation that is introduced across adjacent bins by the re-binning procedure. Furthermore, it can be naturally scaled up to combine several exposures of the same target, or scaled down to produce separate spectra of the individual slices, with a flexibility that reduction pipelines typically do not provide. In this respect, the E2E was instrumental in steering the choice of the right algorithm even before the inception of the DRS design phase. Preliminary examples of simulated calibration frames, constructed by similarity with the calibration frames of VLT ESPRESSO, are shown in Fig.~\ref{fig:E2E_calibrations}. These frames will be integrated with other simulated calibrations and further refined throughout during the coding phase, taking advantage of the information acquired from the instrument manufacturing and integration. The interface between E2E and DRS will be settled with the definition of a shared pool of metadata to be attached to these data, and will make the two tools operate like a single entity even before the instrument comes into operation. In a sense, the E2E paradigm will be brought to its natural consequence, with the final end not being limited to a set of simulated raw data, but including their reduced counterpart, too. \begin{figure*} \includegraphics[width=0.5\textwidth,angle=270]{bias_mock.png} \includegraphics[width=0.5\textwidth,angle=270]{flat_mock.png} \caption{Example of simulated calibration frames for Arm 1, constructed by similarity with VLT ESPRESSO calibration frames. {\it Left:} bias frame; {\it right:} flat frame.} \label{fig:E2E_calibrations} \end{figure*} \section{The CUBES ETC} \label{sec_ETC} Along with the E2E simulator, the CUBES ETC has provided a valuable tool during the Phase~A study to support evaluation of the science cases and the new scientific opportunities that can be achieved with the CUBES instrument. During the Phase~A study we also undertook careful comparisons between the E2E and ETC for several reference input configurations, to confirm their agreement. In general, the role of an ETC is to predict the SNR for a given exposure time. The CUBES ETC is a web-based application\footnote{http://archives.ia2.inaf.it/cubes/\#/etc} that provides the achievable SNR per pixel for a given wavelength ($\lambda$), exposure time ($t$), sky conditions, and Vega magnitude ($U$, $V$) of a point-source target. It can also provide the exposure time required to obtain a given SNR, if the SNR is given as the input instead of the exposure time. The limiting magnitude (in AB units) to obtain SNR\,$=$\,3 at the selected wavelength and exposure time, and graphical outputs such as plots of SNR vs. $t$ and the limiting magnitude vs. SNR for the user-selected $t$, are also provided. \subsection{ETC status and implementation} \label{subsec_ETC_status} The ETC is a Python 3.7.6 script that is called by a web application written in Java and JavaScript and uses the facilities of the Italian Center for Astronomical Archive (IA2) operated by INAF. The web-page of the current ETC version consists of three parts: \begin{itemize} \item The first and main part contains the observation parameters, i.e., target information, expected atmospheric conditions, instrument configuration (LR or HR mode), and the observation parameter exposure time or SNR (Fig.~\ref{fig:ETC_MainPage}). A small database of input spectra (synthetic spectra, a quasar spectrum, a theoretical spectrum with constant AB magnitude) is available for use as input flux distributions. There is also the possibility of loading an input template (in ASCII format) from a user-defined library through the option `Custom spectrum'. This input spectrum can be displayed via the `Plot spectrum' button for a quick visual check. The `Apply' button then submits the parameters to the ETC model. \item The second part is hidden and contains the CUBES setup, but can be visualized via the `Toggle advanced setting' at the bottom of the main one. It contains all of the instrument parameters necessary to define the HR or LR configuration of CUBES, which can be modified within their acceptable ranges. This last option allowed us to explore different design solutions during the Phase~A study. Fig.~\ref{fig:AdvancedSetting} shows the CUBES setup for the HR mode. \item The third part displays the computed results, which are: graphical outputs (SNR vs. $t$ and the limiting magnitude vs. SNR as shown in Fig.~\ref{fig:ETC_outputs}), together with a table including the main input data (object type, sky condition, etc), slit losses, number of counts for the object and the sky, wavelength bin in \AA/pix, instrument efficiencies, detector binning, detector noise counts, magnitude limit at $\textrm{SNR}=3$, and SNR or $t$. \end{itemize} \begin{figure*} \begin{minipage}[c]{.99\textwidth} \centering \includegraphics[width=0.95\textwidth]{ETC_MainPage} \end{minipage} \hspace{10mm} \caption{Main web-page of the CUBES Exposure Time Calculator (ETC), showing the inputs required to compute the signal-to-noise ratio (SNR).} \label{fig:ETC_MainPage} \end{figure*} \begin{figure*} \hspace{15mm} \begin{minipage}[c]{.99\textwidth} \includegraphics[width=0.95\textwidth]{ETC_HR_Setup.png} \end{minipage} \caption{Advanced set-up parameters in the CUBES Exposure Time Calculator (ETC) for the high-resolution mode.} \label{fig:AdvancedSetting} \end{figure*} \begin{figure*} \begin{minipage}[c]{0.93\textwidth} \centering \includegraphics[width=0.8\textwidth]{ETC_outptsa.png} \end{minipage} \hspace{0mm} \caption{Example outputs of the CUBES ETC version at the end of Phase~A. Top panel: predicted SNR vs exposure time at $\lambda$=350\,nm for different exposure times with the HR mode of CUBES. The input template is a theoretical spectrum with constant AB magnitude and scaled to $U$ = 12\,mag, with other parameters set to: $U_{\rm Sky}$ = 22\,mag\,arcsec$^{-2}$, airmass = 1.0, seeing = 0.87$''$, DC = 0.5e$^-$/pix/hr, RON = 2.5\,e$^-$ rms, and 1\,$\times$\,1 pixel binning. The vertical red line shows the SNR at the selected exposure time of 1\,h. Bottom panel: SNR vs AB magnitude limit diagram computed for the exposute time of 1\, h and the same conditions as in the top panel.} \label{fig:ETC_outputs} \end{figure*} Starting from the input science spectrum (from the local database or a user-defined template), the ETC computes the SNR per spectral pixel (or spectral bin) at a user-selected $\lambda$ by taking into account the effects produced on the target's photons by all the components encountered along their optical path from the atmosphere to the detectors. The ETC models of the atmosphere, telescope, slit, spectrograph, camera and detector are implemented through an appropriate parameterization. The modelling approach is similar and coherent to the that presented in the E2E description in Sect.~\ref{subsec_E2E_Modules}. Nevertheless, we note that the purpose of the ETC is not the generation of a full synthetic frame (as in the case of the E2E simulator) but the reliable computation of SNR given a set of observing conditions, a tool for the astronomical community to explore the wide range of science cases that CUBES aims to address. \subsection{Example application: the Be doublet at 313\,nm} \label{subsec_ETC_App} The ETC has been widely used during the Phase~A study, with results presented in many of the scientific contributions in this Special Issue. Here we highlight the example of studies of the beryllium abundance in evolved stars using the Be~{\footnotesize II} doublet at 313\,nm. Although one of the lightest and simplest elements, questions remain regarding the production of Be and the evolution of its abundance in the early Galaxy. Analysis of main-sequence/turn-off stars in globular clusters with different metallicities shows that a minimum SNR of 30-40 is required to detect star-to-star variations in their Be abundances of the order of $\sim$0.2\,dex \cite{Ref-GS}. The current limit for such studies are the 12\,hr observations with UVES of turn-off stars with $V$\,$=$\,16\,mag., where only SNR\,$=$\,8-15 was possible around the Be lines \cite{Ref-Pasquini_2004,Ref-Pasquini_2007}. This topic has been thoroughly explored for a range of spectral types and metallicities (representative of future CUBES targets) during the Phase~A study, with detailed simulations presented by \cite{Ref-GS,Ref-Smiljanic}. Here we simply highlight the significant performance gain provided by CUBES compared to current capabilities. For example, for a metal-poor ([Fe/H]\,$=$\,$-$2.5) input template spectrum with $T_{\rm eff}$\,$=$\,6500\,K and log($g$)\,$=$\,4.0, the ETC predicts SNR\,$=$\,39 for a 1\,hr exposure of a $V$\,$=$\,16\,mag. star. A further illustration of the potential performance is shown in Fig.~\ref{fig:ETC_MAGLIM}. These results show the AB magnitude limit for SNR\,$=$\,10 from the HR mode at $\lambda=\SI{313}{nm}$ for exposure times of (\SI{10}{\minute}, \SI{20}{\minute}, \SI{1}{\hour}, and \SI{2}{\hour}) for the constant AB magnitude theoretical spectrum as the ETC input and adopting: $U_\textrm{sky} = \SI{22}{mag \per arcsec\squared}$, airmass = 1.16, seeing = \ang{;;0.87}, DC = \SI{0.5}{e^-\per pix \per\hour}, RON = \SI{2.5}{e^-} rms and 1\,$\times$\,1 pixel binning. Vega and AB mags are effectively the same in the $V$-band, so with the flat input spectrum, SNR\,$>$\,40 can be recovered down to $V$\,$\sim$\,17\,mag. \begin{figure} \hspace{-5mm} \includegraphics[width=0.55\textwidth]{ETC_MAGLIM_313nm.png} \caption{Predicted signal-to-noise ratio (SNR) vs. AB magnitude limit at $\lambda$=313\,nm for different exposure times with the high-resolution mode of CUBES. The input template to the Exposure Time Calculator (ETC) was a theoretical spectrum with constant AB magnitude, with other parameters set to: $U_{\rm Sky}$ = 22\,mag\,arcsec$^{-2}$, airmass = 1.16, seeing = 0.87", DC = 0.5e$^-$/pix/hr, RON = 2.5\,e$^-$ rms, and 1\,$\times$\,1 pixel binning.} \label{fig:ETC_MAGLIM} \end{figure} \section{Conclusions} \label{sec_Conclusions} CUBES will provide unprecedented spectroscopic sensitivity at intermediate resolution in the bluest part of the spectrum accessible from the ground (at least from \SIrange{305}{400}{nm}). Here we have presented the package of modelling tools (E2E Simulator and ETC) developed for use by the scientific community to perform quantitative simulations of future CUBES observations and for use by the technical team in the design of the instrument. We described the software environments as well as the modelling assumptions and approaches implemented for their development. We used both local environments (MATLAB and Python) and on-line web-page technologies (a Binder server interfaced through Jupyter notebook, and facilities of the Italian Center for Astronomical Archive operated by INAF). The architecture and modelling approaches of these tools have been used to support several aspects of the Phase~A study: system design, science performance evaluation and embryonic development of the DRS. For instance, we have presented the trade-off analyses used to identify the most promising design configurations for the HR and LR modes. These guided important choices in terms of: entrance aperture, wavelength coverage, resolving power, SNR, manufacturing and system constraints and investigation of when the instrument is background limited compared to the expected detector noise. In the HR mode (\ang{;;1.5} aperture, six slices) the design provides $R >20000$, maximizing the entrance aperture and the wavelength coverage (300-\SI{405}{nm}), with no showstoppers in terms of system constraints. The inclusion of the second slicer for the LR mode (\ang{;;6} aperture, six slices) will provide a powerful additional capability, enabling observations to be sky-noise dominated for both detector binning options down to 313/\SI{320}{nm}. An important first interface between simulations and the DRS has been set in the extraction of the 1D spectrum from synthetic 2D images, which is a first basic incarnation of the data reduction pipeline development; moreover, some specific aspects related to the CUBES slices tracing the spectral format and tilt of the projected slit across the detector array have been considered for the definition of future pipeline recipes. Finally, we showed an example of how the ETC has been used to investigate the limiting magnitude of CUBES in estimating the abundances of beryllium in main-sequence stars. This example demonstrates that CUBES will be able to incresae the sample of metal-poor stars needed to address fundamental open questions pertaining to nucleosynthesis of the elements. \section*{Acknowledgments} The INAF authors acknowledge financial support of the Italian Ministry of Education, University, and Research with PRIN 201278X4FL and the "Progetti Premiali" funding scheme. \section*{Conflict of interest} The authors declare that they have no conflict of interest. \section*{Data Availability Statement} The paper details about simulations and it is not based on acquired data. The datasets generated and analysed during the current study are available from the corresponding author on reasonable request.
cc397e3a67146dbdd5e4deb99228ecde96d37306
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \vspace{-1mm} Video frame interpolation (VFI) aims at predicting one or more intermediate frames from a given frame sequence. Given inputs $\langle x_t$, $x_{t+n}\rangle$, where $n$ is the frame gap between the inputs, existing VFI works generally follow two steps. First, they estimate the motion between $x_t$ and $x_{t+n}$ using off-the-shelf motion estimation modules or by imposing motion constraints. Then, they warp the inputs to the target time and synthesize an intermediate frame. VFI works target temporal super-resolution on a premise that the frame rate of the input sequence is often already sufficiently high. We have experimentally verified this notion by evaluating several state-of-the-art VFI methods~\cite{niklaus2017video2,slomo,dain2019,Lee_2020_CVPR,gui2020featureflow} on input sequences sampled at different frame rates. Even though a reasonable performance decrease is an expected phenomenon, we observed a significant drop in performance when the frame rate of the input sequence decreases (see \Tref{tbl:temp_vfi}), highlighting that interpolating frames becomes very challenging as the temporal distance between consecutive frames increases. Moreover, far less attention has been given to this problem in past literature as most evaluations have been done on videos with fixed frame rate (mostly 30 fps). We argue that the main reason behind this limitation is partly associated with the working principle of VFI works. If the estimated motion between inputs is inaccurate, then the interpolated frame synthesized by time warping the inputs with the estimated motion will also likely be inaccurate. This is particularly problematic when the temporal gap between input frames is large as existing flow or kernel based motion estimation modules can not effectively handle large motions. In this work, we tackle the long-term video interpolation problem and propose a general VFI framework robust to relatively low frame rates. Specifically, when there is a large gap between input frames, instead of predicting the motion between the inputs which will likely be imprecise and eventually lead to inaccurate interpolation, we conjecture that we can safely propagate from one side of the input to a reliable extent of time using the other input as a useful reference, \emph{i.e. } given $\langle x_t$, $x_{t+n}\rangle$, we propagate up to $x_{t+\Delta t}$ from the side of the first input $x_t$ and we similarly propagate up to $x_{t+n-\Delta t}$ from the side of the second input $x_{t+n}$, where $\Delta t$ is the extent of propagation. This is intuitive because the intermediate frames in the neighborhood of $x_t$ will most likely depend on $x_t$ compared to $x_{t+n}$, and vice versa. Once we propagate to a reliable time frame from both sides, the rest of the intermediate frames between $x_{t+\Delta t}$ and $x_{t+n-\Delta t}$ can be interpolated using existing interpolation approaches as the temporal gap is now reduced to $n-2\Delta t$. To this end, we propose a propagation network (\textsf{PNet}) that predicts future frames by relying more on one of the inputs while attending the other. We accomplish this by extending the classic feature-to-feature (F2F) forecasting \cite{vondrick2016anticipating,couprie2018joint,vora2018future,chiu2020segmenting,vsaric2019single,saric2020warp} with a novel motion-to-feature (M2F) approach, where we introduce optical flow as another modality to guide the propagation of features and to enforce temporal consistency between the propagated features. Unlike feature supervision which makes a network more dependent on the semantics of input frames, our motion supervision allows the network to focus on the motion between inputs and ensures features are propagated accordingly irrespective of the contents of the images. Moreover, while most F2F works focus on predicting task-specific outputs such as segmentation maps, we perform RGB forecasting by designing a frame synthesis network that reconstructs frames from the propagated features in a coarse-to-fine manner. We experimentally show that the proposed \textsf{PNet} can be used as a plug in module to make existing state-of-the-art VFI approaches \cite{niklaus2017video2,slomo,dain2019,Lee_2020_CVPR,gui2020featureflow} robust particularly when there is a considerable temporal gap between inputs. To be thorough, we adopt a light version of SloMo \cite{slomo} along with \textsf{PNet} as our full model and devise a simple, yet effective, procedure to successfully train the full model in an end-to-end manner. We comprehensively analyze our work and previous methods on several widely used datasets \cite{su2017deep,Nah_2017_CVPR,galoogahi2017need} and confirm the favorability of our approach. Moreover, we carry out ablation experiments to shed light on the network design and loss function choices. \section{Related Works} \label{sec:related_works} \vspace{-1mm} \paragraph{Video Frame Interpolation.} Early conventional methods~\cite{zitnick2004high,mahajan2009moving} relied on the optical flow between inputs and the given image formation model for synthesizing intermediate frames. Recently, several deep network based VFI approaches have been proposed. While some works \cite{long2016learning,choi2020channel} directly predict intermediate frames, most existing approaches embed motion estimation modules in their framework. According to the type of the motion estimation module used, VFI works can be broadly categorized as: phase-based, kernel-based, flow-based and a mix of the last two. Early phase-based works~\cite{meyer2015phase,meyer2018phasenet} formulated the temporal change between the inputs as phase shifts. On the other hand, kernel-based methods such as AdaConv~\cite{niklaus2017video1} and SepConv~\cite{niklaus2017video2} estimate spatially adaptive 2D and 1D kernels, respectively. Meanwhile, due to the significant progress achieved in optical flow estimation research, flow-based interpolation approaches~\cite{slomo,liu2017video,reda2019unsupervised,son2020aim,xue2019video,niklaus2018context,park2020bmbc,Peleg_2019_CVPR,yuan2019zoom,niklaus2020softmax} have grown to be popular. DVF \cite{liu2017video} and SloMo \cite{slomo} estimated flows between input frames and directly warped them to the target intermediate time while~\cite{xue2019video,niklaus2018context,park2020bmbc,niklaus2020softmax} used a trainable frame synthesis network on the warped frames to predict the intermediate frame. DAIN~\cite{dain2019} and MEMC-Net~\cite{bao2019memc} combined kernel-based and flow-based models. AdaCoF~\cite{Lee_2020_CVPR} proposed a generalized warping module via adaptive collaboration of flows for VFI. Recently, several works~\cite{reda2019unsupervised, Peleg_2019_CVPR,choi2020scene,xu2019quadratic,chi2020all,zhangflexible,gui2020featureflow,shen2020blurry,argaw2021motion} have focused on addressing the different limitations of the VFI approaches discussed thus far. However, most existing works assume that the input sequence frame rate is often already sufficiently high, hence, long-term VFI has received far less attention in the past literature. Our work tackles this problem by proposing a novel framework that combines frame propagation and interpolation. \vspace{-3mm} \paragraph{Feature Propagation.} Feature-to-feature (F2F) forecasting inputs intermediate features of the past frames and anticipates their future counter parts. This approach have been previously used for action recognition \cite{vondrick2016anticipating}, instance segmentation \cite{couprie2018joint,luc2018predicting,sun2019predicting} and semantic segmentation \cite{vora2018future,chiu2020segmenting,vsaric2019single,saric2020warp} tasks. Recently, \v{S}ari\'{c} \emph{et al. } \cite{saric2020warp} proposed a feature-to-motion (F2M) module to compliment the classic F2F approach. Previous F2F or F2F + F2M based works use the encoder part of task-oriented pretrained models (\emph{e.g.}~semantic segmentation) to extract intermediate features of a set of inputs and use the extracted features to forecast features of future frame. The forecasting module is trained by optimizing the loss between the forecasted features and the extracted features of the future frame (see \Fref{fig:framework}a). During inference, the task-specific output (\emph{e.g.}~segmentation map) is obtained by feeding the forecasted feature into the decoder part of the pretrained model. In this work, we extend feature-level propagation to a relatively unexplored task, \emph{i.e. } long-term VFI, by presenting a novel motion-to-feature (M2F) approach. Our approach is different from previous feature-level propagation methods in the following aspects. First, we introduce motion (in the form of optical flow) as another modality to guide the forecasting of features and to enforce temporal consistency between forecasted features. Second, we perform RGB forecasting by designing a frame synthesis network that outputs future frames from forecasted features. The proposed formulation is summarized in \Fref{fig:framework}b. \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth,trim={21.8cm 18.9cm 28.3cm 11.7cm},clip]{fgai_fig1_edit.pdf} \vspace{-5mm} \caption{(a) Overview of previous feature-level propagation formulation, (b) Proposed problem formulation.} \label{fig:framework} \vspace{-5mm} \end{figure} \begin{figure*}[!t] \centering \includegraphics[width=1.0\linewidth,trim={3.9cm 2.8cm 6.9cm 6.65cm},clip]{fgai_cvpr_model2_edit.pdf} \vspace{-6mm} \caption{Overview of the proposed propagation-interpolation network (\textsf{P-INet)}. The propagation network (\textsf{PNet}) consists of an encoder network for feature extraction, \textsf{M2FNet} to bidirectionally propagate features using the encoded features as anchor and reference features, \textsf{FFNet} to estimate optical flow between features for motion supervision, and a frame decoder to reconstruct frames from propagated features. An interpolation network (\textsf{INet}) is used to interpolate the intermediate frames between the end propagated frames.} \vspace{-5.5mm} \label{fig:model_new} \end{figure*} \section{Methodology} \label{sec:methodology} Given a pair of consecutive frames $\langle x_t,x_{t+n}\rangle$ from a low-frame-rate video, we aim to generate a high quality, high-frame-rate sequence $\{x_t, x_{t+1}, \ldots, x_{t+n-1}, x_{t+n}\}$ by jointly optimizing interlinked propagation and interpolation networks in an end-to-end manner. The overview of our proposed framework is shown in \Fref{fig:model_new}. \subsection{Propagation Network (\textsf{\textbf{PNet}})} \label{sec:pnet} \vspace{-0.5mm} We use an encoder-decoder architecture for \textsf{PNet}. First, we design an encoder network ${\mathcal{E}}$ to extract features from the input frames $\langle x_t,x_{t+n}\rangle$ in a top-down manner (\Eref{eq: encode}). The encoder is a feed-forward network with 5 convolutional blocks, each block containing 2 layers of convolution with kernel size $3 \times 3$. Except for the first block, features are downsampled to half of their spatial size and the number of channels is doubled after each convolutional block. \begin{equation} \big\{u_t^l\big\}_{l=1}^{k} = {\mathcal{E}} (x_t)\hspace{4mm}\big\{u_{t+n}^l\big\}_{l=1}^{k} = {\mathcal{E}} (x_{t+n}) \label{eq: encode} \end{equation} where $l$ denotes a level in the feature pyramid with a total of $k$ levels ($k = 5$ in our experiments) and $u_t^l$ denotes an encoded feature of the first input $x_t$ at level $l$. To propagate to the frame $x_{t + \Delta t}$ (from $x_t$ side), we first perform feature-level forecasting using the encoded features of $x_t$ and $x_{t+n}$, \emph{i.e. } $\{u_t^1, \ldots, u_t^k\}$ and $\{u_{t+n}^1, \ldots, u_{t+n}^k\}$, as \textit{anchor} and \textit{reference} features, respectively. We then use a decoder network to reconstruct $x_{t + \Delta t}$ from the propagated features in a bottom-up manner. \vspace{-3.4mm} \paragraph{Motion-to-Feature Forecasting.} We design a motion-to-feature network (\textsf{M2FNet}) to forecast the future counterparts of the encoded features. \textsf{M2FNet} takes the anchor and reference features as inputs and anticipates the motion to propagate the anchor feature to its future counterparts. Then, it transforms the anchor feature according to the estimated motion. To take the complex motion dynamics between the input frames into account and better exploit the inter-frame spatio-temporal correlation, we propagate to multiple frames simultaneously. \textsf{M2FNet} has 2 components: global (${\mathcal{D}}_G$) and local (${\mathcal{D}}_L$) motion decoders. ${\mathcal{D}}_G$ learns the global motion between the encoded features, and predicts affine transformation parameters $\theta_{[R|T]}$ to spatially transform the anchor feature to its future counterparts (see \Eref{eqn:global1} and \Eref{eqn:global2}). We use spatial transformer network~\cite{jaderberg2015spatial} for for ${\mathcal{D}}_G$. \vspace{-1.5mm} \begin{equation} \big\{\theta_{[R_{t+i}|T_{t+i}]}\big\}_{i=1}^{m} = {\mathcal{D}}^l_{G}\big(u_t^l~||~u^l_{t+n}\big) \label{eqn:global1} \vspace{-3mm} \end{equation} \vspace{-3mm} \begin{equation} \big\{\hat{u}^l_{t+i}\big\}_{i=1}^{m} = \textsf{transform}\ \big(u_t^l,\ \big\{\theta_{[R_{t+i}|T_{t+i}]}\big\}_{i=1}^{m}\big) \label{eqn:global2} \end{equation} where $||$ denotes channel-wise concatenation, $m$ refers to the number of features (frames) propagated from the anchor feature $u_t$ and $\hat{u}^l_{t+i}$ represents the output of ${\mathcal{D}}_G$ at time step $t+i$ and feature level $l$. As ${\mathcal{D}}_G$ is limited to learning only non-local motion, in order to capture the locally varying motion, we further refine the outputs of ${\mathcal{D}}_G$ with a local motion decoder (${\mathcal{D}}_L$). ${\mathcal{D}}_L$ inputs the globally transformed feature $\hat{u}_{t+i}$ along with the anchor and reference features, and outputs the forecasted feature $u_{t+i}$ (see \Eref{eqn:local}). ${\mathcal{D}}_L$ has 3 densely connected convolutional layers \cite{huang2017densely} each with kernel size $3 \times 3$ and stride $1$. As the forecasted feature $u_{t+i}$ is decoded in a coarse-to-fine manner, a residual connection is built by feeding the the upsampled decoded feature from previous feature level $l+1$ into ${\mathcal{D}}_L$ as shown in \Eref{eqn:local}. A deconvolution layer of kernel size $4 \times 4$ and stride size $2$ is used to upsample ($\times 2$) features. \begin{equation} u_{t+i}^l= {\mathcal{D}}^l_L \big(\hat{u}^l_{t+i}~||~u_t^l~||~u_{t+n}^l~||~\textsf{up}.(u_{t+i}^{l+1})\big) \label{eqn:local} \vspace{-1mm} \end{equation} where $i = \{1,\ldots,m\}$, \textsf{up}. stands for upsampling and $u^l_{t+i}$ is the forecasted feature at level $l$. In principle, ${\mathcal{D}}_L$ can decode both local and global motions. However, explicitly modelling global motions with ${\mathcal{D}}_G$ is shown to be effective for the task at hand (see \Sref{sec:ablation}). \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth,trim={20.3cm 23.9cm 33.1cm 7.8cm},clip]{fgai_flow.pdf} \vspace{-5.5mm} \caption{Optical flow estimation pattern when propagating to $m$ future counterparts.} \vspace{-6.3mm} \label{fig:flow_pattern} \end{figure} \vspace{-2.5mm} \paragraph{Optical Flow Estimation.} \textsf{M2FNet} learns to propagate features via motion supervision. For instance, to ensure that the forecasted feature $u_{t+i}$ can be reconstructed to $x_{t+i}$, we constrain the endpoint error between the flows $f_{x_{t+i} \rightarrow x_t}$ and $\hat{f}_{u_{t+i} \rightarrow u_t}$, which are computed between frames $\langle x_t,x_{t+i}\rangle$ and features $\langle u_t,u_{t+i}\rangle$, respectively. As the ground truth flow $f_{x_{t+i} \rightarrow x_{t}}$ does not exist for real high-speed videos, we generate a pseudo-ground truth flow using pretrained state-of-the-art optical flow models~\cite{IMKDB17,Sun2018PWC-Net}. To estimate the flow $\hat{f}_{u_{t+i} \rightarrow u_t}$, we design a feature flow network (\textsf{FFNet}) which inputs two sets of features, \emph{i.e. }~$\big\{u_{t+i}^l\big\}_{l=1}^{k}$ and $\big\{u_{t}^l\big\}_{l=1}^{k}$, and regresses a flow in a coarse-to-fine manner. We use the architecture of the optical flow estimator in PWC-Net\cite{Sun2018PWC-Net} for \textsf{FFNet}. To predict the flow between the anchor feature $u_t$ and a forecasted feature $u_{t+i}$, we preform the following steps. First, at each level $l$, we backwarp the second feature $u_{t}^l$ (to the first feature $u_{t+i}^l$) with $\times 2$ upsampled flow from previous level $l+1$ (see \Eref{eqn:warp}). A correlation layer \cite{fischer2015flownet,Sun2018PWC-Net,hui2018liteflownet} is then used to compute the cost volume between the first feature $u_{t+i}^l$ and the backwarped feature $w_{t+i}^l$. The first feature, the cost volume and the upscaled flow are feed into \textsf{FFNet} to predict a flow as shown in \Eref{eqn:decode_flow}. \begin{equation} w_{t+i}^l = \textsf{backwarp}\big(u_{t}^l, \textsf{up}.(\hat{f}^{l+1}_{{t+i}\rightarrow t})\big) \label{eqn:warp} \vspace{-4mm} \end{equation} \begin{equation} \hat{f}_{{t+i}\rightarrow t}^l = \textsf{FFNet} \big(u_{t+i}^l \oplus \textsf{corr}.(u_{t+i}^l,w_{t+i}^l) \oplus \textsf{up}.(\hat{f}^{l+1}_{{t+i}\rightarrow t})\big) \label{eqn:decode_flow} \end{equation} \Fref{fig:flow_pattern} depicts the flow estimation pattern when propagating to $m$ future counterparts of the anchor feature $u_t$. We compute several optical flows to ensure that features are propagated by anticipating the complex motion between the input frames and not simply in a linear manner. Specifically, we estimate the flow between the anchor feature and each forecasted feature (shown in \textcolor{red} {red} in \Fref{fig:flow_pattern}) so that \textsf{M2FNet} learns to forecast features according to their proximity to the anchor feature \emph{i.e. }~${\mathcal{D}}_G$ and ${\mathcal{D}}_L$ decode smaller motions for features close to the anchor feature and larger motions for those further away. We also estimate flow between the forecasted features themselves (depicted in \textcolor{green} {green}) in order to account for inter-frame motion between propagated features. To address any potential ambiguity in the direction of propagation, we compute the flow between the last forecasted feature and the reference feature (shown in \textcolor{blue} {blue}). \vspace{-2.5mm} \paragraph{Feature-to-Frame Decoding.} The forecasted features and optical flows are then used to decode frames. For this purpose, we design a frame decoder (${\mathcal{D}}_F$) which regresses frames from the corresponding forecasted features. When decoding the current frame, ${\mathcal{D}}_F$ incorporates contextual and temporal information from the past frames via attention mechanism (see \Fref{fig:frame_synthesis}). This is accomplished by warping the past features into the current time step with the corresponding estimated optical flows and combining the warped features using attention weights as shown in \Eref{eqn:attend}. The attention vector ($\alpha$) is a learnable, one-dimensional weight parameter with elements initially set to 1. For better reconstruction of occluded regions in the predicted frames, ${\mathcal{D}}_F$ also uses the anchor and reference features. Like the feature forecasting and flow estimation steps, frames are decoded in a coarse-to-fine manner. At each feature level $l$, ${\mathcal{D}}_F$ inputs the forecasted feature ($u_{t+i}^l$), attended past features ($v_{t+i}^l$), encoded features ($u_t^l$ and $u_{t+n}^l$) and $\times 2$ upscaled frame predicted from previous level $l+1$ (see \Eref{eqn:decode_frame}). ${\mathcal{D}}_F$ is composed of 3 densely connected convolutional layers each with kernel size $3 \times 3$ and stride $1$, where the last layer outputs a frame. \vspace{-1.2mm} \begin{equation} {v}_{t+i}^l = \sum_{j=t}^{t+i-1}{\alpha_j . \textsf{backwarp}(u^l_j, \hat{f}^l_{{t+i}\rightarrow j})} \label{eqn:attend} \end{equation} \vspace{-3mm} \begin{equation} \hat{x}^l_{t+i} = {\mathcal{D}}^l_F\big(u_{t+i}^l~||~v_{t+i}^l~||~u_t^l~||~u_{t+n}^l~||~\textsf{up}.(\hat{x}^{l+1}_{t+i})\big) \label{eqn:decode_frame} \vspace{-0.5mm} \end{equation} \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth,trim={25.5cm 22.6cm 25.25cm 6.3cm},clip]{frame_synthesis_edit.pdf} \caption{Frame synthesis of $\hat{x}_{t+m}$ at feature level $l$.} \label{fig:frame_synthesis} \vspace{-5.6mm} \end{figure} \vspace{-2mm} \subsection{Propagation-Interpolation Network (\textsf{\textbf{P-INet}})} \vspace{-1mm} The proposed propagation network (\textsf{PNet}) can be used either as a stand-alone model or a plug-in module with existing VFI works (see \Sref{sec:experiment}). However, we have experimentally observed few trade-offs. First, when the temporal gap between inputs is small, \textsf{PNet} gives a sub-optimal performance compared to the state-of-the-art VFI approaches. This is mainly because \textsf{PNet}, by design nature, propagates to future counterparts of the anchor frame by using the other input as a reference, \emph{i.e. } it relies more on one of the inputs by default. This leads to a performance trade-off since an interpolation method, intuitively speaking, should evenly rely on both inputs when there is a small gap between them. Second, as expected, the quality of frames eventually deteriorates as we propagate further away from the anchor frame. For completeness of the proposed approach, thereby alleviating the observed trade-offs, we adopt a light version of \textsf{SloMo} \cite{slomo} as an interpolation network (\textsf{INet}) along with \textsf{PNet} as our full model, \emph{i.e. } \textsf{P-INet}. The \textsf{SloMo} used in our work contains 50\% fewer weight parameters compared to the model used in \cite{slomo}. We train \textsf{P-INet} in an end-to-end manner by guiding it to propagate, interpolate or propagate and interpolate depending on the \textit{temporal gap} between inputs and the \textit{timestamp} of the intermediate frame to be predicted as summarized in \Aref{algo:train_algo}. We use a bidirectional propagation and interpolation scheme since it gives us the flexibility to experiment with long-range temporal gaps. The reliable time frame of propagation $\Delta t (n)$ is defined as $\min(\ceil*{(n-M)/2}, M)$, where $n > M$. In other words, \textsf{PNet} adaptively propagates until the temporal gap between the end propagated frames is less than or equal to $M$. As most VFI works conduct experiments at 30 fps by downsampling 240 fps videos ($\approx$ frame gap of 8) and because our approach uses 3 intervals, we set $M=8$ and $N=24$ during training. We experiment with up to 30 frame gaps during testing to analyze if our approach extends to even larger gaps (see \Sref{sec:experiment}). \setlength{\textfloatsep}{1.5mm} \begin{algorithm}[!t] \footnotesize \LinesNotNumbered \DontPrintSemicolon \SetAlgoLined \SetNoFillComment \textbf{Input}\ : $\langle x_{t},x_{t+n}\rangle$ \tcp*{$n$ is the frame gap} \textbf{Output}\ : $\hat{x}_{t+i}$, where $1<i<n$ Let $N$ be the maximum frame gap in the dataset, $M$ be the upper limit for small frame gap, and $\Delta t (n)$ be a reliable time frame of propagation which is dependent on $n$ \; \ForEach{input sample}{ \eIf (\tcp*[h]{small gap}){$n \le M$}{ $\hat{x}_{t+i} = $ \textsf{INet} $(x_{t},x_{t+n})$ \textbf{for} all $i$ \; }(\tcp*[h]{large gap ($M < n \le N$)}){ \uIf(\tcp*[h]{propagate from $x_t$}){$i \le \Delta t (n)$}{ $\hat{x}_{t+i} = \textsf{PNet}$ $(x_{t},x_{t+n})$\; } \uElseIf{$ \Delta t (n) < i < n-\Delta t (n)$}{ \tcp*[h]{propagate and interpolate}\ $\hat{x}_{t + \Delta t (n)} = \textsf{PNet}$ $(x_{t},x_{t+n})$\; $\hat{x}_{t+ n - \Delta t (n)} = \textsf{PNet}$ $(x_{t+n},x_{t})$\; $\hat{x}_{t+i} \ = $ \textsf{INet} $(\hat{x}_{t + \Delta t (n)},\hat{x}_{t+ n - \Delta t (n)})$\; } \uElse(\tcp*[h]{propagate from $x_{t+n}$}){ $\hat{x}_{t+i} = \textsf{PNet}$ $(x_{t+n},x_{t})$\; } } } \caption{\footnotesize{Training strategy for the \textsf{P-INet}}} \label{algo:train_algo} \end{algorithm} \vspace{-0.4mm} \subsection{Loss Functions} \vspace{-0.5mm} We train our network in an end-to-end manner by jointly optimizing the estimated flows, propagated frames and interpolated frames. To train \textsf{M2FNet}, we compute the endpoint error between the estimated flows and pseudo-ground truth flows across different levels as shown in \Eref{eqn:loss_flow}. To propagate to $m$ features, a total of $\frac{m}{2}(m+1)+1$ flows are estimated. We also investigate training our network by selectively optimizing some of the flows (see \Sref{sec:ablation}). \vspace{-1mm} \begin{equation} {\mathcal{L}}_\textsf{M2FNet} = \sum_{i=1}^{\frac{m}{2}(m+1)+1}\sum_{l=1}^{k}\omega_1^l\big|f_i^l-\hat{f}_i^l\big|_{2} \label{eqn:loss_flow} \vspace{-1.5mm} \end{equation} where $\omega_1^l$ is a flow loss weight coefficient at level $l$. For sharp frame decoding, we train \textsf{PNet} with the multi-scale $\ell_1$ photometric loss. We also use gradient difference loss \cite{mathieu2015deep} (${\mathcal{L}}_\textsf{GDL}$) between the predicted frames and their ground truth to mitigate blurry predictions (see \Eref{eqn:loss_frame}). \vspace{-1.5mm} \begin{equation} {\mathcal{L}}_\textsf{PNet} = \sum_{i=1}^{m}\sum_{l=1}^{k}\omega_2^l\big|x_i^l-\hat{x}_i^l\big|_{1} + {\mathcal{L}}_\textsf{GDL} (x_i, \hat{x}_i) \label{eqn:loss_frame} \vspace{-1.35mm} \end{equation} where $\omega_2^l$ is a frame loss weight coefficient at level $l$. We use the training loss of \textsf{SloMo} discussed in Section 3.3 of \cite{slomo} to train \textsf{INet}. We refer the reader to \cite{slomo} for details. The total training loss for \textsf{P-INet} is defined as weighted sum of all losses as shown in \Eref{eqn:loss_total}. \vspace{-2mm} \begin{equation} {\mathcal{L}}_\textsf{total} = \lambda_1{\mathcal{L}}_\textsf{M2FNet} + \lambda_2{\mathcal{L}}_\textsf{PNet} + \lambda_3{\mathcal{L}}_\textsf{INet} \label{eqn:loss_total} \vspace{-2.5mm} \end{equation} \section{Experiment} \label{sec:experiment} \vspace{-0.5mm} \begin{table*}[!t] \caption{Quantitative comparison at different fps. The numbers in \textcolor{red}{red} and \textcolor{blue}{blue} represent the best and second best results, respectively.} \label{tbl:temp_vfi} \vspace{-2.5mm} \begin{adjustbox}{width=\linewidth} \setlength{\tabcolsep}{4.5pt} \renewcommand{\arraystretch}{1.035} \begin{tabular}{l|cccccc|cccccc|cccccc} \toprule & \multicolumn{6}{c|}{\textsf{Adobe240} \cite{su2017deep}} & \multicolumn{6}{c|}{\textsf{GOPRO}~\cite{Nah_2017_CVPR}} & \multicolumn{6}{c}{\textsf{NfS}~\cite{galoogahi2017need}} \\ \cmidrule(lr){2-7} \cmidrule{8-13} \cmidrule(lr){14-19} Method & \multicolumn{2}{c}{30 fps} & \multicolumn{2}{c}{15 fps} & \multicolumn{2}{c|}{8 fps} & \multicolumn{2}{c}{30 fps} & \multicolumn{2}{c}{15 fps} & \multicolumn{2}{c|}{8 fps} & \multicolumn{2}{c}{30 fps} & \multicolumn{2}{c}{15 fps} & \multicolumn{2}{c}{8 fps} \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){8-9} \cmidrule(lr){10-11} \cmidrule(lr){12-13}\cmidrule(lr){14-15}\cmidrule(lr){16-17}\cmidrule(lr){18-19} & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM \\ \midrule \textsf{SepConv}~\cite{niklaus2017video2}&29.91 &0.915&23.94&0.811& 19.88&0.707&28.64&0.871&23.23&0.694&19.74&0.560&31.84&0.915&26.73&0.811&23.00&0.707 \\ \textsf{SloMo}~\cite{slomo} &30.03&0.917&24.30&0.818&20.17&0.717&29.03&0.917&23.58&0.818&19.99&0.718&31.83&0.917&26.95&0.818&23.19&0.717 \\ \textsf{DAIN}~\cite{dain2019} &\textcolor{red}{30.53}&\textcolor{red}{0.924}&\textcolor{blue}{24.39}&\textcolor{blue}{0.824}&\textcolor{blue}{20.21}&\textcolor{blue}{0.721}&\textcolor{blue}{29.25}&\textcolor{red}{0.924}&\textcolor{blue}{23.63}&\textcolor{blue}{0.824}&\textcolor{blue}{20.18}&0.721&\textcolor{red}{32.46}&\textcolor{red}{0.924}&\textcolor{blue}{27.19}&\textcolor{blue}{0.824}&\textcolor{blue}{23.36}&0.720 \\ \textsf{AdaCoF}~\cite{Lee_2020_CVPR}&30.14&0.896&24.11&0.741&20.07&0.567&29.05&0.876&23.49&0.701&19.89&0.571&32.28&0.919&27.05&0.819&23.23&0.719 \\ \textsf{FeFlow}~\cite{gui2020featureflow} &\textcolor{blue}{30.48}&{0.902}&24.19&0.737&20.04&0.576&\textcolor{red}{29.30}&\textcolor{blue}{0.921}&23.51&0.822&19.82&\textcolor{blue}{0.724}&\textcolor{blue}{32.42}&\textcolor{blue}{0.921}&27.05&0.822&23.16&\textcolor{blue}{0.724} \\ \midrule \textsf{INet} &30.30&0.920&24.21&0.819&20.12&0.718&29.17&0.919&23.59 &0.821&20.04&0.722&32.03&0.920&26.99&0.822&23.27&0.721 \\ \textbf{\textsf{P-INet}} &30.30&\textcolor{blue}{0.920}&\textcolor{red}{27.10}&\textcolor{red}{0.890}&\textcolor{red}{24.00}&\textcolor{red}{0.810}&29.17&0.919&\textcolor{red}{26.45}&\textcolor{red}{0.879}&\textcolor{red}{23.90}&\textcolor{red}{0.804}&32.03&0.920&\textcolor{red}{28.98}&\textcolor{red}{0.874}&\textcolor{red}{26.23}&\textcolor{red}{0.798} \\ \bottomrule \end{tabular} \end{adjustbox} \vspace{-2.8mm} \end{table*} \begin{figure*}[!t] \begin{center} \setlength{\tabcolsep}{0.3pt} \renewcommand{\arraystretch}{0.2} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{cccccc} \tiny{\textsf{Inputs Overlay}} & \tiny{\textsf{DAIN} \cite{dain2019}} & \tiny{\textsf{AdaCoF} \cite{Lee_2020_CVPR}} & \tiny{\textsf{FeFlow} \cite{gui2020featureflow}} & \tiny{\textsf{\textbf{P-INet}}} & \tiny{\textsf{GT}} \\ \includegraphics[width=0.1\linewidth]{qual_compare/0002_overlay.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0002_dain.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0002_adacof.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0002_feflow.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0002_ours.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0002_gt.png}\\ \includegraphics[width=0.1\linewidth]{qual_compare/0004_overlay.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0004_dain.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0004_adacof.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0004_feflow.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0004_ours.png}& \includegraphics[width=0.1\linewidth]{qual_compare/0004_gt.png}\\ \end{tabular}} \end{center} \vspace{-6mm} \caption{Qualitative comparison of our method and state-of-the-art VFI approaches for inputs with large temporal gap.} \label{tbl:qual_compare} \vspace{-5.5mm} \end{figure*} \paragraph{Datasets.} Most existing VFI works use Vimeo-90K \cite{xue2019video} dataset which has 51312 triplets, where each triplet contains 3 consecutive video frames. However, as this dataset is not applicable to train a network for long-term VFI, we generate a dataset by sampling frames at different fps from high-speed video datasets. For this purpose, we use \textsf{Adobe240} \cite{su2017deep}, \textsf{GOPRO} \cite{Nah_2017_CVPR} and Need-for-Speed (\textsf{NfS}) \cite{galoogahi2017need} datasets, which contain 133, 33 and 100 videos, respectively. These datasets provide 240 fps videos which capture diverse combination of camera and object motions in real-world scenarios, and thus are suitable for the task at hand. A majority of the videos, however, have less than 1000 frames which makes it challenging to extract enough training samples with large temporal gaps. Hence, instead of training separately on each dataset, we used a total of 176 videos (103 from \textsf{Adobe240}, 3 from \textsf{GOPRO} and 70 from \textsf{NfS}) for training. The remaining 90 videos (30 from each dataset) are used for testing. We prepare train and test sets by extracting samples with variable length ranging from 9 to 31 consecutive frames in a video. In other words, we sample video clips at different frame rates in the range of approximately 30 fps to 8 fps, respectively. Following \cite{xue2019video}, we resize each frame in the dataset to a resolution of $448 \times 256$ to suppress noise and create consistency in size across videos. \vspace{-6mm} \paragraph{Implementation Details.} We implement our network in PyTorch \cite{paszke2019pytorch} and optimize it using Adam \cite{KingmaB14} with parameters $\beta_1$ , $\beta_2$ and \textit{weight decay} fixed to $0.9$, $0.999$ and $4e-4$, respectively. The loss weight coefficients are set to $\omega^5 = 0.08$, $\omega^4 = 0.04$, $\omega^3 = 0.02$, $\omega^2 = 0.01$ and $\omega^1 = 0.005$ from the lowest to the highest resolution, respectively, for both ${\mathcal{L}}_\textsf{M2FNet}$ and ${\mathcal{L}}_\textsf{PNet}$. We train \textsf{P-INet} for 200 epochs with the learning rate initially set to $\lambda=1e-4$ and gradually decayed by half at 100, 150 and 175 epochs. For the first 40 epochs, we only train the \textsf{M2FNet} by setting $\lambda_1 = 1$, $\lambda_2 = 0$ and $\lambda_3 = 0$ to facilitate motion estimation and feature propagation. For the remaining epochs, we fix $\lambda_1$, $\lambda_2$ and $\lambda_3$ to 1. We use a mini-batch size of 4 and randomly crop image patches of size $256 \times 256$ during training. The pseudo-ground truth optical flows for supervising \textsf{M2FNet} are computed on-the-fly using FlowNet 2 \cite{IMKDB17}. \vspace{-0.5mm} \subsection{Experimental Results} \vspace{-0.6mm} In this section, we comprehensively analyze our work and several state-of-the-art VFI approaches for which open source implementations are available. These include \textsf{SepConv} \cite{niklaus2017video2}, \textsf{SloMo}~\cite{slomo}, \textsf{DAIN}~\cite{dain2019}, \textsf{AdaCoF}~\cite{Lee_2020_CVPR} and \textsf{FeFlow}~\cite{gui2020featureflow}. For fair comparison, we retrain these models using our training set by following their official code. We deploy a multi-frame interpolation training scheme for \textsf{P-INet}, \textsf{SloMo}~\cite{slomo} and \textsf{DAIN}~\cite{dain2019} as it is possible while we use single-frame interpolation scheme for others. For quantitative evaluation, we use PSNR and SSIM metrics. \vspace{-3.1mm} \paragraph{Temporally Robust VFI.} Here, we analyze the robustness of different VFI models for input sequences with different temporal gaps. In \Tref{tbl:temp_vfi}, we compare our approach and state-of-the-art VFI methods on single frame interpolation of test videos sampled at 3 different frame rates: 30 fps, 15 fps and 8 fps. As can be inferred from \Tref{tbl:temp_vfi}, \textsf{P-INet} performs competitively for smaller temporal gaps and significantly better than SOTA approaches for larger temporal gaps. For instance, our approach outperforms the second best method, ~\emph{i.e. } \textsf{DAIN}\cite{dain2019}, by an average margin of of 2.44 dB and 3.51 dB at 15 fps and 8 fps, respectively. Moreover, the performance gap for \textsf{DAIN} between 30 fps and 8 fps is 9.50 dB on average. By contrast, the performance gap for our model is 5.79 dB. This shows the effectiveness of our approach for low-frame-rate videos. It can also be noticed from \Tref{tbl:temp_vfi} that the joint training of \textsf{PNet} and \textsf{INet} is beneficial even for smaller frame gaps. For instance, \textsf{INet} outperforms \textsf{SloMo} \cite{slomo} by an average margin of 0.2 dB at 30 fps. In \Fref{tbl:qual_compare}, we qualitatively compare the frames interpolated by our method and SOTA VFI approaches for input samples with large temporal gap. As can be seen from the figure, our approach interpolates sharper images with clearer contents compared to other VFI approaches. \vspace{-3.65mm} \begin{figure*}[!t] \centering \includegraphics[width=1.0\linewidth,trim={0.3cm 0.35cm 0.3cm 0.1cm},clip]{fpnet_sota.pdf} \vspace{-6.5mm} \caption{Quantitative analysis of \textsf{PNet} with state-of-the-art VFI approaches.} \label{fig:fpnet_interp} \vspace{-2.5mm} \end{figure*} \begin{figure*}[!t] \begin{center} \setlength{\tabcolsep}{0.3pt} \renewcommand{\arraystretch}{0.2} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{ccccccc} \tiny{\textsf{Inputs Overlay}} & \tiny{\textsf{FeFlow} \cite{gui2020featureflow}} & \tiny{\textsf{\textbf{PNet}} + \textsf{FeFlow}\cite{gui2020featureflow}} & \tiny{\textsf{DAIN} \cite{dain2019}} & \tiny{\textsf{\textbf{PNet}} + \textsf{DAIN} \cite{dain2019}} & \tiny{\textsf{GT}} \\ \includegraphics[width=0.1\linewidth]{qual_cascade/0053_overlay.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0053_feflow.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0053_fpnet_feflow.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0053_dain.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0053_fpnet_dain.png} & \includegraphics[width=0.1\linewidth]{qual_cascade/0053_gt.png}\\ \includegraphics[width=0.1\linewidth]{qual_cascade/0000_overlay.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0000_feflow.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0000_fpnet_feflow.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0000_dain.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0000_fpnet_dain.png}& \includegraphics[width=0.1\linewidth]{qual_cascade/0000_gt.png} \end{tabular}} \end{center} \vspace{-6.5mm} \caption{Qualitative analysis of \textsf{PNet} cascaded with state-of-the-art VFI approaches.} \label{tbl:qual_fpnet} \vspace{-2.5mm} \end{figure*} \begin{figure*}[!t] \centering \includegraphics[width=1.0\linewidth,trim={0.3cm 0.15cm 0.25cm 0.25cm},clip]{temp_smooth.pdf} \vspace{-6.3mm} \caption{Quantitative analysis of intermediate frames at different time steps for long-term VFI.} \vspace{-5.3mm} \label{fig:temp_smooth} \end{figure*} \paragraph{\textsf{PNet} with VFI Methods.} To highlight the versatility of the proposed \textsf{PNet} for long-term VFI, we couple \textsf{PNet} with VFI approaches and perform intermediate frame interpolation for input sequences with relatively large frame gap ranging from 11 to 30. Following the procedure in \Aref{algo:train_algo}, we first propagate bidirectionally using \textsf{PNet} from a pretrained \textsf{P-INet}. Then, we interpolate an intermediate frame between the propagated frames using state-of-the-art VFI methods~\cite{slomo,dai2008motion,Lee_2020_CVPR,gui2020featureflow}. The averaged results on the 3 datasets are plotted in \Fref{fig:fpnet_interp}. As can be inferred from the figure, the cascade models consistently outperform their vanilla baseline by a notable margin. The qualitative analysis in \Fref{tbl:qual_fpnet} also shows that, when the temporal distance between the inputs is large, incorporating \textsf{PNet} results in interpolated frames with more \textit{accurate} contents compared to directly using SOTA VFI approaches. The static regions in \Fref{tbl:qual_fpnet} appear slightly less sharp for cascade models most likely because the interpolation model uses the output of \textsf{PNet} as inputs rather than the raw input frames. \vspace{-4mm} \paragraph{Long-term Multi-Frame Interpolation.} Beyond evaluating the robustness of VFI approaches at different frame rates, we analyze the quality of the intermediate frames interpolated during a direct \textit{very low} fps $\rightarrow$ \textit{very high} fps upsampling. We perform 10 fps $\rightarrow$ 240 fps up-conversion in a single pass and measure the quality of the interpolated frames at each time step. In \Fref{fig:temp_smooth}, we compare our approach with \textsf{SloMo} \cite{slomo} and \textsf{DAIN} \cite{dain2019} since they are also capable of multi-frame interpolation. As expected, performance generally decreases as we move to the middle time step from both sides. However, it can be noticed from \Fref{fig:temp_smooth} that there is a rapid performance drop for \textsf{SloMo} and \textsf{DAIN} compared to \textsf{P-INet}. For instance, the average performance range, \emph{i.e. } the difference between largest and smallest PSNR values averaged over the 3 datasets, for \textsf{SloMo} is 8.62 dB. By contrast, the average performance range for \textsf{P-INet} is 6.11 dB. Instead of interpolating frames based on pre-computed motion that will likely be inaccurate due to large motion, our model adapts to propagate and interpolate frames, which explains the significant performance gain achieved over state-of-the-art approaches particularly for central time steps. \vspace{-4.5mm} \begin{figure*}[!t] \begin{center} \setlength{\tabcolsep}{0.3pt} \renewcommand{\arraystretch}{0.5} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{cccccc} \tiny{\textsf{Input} ($x_t$) } & \tiny{$\hat{f}$ (\textsf{Ours})} & \tiny{$f$ (\textsf{p-GT})} & \tiny{\textsf{Input} ($x_t$) } & \tiny{$\hat{f}$ (\textsf{Ours})} & \tiny{$f$ (\textsf{p-GT})} \\ \includegraphics[width=0.1\linewidth]{qual_flow/1/0001.png}& \includegraphics[width=0.1\linewidth]{qual_flow/1/ours.png}& \includegraphics[width=0.1\linewidth]{qual_flow/1/gt.png}& \includegraphics[width=0.1\linewidth]{qual_flow/9/0001.png}& \includegraphics[width=0.1\linewidth]{qual_flow/9/ours.png}& \includegraphics[width=0.1\linewidth]{qual_flow/9/gt.png} \end{tabular}} \end{center} \vspace{-6.3mm} \caption{Qualitative analysis of the estimated optical flows between features in comparison with the pseudo-ground truth (\textsf{p-GT}) flows.} \label{tbl:qual_compare_flow1} \vspace{-5mm} \end{figure*} \begin{figure}[!t] \centering \includegraphics[width=1\linewidth,trim={0.5cm 0.4cm 0.7cm 0.45cm},clip]{heatmap.pdf} \vspace{-6mm} \caption{Quantitative analysis of the estimated flows.} \label{fig:heatmap} \end{figure} \paragraph{Optical Flow.} \Fref{tbl:qual_compare_flow1} depicts the feature flows estimated by our network in comparison with the corresponding pseudo-ground truth (\textsf{p-GT}) flows. As can be seen from \Fref{tbl:qual_compare_flow1}, our model reasonably anticipates the accurate motion to propagate features. To further confirm if ${\mathcal{D}}_G$ and ${\mathcal{D}}_L$ in the \textsf{M2FNet} properly learned to decode motions for feature propagation, we quantitatively analyze the optical flows estimated between the \textit{anchor} and the \textit{forecasted} features. To purely evaluate the magnitude of motion, we compute the sum of the absolute value of the estimated flows. In \Fref{fig:heatmap}, we plot a heat map of the magnitude of the estimated flows (rescaled between 0 \& 1) for different temporal gaps, where $z_i = \frac{1}{2}(\sum{|\hat{f}_{{t+i}\rightarrow t}|}+\sum{|\hat{f}_{{t+n-i}\rightarrow{t+n}}|})$. We can infer two key things from \Fref{fig:heatmap}. First, the proximity of the forecasted feature to the anchor is directly related to the magnitude of the estimated flow, \emph{i.e. } ${\mathcal{D}}_G$ and ${\mathcal{D}}_L$ decode smaller motions for closer features and larger motion for those that are far. Second, \textsf{M2FNet} is implicitly aware of the relative temporal distance between inputs, \emph{i.e. } the magnitude of the forecasted flows increases for increasing frame gap. \section{Ablation Studies} \vspace{-1.5mm} \label{sec:ablation} Here, we present ablation experiments on different components of \textsf{P-INet}. We evaluate the quality of all \textit{propagated} frames during long-term VFI (10 fps $\rightarrow$ 240 fps) for \textsf{Adobe240} \cite{su2017deep} and \textsf{GOPRO}\cite{Nah_2017_CVPR} test videos (see \Tref{tbl:ablation_flow}). \vspace{-9mm} \paragraph{Loss Functions.} To highlight the importance of using optical flow as a guidance for feature propagation, we forecast features without estimating flows and directly regress frames from the respective forecasted features, \emph{i.e. } \textsf{P-INet} is trained without ${\mathcal{L}}_\textsf{\textsf{M2FNet}}$. A network trained without motion supervision performed significantly worse compared to a model trained with motion supervision. We also confirmed the contribution of the different groups of flows estimated in \Sref{sec:methodology}. It can be inferred from \Tref{tbl:ablation_flow} that estimating optical flows between the forecasted features is crucial as a network trained without inter-frame motion supervision (shown in \textcolor{green}{green} in \Fref{fig:flow_pattern}) gives a subpar performance. Moreover, we studied the importance of addressing potential directional ambiguity by constraining the optical flow between the end propagated feature and the reference feature (shown in \textcolor{blue}{blue} in \Fref{fig:flow_pattern}). As can be seen from \Tref{tbl:ablation_flow}, training a network without direction supervision results in a performance decrease of 0.48 dB. We analyze the benefit of the gradient difference loss \cite{mathieu2015deep} (${\mathcal{L}}_\textsf{GDL}$) in mitigating blurry frame predictions. It can be noticed from \Tref{tbl:ablation_flow} that training our model with ${\mathcal{L}}_\textsf{GDL}$ improves performance by an average margin of 0.65 dB. \vspace{-3.5mm} \paragraph{\textsf{M2FNet}.} We examine the importance of global (${\mathcal{D}}_G$) and local (${\mathcal{D}}_L$) motion decoders in \textsf{M2FNet}. First, we only use ${\mathcal{D}}_G$ for decoding motion. This resulted in a subpar network performance as ${\mathcal{D}}_G$ is limited to anticipating only global motion at a feature-level and the local motion apparent in the test videos can not be effectively forecasted. In theory, ${\mathcal{D}}_L$ can decode both local and global motions (without the need to explicitly model global motions with ${\mathcal{D}}_G$) as CNNs are effective in motion estimation tasks \cite{Sun2018PWC-Net,IMKDB17}. This is also empirically evident as a network trained only using ${\mathcal{D}}_L$ gives a competitive performance. However, using ${\mathcal{D}}_G$ to forecast global motions proved to give a considerable performance boost of 0.92 dB. \vspace{-4mm} \paragraph{Frame Decoding.} We study the importance of incorporating features of past frames when decoding the current frame in \textsf{PNet}. As can be inferred from \Tref{tbl:ablation_flow}, only attending to the \textit{anchor} feature (only warping $u_t$ in \Eref{eqn:attend}) when synthesizing frames gives a notably lower performance compared to attending all past features. Moreover, not attending to any past feature (excluding $v_{t+i}$ from \Eref{eqn:decode_frame}) during frame decoding performs significantly worse. \begin{table}[!t] \begin{center} \caption{Ablation experiments} \vspace{-2.9mm} \label{tbl:ablation_flow} \setlength{\tabcolsep}{5pt} \renewcommand{\arraystretch}{0.94} \begin{adjustbox}{width=\linewidth} \begin{tabular}{l|cccc} \toprule & \multicolumn{2}{c}{\textsf{Adobe240}\cite{su2017deep}} & \multicolumn{2}{c}{\textsf{GOPRO}\cite{Nah_2017_CVPR}} \\ \cmidrule (lr){2-3} \cmidrule (lr){4-5} \textbf{Loss Functions} & PSNR & SSIM & PSNR & SSIM \\ \midrule w/o ${\mathcal{L}}_\textsf{\textsf{M2FNet}}$ &25.09&0.730&25.16&0.728 \\ w/o inter-frame motion &25.81&0.776&26.11&0.776 \\ w/o direction supervision &27.13&0.801&27.83&0.806\\ w/o ${\mathcal{L}}_\textsf{\textsf{GDL}}$ & 26.97 & 0.801 & 27.84 & 0.813\\ \midrule \textbf{\textsf{M2FNet}} & & & & \\ w/o ${\mathcal{D}}_L$ &25.13&0.734&25.71&0.760 \\ w/o ${\mathcal{D}}_G$ &26.96&0.801&27.34&0.811\\ \midrule \textbf{Frame Decoding} & & & & \\ only warping $u_t$ in \Eref{eqn:attend} & 26.82&0.793 & 27.41 & 0.812 \\ excluding $v_{t+i}$ from \Eref{eqn:decode_frame} & 26.03 &0.781&26.57& 0.789\\ \midrule \textbf{\textsf{P-INet}} & $\textbf{27.70}$ & $\textbf{0.816}$ & $\textbf{28.43}$ & $\textbf{0.843}$ \\ \bottomrule \end{tabular} \end{adjustbox} \end{center} \vspace{-3.5mm} \end{table} \section{Conclusion} \vspace{-1mm} Our work introduces a temporally robust VFI framework by adopting a feature propagation approach. The proposed motion supervision tailors the network for the task at hand as it enforces features to be propagated according to the motion between inputs irrespective of their contents. The adaptive cascading of \textsf{PNet} with a simple interpolation backbone has significantly improved the interpolation quality for low frame rate videos as briefly analyzed in \Sref{sec:experiment}. \vspace{-3mm} \paragraph{Limitations.} The multi-scale approach along with aggregated motion estimation significantly increases the time complexity of our model. For instance, during 10 fps $\rightarrow$ 240 fps up-conversion given an input pair of size $448 \times 256$, \textsf{SloMo}~\cite{slomo} takes 0.32 secs while \textsf{P-INet} takes 3.37 secs. We experimentally observed failure cases when there is a fast-moving \textit{small} object in the foreground of a scene with a relatively large, dynamic background. In this scenario, \textsf{PNet} fails to detect and anticipate the motion of such objects, and instead imitates the input feature during propagation. This results in temporal jittering artifact in the interpolated video. Improving this limitation using a detection module \cite{yuan2019zoom} or an attention mechanism \cite{choi2020channel} would be an interesting future direction.
3a245cb5a34236d324cabef1d11398a56870ca92
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:intro} \emph{Gender diversity}, or more often its lack thereof, among participants to software development activities has been thoroughly studied in recent years. In particular, the presence of, effects of, and countermeasures for \emph{gender bias} in Free/Open Source Software (FOSS) have received a lot of attention over the past decade~\cite{david2008fossdevs, qiu2010kdewomen, nafus2012patches, kuechler2012genderfoss, vasilescu2014gender, oneil2016debiansurvey, robles2016womeninfoss, terrell2017gender, zacchiroli2021gender}. \emph{Geographic diversity} is on the other hand the kind of diversity that stems from participants in some global activity coming from different world regions and cultures. Geographic diversity in FOSS has received relatively little attention in scholarly works. In particular, while seminal survey-based and point-in-time medium-scale studies of the geographic origins of FOSS contributors exist~\cite{ghosh2005understanding, david2008fossdevs, barahona2008geodiversity, takhteyev2010ossgeography, robles2014surveydataset, wachs2021ossgeography}, large-scale longitudinal studies of the geographic origin of FOSS contributors are still lacking. Such a quantitative characterization would be useful to inform decisions related to global development teams~\cite{herbsleb2007globalsweng} and hiring strategies in the information technology (IT) market, as well as contribute factual information to the debates on the economic impact and sociology of FOSS around the world. \paragraph{Contributions} With this work we contribute to close this gap by conducting \textbf{the first longitudinal study of the geographic origin of contributors to public code over 50 years.} Specifically, we provide a preliminary answer to the following research question: \begin{researchquestion} From which world regions do authors of publicly available commits come from and how has it changed over the past 50 years? \label{rq:geodiversity} \end{researchquestion} We use as dataset the \SWH/ archive~\cite{swhipres2017} and analyze from it 2.2 billion\xspace commits archived from 160 million\xspace projects and authored by 43 million\xspace authors during the 1971--2021 time period. We geolocate developers to \DATAWorldRegions/ world regions, using as signals email country code top-level domains (ccTLDs) and author (first/last) names compared with name distributions around the world, and UTC offsets mined from commit metadata. We find evidence of the early dominance of North America in open source software, later joined by Europe. After that period, the geographic diversity in public code has been constantly increasing. We also identify relevant historical shifts related to the end of the UNIX wars and the increase of coding literacy in Central and South Asia, as well as of broader phenomena like colonialism and people movement across countries (immigration/emigration). \paragraph{Data availability.} A replication package for this paper is available from Zenodo at \url{https://doi.org/10.5281/zenodo.6390355}~\cite{replication-package}. \section{Related Work} \label{sec:related} Both early and recent works~\cite{ghosh2005understanding, david2008fossdevs, robles2014surveydataset, oneil2016debiansurvey} have characterized the geography of Free/Open Source Software (FOSS) using \emph{developer surveys}, which provide high-quality answers but are limited in size (2-5\,K developers) and can be biased by participant sampling. In 2008 Barahona et al.~\cite{barahona2008geodiversity} conducted a seminal large-scale (for the time) study on FOSS \emph{geography using mining software repositories (MSR) techniques}. They analyzed the origin of 1\,M contributors using the SourceForge user database and mailing list archives over the 1999--2005 period, using as signals information similar to ours: email domains and UTC offsets. The studied period (7 years) in~\cite{barahona2008geodiversity} is shorter than what is studied in the present paper (50 years) and the data sources are largely different; with that in mind, our results show a slightly larger quote of European v.~North American contributions. Another empirical work from 2010 by Takhteyev and Hilts~\cite{takhteyev2010ossgeography} harvested self-declared geographic locations of GitHub accounts recursively following their connections, collecting information for $\approx$\,70\,K GitHub users. A very recent work~\cite{wachs2021ossgeography} by Wachs et al.~has geolocated half a million GitHub users, having contributed at least 100 commits each, and who self-declare locations on their GitHub profiles. While the study is point-in-time as of 2021, the authors compare their findings against~\cite{barahona2008geodiversity, takhteyev2010ossgeography} to characterize the evolution of FOSS geography over the time snapshots taken by the three studies. Compared with previous empirical works, our study is much larger scale---having analyzed 43 million\xspace authors of 2.2 billion\xspace commits from 160 million\xspace projects---longitudinal over 50 years of public code contributions rather than point in time, and also more fine-grained (with year-by-year granularity over the observed period). Methodologically, our study relies on Version Control System (VCS) commit data rather than platform-declared location information. Other works---in particular the work by Daniel~\cite{daniel2013ossdiversity} and, more recently, Rastogi et al.~\cite{rastogi2016geobias, rastogi2018geobias, prana2021geogenderdiversity}---have studied geographic \emph{diversity and bias}, i.e., the extent to which the origin of FOSS developers affect their collaborative coding activities. In this work we characterized geographic diversity in public code for the first time at this scale, both in terms of contributors and observation period. We do not tackle the bias angle, but provide empirical data and findings that can be leveraged to that end as future work. \emph{Global software engineering}~\cite{herbsleb2007globalsweng} is the sub-field of software engineering that has analyzed the challenges of scaling developer collaboration globally, including the specific concern of how to deal with geographic diversity~\cite{holmstrom2006globaldev, fraser2014eastwest}. Decades later the present study provides evidence that can be used, in the specific case of public code and at a very large scale, to verify which promises of global software engineering have borne fruit. \section{Methodology} \label{sec:method} \newif\ifgrowthfig \growthfigtrue \ifgrowthfig \begin{figure} \includegraphics[width=\columnwidth]{yearly-commits} \caption{Yearly public commits over time (log scale). } \label{fig:growth} \end{figure} \fi \paragraph{Dataset} We retrieved from \SWH/~\cite{swh-msr2019-dataset} all commits archived until \DATALastCommitDate/. They amount to \DATACommitsRaw/ commits, unique by SHA1 identifier, harvested from \DATATotalCommitsInSH/ public projects coming from major development forges (GitHub, GitLab, etc.) and package repositories (Debian, PyPI, NPM, etc.). Commits in the dataset are by \DATAAuthorsRaw/ authors, unique by $\langle$name, email$\rangle$ pairs. The dataset came as two relational tables, one for commits and one for authors, with the former referencing the latter via a foreign key. \iflong Each row in the commit table contains the following fields: commit SHA1 identifier, author and committer timestamps, author and committer identifiers (referencing the author table). The distinction between commit authors and committers come from Git, which allows to commit a change authored by someone else. For this study we focused on authors and ignored committers, as the difference between the two is not relevant for our research questions and the amount of commits with a committer other than its author is negligible. \fi For each entry in the author table we have author full name and email as two separate strings of raw bytes. We removed implausible or unusable names that: are not decodable as UTF-8 (\DATAAuthorsRmNondecodable/ author names removed), are email addresses instead of names (\DATAAuthorsRmEmail/ ``names''), consist of only blank characters (\DATAAuthorsRmBlank/), contain more than 10\% non-letters (\DATAAuthorsRmNonletter/), are longer than 100 characters (\DATAAuthorsRmToolong/). After filtering, about \DATAAuthorsPlausibleApprox/ authors (\DATAAuthorsPlausiblePct/ of the initial dataset) remained for further analysis. Note that the amount of public code commits (and authors) contained in the initial dataset grows exponentially over time~\cite{swh-provenance-emse}\ifgrowthfig, as shown for commits in \Cref{fig:growth}\else: from $10^4$ commits in 1971, to $10^6$ in 1998, to almost $10^9$ in 2020\fi. As a consequence the observed trends tend to be more stable in recent decades than in 40+ year-old ones, due to statistics taken on exponentially larger populations. \paragraph{Geolocation} \begin{figure} \centering \includegraphics[clip,trim=6cm 6cm 0 0,width=\linewidth]{subregions-ours} \caption{The \DATAWorldRegions/ world regions used as geolocation targets.} \label{fig:worldmap} \end{figure} As geolocation targets we use macro world regions derived from the United Nations geoscheme~\cite{un1999geoscheme}. To avoid domination by large countries (e.g., China or Russia) within macro regions, we merged and split some regions based on geographic proximity and the sharing of preeminent cultural identification features, such as spoken language. \Cref{fig:worldmap} shows the final list of \DATAWorldRegions/ world regions used as geolocation targets in this study. Geolocation of commit authors to world regions uses the two complementary techniques introduced in~\cite{icse-seis-2022-gender}, briefly recalled below. The first one relies on the country code top-level domain (ccTLD) of email addresses extracted from commit metadata, e.g., \texttt{.fr}, \texttt{.ru}, \texttt{.cn}, etc. We started from the IANA list of Latin character ccTLDs~\cite{wikipedia-cctld} and manually mapped each corresponding territory to a target world region. The second geolocation technique uses the UTC offset of commit timestamps (e.g., UTC-05:00) and author names to determine the most likely world region of the commit author. For each UTC offset we determine a list of compatible places (country, state, or dependent territory) in the world that, at the time of that commit, had that UTC offset; commit time is key here, as country UTC offsets vary over time due to timezone changes. To make this determination we use the IANA time zone database~\cite{tzdata}. Then we assign to each place a score that captures the likelihood that a given author name is characteristic of it. To this end we use the Forebears dataset of the frequencies of the most common first and family names which, quoting from~\cite{forebear-names}: {\itshape ``provides the approximate incidence of forenames and surnames produced from a database of \num{4 044 546 938} people (55.5\% of living people in 2014). As of September 2019 it covers \num{27 662 801} forenames and \num{27 206 821} surnames in 236 jurisdictions.''} As in our dataset authors are full name strings (rather than split by first/family name), we first tokenize names (by blanks and case changes) and then lookup individual tokens in both first and family names frequency lists. For each element found in name lists we multiply the place population\footnotemark{} by the name frequency to obtain a measure that is proportional to the number of persons bearing that name (token) in the specific place. \footnotetext{To obtain population totals---as the notion of ``place'' is heterogeneous: full countries v.~slices of large countries spanning multiple timezones---we use a mixture of primary sources (e.g., government websites), and non-primary ones (e.g., Wikipedia articles).} We sum this figure for all elements to obtain a place score, ending up with a list of $\langle$place, score$\rangle$ pairs. We then partition this list by the world region that a place belongs to and sum the score for all the places in each region to obtain an overall score, corresponding to the likelihood that the commit belongs to a given world region. We assign the starting commit as coming from the world region with the highest score. The email-based technique suffers from the limited and unbalanced use of ccTLDs: most developers use generic TLDs such as \texttt{.com}, \texttt{.org}, or \texttt{.net}. Moreover this does not happen uniformly across zones: US-based developers, for example, use the \texttt{.us} ccTLD much more seldomly than their European counterparts. On the other hand the offset/name-based technique relies on the UTC offset of the commit timestamps. Due to tool configurations on developer setups, a large number of commits in the dataset has an UTC offset equal to zero. This affects less recent commits (\DATACommitsTZZTwoThousandTwenty/ of 2020s commits have a zero offset) than older ones (\DATACommitsTZZTwoThousand/ in 2000). As a result the offset/name-based technique could end up detecting a large share of older commits as authored by African developers, and to a lesser extent Europeans. To counter these issues we combine the two geolocation techniques together by applying the offset/name-based techniques to all commits with a non-zero UTC offset, and the email-based on to all other commits. \section{Results and Discussion} \label{sec:results} \begin{figure*} \centering \includegraphics[width=\linewidth]{stacked.pdf} \caption{Ratio of commits (above) and active authors (below) by world zone over the 1971--2020 period.} \Description[Chart]{Stacked bar chart showing the world zone ratios for commits and authors over the 1971--2020 period.} \label{fig:results} \end{figure*} To answer \cref{rq:geodiversity} we gathered the number of commits and distinct authors per year and per world zone. We present the obtained results in \Cref{fig:results} as two stacked bar charts, showing yearly breakdowns for commits and authors respectively. Every bar represents a year and is partitioned in slices showing the commit/author ratio for each of the world regions of \Cref{fig:worldmap} in that year. To avoid outliers due to sporadic contributors, in the author chart we only consider authors having contributed at least 5 commits in a given year. While observing trends in the charts remember that the total numbers of commits and authors grow exponentially over time. Hence for the first years in the charts, the number of data points in some world regions can be extremely small, with negative consequences on the stability of trends. \paragraph{Geographic diversity over time} Overall, the general trend appears to be that the \textbf{geographic diversity in public code is increasing}: North America and Europe alternated their ``dominance'' until the middle of the 90s; from that moment on most other world regions show a slow but steady increment. This trend of increased participation into public code development includes Central and South Asia (comprising India), Russia, Africa, Central and South America, Notice that also zones that do not seem to follow this trend, such as Australia and New Zealand, are also increasing their participation, but at a lower speed with respect to other zones. For example, Australia and New Zealand incremented the absolute number of their commits by about 3 orders of magnitude from 2000 to present days. Another interesting phenomenon that can be appreciated in both charts is the sudden contraction of contributions from North America in 1995; since the charts depict ratios, this corresponds to other zones, and Europe in particular, increasing their share. An analysis of the main contributions in the years right before the contraction shows that nine out of ten have \texttt{ucbvax.Berkeley.EDU} as author email domain, and the tenth is Keith Bostic, one of the leading Unix BSD developers, appearing with email \texttt{bostic}. No developer with the same email domain appears anymore within the first hundred contributors in 1996. This shows the relevance that BSD Unix and the Computer Systems Research Group at the University of California at Berkeley had in the history of open source software. The group was disbanded in 1995, partially as a consequence of the so-called UNIX wars~\cite{kernighan2019unixhistory}, and this contributes significantly---also because of the relatively low amount of public code circulating at the time---to the sudden drop of contributions from North America in subsequent years. Descendant UNIX operating systems based on BSD, such as OpenBSD, FreeBSD, and NetBSD had smaller relevance to world trends due to (i) the increasing amount of open source code coming from elsewhere and (ii) their more geographically diverse developer community. Another time frame in which the ratios for Europe and North America are subject to large, sudden changes is 1975--79. A preliminary analysis shows that these ratios are erratic due to the very limited number of commits in those time period, but we were unable to detect a specific root cause. Trends for those years should be subject to further studies, in collaboration with software historians. \paragraph{Colonialism} Another trend that stands out from the charts is that Africa appears to be well represented. To assess if this results from a methodological bias, we double-checked the commits detected as originating from Africa for timezones included in the $[0, 3]$ range using both the email- the offset/name-based methods. The results show that the offset/name-based approach assigns 22.7\% of the commits to Africa whereas the email-based one only assigns 2.7\% of them. While a deeper investigation is in order, it is our opinion that the phenomenon we are witnessing here is a consequence of colonialism, specifically the adoption of Europeans names in African countries. For example the name Eric, derived from Old Norse, is more popular in Ghana than it is in France or in the UK. This challenges the ability of the offset/name-based method to correctly differentiate between candidate places. Together with the fact that several African countries are largely populated, the offset/name-based method could detect European names as originating from Africa. While this cuts both way, the likelihood of a random person contributing to public code is very different between European countries, all having a well-developed software industry, and African countries that do not all share this trait. \paragraph{Immigration/emigration} Another area where a similar phenomenon could be at play is the evolution of Central and South America. Contribution from this macro region appears to be growing steadily. To assess if this is the result of a bias introduced by the name-based detection we analyzed the evolution of offset/name-based assignment over time for authors whose email domain is among the top-ten US-based entities in terms of overall contributions (estimated in turn by analyzing the most frequent email domains and manually selecting those belonging to US-based entities). In 1971 no author with an email from top US-based entities is detected as belonging to Central and South America, whereas in 2019 the ratio is 12\%. Nowadays more than one tenth of the people email-associated to top US-based entities have popular Central and South American names, which we posit as a likely consequence of immigration into US (emigration from Central and South America). Since immigration has a much longer history than what we are studying here, what we are witnessing probably includes long-term consequences of it, such as second and third generation immigrants employed in white-collar jobs, such as software development. \section{Limitations and Future Work} \label{sec:conclusion} We have performed an exploratory, yet very large scale, empirical study of the geographic diversity in public code commits over time. We have analyzed 2.2 billion\xspace public commits covering the \DATAYearRange/ time period. We have geolocated developers to \DATAWorldRegions/ world regions using as signals email domains, timezone offsets, and author names. Our findings show that the geographic diversity in public code is increasing over time, and markedly so over the past 20--25 years. Observed trends also co-occur with historical events and macro phenomena like the end of the UNIX wars, increase of coding literacy around the world, colonialism, and immigration. \medskip \emph{Limitations.} This study relies on a combination of two geolocation methods: one based on email domains, another based on commit UTC offsets and author names. We discussed some of the limitations of either method in \Cref{sec:method}, motivating our decision of restricting the use of the email-based method to commits with a zero UTC offset. As a consequence, for most commits in the dataset the offset/name-based method is used. With such method, the frequencies of forenames and surnames are used to rank candidate zones that have a compatible UTC offset at commit time. A practical consequence of this is that for commits with, say, offset UTC+09:00 the candidate places can be Russia, Japan and Australia, depending on the specific date due to daylight saving time. Popular forenames and surnames in these regions tend to be quite different so the likelihood of the method to provide a reliable detection is high. For other offsets the set of popular forenames and surnames from candidate zones can exhibit more substantial overlaps, negatively impacting detection accuracy. We have discussed some of these cases in \Cref{sec:results}, but other might be lingering in the results impacting observed trends. The choice of using the email-based method for commits with zero UTC offset, and the offset/name-based method elsewhere, has allowed us to study all developers not having a country-specific email domain (ccTLD), but comes with the risk of under-representing the world zones that have (in part and in some times of the year) an actual UTC offset of zero. A potential bias in this study could be introduced by the fact that the name database used for offset/name-based geolocation only contains names formed using Latin alphabet characters. We looked for names containing Chinese, Japanese, and Korean characters in the original dataset, finding only a negligible amount of authors who use non-Latin characters in their VCS names, which leads us to believe that the impact of this issue is minimal. We did not apply identity merging (e.g., using state-of-the-art tools like SortingHat~\cite{moreno2019sortinghat}), but we do not expect this to be a significant issue because: (a) to introduce bias in author trends the distribution of identity merges around the world should be uneven, which seems unlikely; and (b) the observed commit trends (which would be unaffected by identity merging) are very similar to observed author trends. We did not systematically remove known bot accounts~\cite{lebeuf2018swbots} from the author dataset, but we did check for the presence of software bots among the top committers of each year. We only found limited traces of continuous integration (CI) bots, used primarily to automate merge commits. After removing CI bots from the dataset the observed global trends were unchanged, therefore this paper presents unfiltered data. \medskip \emph{Future work.} To some extent the above limitations are the price to pay to study such a large dataset: there exists a trade-off between large-scale analysis and accuracy. We plan nonetheless to further investigate and mitigate them in future work. Multi-method approaches, merging data mining with social science methods, could be applied to address some of the questions raised in this exploratory study. While they do not scale to the whole dataset, multi-methods can be adopted to dig deeper into specific aspects, specifically those related to social phenomena. Software is a social artifact, it is no wonder that aspects related to sociocultural evolution emerge when analyzing its evolution at this scale. \clearpage
61aa922b6be004f9063638d633fe6b8f84aa4d67
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:intro} Synthetic Aperture Radar (SAR) is an active microwave imaging sensor with long-distance observation capability in all-day and all-weather conditions and has good adaptability to monitoring the ocean. In ocean SAR images, ships are the most critical yet small targets to detect when developing a SAR search and tracking system. SAR-Ship detection aims to find the pre-defined ship objects in a given SAR scene by generating accurate 2D bounding boxes to locate them. Although many efforts have been explored to the SAR-ship detection task, it is still not completely and effectively solved, due to the non-trivial SAR imaging mechanism, where various ships are very small and blurred, and even submerged in extremely complicated backgrounds. \begin{figure}[t] \centering \label{fig:ship} \subfigure[CenterNet] { \begin{minipage}[b]{.2\linewidth} \centering \includegraphics[scale=0.21]{complexShip/small.png} \\ \includegraphics[scale=0.21]{complexShip/speckle_baseline.png}\\ \includegraphics[scale=0.21]{complexShip/complex_baseline.png} \end{minipage} } \subfigure[YOLOV4] { \begin{minipage}[b]{.2\linewidth} \centering \includegraphics[scale=0.21]{complexShip/small_yolo4.png}\\ \includegraphics[scale=0.21]{complexShip/speckle_yolo.png}\\ \includegraphics[scale=0.21]{complexShip/complex_yolo.png} \end{minipage} } \subfigure[EfficientDet] { \begin{minipage}[b]{.2\linewidth} \centering \includegraphics[scale=0.21]{complexShip/effi_1.png}\\ \includegraphics[scale=0.21]{complexShip/effi_2.png}\\ \includegraphics[scale=0.21]{complexShip/eff_3.png} \end{minipage} } \subfigure[Ours] { \begin{minipage}[b]{.2\linewidth} \centering \includegraphics[scale=0.21]{complexShip/small_2.png}\\ \includegraphics[scale=0.21]{complexShip/speck2_ours.png}\\ \includegraphics[scale=0.21]{complexShip/complex_ours.png} \end{minipage} } \caption{Ships are often small targets and submerged in extremely complicated backgrounds. Meanwhile, SAR images inevitably contain speckle noise. These adverse factors heavily hinder accurate SAR-Ship detection. When designing a neural network model, it is natural to suppress the extracted features from the adverse factors of surroundings while enhancing the beneficial features from the ship targets. The proposed SAR-ShipNet can deal with the aforementioned problems, therefore leading to better detection results than SOTAs.} \vspace{-4mm} \end{figure} \begin{figure}[t] \centering \subfigure{ \label{Fig.sub.1} \includegraphics[width=1\linewidth]{Structure/net5.png}} \caption{Overview of SAR-ShipNet structure. SAR-ShipNet is composed of three modules: the feature extraction network that the backbone adds the attention mechanism, feature fusion: MRF, and elliptic gauss.} \label{fig:net} \vspace{-4mm} \end{figure} Traditional SAR target detection methods are mainly based on contrast information, geometric, texture features, and statistics. They are implemented by the hand-crafted feature extractors and classifiers. However, these methods are not only time-consuming but also lead to inaccurate detection results in complicated sea-and-land scenarios. Constant false alarm rate detectors (CFAR) \cite{gao2008adaptive}, is one of the most commonly used techniques. \cite{gao2016scheme} considers practical application situation and tries to strike a good balance between estimation accuracy and speed. \cite{leng2015bilateral,shi2013ship} introduce a bilateral CFAR algorithm for ship detection and reduced the influence of synthetic aperture radar ambiguity and ocean clutter. With the development of deep learning, CNN-based detection models have emerged in multitude, which can automatically extract features and get rid of the shortcomings of manually designed features \cite{krizhevsky2012imagenet} for SAR-ship detection. Thus, many researchers begin to use deep learning for SAR ship detection. \cite{cui2019dense} integrates the feature pyramid networks with the convolutional block attention module. \cite{du2019saliency} introduces significant information into the network so that the detector can pay more attention to the object region. \cite{fu2020anchor} proposes an anchor-free network for ship detection, using a balancing pyramid composed of attention-guided and using different levels of features to generate appropriate pyramids. \cite{guo2021CenterNet++} improves CenterNet++ and enhanced ship feature through multi-scale feature fusion and head enhancement. These detectors have achieved great results in SAR-ship detection, there are still many problems with these detectors. These problems include misclassification caused by the high similarity of ships and islands in the complex sea and land scenes, omissions in the detection of small target ships under long-distance satellite observation, and scattering noise in the SAR imaging process. Figure~\ref{fig:ship} shows these three types of SAR-ship detection challenges, where the local regions similar to small ship targets spread over the whole background. Thus, exploring the interaction information amongst SAR image features in large-range dependencies to amplify the difference between the ship target and its background is crucial for robust detection. However, cutting-edge learning models are limited by the locality of CNNs, which behave poorly to capture large-range dependencies. To solve these challenges, we design a high-speed and effective detector called SAR-ShipNet. We propose a new attention mechanism, i.e., bidirectional coordinated attention (BCA), to solve the effects of complex background noise and islands on ship detection. Next, we generate high-resolution feature maps in different feature layers instead of the previous solution of only generating one feature map. This can solve the problem of small ship targets and shallow pixels caused by long-distance detection and scattered noise. Finally, considering the change of detection effect caused by the aspect ratio of ships, we adopt an elliptical Gaussian probability distribution scheme to replace the circular Gaussian probability distribution scheme in CenterNet, which significantly improves the detection effect of the detector without any consumption. \section{Methodology} \label{sec:typestyle} \textbf{Motivation}. SAR-ship detection encounters many challenges. Ships in SAR images are small, while backgrounds are usually complex. As a result, the small ship is easily submerged in the complex background, with a low Signal-to-Clutter Ratio (SCR). Besides, the number of ship pixels is much fewer than background pixels. That means the ship and background pixels in an image are of extreme imbalance. Meanwhile, SAR images inevitably contain speckle noise. These factors make SAR-ship detection slightly different from other detection tasks. To develop a high-precision ship detector, one should suppress the extracted features from the adverse factors of backgrounds while enhancing the beneficial features from the ship targets themselves. By completely considering both the adverse and beneficial features of SAR images with ships in them, we broadly extract different types of SAR image features, and 1) suppress data variations (e.g., complex land-sea backgrounds, scattered noise) of SAR images, and 2) enhance the features of ships that are small objects and have different aspect (length-width) ratios, therefore resulting in the improvement of ship detection. We propose a SAR-ship detection neural network (call SAR-ShipNet for short), by newly developing Bidirectional Coordinate Attention (BCA) and Multi-resolution Feature Fusion (MRF) based on CenterNet. SAR-ShipNet is composed of three modules, as shown in Figure~\ref{fig:net}. The first module is the feature extraction network that a backbone adds the attention mechanism: BCA. The second module is feature fusion: MRF. The third module is elliptic Gauss. \subsection{Bidirectional Coordinate Attention} Complicated background islands and other scattered noise affect the effectiveness of ship detection. Inspired by the coordinate attention mechanism (CA) \cite{hou2021coordinate}, we propose a Bidirectional Coordinate Attention mechanism (BCA). CA aggregates information in two directions through Avgpooling and then encodes the generated feature maps into a pair of direction-aware and position-sensitive attention maps, which are complementarily applied to the input feature maps to enhance the representation of the object of interest. But there is a lot of noise redundancy in SAR pictures. Only using average pooling to aggregate information must have noise features to be extracted. It is necessary to ignore unnecessary redundant noise information in SAR pictures. Max pooling information is equally important, thus we propose a BCA mechanism that combines Avg and Max pooling (see Figure~\ref{fig:DCA Attention}). \begin{figure}[t] \centering \subfigure{ \label{Fig.sub.1} \includegraphics[width=0.9\linewidth]{Structure/comBCA.png}} \caption{Bidirectional Coordinate Attention mechanism (BCA mechanism). ACA uses Avgpooling to aggregate features, and MCA uses Maxpooling to aggregate features.} \label{fig:DCA Attention} \end{figure} BCA is formulated as follows: \begin{equation} \begin{aligned} & f_{a}=\delta\left(F_{1}\left[\operatorname{avgpool}\left(x_{c}^{h}\right), \operatorname{avgpool}\left(x_{c}^{w}\right)\right]\right)\\ & g^{h}, g^{w}=\sigma\left(F_{h}\left(f_{a}^{h}\right)\right), \sigma\left(F_{w}\left(f_{a}^{w}\right)\right)\\ & y_{c}(i, j)=x_{c}(i, j) \times g_{c}^{h}(i) \times g_{c}^{w}(j)\\ \end{aligned} \end{equation} \begin{equation} \begin{aligned} & f_{m}=\delta\left(F_{2}\left[\operatorname{maxpool}\left(y_{c}^{h}\right), \operatorname{maxpool}\left(y_{c}^{w}\right)\right]\right)\\ & z^{h}, z^{w}=\sigma\left(F_{h2}\left(f_{m}^{h}\right)\right), \sigma\left(F_{w2}\left(f_{m}^{w}\right)\right)\\ & \operatorname{output}\left(x_{c}(i, j)\right)=x_{c}(i, j) \times g_{c}^{h}(i)\times g_{c}^{w}(j)\\ &\times z_{c}^{h}(i) \times z_{c}^{w}(j) \end{aligned} \end{equation} where ${x}\in\mathrm{R}^{\mathrm{C}\times\mathrm{W} \times\mathrm{H}}$ is the feature map, $c$ represents the channel index, $avgpool\left(x_{c}^{h}\right)$ and $avgpool\left(x_{c}^{w}\right)$ represents the average pooled output of the c-th channel with height h in the horizontal direction and width w in the vertical direction. $[ ]$ represents the splicing operation of the feature map. ${F}_{1}$ represents the 1$\times$1 convolution. $\delta$ is the non-linear activation function, ${f_{a}}\in\mathrm{R}^{\frac{C}{\mathrm{r}}\times(\mathrm{W}+\mathrm{H}) \times 1} $ is the intermediate feature. $f_{a}^{h} \in \mathrm{R}^{\frac{\mathrm{C}}{\mathrm{r}} \times \mathrm{H} \times 1}$ and $f_{a}^{w} \in \mathrm{R}^{\frac{\mathrm{C}}{\mathrm{r}} \times \mathrm{W} \times 1}$are two vectors obtained by decomposing $f_{a}$, ${F_{h}}$ and ${F_{w}}$ are two 1${\times}$1 convolutions. $\sigma$ is the sigmoid activation function. $g^{h} \in \mathrm{R}^{\mathrm{C} \times \mathrm{H} \times 1}$ and $g^{w} \in \mathrm{R}^{\mathrm{C} \times \mathrm{W} \times 1}$ are two attention weights respectively. $y_{c}(i, j)$ is the feature point output after avgpooling attention. Similarly, the process of using the maxpooling attention mechanism is consistent with the avgpooling attention mechanism. $\operatorname{output}\left(x_{c}(i, j)\right)$ is the last output of attention through BCA. BCA makes full use of the captured position information through two different information aggregation methods so that the region of interest can be accurately captured. \subsection{Multi-resolution Feature Fusion} The Multi-resolution Feature Fusion module (MRF) is used to enhance the detailed information of small-scale ships to solve the problem of small ship targets and huge differences in surface morphology. In the deep network, if only the last feature layer is used to generate a high-resolution feature map, it is easy to lose the spatial position information of the ship, so we propose an MRF module to enhance ship features. \begin{figure}[t] \centering \subfigure{ \label{Fig.sub.1} \includegraphics[width=1\linewidth]{Structure/MRF.png}} \caption{MRF module. {C3, C4, C5} are the feature layers output by the last three stages of Resnet50, Devconv is the deconvolution operation.} \label{fig:MRF} \end{figure} The output of the last three stages of ResNet-50 is defined as \{C3, C4, C5\}. The MRF module uses three feature layers to generate three feature maps of the same size. Figure~\ref{fig:MRF} shows the implementation details of the MRF module. By deconvolution of \{C3, C4, C5\} multiple times. Finally, we merge the three high-resolution feature maps to enhance the detailed features of the ship. The process can be defined as: \begin{equation} \small P=\operatorname{dev}_{-}3\left(C_{5}\right)+\operatorname{dev}_{-}2 \left(C_{4}\right)+\operatorname{dev}_{-}1\left(C_{3}\right) \end{equation} where ${dev}_{-}i$ is the deconvolution \cite{2011Adaptive} operation, $i$ is deconvolution times. P is the total feature after fusion. After the feature fusion of the MRF module, it can significantly enhance the feature extraction of ships, reduce the detection interference caused by complex backgrounds, and improve the generalization ability of the model. \begin{table*}[] \scriptsize \centering \caption{Experimental results of SAR-ShipNet and other different SAR ship detectors.} \label{fig:all} \begin{tabular}{ccccccccccccccc} \toprule \multirow{2}{*}{Method} &\multirow{2}{*}{Backbone} & \multicolumn{4}{c}{SAR-Ship} & \multicolumn{4}{c}{SSDD} & \multirow{2}{*}{FPS} & \multirow{2}{*}{Parameter}& \multirow{2}{*}{Input-size} \\ \cmidrule(r){3-6} \cmidrule(r){7-10} && Precision & Recall & F1& AP0.5 & Precision & Recall & F1& AP0.5 & &&\\ \midrule YOLOV3 \cite{redmon2018YOLOV3} & DarkNet53 & 92.62 & 70.12 & 80 & 87.24& 90.67 & 67.61 & 77 & 79.06 & 83 & 234MB & 416${\times}$416 \\ YOLOV4 \cite{bochkovskiy2020YOLOV4}& DarkNet53 & 94.46 & 70.36 & 81 & 88.76& \textbf{96.94} & 75.65 & 85 & 88.46 & 70 & 245MB & 416${\times}$416 \\ YOLOX \cite{YOLOX2021}& DarkNet53 & 93.65 & 67.51 & 78 & 88.21& 90.78 & 71.36 & 80 & 85.31 & 50 & 97MB & 640${\times}$640 \\ SSD300\cite{liu2016ssd} & VGG16 & 87.79 & 72.48 & 79 & 82.90 & 93.83 & 33.04 & 49 & 74.07 & 142 & 91MB & 300${\times}$300 \\ SSD512 \cite{liu2016ssd}& VGG16 & 87.48 & \textbf{74.58} & 81 & 84.42& 90.07 & 55.22 & 68 & 70.04 & 80 & 92MB & 512${\times}$512 \\ RetinaNet\cite{lin2017focal} & ResNet50 & 91.52 & 73.24 & 81 & 88.37& 39.34 & 51.74 & 45 & 37.53 & 49 & 145MB & 600${\times}$600 \\ CenterNet\cite{zhou2019objects} & ResNet50 & 94.66 & 60.02 & 74 & 87.44& 92.57 & 59.57 & 72 & 78.86 & 127 & 124MB & 512${\times}$512 \\ FR-CNN \cite{ren2015faster} & ResNet50 & 75.68 & 70.95 & 73 & 75.19& 67.51 & 75 & 71 & 71.9 & 15 & 108MB & 600${\times}$600 \\ EfficientDet\cite{tan2020efficientdet} & EfficientNet & 89.48 & 71.77 & 80 & 85.20 & 94.33 & 39.78 & 56 & 68.27& 45 & 15MB & 512${\times}$512 \\ SAR-ShipNet(ours) & ResNet50 & \textbf{94.85} & 71.31 & \textbf{81} & \textbf{90.20}& 95.12 & \textbf{76.30} & \textbf{85} & \textbf{89.08} & 82 & 134MB & 512${\times}$512 \\ \bottomrule \end{tabular} \vspace{-5mm} \end{table*} \subsection{Elliptic Gauss} In the original CenterNet, the center point of the object needs to be mapped to the heatmap to form a circular Gaussian distribution. This distribution is used to measure the discrete distribution of the center point. For each GT, the key point $p \in R^{2}$ corresponding to category c, then calculate the key points after down sampling $\tilde{p}=\left\lfloor\frac{p}{R}\right\rfloor$. CenterNet splat all ground truth keypoints onto a heatmap $Y \in[0,1]^{\frac{W}{R} \times \frac{H}{R} \times C}$ using a Gaussian kernel $Y_{x y c}=\exp \left(-\frac{\left(x-\tilde{p}_{x}\right)^{2}+\left(y-\tilde{p}_{y}\right)^{2}}{2 \sigma_{p}^{2}}\right)$, where $\sigma_{p}$ is an object size-adaptive standard deviation. The Gaussian kernel generated by this method is a circular distribution. The parameter $\sigma_{p}$ in the Gaussian kernel is only related to the area of GT, and the aspect ratio of GT is not fully considered. Ships in real life usually have a large aspect ratio. To fully consider the aspect ratio of GT, we are inspired by the elliptic Gaussian method in TtfNet \cite{2019Training}. When the key point $\tilde{p}=\left\lfloor\frac{p}{R}\right\rfloor$ is dispersed on the heatmap, the 2D Gaussian kernel $Y_{x y c}$ is: \begin{equation} \small \mathbf{Y}_{x, y, c}=\exp \left(-\frac{\left(x-\tilde{p}_{x}\right)^{2}}{2 \sigma_{x}^{2}}-\frac{\left(y-\tilde{p}_{y}\right)^{2}}{2 \sigma_{y}^{2}}\right) \end{equation} where $\sigma_{x}=\frac{\alpha w}{6}$, $\sigma_{y}=\frac{\alpha h}{6}$, $\alpha$ is a super parameter, $w$ and $h$ are the width and height of GT respectively. \subsection{Loss Function} Our training loss function consists of three parts: \begin{equation} \small \begin{aligned} \operatorname{Loss}= &\frac{1}{N_{p o s}} \sum_{x y c} F L\left(\hat{p}, p\right)+\frac{\lambda_{1}}{N_{p o s}} \sum_{i}L_{1}\left(\hat{L}_{wh}, L_{w h}\right)\\ & +\frac{\lambda_{2}}{N_{p o s}} \sum_{i} L_{1}(\hat{s}, s) \end{aligned} \end{equation} where ${\hat{p}}$ is the confidence of classification prediction, ${{p}}$ is the ground-truth category label, $FL$ is Focal loss\cite{lin2017focal}. ${ \hat{L}_{wh}}$ are the width and height of the predicted bounding box, ${ L_{w h}}$ are the width and height of the ground-truth bounding box. ${s}$ is the offset $\left(\sigma x_{i}, \sigma y_{i}\right)$ generated by the center point $\left(x_{i}, y_{i}\right)$ of the down-sampling process, ${\hat{s}}$ is the offset predicted value. ${N_{p o s}}$ is the number of positive samples, ${\lambda_{1}}$ and ${\lambda_{2}}$ are the weight parameters. We set $\lambda_{1}=0.1$ and $\lambda_{2}=1$. \begin{table} \scriptsize \centering \caption{Ablation experiments on the SAR-Ship dataset.} \label{fig:comtab3} \begin{tabular}{cccc|cccc} \toprule \multicolumn{2}{c}{CenterNet}&\multirow{2}{*}{MRF}&\multirow{2}{*}{EGS}& \multirow{2}{*}{Precision}&\multirow{2}{*}{Recall}&\multirow{2}{*}{ F1 }&\multirow{2}{*}{AP0.5}\\ \cline{1-2} CA & BCA & & & & &\\ \hline $\times$& $\times$& $\times$&$\times$& 94.66& 60.20& 74& 87.44\\ $\surd$& $\times$& $\times$&$\times$& 96.95& 51.80& 68& 88.56\\ $\times$& $\surd$& $\times$&$\times$& 96.76& 57.71& 72& 89.10\\ $\times$& $\surd$& $\surd$&$\times$& \textbf{97.06}& 50.19& 66& 89.40\\ $\times$& $\surd$& $\surd$&$\surd$& 94.85& \textbf{71.31}& \textbf{81}& \textbf{90.20}\\ \toprule \end{tabular} \vspace{-5mm} \end{table} \section{Experiments} \subsection{Experimental Dataset} \label{sec:majhead} We directly evaluate the SAR-ShipNet model on the SAR-Ship \cite{wang2019sar} and SSDD\cite{li2017ship} dataset. The SAR-ship dataset contains ship slices (43819) and the number of ships (59535) and the size of the all ship slices is fixed at 256${\times}$256 pixels. The SSDD data set has a total of 1160 images and 2456 ships. We randomly divide the data set into the training set, validation set, and test set at a ratio of 7:1:2. \subsection{Experimental results} \begin{table} \scriptsize \centering \caption{SAR-ShipNet test results of different $\alpha$.} \begin{tabular}{c| c | c | c | c} \hline Parameter & Precision & Recall & F1 & AP0.5 \\ \hline $\alpha$ = 0.1 & 96.16 & 6.12 & 12 & 87.40 \\ $\alpha$ = 0.2 & 97.84 & 7.2 & 13 & 88.16 \\ $\alpha$ = 0.3 & \textbf{98.12} & 24.38 & 39 & 88.81 \\ $\alpha$ = 0.4 & 97.58 & 42.11 & 59 & 89.48 \\ $\alpha$ = 0.5 & 95.86 & 63.12 & 76 & 89.80 \\$\alpha$ = 0.6 & 97.36 & 55.82 & 71 & 90.03 \\ $\alpha$ = 0.7 & 96.61 & 61.58 & 75 & 89.85 \\ $\alpha$ = 0.8 & 94.85 & \textbf{71.31} & \textbf{81} & \textbf{90.20} \\ $\alpha$ = 0.9 & 95.88 & 65.2 & 78 & 90.16 \\ \hline Circular Gaussian & 97.06 & 50.19 & 66 & 89.40 \\ \end{tabular} \label{tab:e} \vspace{-5mm} \end{table} We evaluate our SAR-ShipNet on 4 evaluation metrics and compare it with other methods. Table~\ref{fig:all} shows the quantitative results of all the methods in two datasets. Compared with other detectors SAR-ShipNet achieves the best $F_{1}$, and AP on two datasets, indicating that our model has the best overall performance. This is because SAR-ShipNet uses the attention mechanism to pay more attention to ship features, and uses feature fusion to strengthen small targets and fully consider the aspect ratio of the ship. Experiments show that our model can achieve the best comprehensive performance on both the large dataset SARShip and the small dataset SSDD. Table~\ref{fig:comtab3} shows the ablation experimental results. It can be found that CA, BCA, MRF, and elliptic Gauss can increase the detection performance of the model. In particular, after adding the attention mechanism, the precision and AP have been improved, which shows that our model reduces the misclassification of islands and backgrounds into ships. Table~\ref{tab:e} shows the experimental results of the effect of hyperparameter $\alpha$ on SAR-Ship dataset. When $\alpha$ = 0.8, we get the best AP (90.20). \section{Conclusion} In this paper, we propose an effective SAR-ShipNet for SAR-ship detection. SAR-ShipNet mainly has three modules: the BCA mechanism, the MRF module, and the elliptic Gaussian module. BCA mechanism is used to solve the problem of ship detection in complex backgrounds. It can make the model pay attention to ship features as much as possible while ignoring background noise. The MRF module is used to solve the problems of small ship sizes and shallower pixels in long-distance observation. Elliptical Gauss fully considers the influence of ship aspect ratio detection. Experimental results show that our SAR-ShipNet achieves a competitive detection performance. \bibliographystyle{IEEE}
41f3643afab19b8f10661c5bc6cb13fd227b97e0
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Artificial intelligence (AI) technologies under rapid development have been widely studied and deployed in various scenarios. As a data-driven technology, its reliability and accuracy largely depend on the volume and quality of source data. However, it is recognized as a big challenge for most enterprises to obtain a dataset with sufficient volume and quality for AI model training. In the meantime, data privacy is another crucial issue that needs to be considered among different involved parties~\cite{xu2014information}. To this end, it is preferred in real-world implementations that data be kept locally, forming a variety of isolated data islands. This makes it difficult to directly aggregate data in the cloud and centrally train the AI models. Therefore, federated learning (FL)~\cite{mcmahan2017communication, bonawitz2019towards, yang2019federated} has emerged as a novel paradigm to address these challenges. A generic and practical FL framework is essentially a distributed training process, and each iteration of FL includes the following three steps~\cite{yang2019federated}. Firstly, the server broadcasts the current global model parameters to all the involved devices. Next, each device performs local model training based on its local data and then sends the local updates back to the server. Finally, the server aggregates the local updates and generates new global model parameters for the next iteration of distributed training. In essence, the server and devices aim to collaboratively solve a distributed optimization problem, which is typically referred to as \emph{Federated Optimization}~\cite{konevcny2016federated}. Different from centralized optimization, federated optimization confronts several practical challenges including communication efficiency, data heterogeneity, security, system complexity, etc.~\cite{wang2021field}. Among them, communication efficiency is of utmost importance since the communication between the server and devices usually suffers from unreliable network connections, limited resources, and severe latency~\cite{shi2020communication}. To deal with the communication issue, a large amount of research has been conducted in federated optimization. On the one hand, reducing the communication volume in each iteration is an effective method. Specifically, quantization and sparsification techniques are employed to reduce the transmitted bits and remove the redundant updates of parameters, respectively~\cite{bernstein2018signsgd, aji2017sparse}. These compression techniques have shown remarkable effectiveness for high-dimensional models. However, their design needs to consider the compatibility for the aggregation operation in FL~\cite{wang2021field}. On the other hand, minimizing the total communication rounds is another primary method. To this end, zeroth-order methods~\cite{chen2019zo, gao2020can} have been investigated for some restrictive circumstances (e.g., black-box adversarial attack, non-smooth objective function) while showing great potential as only the objective function value is required to approximate derivative information~\cite{nesterov2017random}. In the situation where gradients are available, first-order methods are widely used. By increasing the amount of local computation, various gradient descent based methods have been shown that can significantly decrease the total number of communication rounds~\cite{mcmahan2017communication, woodworth2020local, yuan2020federated, pathak2020fedsplit}. Nevertheless, these existing approaches, i.e., zeroth-order and first-order approaches, are governed by the linear convergence in the best case. As a result, the total number of iteration rounds required to achieve the desired accuracy is relatively large~\cite{bischoff2021second}. Therefore, the second-order methods (e.g., Newton-type methods) become attractive in such a wireless environment due to their fast local quadratic convergence rate. Nevertheless, the construction of the canonical Newton update requires both the Hessian and gradient information, where the distributed situation in FL makes gathering Hessian information a severe communication overhead. To this end, second-order federated optimization algorithms have been investigated to resolve this issue, which can be divided into two categories~\cite{bischoff2021second}. One is to use second-order information implicitly. In~\cite{shamir2014communication}, a mirror descent update is carried out on the local function to approximate the Hessian information. In~\cite{smith2018cocoa}, the dual problems of the objective function are used to serve as the local subproblems. The other category is to use second-order information explicitly. In~\cite{wang2018giant}, a globally improved approximate Newton method (GIANT) using local Hessian for aggregation is proposed. In~\cite{crane2019dingo, crane2020dino}, the optimization of the gradient's norm acts as the surrogate function. In~\cite{zhang2015disco}, Hessian-vector product computation and conjugate gradient descent are performed on the devices and the server, respectively. The fast convergence rate with efficient communication makes the application of these second-order algorithms a great benefit to FL. Despite the potential in the application of second-order algorithms to reduce the total communication rounds and improve the communication efficiency, the transmission of FL model parameters through wireless channels still confronts great challenges as wireless channels are always noisy with limited resources and high latency~\cite{yang2020federatedIOT, letaief2019roadmap, li2021delay}. Based on the conventional ``transmit-then-communicate'' principle, the aggregation of FL model parameters can be achieved by digital coded transmission and orthogonal multiple access (OMA) schemes~\cite{amiri2020machine, elgabli2021harnessing, chang2020communication}. By taking advantage of OMA and error correction techniques, local updates are transmitted separately in the quantized form and then decoded individually at the server. In this way, the model transmission can be deemed to be reliable and trustworthy. However, the increase in the number of devices will inevitably lead to a sharp increase in total communication latency and bandwidth requirement, which is often intolerable. Therefore, a novel technique called over-the-air computation (AirComp)~\cite{nazer2007computation} has emerged in FL algorithm design to decrease the communication cost based on the ``compute-when-transmit'' principle~\cite{yang2020federated, zhu2019broadband, amiri2020machine, sery2020analog, liu2020privacy, elgabli2021harnessing, liu2020reconfigurable, xiaowen2021optimized, xu2021learning, zhu2020one, wei2022federated, fan2021joint}. This technique leverages the superposition property of multiple access channels to realize the aggregation operation. Through the simultaneous transmission of all local updates, which are aggregated over the air, the communication overheads are significantly decreased. Specifically, the authors in~\cite{yang2020federated} proposed an AirComp-based approach for FL with joint design of device selection and beamforming to improve the statistical learning performance. In~\cite{sery2020analog}, a novel Gradient-Based Multiple Access (GBMA) algorithm was put forward to perform FL with an energy scaling law for approaching the convergence rate of centralized training. In~\cite{xiaowen2021optimized}, the authors investigated the power control optimization for enhancing the learning performance of over-the-air federated learning. In~\cite{liu2020reconfigurable, wang2020federated}, intelligent reflecting surface (IRS) technology was used to achieve fast yet reliable model aggregation for over-the-air federated learning. The authors in~\cite{xu2021learning} proposed the dynamic learning rate design for AirComp-based FL. Overall, the application of over-the-air computation in FL also improves the communication efficiency a lot. Based on the above observations, this paper proposes to improve communication efficiency from two aspects, i.e., reducing communication rounds and the communication overhead in each round. To reduce the communication rounds, we shall utilize second-order information during the training process of FL. Due to the fast convergence speed, all these existing second-order state-of-the-arts have shown substantial improvement in terms of the total iteration rounds compared with first-order methods. However, their iterative procedures still have at least two communication rounds per iteration, i.e., the aggregation of gradient and second-order information. To avoid such two communication rounds, a recently proposed second-order method~\cite{ghosh2020distributed} cuts down the aggregation of gradients and realizes one communication round per iteration. Motivated by this, we adopt local Newton step aggregation for wireless FL algorithm design. Specifically, the product of the local Hessian's inversion and the local gradient is used to construct a local Newton step for aggregation. By this means, the devices only need to communicate once with the server per iteration, cutting down the transmission of local Hessian matrices and local gradients while keeping the convergence behavior of canonical Newton's method. Moreover, due to the limited radio resources, we adopt over-the-air computation, which has been widely used in the existing wireless FL schemes, to further reduce the communication overheads in each round. Based on this efficient local Newton step aggregation and AirComp technique, we propose an over-the-air second-order federated algorithm over wireless networks. Furthermore, we provide a rigorous theoretical analysis of the convergence behavior of our proposed method. The results show that the transmission of the above-mentioned product is sufficient to guarantee convergence and our proposed method outperforms first-order algorithms. To be specific, the proposed algorithm keeps a linear-quadratic convergence rate, which means it can achieve the optimal point with a quadratic convergence rate and degenerate into the linear convergence rate when it is close enough to the optimal point. However, as a result of local Newton step aggregation, device selection, and channel noise, there is an error term in each iteration. As the training proceeds, this accumulative error term will deflect the model parameters and affect learning performance. In order to mitigate the impact of this error term, we further propose a joint optimization approach of device selection and receiver beamforming. Specifically, Gibbs Sampling \cite{geman1984stochastic} is adopted to determine the set of selected devices, and the difference-of-convex-functions (DC) algorithm \cite{tao1997convex} is tailored to optimize the receiver beamforming during the iterative process of Gibbs Sampling. \subsection{Contributions} In this paper, we propose a novel over-the-air FL algorithm via the second-order optimization method. Then, we theoretically analyze its convergence behavior, which shows that the proposed algorithm keeps a linear-quadratic convergence rate, with an accumulative error term arising during the FL process. To minimize the error gap and achieve better performance, we formulate this problem as a combinatorial non-convex problem and propose a system optimization approach to solve it. The main contributions of this paper are summarized as follows: \begin{itemize} \item[1)] We design a novel AirComp-based FL algorithm by leveraging the principles of distributed second-order optimization methods and exploiting the waveform superposition property of a wireless multi-access channel for model aggregation. This algorithm is fundamentally different from most existing works which only consider gradient descent/SGD in training. The utilization of second-order information significantly reduces the total communication rounds in Aircomp-based FL, which further improves the communication efficiency. \item[2)] We theoretically analyze the convergence behaviors of our proposed over-the-air second-order federated optimization algorithm with the presence of data heterogeneity (i.e., the different data sizes), device selection, and channel noise. The results show that our algorithm keeps a linear-quadratic convergence rate and outperforms first-order methods; \item[3)] We formulate a system optimization problem to minimize the accumulative error gap during the execution of our proposed algorithm. Correspondingly, we propose a system optimization approach. Through the combination of Gibbs Sampling and DC algorithm, we jointly optimize the device selection and receiver beamforming; \item[4)] We conduct extensive experiments to demonstrate that our proposed algorithm and system optimization approach can achieve better performance than other state-of-art approaches. \end{itemize} \subsection{Organization and Notations} The remainder of this paper is organized as follows. Section \ref{Federated Edge Learning Model and Algorithm} presents the federated learning model and our FL algorithm. Section \ref{Theoretical Analysis} provides the convergence analysis of our proposed algorithm. Section \ref{System Optimization} analyzes the system optimization problem arising from the error term, and describes our joint optimization method of device selection and beamforming. The experimental results are given in Section \ref{Simulation Results}. Finally, Section \ref{Conclusion} concludes the whole paper. $\|\cdot\|_p$ is the $\ell_p$-norm, $\|\cdot\|_\mathsf{F}$ is the Frobenius norm. Italic, boldface lower case and upper case letters represent scalars, vectors and matrices, respectively. For a given set $\mathcal{X}$, $|\mathcal{X}|$ denotes the cardinality of $\mathcal{X}$. The operators $(\cdot)^\mathsf{T}$, $(\cdot)^\mathsf{H}$, $\text{Tr}(\cdot)$ and $\text{diag}(\cdot)$ denote the transpose, Hermitian transpose, trace, and diagonal matrix, respectively. $\mathbb{E}[\cdot]$ denotes the statistical expectation. \section{Federated Learning Model and Algorithm} \label{Federated Edge Learning Model and Algorithm} \subsection{Federated Learning System} \begin{figure}[htbp!] \centering \includegraphics[width=0.4\linewidth]{fig/FL_system.pdf} \caption{Illustration of wireless FL systems.} \label{FL system} \vspace{-0.6cm} \end{figure} A typical wireless federated learning system consists of a group of distributed devices and one server, where the communication takes place over wireless channels. As depicted in Fig.~\ref{FL system}, there are $m$ single-antenna devices and a server equipped with $k$ antennas to collaboratively complete a learning task. We denote $\mathcal{D}$ as the entire sample set used in the FL task. Each device $i \in \mathcal{S}$ stores a sample set $\mathcal{D}_{i} = \left\{\bm{z}_{i, j} := \left(\bm{u}_{i, j}, v_{i, j}\right)\right\}$ and $\mathcal{D} = \bigcup_{i=1}^{m} \mathcal{D}_{i}$ with $\card{\mathcal{D}} = n$, where $\mathcal{S}$ denotes the index set of devices, $\bm{u}_{i, j}$ is the feature vector and $v_{i, j}$ is the corresponding label. As an important part of the learning task, the loss function is usually used for model parameter estimation. Here, the loss function of the $i$-th device is defined by \begin{small} \begin{equation} F_{i}\left(\bm{w}\right)=\frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} f\left(\bm{w}, \bm{z}_{i, j}\right)+\frac{\gamma}{2}\|\bm{w}\|_{2}^{2}\;. \label{local_loss} \end{equation} \end{small} The first term is the average of $f\left(\bm{w}, \bm{z}_{i, j}\right)$, where $\bm{w} \in \mathbb{R}^{d}$ is the model parameter vector and function $f$ is used to measure the prediction error of $\bm{w}$. The second term is for regularization with $\gamma$ being the weighting parameter. FL aims to train a suitable model at the server by aggregating the results collected from multiple devices, on which the distributed models are trained based on local datasets. Specifically, the server needs to optimize the following global loss function: \begin{small} \begin{equation} F \bracket{\bm{w}} = \frac{1}{n}\sum_{i=1}^{m}\card{\mathcal{D}_{i}}F_{i}\bracket{\bm{w}} \;. \label{global_loss} \end{equation} \end{small} \subsection{Federated Second-Order Optimization Algorithm} As typical training algorithms, gradient descent methods (e.g., SGD \cite{bottou2012stochastic}, batch gradient descent) are widely used. However, the relatively slow convergence rate of gradient descent results in too many communication rounds between the server and devices to complete the learning task. Thus, many research works have been done to improve the communication efficiency of gradient descent in FL. For example, some methods utilize multiple local updates to reduce the number of communication rounds \cite{mcmahan2017communication, woodworth2020local}, while several algorithms employ compression techniques to reduce transmitted bits and save communication costs~\cite{bernstein2018signsgd, aji2017sparse, vogels2019powersgd}. Although these schemes have greatly improved the communication efficiency of gradient descent in FL, they are still limited by the linear convergence rate. To address this issue, this paper considers second-order algorithms with a faster convergence rate such that the communication rounds can be significantly reduced. The descent direction vector of canonical Newton's method~\cite{nocedal2006numerical} is given by \begin{small} \begin{equation} \bm{p} = \left(\nabla^{2}F\left(\bm{w}\right)\right)^{-1}\nabla F\left(\bm{w}\right). \label{Newton step} \end{equation} \end{small} The canonical Newton's method can achieve a locally quadratic convergence rate so that its total iteration rounds needed to complete the learning task are much fewer than first-order algorithms. However, in the distributed scenario, the computation of $\nabla^{2}F\left(\bm{w}\right) = \frac{1}{m}\sum_{i=1}^{m} \nabla^{2}F_{i}\left(\bm{w}\right)$ requires the aggregation of the local Hessian $\nabla^{2}F_{i}\left(\bm{w}\right)$. The transmission of such $d \times d$ matrices inevitably brings huge communication overheads. To resolve this issue, numerous second-order distributed machine learning algorithms have been proposed, such as DANE \cite{shamir2014communication}, DISCO \cite{zhang2015disco}, GIANT \cite{wang2018giant}, DINGO \cite{crane2019dingo}, and DINO \cite{crane2020dino}. These methods approximate Hessian information in varied forms to avoid the direct transmission of Hessian matrices and approach the performance of canonical Newton's method. However, at least two communication rounds per iteration are required, including the aggregation of local gradients and second-order descent directions. Different from these second-order algorithms, which require the aggregation of local gradients $\nabla F_{i}\left(\bm{w}\right)$ to compute the global gradient $\nabla F\left(\bm{w}\right) = \frac{1}{m} \sum_{i=1}^{m} \nabla F_{i}\left(\bm{w}\right)$, a recently proposed COMRADE \cite{ghosh2020distributed} method cuts down this aggregation. By this means, the number of communication rounds required per iteration is reduced to one, further improving the communication efficiency. Motivated by this, we leverage the local Newton step aggregation as in~\cite{ghosh2020distributed} to achieve a faster convergence rate with fewer communication rounds. The product of the inversion of the local Hessian matrix $\left(\nabla^{2}F_{i}\left(\bm{w}\right)\right)^{-1}$ and the local gradient $\nabla F_{i}\left(\bm{w}\right)$ is used to serve as the local descent direction vector $\bm{p}_{i} = \left(\nabla^{2}F_{i}\left(\bm{w}\right)\right)^{-1}\nabla F_{i}\left(\bm{w}\right)$ for model aggregation. In this way, with the preserved convergence behavior of Newton's method, only one aggregation of the $d$-dimensional local descent direction vectors will be carried out in each iteration. To be specific, at $t$-th iteration, the procedure of our proposed method is summarized as follows: \begin{itemize} \item[1)] \textbf{Device Selection}: The server decides the set of devices, denoted as $\mathcal{S}_{t}$, to participate in this iteration. \item[2)] \textbf{Global Model Broadcast}: The server disseminates the current global model parameter vector $\bm{w}_{t}$ to the selected devices through the wireless channel. \item[3)] \textbf{Local Model Update}: After the $i$-th device receives global model parameter vector $\bm{w}_{t}$, it first computes the local gradient based on local data samples: \begin{small} \begin{equation} \bm{g}_{t,i} = \nabla F_{i}\left(\bm{w}_{t}\right)=\frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} \nabla f\left(\bm{w}_{t} ,\bm{z}_{i, j}\right)+\gamma \bm{w}_{t}\;, \label{local_gradient} \end{equation} \end{small} where the derivatives are taken with respect to the first argument. Afterwards, the $i$-th device calculates the local Hessian matrix according to local gradient and local data samples: \begin{small} \begin{equation} \bm{H}_{t, i}=\nabla^2F_{i}\left(\bm{w}_{t}\right)=\frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} \nabla^{2}f\left(\bm{w}_{t}, \bm{z}_{i, j}\right)+\gamma \bm{I}_{d}\;. \label{local_hessian} \end{equation} \end{small} The $i$-th device then gets a local Newton descent direction vector from previous results: \begin{small} \begin{equation} \bm{p}_{t,i} = \bm{H}_{t, i}^{-1} \bm{g}_{t,i} = \left(\nabla^{2}F_{i}\left(\bm{w}_{t}\right)\right)^{-1}\nabla F_{i}\left(\bm{w}_{t}\right). \label{approx_newton_direction} \end{equation} \end{small} In practice, this step involves the computation of Hessian matrix and its inverse operation. To reduce the computational complexity, we adopt the conjugate gradient method~\cite{nocedal2006numerical} to obtain an approximate local Newton descent direction vector. According to the analysis in~\cite{wang2018giant}, this approximate solution will not have a significant impact on the convergence behavior. \item[4)] \textbf{Model Aggregation}: The devices participating in the $t$-th iteration transmit local Newton descent direction vectors $\{\bm{p}_{t,i}\}$ to the server through the wireless channel, and the server aggregates them to obtain the global descent direction vector for this iteration: \begin{small} \begin{equation} \tilde{\bm{p}}_{t} = \frac{1}{\underset{i \in \mathcal{S}_{t}}{\sum}\card{\mathcal{D}_{i}}}\underset{i \in \mathcal{S}_{t}}{\sum}\card{\mathcal{D}_{i}} \bm{p}_{t,i} \;. \label{averaged_local_descent_direction} \end{equation} \end{small} \item[5)] \textbf{Global Model Update}: Finally, the server updates the model parameter vector $\bm{w}_{t}$ through global descent direction vector $\tilde{\bm{p}}_{t}$ and learning rate $\alpha$. \end{itemize} \begin{small} \begin{equation} \bm{w}_{t+1} = \bm{w}_{t} - \alpha \tilde{\bm{p}}_{t}\;. \label{global_update} \end{equation} \end{small} Notably, the Newton's method has a faster convergence rate than the gradient descent methods because it makes full use of the curvature information of the loss function, but the aggregation of the $d \times d$ local Hessian matrices for Newton descent direction in~\eqref{Newton step} aggravates the communication overheads in another way. As implied in Step 3) of our proposed FL scheme, it does not need to compute the global gradient $\nabla F\left(\bm{w}\right)$ and Hessian $\nabla^{2}F\left(\bm{w}\right)$ to get a precise Newton descent direction by aggregating the local $\nabla F_i\left(\bm{w}\right)$ and $\nabla^{2}F_i\left(\bm{w}\right)$. Note that this approximation also brings a controllable error gap with the exact descent direction vector, and its impact on the convergence rate will be analyzed in Section~\ref{Theoretical Analysis}. \subsection{Communication Model} To further reduce the communication overheads, this subsection focuses on the design of the communication model between the server and devices. Specifically, there are two communication-related steps in each iteration of our FL algorithm. One is global model broadcasting in the downlink. Since only one global parameter vector needs to be broadcasted, the total communication cost of this step is negligible~\cite{sery2020analog, chang2020communication, amiri2020machine, amiri2020federated}. The other is model aggregation in the uplink, which involves the transmission of $|\mathcal{S}_{t}|$ local descent direction vectors. Accordingly, the uploading process of this step brings the primary communication overhead in FL, which is also the focus of our communication model design. In this paper, we consider a block fading channel. Each block is divided into $d$ time slots, ensuring the transmission of one local descent direction vector. Suppose the traditional orthogonal multiple access channel is used to perform the model aggregation procedure. Each device will use one coherent block to transmit its local descent direction vector. Consequently, the time consumed for transmission in this step will increase linearly with the number of participating devices $|\mathcal{S}_{t}|$. Unfortunately, the number of devices $|\mathcal{S}_{t}|$ is usually very large, which inevitably leads to unacceptable communication overheads. In order to eliminate this issue, we adopt a state-of-the-art technique named over-the-air computation (AirComp)~\cite{nazer2007computation}, which is shown to be effective in assisting the analog aggregation in FL studies~\cite{yang2020federated, zhu2019broadband, amiri2020machine, sery2020analog, liu2020privacy, elgabli2021harnessing, liu2020reconfigurable, xiaowen2021optimized}. This technique captures the nomographic function form of averaging the local descent direction vectors and implements the summation operation by the superposition property of the wireless channel. In this way, the server can receive the summation by letting all devices transmit their local descent direction vectors simultaneously in each block. Therefore, the entire process of model aggregation can be completed over the air in a single coherent block, and the communication overheads can be significantly reduced. More specifically, in the $t$-th iteration, the over-the-air computation can be represented as the nomographic function form~\cite{zhu2018mimo} : $ \hat{\bm{p}}_{t}=\psi\left(\sum_{i \in \mathcal{S}_t} \varphi_{i}\left(\bm{p}_{t,i}\right)\right).$ To reduce the transmission power, the pre-processing function $\phi_{i}$ and post-processing function $\psi$ can be designed to normalize and de-normalize the local descent direction vector $\bm{p}_{t,i}$~\cite{zhu2019broadband}. However, due to the variety of $\bm{p}_{t,i}$ among devices, the stationary of the information-bearing symbols obtained by such normalization methods can not be guaranteed, which further leads to the inapplicability of the uniform-forcing transceiver design in the following. Therefore, to guarantee the stationary of the information-bearing symbols, we adopt the data-and-CSI-aware design as in~\cite{guo2020analog}. Before transmission, $\bm{p}_{t,i}$ is first pre-processed and encoded as $\bm{s}_{t,i} \in \mathbb{R}^{d}$ at the $i$-th device: \begin{small} \begin{equation} \bm{s}_{t,i} = \phi_{i}\bracket{\bm{p}_{t,i}} = \frac{\card{\mathcal{D}_{i}}\bm {p}_{t,i}}{\bar{p}_{t,i}} \;, \label{preprocess} \end{equation} \end{small} where $\bar{p}_{t,i} = \card{\mathcal{D}_{i}}\norm{\bm{p}_{t,i}}$ is the product of the size of local dataset and the magnitude of $\bm{p}_{t,i}$. In this way, the stationary of the information-bearing symbols $\{\bm{s}_{t,i}\}$ can be guaranteed. Hence, we have $\norm{\bm{s}_{t,i}}^{2} = 1$ and $\mathbb{E}\bracket{|\bm{s}_{t,i}[j]|^{2}} = \frac{1}{d}, \;\forall j\in d$, where $\bm{s}_{t,i}[j]$ denotes the $j$-th entry of $\bm{s}_{t,i}$. Thereafter, each entry of the transmitted signal sent by the $i$-th device is given by: \begin{small} \begin{equation} \bm{x}_{t,i}[j] = b_{t,i}\bm{s}_{t,i}[j] \;, \label{transmitted_signal} \end{equation} \end{small} where $\bm{x}_{t,i}[j] \in \mathbb{R}$ and $\bm{s}_{t,i}[j] \in \mathbb{R}$ denote two representative entries of $\bm{x}_{t,i}$ and $\bm{s}_{t,i}$, respectively. $b_{t,i} \in \mathbb{R}$ is the transmitted power control factor, and the power constraint for each device in the whole process is given by: \begin{small} \begin{equation} \mathbb{E}\bracket{|b_{t,i}\bm{s}_{t,i}[j]|^{2}} = b_{t,i}^{2} / d \leq P_{0}, \; \forall t, i\;, \label{power_constraint} \end{equation} \end{small} where $P_{0}$ denotes the maximum transmitted power of each device. Let $\bm{h}_{t,i} \in \mathbb{C}^{k}$ be the channel coefficient vector between the $i$-th device and the server in the $t$-th block, which remains unchanged in each block but differs among blocks. In addition, we assume that perfect channel state information (CSI) is available at all devices to adjust their transmitted signals based on channel coefficients~\cite{sery2020analog, amiri2020machine, liu2020privacy, zhu2019broadband, yang2020federated, wang2020federated, seif2020wireless, wang2020wireless, fang2021over}. Then the received signal $\bm{y}_{t} \in \mathbb{C}^{k}$ at the server can be represented as follows: \begin{small} \begin{equation} \bm{y}_{t} = \sum_{i\in\mathcal{S}_{t}}\bm{h}_{t,i}\bm{x}_{t,i}[j] + \bm{e}_{t} = \sum_{i\in\mathcal{S}_{t}}\tilde{\bm{h}}_{t,i}b_{t,i}\card{\mathcal{D}_{i}}\bm{p}_{t,i}[j] + \bm{e}_{t}\;, \label{received_signal} \end{equation} \end{small} where $\tilde{\bm{h}}_{t,i} = \frac{\bm{h}_{t,i}}{\bar{p}_{t,i}}$ is the effective channel coefficient introduced in~\cite{guo2020analog}, $\bm{e}_{t} \in \mathbb{C}^{k}$ denotes the additive white Gaussian noise vector with the power of $\sigma^{2}$. We define the signal-to-noise ratio (SNR) as $P_{0} / \sigma^{2}$. After the server receives $\bm{y}_{t}$, it can obtain the value $\bm{r}_{t}[j] \in \mathbb{C}$ before post-processing: \begin{small} \begin{equation} \bm{r}_{t}[j] = \frac{1}{\sqrt{\eta_{t}}}\bm{a}_{t}^{\mathsf{H}}\bm{y}_{t} = \frac{1}{\sqrt{\eta_{t}}}\bracket{\bm{a}_{t}^{\mathsf{H}}\sum_{i\in\mathcal{S}_{t}}\tilde{\bm{h}}_{t,i}b_{t,i}\card{\mathcal{D}_{i}}\bm{p}_{t,i}[j] + \bm{a}_{t}^{\mathsf{H}}\bm{e}_{t}} \;, \label{process_received_signal} \end{equation} \end{small} where $\bm{a}_{t} \in \mathbb{C}^{k}$ represents the receiver beamforming vector and $\eta_{t}$ is the scaling factor. For convenience, we use $\bm{H}_{t} = [\tilde{\bm{h}}_{t,1},\ldots,\tilde{\bm{h}}_{t,|\mathcal{S}_{t}|}]$ to denote the effective channel coefficient matrix, $\bm{B}_{t} = \text{diag}\bracket{b_{t,1},\ldots,b_{t,|\mathcal{S}_{t}|}}$ to denote the power transmission matrix, $\bm{G}_{t} = [\card{\mathcal{D}_{1}}\bm{p}_{t,1}, \ldots, \card{\mathcal{D}_{|\mathcal{S}_{t}|}}\bm{p}_{t,|\mathcal{S}_{t}|}]^{\mathsf{T}}$ to denote the signal transmission matrix, and $\bm{E}_{t} = [\bm{e}_{t,1}, \ldots, \bm{e}_{t,d}]$ to denote the noise matrix. So the total estimated value vector $\bm{r}_{t} = [\bm{r}_{t}[1], \ldots, \bm{r}_{t}[d]]$ can be written as: \begin{small} \begin{equation} \bm{r} = \frac{1}{\sqrt{\eta_{t}}}\bracket{\bm{a}^{\mathsf{H}}\bm{H}_{t}\bm{B}_{t}\bm{G}_{t} + \bm{a}_{t}^{\mathsf{H}}\bm{E}_{t}} \;. \label{rewrite_process_received_signal} \end{equation} \end{small} To alleviate the influence of the distortion caused by noise and improve the performance of over-the-air computation, each entry of $\bm{B}_{t}$ follows the uniform-forcing transceiver design~\cite{chen2018uniform}: \begin{small} \begin{equation} b_{t,i} = \sqrt{\eta_{t}}\frac{\bracket{\bm{a}_{t}^{\mathsf{H}}\tilde{\bm{h}}_{t,i}}^{\mathsf{H}}}{\norm{\bm{a}_{t}^{\mathsf{H}}\tilde{\bm{h}}_{t,i}}^{2}} \;. \label{transmit_vector} \end{equation} \end{small} where the transmission scalar $b_{t,i}$ can be computed after the calculation of receiver beamforming vector in system optimization, and then feed back to each device~\cite{yang2020federated}. Substituting~\eqref{transmit_vector} into~\eqref{rewrite_process_received_signal}, we can get a simplified version of $\bm{r}_{t}$: \begin{small} \begin{equation} \bm{r}_{t} = \sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}\bm{p}_{t,i}^{\mathsf{T}} + \frac{1}{\sqrt{\eta_{t}}}\bm{a}_{t}^{\mathsf{H}}\bm{E}_{t} \;. \label{simplified_recovered_signal} \end{equation} \end{small} Finally, through the post-processing function of $\psi$, the server obtains the global descent direction vector $\hat{\bm{p}}_{t}$: \begin{small} \begin{equation} \hat{\bm{p}}_{t} = \psi\bracket{\bm{r}_{t}} = \frac{1}{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\bm{r}_{t}^{\mathsf{H}} = \tilde{\bm{p}}_{t} + \frac{1}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bracket{\bm{a}_{t}^{\mathsf{H}}\bm{E}_{t}}^{\mathsf{H}} \;, \label{global_update_direction} \end{equation} \end{small} where $\tilde{\bm{p}}_{t,i}$ is the averaged local descent direction vector as defined in~\eqref{averaged_local_descent_direction}. \begin{algorithm} \caption{Over-the-Air Second-Order Federated Algorithm} \label{ACCADE} \small \For{each iteration t} { server chooses devices participating in this iteration and stores them as $\mathcal{S}_{t}$.\\ server broadcasts the current model parameter vector $\bm{w}_{t}$ to all devices.\\ \For{each participating device $i \;\; \textbf{in parallel}$ }{ compute local gradient $\bm{g}_{t,i} = \frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} \nabla f\left(\bm{w}_{t} ,\bm{z}_{i, j}\right)+\gamma \bm{w}_{t}$.\\ compute local Hessian matrix $\bm{H}_{t, i} = \frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} \nabla^{2} f\left(\bm{w}_{t}, \bm{z}_{i, j}\right)+\gamma \bm{I}_{d}$.\\ compute local Newton descent direction $\bm{p}_{t,i} = \bm{H}_{t, i}^{-1} \bm{g}_{t,i}$.\\ encode $\bm{p}_{t, i}$ as $\bm{s}_{t,i}$ according to \eqref{preprocess}. \\ transmit the signal $\bm{x}_{t,i} = b_{t,i}\bm{s}_{t,i}$ through wireless channel. } server receives the signal $\bm{y}_{t}$ \eqref{received_signal} and maintains $\hat{\bm{p}_{t}}$ \eqref{global_update_direction}.\\ server performs an update step $\bm{w}_{t+1} = \bm{w}_{t} - \alpha \hat{\bm{p}_{t}}$. } \end{algorithm} Based on the AirComp-based communication model and second-order optimization algorithm, we propose our over-the-air second-order federated algorithm, as shown in Algorithm \ref{ACCADE}. \section{Theoretical Convergence Analysis} \label{Theoretical Analysis} In this section, we provide the convergence analysis of our proposed algorithm. A major challenge of convergence analysis is to tackle the distortion of the descent direction vector caused by channel noise, device selection, and the use of local Newton step. To address this issue, we study the impact of distortion with respect to these influencing factors. In particular, we exploit the idea of sketching to analyze the approximation of local gradients and Hessian matrices. To better elaborate our analysis, some preliminaries are firstly presented. \subsection{Preliminaries} The core of our proposed algorithm is using local Hessian matrices and local gradients, which is calculated through subsets of the total data set, to construct local Newton descent directions and aggregate them. This brings the benefits of fewer communication rounds between the server and the devices. However, since we rely on local information to approximate Newton descent directions, the quality of local Hessian/gradients, in other words, the difference between the local ones and global ones, are of concern. In order to tackle this issue, we adopt the idea of matrix sketching~\cite{drineas2016randnla, woodruff2014sketching}. Specifically, for a given input matrix $\bm{M} \in \mathbb{R}^{n \times d}$, we can replace it with $\bm{C} = \bm{L}^{\mathsf{T}}\bm{M} \in \mathbb{R}^{s\times d}$, where matrix $\bm{C}$ acts as the sketch of $\bm{M}$ with the sketching matrix $\bm{L} \in \mathbb{R}^{n \times s}$. In this way, the original problem related to $\bm{M}$ can be solved more efficiently using the smaller alternative matrix $\bm{C}$ without losing too much information. The construction of the sketch is similar to the calculation of local Hessian/gradients, where we adopt partial information of the global Hessian/gradients to serve as the local Hessian/gradients. In this paper, we consider the row sampling scheme in matrix sketching. The sketch $\bm{C}$ is constructed by the uniform sampled and re-scaled subset of rows of $\bm{M}$ with sampling probability $\mathbb{P}\bracket{\bm{c}_{i} = \frac{\bm{m}_{j}}{\sqrt{sp}}} = p,\; p =\frac{1}{n}$, where $\bm{c}_{i}$ and $\bm{m}_{j}$ are the $i$-th row of $\bm{C}$ and $j$-th row of $\bm{M}$, respectively. Consequently, the sketching matrix $\bm{L}$ has only one non-zero entry in each column, and we shall measure the difference between the local Hessian/gradients and global ones with the help of such sketching matrices. In the following, we consider a linear predictor model $\ell: \mathbb{R} \rightarrow \mathbb{R}$, which is frequently used in machine learning research, e.g., logistic and linear regression, support vector machines, neural networks and graphical models. The function $f\bracket{\bm{w}, \bm{z}_{i,j}}$ can thus be rewritten as $\ell\bracket{\bm{w}^{\mathsf{T}}\bm{u}_{i,j}}$. Accordingly, we define $\boldsymbol{M}_{t}=\left[\boldsymbol{m}_{1}^{\mathsf{T}}, \ldots, \boldsymbol{m}_{n}^{\mathsf{T}}\right]^{\mathsf{T}} \in \mathbb{R}^{n \times d}$ with $\bm{m}_{t,j} = \sqrt{\ell^{\prime\prime}\bracket{\bm{w}^{\mathsf{T}}\bm{u}_{i,j}} / n}\bm{u}_{i,j} \in \mathbb{R}^{d}$, so the global Hessian matrix can be represented as $\boldsymbol{H}_{t}=\boldsymbol{M}_{t}^{\mathsf{T}} \boldsymbol{M}_{t}+\gamma \boldsymbol{I}_{d}$. Moreover, by defining $\bm{N}_{t} = \left[\bm{n}_{1}, \ldots, \bm{n}_{n}\right] \in \mathbb{R}^{d \times n}$ with $\bm{n}_{i}= \nabla f \left(\bm{w}_{t}, \bm{z}_{i}\right)$, the global gradient $\nabla F\left(\bm{w}_{t}\right)$ can be denoted by $\bm{g}_{t}=\frac{1}{n} \bm{N}_{t} \bm{1}+\gamma \bm{w}_{t}$. Let $\left\{\bm{L}_{i}\right\}_{i = 1}^{m}$ be the sketching matrices, the local Hessian matrices and local gradients can be reformulated as: \begin{small} \begin{equation} \bm{H}_{t, i}=\bm{M}_{t}^\mathsf{T} \bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{M}_{t}+\gamma \bm{I}_{d} \;,\quad \bm{g}_{t, i}=\frac{1}{n} \bm{N}_{t} \bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{1}+\gamma \bm{w} \;. \end{equation} \end{small} In addition, we define an auxiliary quadratic function as follows to facilitate our analysis: \begin{small} \begin{equation} \phi(\bm{p})=\frac{1}{2} \bm{p}^\mathsf{T} \bm{H}_{t} \bm{p}-\bm{g}_{t}^\mathsf{T} \bm{p}=\frac{1}{2} \bm{p}^\mathsf{T}\left(\bm{M}_{t}^\mathsf{T} \bm{M}_{t}+\gamma \bm{I}_{d}\right) \bm{p}-\bm{g}_{t}^\mathsf{T} \bm{p} \;. \label{quadratic function} \end{equation} \end{small} As a quadratic function, the minimum point of $\phi(\bm{p})$ denoted by $\bm{p}^{*}$ can be analytically obtained, which is the same as the exact Newton descent direction vector in \eqref{Newton step}, i.e., \begin{small} \begin{equation} \bm{p}^{*}=\arg \min \phi(\bm{p})= \nabla^{2}F^{-1}\left(\bm{w}_{t}\right)\nabla F\left(\bm{w}_{t}\right) = \bm{H}_{t}^{-1} \bm{g}_{t}=\left(\bm{M}_{t}^{\top} \bm{M}_{t}+\gamma \bm{I}_{d}\right)^{-1} \bm{g}_{t} \;. \end{equation} \end{small} Due to the effect of channel noise, device selection, and the use of local Newton step, the actual descent direction rather than the exact Newton step $\bm{p}^{*}$ is given by: \begin{small} \begin{equation} \begin{aligned} \hat{\bm{p}}_{t} =\,& \bm{p}^{*} + \underbrace{\left(\bar{\bm{p}}_{t} - \bm{p}^{*}\right)}_{\text{Local Hessian}} + \underbrace{\left(\bm{p}_{t} - \bar{\bm{p}}_{t}\right)}_{\text{Local Gradient}} + \underbrace{\left(\tilde{\bm{p}}_{t} - \bm{p}_{t}\right)}_{\text{Device Selection}} + \underbrace{\left(\hat{\bm{p}}_{t} - \tilde{\bm{p}}_{t}\right)}_{\text{Channel Noise}} \;, \end{aligned} \label{decomposition_global_update_direction} \end{equation} \end{small} where $\hat{\bm{p}}_{t}$ and $\tilde{\bm{p}}_{t}$ are defined in~\eqref{global_update_direction} and~\eqref{averaged_local_descent_direction}, respectively, $\bm{p}_{t} = \frac{1}{\underset{i \in \mathcal{S}}{\sum}\card{\mathcal{D}_{i}}}\sum_{i \in \mathcal{S}} \card{\mathcal{D}_{i}}\bm{p}_{t,i}$ is the averaged local descent direction vector without device selection, and $\bar{\bm{p}}_{t} = \frac{1}{\underset{i \in \mathcal{S}}{\sum}\card{\mathcal{D}_{i}}}\sum_{i \in \mathcal{S}} \card{\mathcal{D}_{i}}\bar{\bm{p}}_{t,i} = \frac{1}{\underset{i \in \mathcal{S}}{\sum}\card{\mathcal{D}_{i}}}\sum_{i \in \mathcal{S}} \card{\mathcal{D}_{i}}\bm{H}_{t,i}^{-1}\bm{g}_{t}$ is the Newton descent direction with the exact global gradient. In the following analysis, we will use the quadratic function~\eqref{quadratic function} to illustrate how close $\hat{\bm{p}}_{t}$ and $\bm{p}^{*}$ are. Besides, the error of model parameter vector in the iterates $\bm{\Delta}_{t} = \bm{w}_{t} - \bm{w}^{*}$ acts as the metric, where $\bm{w}^{*}$ denotes the optimal solution. Throughout this paper, we consider the following assumptions, which are widely adopted in FL problems \cite{chen2020joint, liu2020reconfigurable, xiaowen2021optimized}. \noindent\textbf{Assumption 1.} The global loss function $F$ is $L$-smooth. \noindent\textbf{Assumption 2.} The global loss function $F$ is strongly convex, which indicates the unique optimal model parameter vector $\bm{w}^{*}$ of the FL task. \noindent\textbf{Assumption 3.} The local loss function $F_{i}$ is twice-differentiable, smooth and convex. \subsection{Convergence Analysis} Since the local gradients and Hessian matrices are adopted to approximate the global descent direction, the gap between the local direction and the global direction is essential for the convergence analysis. Therefore, we first recall two lemmas to reveal their relationships. \begin{lemma}[{\cite[variant of Lemma 2]{ghosh2020distributed}}] Let $\lambda , \delta = \sum_{i=1}^{m} \delta_{i}, \{\delta_{i}\} \in(0,1)$ be fixed parameters, $r=\operatorname{rank}\left(\bm{M}_{t}\right)$, and $\bm{U} \in \mathbb{R}^{n \times r}$ be the orthonormal bases of the matrix $\bm{M}_{t}$. Let $\mu \in\left[1, \frac{n}{d}\right]$ be the coherence of $\bm{M}_{t}$ defined in~[30]. Let $\left\{\bm{L}_{i} \in \mathbb{R}^{n \times \card{\mathcal{D}_{i}}}\right\}_{i=1}^{m}$ be independent uniform sampling sketching matrices with $\card{\mathcal{D}_{i}} \geq \frac{3 \mu d}{\lambda^{2}} \log \frac{d}{\delta_{i}}$. It holds with the probability exceeding $1-\delta$ that: \begin{small} \begin{equation} \left\|\bm{U}^\mathsf{T} \bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{U}-\bm{I}\right\|_{2} \leq \lambda\;, \quad \forall i \in \mathcal{S}\;. \end{equation} \end{small} \end{lemma} \begin{lemma}[{\cite[variant of Lemma 3]{ghosh2020distributed}}] Let $\left\{\bm{L}_{i} \in \mathbb{R}^{n \times \card{\mathcal{D}_{i}}}\right\}_{i=1}^{m}$ be independent uniform sampling sketching matrices, $\delta = \sum_{i=1}^{m} \delta_{i}, \{\delta_{i}\} \in(0,1)$ be fixed parameters, then with the probability exceeding $1-\delta$, we have: \begin{small} \begin{equation} \left\|\frac{1}{n} \bm{N}_{t}\bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{1}-\frac{1}{n} \bm{N}_{t} \bm{1}\right\| \leq\left(1+\sqrt{2 \ln \left(\frac{1}{\delta_{i}}\right)}\right) \sqrt{\frac{1}{\card{\mathcal{D}_{i}}}} \max _{j}\left\|\bm{n}_{j}\right\|\;. \end{equation} \end{small} \end{lemma} With Lemma 1 and Lemma 2, we further propose Lemma 3 to characterize the gap between $\hat{\bm{p}}_{t}$ and $\bm{p}^{*}$ via the support quadratic function. \begin{lemma} Let $\left\{\bm{L}_{i}\right\}_{i=1}^{m} \in \mathbb{R}^{n \times \card{\mathcal{D}_{i}}}$ be independent uniform sampling sketching matrices, $\phi_{t}$ be the quadratic function as defined in~\eqref{quadratic function}, $\lambda , \{\delta_{i}\} \in(0,1)$ be fixed parameters with $\tilde{\delta} = \min\{\delta_{i}\}$ and $\hat{\bm{p}}_{t}$ be the approximate descent direction vector defined in~\eqref{decomposition_global_update_direction}. It holds that: $$ \phi_{t}(\bm{p}^{*}) \leq \phi_{t}\left(\hat{\bm{p}}_{t}\right) \leq \epsilon^{2} +\left(1-\zeta^{2}\right) \phi_{t}(\bm{p}^{*}) \;, $$ where \begin{small} \begin{equation} \zeta^{2} = 3\tau^{2}\left(\lambda+\frac{\lambda^{2}}{1-\lambda}\right)^{2} + 24\vartheta^{2}\left(\tau\left(\lambda+\frac{\lambda^{2}}{1-\lambda}\right)+1\right)^{2} \label{zeta} \end{equation} \end{small} with $\tau=\frac{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)}{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)+n\gamma}$, $\vartheta = \max _{t} \left(1 - \frac{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right) < 1$ and \begin{small} \begin{equation} \begin{aligned} \epsilon^{2} =& \frac{3}{\sigma_{\min}\left(\bm{H}_{t}\right)}\left\|\frac{1}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bm{a}_{t}^\mathsf{H}\bm{E}_{t}\right\|^{2} + \left[24\left(1 - \frac{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}\right] \\ &\qquad\qquad\qquad\cdot \bigg[\frac{1}{1-\lambda} \frac{1}{\sqrt{\sigma_{\min }\left(\bm{H}_{t}\right)}}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right) \max _{j} \left\| \bm{n}_{j} \right\|\bigg]^{2}. \end{aligned} \label{epsilon} \end{equation} \end{small} \end{lemma} The proof of Lemma~3 can be found in Appendix A. To illustrate that $\hat{\bm{p}}_{t}$ is a good descending direction, we introduce Lemma 4 supported by the property of the quadratic function introduced in Lemma 3. \begin{lemma}[{\cite[Lemma~6]{ghosh2020distributed}}] Let $\zeta \in(0,1)$, $\epsilon$ be any fixed parameter, if $\hat{\bm{p}_{t}}$ satisfies $\phi\left(\hat{\bm{p}}_{t}\right) \leq \epsilon^{2}+(1-\left.\zeta^{2}\right) \min _{\bm{p}} \phi(\bm{p})$, then under Assumption 1, the error of model parameter vector $\bm{\Delta}_{t}=\bm{w}_{t}-\bm{w}^{*}$ in iterations satisfies \begin{small} \begin{equation} \bm{\Delta}_{t+1}^\mathsf{T} \bm{H}_{t} \bm{\Delta}_{t+1} \leq L\left\|\bm{\Delta}_{t+1}\right\|\left\|\bm{\Delta}_{t}\right\|^{2}+\frac{\zeta^{2}}{1-\zeta^{2}} \bm{\Delta}_{t}^\mathsf{T} \bm{H}_{t} \bm{\Delta}_{t}+2 \epsilon^{2} \;, \end{equation} \end{small} \end{lemma} Based on Lemma 3 and Lemma 4, we can derive the main result: \begin{theorem} \label{theorem 1} Suppose the size of local dataset at each device $\card{\mathcal{D}_{i}} \geq \frac{3 \mu d}{\lambda^{2}} \log \frac{d}{\delta_{i}}$ for some $\lambda, \delta_{i} \in(0,1)$, then under Assumption 1 with the probability exceeding $1-\delta$ we have \begin{small} \begin{align*} \mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq \max \left\{\sqrt{\kappa_{t}\left(\frac{\zeta^{2}}{1-\zeta^{2}}\right)}\left\|\bm{\Delta}_{t}\right\|, \frac{L}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left\|\bm{\Delta}_{t}\right\|^{2}\right\} +\epsilon^{\prime}\;, \end{align*} \end{small} where the expectation takes with respect to the channel noise $\bm{e}_{t}$, $\zeta$ is defined as \eqref{zeta}, $\kappa_{t}=\frac{\sigma_{\max }\left(\bm{H}_{t}\right)}{\sigma_{\min }\left(\bm{H}_{t}\right)}$ denotes the condition number of $\bm{H}_{t}$, and \[ \begin{small} \begin{aligned} \epsilon^{\prime} =& \frac{2\sqrt{3}}{\sigma_{\min}\left(\bm{H}_{t}\right)}\frac{d\sigma}{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\frac{\norm{\bm{a}_{t}}}{\sqrt{\eta_{t}}} + \sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\\ &\qquad\qquad\qquad\qquad\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\|\;. \end{aligned} \end{small} \] \end{theorem} The proof can be found in Appendix B. From Theorem \ref{theorem 1}, we have the following observations. \subsubsection{\bf The proposed algorithm keeps a linear-quadratic convergence rate} From the analysis results, it can be seen that the term $\left\|\bm{\Delta}_{t}\right\| = \left\|\bm{w}_{t} - \bm{w}^{*}\right\|$ keeps the property in this form: $\mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq \max \left\{\omega_{1}\left\|\bm{\Delta}_{t}\right\|, \omega_{2}\left\|\bm{\Delta}_{t}\right\|^{2}\right\} + \epsilon^{\prime}$. When $\left\|\bm{\Delta}_{t}\right\| > \frac{\omega_{1}}{\omega_{2}}$, this property can be simplified as $ \mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq \omega_{2}\left\|\bm{\Delta}_{t}\right\|^{2} + \epsilon^{\prime} $. It is obvious that the proposed algorithm keeps the same quadratic convergence rate as the canonical Newton's method. At the beginning of the algorithm it can converge to the neighbor of the optimal point quickly. When $\left\|\bm{\Delta}_{t}\right\| < \frac{\omega_{1}}{\omega_{2}}$, this property turns into $ \mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq \omega_{1}\left\|\bm{\Delta}_{t}\right\| + \epsilon^{\prime} $, which means when $\left\|\bm{\Delta}_{t}\right\|$ is small enough during the process of the algorithm, it degenerates into the linear convergence rate. In conclusion, the proposed algorithm keeps a linear-quadratic convergence rate and performs better than first-order algorithms. \subsubsection{\bf The proposed algorithm is accompanied by an accumulative error term} Notice that there is an error term $\epsilon^{\prime}$ in each iteration, which comes from the approximation, device selection and channel noise. Consider the noise-free case without device selection, which means $\sigma = 0$ and $\left|\mathcal{S}_{t}\right| = m$, this error term degenerates to: \begin{small} \begin{equation} \begin{aligned} \epsilon^{\prime}_{1} = \frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\sqrt{\frac{m}{n}}\max _{j} \left\| \bm{n}_{j} \right\|\;, \end{aligned} \label{epsilon1} \end{equation} \end{small} which is exactly the same as the error term introduced in~\cite{ghosh2020distributed}. With the algorithm executed iteratively, the gap between the expected global loss function value and the optimal one is upper bounded by this accumulative error term. Therefore, the active device set $\mathcal{S}_{t}$, the receiver beamforming vectors $\left\{\bm{a}_{t}\right\}$ and the scaling factors $\left\{\eta_{t}\right\}$ need to be tuned in each iteration so as to reduce the error gap. \section{System Optimization} \label{System Optimization} In this section, we first formulate a system optimization problem to minimize the error term in the convergence analysis results. Then, we propose our approach for joint optimization of device selection and receiver beamforming vector. \subsection{Problem Formulation} In light of convergence analysis, to obtain a precise model parameter vector, minimizing the error gap demonstrated in Theorem 1 is a key issue. It is observed that the coefficients of the two iterative terms $\bm{\Delta}_{t}$ and $\bm{\Delta}_{t+1}$ in Theorem 1 are independent of variables $\mathcal{S}_{t}$, $\bm{a}_{t}$ and $\eta_{t}$. Therefore, in order to achieve the minimization of the total error gap, we only need to minimize the error term $\epsilon^{\prime}$ in each iteration as follows \begin{small} \begin{equation} \label{power constraint} \begin{aligned} \min_{\mathcal{S}_{t}, \bm{a}_{t}, \eta_{t}} \quad&\frac{2\sqrt{3}}{\sigma_{\min}\left(\bm{H}_{t}\right)}\frac{d\sigma}{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\frac{\norm{\bm{a}_{t}}}{\sqrt{\eta_{t}}} + \sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\\ &\qquad\qquad\qquad\qquad\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\| \\ \text{s.t.}\;\quad & \frac{\eta_{t}}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2}} \leq dP_{0} \quad \forall i \in \mathcal{S}_{t} \; \end{aligned} \end{equation} \end{small} The power constraint in \eqref{power constraint} can be rewritten in the form of the restriction of scaling factor: $\eta_{t} \leq dP_{0}\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2}, \ \forall i \in \mathcal{S}_{t}$. We take the negative correlation between the scaling factor $\eta_{t}$ and the objective function value $\epsilon^{\prime}$ into consideration. $\eta_{t}$ can be set as $\eta_{t} = dP_{0}\min_{i \in \mathcal{S}_{t}}\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2}$~\cite{chen2018uniform}, and the problem can be simplified as $\mathscr{P}$: \begin{small} \begin{equation} \begin{aligned} \mathscr{P}: \min_{\mathcal{S}_{t}, \bm{a}_{t}}\quad & \frac{\sqrt{3d}\sigma}{\sqrt{P_{0}}\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\;\; \max_{i \in \mathcal{S}_{t}}\;\; \left(\frac{\left\|\bm{a}_{t}\right\|}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|}\right) + \sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\\ &\qquad\qquad\qquad\qquad\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\|\;. \end{aligned} \label{system_optimization_problem} \end{equation} \end{small} We have the following key observations for solving \eqref{system_optimization_problem}: \begin{itemize} \item [\textbullet] Intuitively, to achieve the minimization of the objective value of $\mathscr{P}$ , the number of selected devices is supposed to be maximized, then $\mathscr{P}$ will degenerate into the form of traditional beamforming optimization. However, the term $\max_{i \in \mathcal{S}_{t}}\; \left(\frac{\left\|\bm{a}_{t}\right\|}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|}\right)$ is related to device selection, which further results in the incorrectness to directly maximize $|\mathcal{S}_{t}|$. \item [\textbullet] By searching over all the possible participating device sets, the optimal $\mathcal{S}_{t}$ can be determined. Still, the number of devices $m$ can be very large, leading to an exponential growth of the optimization procedure in the number of devices $m$. \item [\textbullet] After the search of participating devices, the remaining problem is a typical beamforming optimization problem, but it is still non-convex and intractable. \end{itemize} In conclusion, since a combinatorial search of participating devices and minimization of the non-convex objective function are involved, it is evident that $\mathscr{P}$ is a mixed-integer non-convex problem. In order to tackle the complexity of computation and the difficulty of non-convexity, we propose an efficient method to iteratively search the optimal set of selected devices $\mathcal{S}_{t}$ while jointly optimizing the receiver beamforming vector $\bm{a}_{t}$ for each given $\mathcal{S}_{t}$. \subsection{Receiver Beamforming Optimization} For a given set of selected devices $\mathcal{S}_{t}$, $\mathscr{P}$ can be simplified as $\mathscr{P}_{1}: \min_{\bm{a}_{t}} \max_{i \in \mathcal{S}_{t}} \frac{\left\|\bm{a}_{t}\right\|}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|}$, which is equivalent to: $ \min_{\bm{a}_{t}} \max_{i \in \mathcal{S}_{t}} \frac{\left\|\bm{a}_{t}\right\|^{2}}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2}}\;.$ This can be further reformulated as $\mathscr{P}_{1}^{\prime}$ according to the analysis in~\cite{chen2018uniform}: \begin{small} \begin{align*} \mathscr{P}_{1}^{\prime}: \min_{\bm{a}_{t}} \quad \left\|\bm{a}_{t}\right\|^{2} \qquad \text{s.t.} \quad \left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2} \geq 1 \quad \forall i \in \mathcal{S}_{t}\;. \end{align*} \end{small} It can be seen that $\mathscr{P}_{1}^{\prime}$ is actually a quadratically constrained quadratic programming problem, which is difficult to solve. We first use the matrix lifting technique to pre-process $\mathscr{P}_{1}^{\prime}$ and turn it into a low-rank optimization form. Specifically, let $\bm{A} = \bm{a}_{t}\bm{a}_{t}^\mathsf{H}$ with $\text{rank}\left(\bm{A}\right)=1$ and $\bm{Q}_{i}=\tilde{\bm{h}}_{t,i}\tilde{\bm{h}}_{t,i}^\mathsf{H}$, $\mathscr{P}_{1}^{\prime}$ can be recast as: \begin{small} \begin{align*} \min_{\bm{A}} \quad \operatorname{Tr}\left(\bm{A}\right)\qquad \text{s.t.} \quad \bm{A} \succeq \bm{0} ,\;\;\operatorname{rank}(\bm{A})=1,\;\; \operatorname{Tr}\left(\bm{A}\bm{Q}_{i}\right) \ge 1 \quad \forall i \in \mathcal{S}_{t}\;. \end{align*} \end{small} The key to solving this low-rank optimization problem is to deal with the troublesome rank-one constraint. A common method to solve such a problem is semidefinite relaxation (SDR)~\cite{luo2007approximation, sidiropoulos2006transmit}, which drops the rank-one constraint to obtain a relaxed problem in the form of semidefinite programming. By this means, SDR can arrive at an approximate solution efficiently through solving the relaxed problem. However, as the size of the problem grows, the rank-one constraint is usually unsatisfied. In this situation, the approximate solution needs to be scaled through randomization methods, leading to an alternative solution with low accuracy~\cite{chen2018uniform}, which will further affect the learning performance of FL. To guarantee the rank-one constraint, we can replace it with its equivalent form~\cite{yang2020federated, hua2019device}: $ \operatorname{Tr}\left(\bm{A}\right) - \left\|\bm{A}\right\|_{2} = 0 \quad \text{with} \quad \operatorname{Tr}\left(\bm{A}\right) > 0\;. $ Then, the original problem turns into a difference-of-convex-function (DC) program. By solving this DC program, a more precise solution can be obtained since all constraints are satisfied. Therefore, we develop a DC Algorithm (DCA) based on the principles in~\cite{tao1997convex, khamaru2018convergence} to solve this problem. Specifically, we can get the following problem by taking the new constraint as a penalty term: \begin{small} \begin{align*} \min_{\bm{A}} \quad \operatorname{Tr}\left(\bm{A}\right)+\theta \left(\operatorname{Tr}\left(\bm{A}\right) - \left\|\bm{A}\right\|_{2}\right) \quad \text{s.t.} \quad \bm{A} \succeq \bm{0}, \; \operatorname{Tr}(\bm{A})>0,\; \operatorname{Tr}\left(\bm{A}\bm{Q}_{i}\right) \ge 1 \;\; \forall i \in \mathcal{S}_{t} \; , \end{align*} \end{small} where $\theta$ is the penalty factor. Although this is still a non-convex problem owing to the concave term $- \left\|\bm{A}\right\|_{2}$, we can take the linearization of $\left\|\bm{A}\right\|_{2}$ and convert it into a convex subproblem: \begin{small} \begin{align*} \mathscr{P}_{DCA}:\min_{\bm{A}} \ & (1+\theta) \operatorname{Tr}(\bm{A})-\theta\left\langle\partial\left\|\bm{A}_{j}\right\|_{2}, \bm{A}\right\rangle \ \; \text{s.t.} \ \bm{A} \succeq \bm{0},\; \operatorname{Tr}(\bm{A})>0,\; \operatorname{Tr}\left(\bm{A}\bm{Q}_{i}\right) \ge 1 \ \forall i \in \mathcal{S}_{t}, \end{align*} \end{small} where $\langle\cdot,\cdot \rangle$ denotes the inner product of two matrices and $\partial\left\|\bm{A}_{j}\right\|_{2}$ represents the subgradient of $\left\|\bm{A}_{j}\right\|_{2}$ at $\bm{A}_{j}$. Therefore, the result can be obtained by iteratively solving $\mathscr{P}_{DCA}$ until $\operatorname{Tr}\left(\bm{A}\right) - \left\|\bm{A}\right\|_{2}$ is sufficiently small. The overall procedure of DCA is as summarized in Algorithm \ref{DCA}. \begin{algorithm} \caption{DC Algorithm for Receiver Beamforming Optimization (DCA)} \label{DCA} \small \textbf{input:} effective channel coefficients $\left\{\tilde{\bm{h}}_{t,i}\right\}$, penalty factor $\theta$, threshold $\xi $ turn $\mathscr{P}$ into the DCA form $\mathscr{P}_{DCA}$. choose $\bm{A}_{0} \succeq 0$, set $j = 1$. \While{$\left|\operatorname{Tr}\left(\bm{A}_{j-1}\right) - \left\|\bm{A}_{j-1}\right\|_{2}\right| \ge \xi$}{ compute the subgradient $\partial\left\|\bm{A}_{j-1}\right\|_{2}$. substitute $\partial\left\|\bm{A}_{j-1}\right\|_{2}$ into $\mathscr{P}_{DCA}$, solve the subproblem and set the result as $\bm{A}_{j}$. $j \leftarrow j+1 \;.$ } \end{algorithm} \begin{algorithm} \caption{System optimization approach GS+DCA} \label{GS-DCA} \small \textbf{input:} effective channel coefficients $\left\{\tilde{\bm{h}}_{t,i}\right\}$, $T^{(0)}$, $\rho$, $K$ \textbf{output:} $\mathcal{S}^{(k+1)}$ and its corresponding $\bm{a}^{(K+1)}$. \textbf{initialization:} $\mathcal{S}^{(0)} = \mathcal{S}$ \For{iteration $k = 0, 1, 2, ... , K$}{ generate the neighboring solution set $\mathcal{F}^{(k)}$. \For{each $\tilde{\mathcal{S}} \in \mathcal{F}^{(k)}$}{ substitute $\tilde{\mathcal{S}}$ into $\mathscr{P}_{1}$, then solve the problem using DCA to get the corresponding optimal $\tilde{\bm{a}}$. } sample $\tilde{\mathcal{S}}^{(k)}$ according to the probability $\mathbb{P}\left(\tilde{\mathcal{S}}^{(k)}\right)= \frac{ \exp \left(-J\left(\tilde{\mathcal{S}}^{(k)}, \tilde{\bm{a}}^{(k)}\right)/T^{(k)}\right)}{\sum_{\tilde{\mathcal{S}} \in \mathcal{F}^{(k)}} \exp \left(-J\left(\tilde{\mathcal{S}}, \tilde{\bm{a}}\right)/T^{(k)}\right)}.$ $\mathcal{S}^{(k+1)} \gets \tilde{\mathcal{S}}^{(k)},\;T^{(k+1)} \gets \rho T^{(k)}$. } \end{algorithm} \subsection{Device Selection Optimization} As mentioned above, the device selection is a combinatorial optimization problem, which is impossible to perform a traversal in the whole solution space. Thus, we adopt the well-known Gibbs Sampling (GS) \cite{geman1984stochastic} method to optimize the selection of device set iteratively. The main idea of GS is that in each iteration, a device set is sampled from the neighbors of the current device set according to an appropriate distribution. In this way, the set of selected devices can gradually approach the global optimal solution. To be specific, we treat different sets of selected devices as states, and the goal is to find the state which can minimize the objective value in $\mathscr{P}$. For the sake of such state, at iteration $k$ of GS's process, with the set of selected devices $\mathcal{S}^{(k-1)}$ given in the last iteration, we first generate the neighboring solution set of $\mathcal{S}^{(k-1)}$. The neighboring solution set, denoted by $\mathcal{F}^{(k)}$, contains the device sets that differ from the $\mathcal{S}^{(k-1)}$ in only one entry. For example, by assuming $\mathcal{S} = \{0, 1, 2\}$ and $\mathcal{S}^{(k-1)} = \{1, 2\}$, then we have $\mathcal{F}^{(k)} = \{\{0, 1, 2\}, \{2\}, \{1\}\}$. After the identification of the neighboring solution set, the candidate states are also determined according to the sets in $\mathcal{F}^{(k)}$, and we need to choose a state to approach the optimal set. Based on the distribution introduced in \cite{bremaud2013markov}, we sample a device set in $\mathcal{F}^{(k)}$ with the probability \begin{small} \begin{equation} \mathbb{P}\left(\tilde{\mathcal{S}}^{(k)}\right)= \frac{ \exp \left(-J\left(\tilde{\mathcal{S}}^{(k)}, \tilde{\bm{a}}^{(k)}\right)/T^{(k)}\right)}{\sum_{\tilde{\mathcal{S}} \in \mathcal{F}^{(k)}} \exp \left(-J\left(\tilde{\mathcal{S}}, \tilde{\bm{a}}\right)/T^{(k)}\right)}\;, \label{Gibbs_distribution} \end{equation} \end{small} where $J(\bm{x}, \bm{y})$ denotes the objective function value of $\mathscr{P}$. Here, the receiver beamforming vector is calculated through DCA with the given set of selected devices. In the distribution \eqref{Gibbs_distribution}, there is a special parameter $T^{(k)}$ serving as the temperature. The algorithm starts from a relatively high temperature $T^{(0)}$ in order to move around the solution space freely, rather than being stuck in a local minimum point. As the algorithm proceeds, the algorithm slowly decreases the temperature by the factor $\rho$ to focus on the states that minimize the objective function. Besides, to reduce the computational complexity, we have adopted a similar warm start technique as in~\cite{liu2020reconfigurable}. The optimal beamforming vector in the previous iteration is used to serve as the initial point to accelerate the process of beamforming optimization. The overall process of system optimization is outlined in Algorithm~\ref{GS-DCA}. \section{Simulation Results} \label{Simulation Results} In this section, we evaluate the performance of the proposed schemes to demonstrate the advantage of our proposed second-order federated optimization algorithm and the effectiveness of our system optimization approach. Code for our experiments are available at: https://github.com/Golden-Slumber/AirFL-2nd. We first consider logistic regression with the loss function of the $i$-th device $ F_{i}\left(\bm{w}\right)=\frac{1}{|\mathcal{D}_{i}|} \sum_{\bm{z}_{i, j}=\left(\bm{u}_{i, j}, v_{i, j}\right) \in \mathcal{D}_{i}} \log \left(1+\exp \left(-v_{i, j} \bm{u}_{i, j}^\mathsf{T} \bm{w}\right)\right)+\frac{\gamma}{2}\|\bm{w}\|_{2}^{2}$, where the regularization parameter is set to be $\gamma = 10^{-8}$. As for datasets, we adopt four different standard datasets from the LIBSVM library: Covtype, a9a, w8a, and phishing. In this paper, we consider a distributed wireless scenario, where these data samples are uniformly distributed in $m=20$ devices, the server is equipped with $k=5$ antennas. The channel coefficients are given by the small-scale fading coefficients $\{\bm{h}_{t,i}^{\prime}\}$ multiplied by the path loss gain $PL_{i}$, i.e., $\bm{h}_{t,i} = PL_{i}\bm{h}_{t,i}^{\prime}$. Here, the small-scale fading coefficients follow the i.i.d complex normal distribution $\mathcal{CN}\bracket{0,\bm{I}}$. The path loss gain is given by $PL_{i} = \sqrt{G_{0}}\bracket{d_{0}/d_{i}}^{\nu/2}$, where $G_{0} = 10^{-3.35}$ is the average channel power gain with the distance to the server $d_{0} = 1$ m, $d_{i} \in [100, 120]$ stands for the distance between the $i$-th device and the server, and $\nu = 3.76$ represents the path loss exponent factor. For the step size $\alpha$, we use backtracking line search to find $\alpha$ satisfying the Armijo–Goldstein condition~\cite[Chapter~3]{nocedal2006numerical}. For the system optimization, we set $\lambda = 0.1$, $\tilde{\delta} = 0.01$, penalty factor $\theta = 1$, threshold $\xi = 10^{-10}$, initial temperature $T_{0} = 100$, $\rho=0.9$, and $K=30$. Besides, we use Baseline 0 to denote the centralized training setting in all experiments. Furthermore, we also consider an image classification problem on a non-i.i.d dataset constructed from the Fashion-MNIST dataset at the end of this section. To address it, we train a softmax classifier with cross-entropy loss and $\ell_{2}$ regularization term. To be specific, the loss function of the $i$-th device is given as $F_{i}\left(\bm{W}\right)=\frac{1}{|\mathcal{D}_{i}|} \sum_{\left(\bm{u}, v\right) \in \mathcal{D}_{i}} \sum_{c=1}^{C} \bm{1}\{v = c\} \log \frac{\exp (\bm{u}^\mathsf{T} \bm{w}_{c})}{\sum_{j=1}^{C}\exp(\bm{u}^\mathsf{T} \bm{w}_{j})}+\frac{\gamma}{2}\sum_{c=1}^{C}\|\bm{w}_{c}\|_{2}^{2}$, where $\bm{W} = [\bm{w}_{1}, \dots, \bm{w}_{C}]$ is the concatenation of parameter vectors related to different classes, and $C = 10$ represents the total number of classes. \subsection{Comparison with First-Order Algorithms} We compared our proposed algorithm with two existing AirComp-based first-order algorithms in this experiment, where SNR is set to 80 dB: \begin{enumerate} \item Baseline $1$: AirComp-based Federated Averaging (FedAvg) algorithm with DC-based optimization framework \cite{yang2020federated}, where the threshold of MSE is set to $5$ dB. \item Baseline $2$: AirComp-based Fedsplit algorithm \cite{xia2020fast}, where the threshold for device selection is set to $0.5$. \end{enumerate} \begin{figure*}[htbp!] \centering \subfloat[Covtype]{ \begin{minipage}[c][1\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_first_order_demo_err_covtype_antenna_5_tau_1e-08.pdf} \end{minipage} } \hfill \subfloat[a9a]{ \begin{minipage}[c][1\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_first_order_demo_err_a9a_antenna_5_tau_1e-08.pdf} \end{minipage} } \hfill \subfloat[w8a]{ \begin{minipage}[c][1\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_first_order_demo_err_w8a_antenna_5_tau_1e-08.pdf} \end{minipage} } \hfill \subfloat[phishing]{ \begin{minipage}[c][1\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_first_order_demo_err_phishing_antenna_5_tau_1e-08.pdf} \end{minipage} } \caption{Training loss of the proposed algorithm and two first-order algorithms.} \label{with first-order loss} \vspace{-0.5cm} \end{figure*} \begin{figure*}[htbp!] \centering \subfloat[Covtype]{ \begin{minipage}[c][1\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_first_order_demo_acc_covtype_antenna_5_tau_1e-08.pdf} \end{minipage} } \hfill \subfloat[a9a]{ \begin{minipage}[c][1\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_first_order_demo_acc_a9a_antenna_5_tau_1e-08.pdf} \end{minipage} } \hfill \subfloat[w8a]{ \begin{minipage}[c][1\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_first_order_demo_acc_w8a_antenna_5_tau_1e-08.pdf} \end{minipage} } \hfill \subfloat[phishing]{ \begin{minipage}[c][1\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_first_order_demo_acc_phishing_antenna_5_tau_1e-08.pdf} \end{minipage} } \caption{Test accuracy of the proposed algorithm and two first-order algorithms.} \label{with first-order accuracy} \vspace{-0.5cm} \end{figure*} Fig. \ref{with first-order loss} and Fig. \ref{with first-order accuracy} show the performance of these algorithms in training loss and test accuracy. Regarding the optimality gap, benefiting from the linear-quadratic convergence rate, the proposed algorithm reaches a small optimality gap in the first few dozen communication rounds, while that of the first-order methods remains at a relatively higher level. As for the test accuracy, our proposed algorithm can quickly reach and stabilize at a high accuracy level, while the first-order methods have relatively low and fluctuating accuracy. Overall, our proposed algorithm keeps a quadratic convergence rate at the beginning of FL process, resulting in fewer communication rounds to complete the learning task than first-order algorithms. This further leads to less wireless channel impact and better learning performance, as illustrated in the simulation results. \begin{figure*}[htbp!] \centering \subfloat[Covtype]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_second_order_demo_err_covtype_antenna_5_tau_1e-07.pdf} \end{minipage} } \hfill \subfloat[a9a]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_second_order_demo_err_a9a_antenna_5_tau_1e-07.pdf} \end{minipage} } \hfill \subfloat[w8a]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_second_order_demo_err_w8a_antenna_5_tau_1e-08.pdf} \end{minipage} } \hfill \subfloat[phishing]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_second_order_demo_err_phishing_antenna_5_tau_1e-07.pdf} \end{minipage} } \caption{Training loss of the proposed algorithm and two second-order algorithms.} \label{with second-order loss} \vspace{-0.5cm} \end{figure*} \begin{figure*}[htbp!] \centering \subfloat[Covtype]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_second_order_demo_acc_covtype_antenna_5_tau_1e-07.pdf} \end{minipage} } \hfill \subfloat[a9a]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_second_order_demo_acc_a9a_antenna_5_tau_1e-07.pdf} \end{minipage} } \hfill \subfloat[w8a]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_second_order_demo_acc_w8a_antenna_5_tau_1e-08.pdf} \end{minipage} } \hfill \subfloat[phishing]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_second_order_demo_acc_phishing_antenna_5_tau_1e-07.pdf} \end{minipage} } \caption{Test accuracy of the proposed algorithm and two second-order algorithms.} \label{with second-order accuracy} \vspace{-0.5cm} \end{figure*} \subsection{Comparison with Second-Order Algorithms} In this experiment, we compared our proposed algorithm with the following two state-of-the-art second-order algorithms under over-the-air computation: \begin{enumerate} \item Baseline 3: GIANT \cite{wang2018giant} with over-the-air computation. GIANT requires an extra aggregation of local gradients, leading to two communication rounds in each iteration. The communication model of this gradients aggregation is implemented in the same way of $\bm{p}_{t}$, as illustrated in Section II-C. Here, we set $|\mathcal{S}_{t}| = m$, and the receiver beamforming vector is optimized through DCA. \item Baseline 4: DANE \cite{shamir2014communication} with over-the-air computation. Similar to GIANT, It also requires an aggregation of local gradients, so its implementation is the same as GIANT. \end{enumerate} Fig. \ref{with second-order loss} and Fig. \ref{with second-order accuracy} plot the training loss and the test accuracy, respectively, where SNR is set to 70 dB. It is observed that our proposed algorithm converges faster and remains stable at a relatively high level of accuracy, while the compared methods, AirComp-based GIANT and AirComp-based DANE, have a slower convergence rate. This is because both the procedures of GIANT and DANE involve aggregating local gradients to calculate the global gradient in each iteration. This extra transmission of local gradients through a wireless environment aggravates the impact of channel noise, leading to a relatively poor convergence rate. Therefore, we can see that our proposed algorithm outperforms AirComp-based GIANT and AirComp-based DANE. \subsection{Effectiveness of Proposed System Optimization Approach} In this experiment, we evaluated the performance using GS+DCA to accomplish system optimization with four settings: \begin{enumerate} \item perfect aggregation, where the model is aggregated without wireless channel impact. \item GS+SDR, where the receiver beamforming optimization is performed through SDR. \item DCA only, where we only perform beamforming optimization through DCA. \item SDR only, where we only perform beamforming optimization through SDR. \end{enumerate} \begin{figure*}[htbp] \centering \subfloat{ \begin{minipage}[c][0.9\width]{0.3\textwidth} \centering \includegraphics[width=1\linewidth]{fig/system_optimization_covtype_VERSUS_SNR.pdf} \label{with SNR} \end{minipage} } \hspace{8em} \subfloat{ \begin{minipage}[c][0.9\width]{0.3\textwidth} \centering \includegraphics[width=1\linewidth]{fig/system_optimization_covtype_VERSUS_ANTENNAS.pdf} \label{with antenna} \end{minipage} } \caption{Objective value of system optimization problem $\mathscr{P}$ versus SNR and number of antennas.} \label{with optimization} \vspace{-0.5cm} \end{figure*} To verify the effectiveness of the device selection, we consider the distance heterogeneity and data size heterogeneity in this experiment. Specifically, as for distance heterogeneity, we set the distance of $10\%$ devices to be $d_{i} \in [200, 220]$ while the rest to be $d_{i} \in [50, 60]$. As for data size heterogeneity, we set the data size of $10\%$ devices to be $\card{\mathcal{D}_{i}} \in [0.008\frac{n}{m}, 0.01\frac{n}{m}]$ while the rest to be $\card{\mathcal{D}_{i}} \in [1.01\frac{n}{m}, 1.11\frac{n}{m}]$. We first numerically evaluate the objective value of the system optimization problem $\mathscr{P}$ under different settings in Fig. \ref{with optimization} by averaging 100 channel realizations. The objective value of perfect aggregation does not depend on SNR and the number of antennas since the error during the FL process in this situation only comes from the approximation as \eqref{epsilon1} indicates. The objective values of all settings decrease as SNR and the number of antennas increase, due to the mitigation of noise effect and the increase of diversity gain \cite{chen2018uniform}, respectively. However, the objective value of GS+DCA is smaller than that of other settings. On the one hand, SDR fails to give a precise solution for the receiver beamforming vector as the size of the problem grows. This further leads to the ineffectiveness of device selection in GS+SDR and worse performance compared with the settings using DCA to perform beamforming optimization. On the other hand, device selection in GS+DCA mitigates the straggler issue caused by distance heterogeneity and data size heterogeneity, resulting in a better performance compared with DCA only. \begin{figure*}[htbp!] \centering \subfloat[Covtype]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_err_covtype_antenna_5_tau_5e-05.pdf} \end{minipage} } \hfill \subfloat[a9a]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_err_a9a_antenna_5_tau_5e-05.pdf} \end{minipage} } \hfill \subfloat[w8a]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_err_w8a_antenna_5_tau_5e-05.pdf} \end{minipage} } \hfill \subfloat[phishing]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_err_phishing_antenna_5_tau_5e-05.pdf} \end{minipage} } \caption{Training loss of the proposed algorithm in different system optimization settings.} \label{with optimization loss} \vspace{-0.5cm} \end{figure*} \begin{figure*}[htbp!] \centering \subfloat[Covtype]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_acc_covtype_antenna_5_tau_5e-05.pdf} \end{minipage} } \hfill \subfloat[a9a]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_acc_a9a_antenna_5_tau_5e-05.pdf} \end{minipage} } \hfill \subfloat[w8a]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_acc_w8a_antenna_5_tau_5e-05.pdf} \end{minipage} } \hfill \subfloat[phishing]{ \begin{minipage}[c][0.85\width]{0.23\textwidth} \centering \includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_acc_phishing_antenna_5_tau_5e-05.pdf} \end{minipage} } \caption{Test accuracy of the proposed algorithm in different system optimization settings.} \label{with optimization accuracy} \vspace{-0.5cm} \end{figure*} Fig. \ref{with optimization loss} plots the training loss for our proposed algorithm in different system optimization settings, where SNR is set to 35 dB. The results show that with device selection and a more precise solution given by DCA, the error term can be minimized in each iteration and a smaller optimality gap close to that of perfect aggregation can be obtained. As revealed in Fig. \ref{with optimization accuracy}, this smaller optimality gap further leads to higher test accuracy, demonstrating that our proposed system optimization approach effectively improves learning performance. \begin{figure*}[htbp] \centering \subfloat{ \begin{minipage}[c][0.8\width]{0.3\textwidth} \centering \includegraphics[width=1\linewidth]{fig/cross_entropy_demo_err_fashion_mnist_antenna_5_tau_1e-09.pdf} \label{with algorithms} \end{minipage} } \hspace{8em} \subfloat{ \begin{minipage}[c][0.8\width]{0.3\textwidth} \centering \includegraphics[width=1\linewidth]{fig/cross_entropy_demo_acc_fashion_mnist_antenna_5_tau_1e-09.pdf} \label{with optimization methods} \end{minipage} } \caption{Simulation results on the Fashion-MNIST dataset.} \label{with mnist} \vspace{-0.8cm} \end{figure*} \subsection{Fashion-MNIST Data Set} We consider an image classification problem on a non-i.i.d dataset constructed from the Fashion-MNIST dataset in this experiment, where $m=10$ and SNR is set to $90$ dB. The related parameters are set to be the same as the previous experiments, and we use the percentage of correctly classified test images to evaluate the learning performance. Fig. \ref{with mnist} presents the training loss and test accuracy versus communication rounds of our proposed algorithm and four baseline algorithms. It reveals that our proposed algorithm significantly outperforms the baseline algorithms. On the one hand, it keeps a better convergence rate than first-order algorithms, leading to fewer communication rounds between the devices and the server. On the other hand, compared with other second-order algorithms under over-the-air computation, the aggregation operation only occurs once per iteration in our proposed algorithm. Therefore, our proposed algorithm is more communication-efficient than baseline algorithms in terms of both the total iteration rounds and the communication within each iteration, which further benefit learning performance, as illustrated in Fig. \ref{with mnist}. \section{Conclusion} \label{Conclusion} In this paper, we developed a communication-efficient FL system by over-the-air second-order federated optimization algorithm. The communication rounds and communication latency at each round can be simultaneously reduced. This is achieved by leveraging the second-order information of the learning loss function for achieving fast convergence rates and exploiting the signal superposition property of a multiple access channel for fast model aggregation. The characterized convergence behavior reveals a linear-quadratic convergence rate for the proposed algorithm. As the proposed algorithm is accompanied by an accumulative error term in each iteration, a system optimization problem was formulated to minimize the total error gap while achieving a precise model. We then presented Gibbs Sampling and DC programming methods to jointly optimize device selection and receiver beamforming. The experimental results illustrated that our proposed algorithm and network optimization approach can achieve high communication efficiency for FL systems. \begin{appendices} \section{Proof of Lemma 3} In order to bound $\hat{\bm{p}_{t}}$ through $\bm{p}^{*}$, the difference between the values of their quadratic functions is essential. According to \eqref{decomposition_global_update_direction}, here we decompose this difference as \begin{small} \begin{align*} \phi_{t}\left(\hat{\bm{p}}_{t}\right)-\phi_{t}\left(\bm{p}^{*}\right) =& \frac{1}{2}\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\hat{\bm{p}}_{t}-\bm{p}^{*}\right)\right\|^{2} = \frac{1}{2}\left\|\bm{H}_{t}^{\frac{1}{2}}\left[\left(\bar{\bm{p}}_{t}-\bm{p}^{*}\right)+\left(\bm{p}_{t}-\bar{\bm{p}}_{t}\right)+\left(\tilde{\bm{p}}_{t}-\bm{p}_{t}\right)+\left(\hat{\bm{p}}_{t}-\tilde{\bm{p}}_{t}\right) \right]\right\|^{2} \\ \leq& \underbrace{\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\bm{p}_{t}-\bar{\bm{p}}_{t}\right)\right\|^{2}}_{\text{Term 1}} +\underbrace{3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t}-\bm{p}^{*}\right)\right\|^{2}}_{\text{Term 2}} + \underbrace{3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\tilde{\bm{p}}_{t} - \bm{p}_{t}\right)\right\|^{2}}_{\text{Term 3}} + \underbrace{3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\hat{\bm{p}}_{t}-\tilde{\bm{p}}_{t}\right)\right\|^{2}}_{\text{Term 4}}\;, \end{align*} \end{small} As for Term 1, by Lemma 1, we have $(1-\lambda) \bm{M}_{t}^\mathsf{T} \bm{M}_{t} \preceq \bm{M}_{t}^\mathsf{T} \bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{M}_{t} \preceq (1+\lambda) \bm{M}_{t}^\mathsf{T} \bm{M}_{t}$. Through this we can get $(1-\lambda) \bm{H}_{t} \preceq \bm{H}_{i, t} \preceq(1+\lambda) \bm{H}_{t}$. Thus, there exists matrix $\xi_{i}$ satisfying $\bm{H}_{t}^{\frac{1}{2}} \bm{H}_{t,i}^{-1} \bm{H}_{t}^{\frac{1}{2}}=\bm{I}+\xi_{i} $ and $-\frac{\lambda}{1+\lambda} \preceq \xi_{i} \preceq \frac{\lambda}{1-\lambda}$, which leads to a useful property: $\left\|\bm{H}_{t}^{\frac{1}{2}} \bm{H}_{t,i}^{-1} \bm{H}_{t}^{\frac{1}{2}}\right\| \leq 1+\frac{\lambda}{1-\lambda}=\frac{1}{1-\lambda}$. With this property and Lemma 2, we can get the following inequality: \begin{small} \begin{align*} \norm{\bm{H}_{t}^{\frac{1}{2}}\bracket{\bm{p}_{t} - \bar{\bm{p}}_{t}}} &\leq \frac{1}{n} \sum_{i\in \mathcal{S}} \card{\mathcal{D}_{i}} \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{H}_{t,i}^{-1}\bm{H}_{t}^{\frac{1}{2}}}\norm{\bm{H}_{t}^{-\frac{1}{2}}\bracket{\bm{g}_{t,i}-\bm{g}_{t}}} \\ &\leq \frac{1}{1-\lambda} \frac{1}{\sigma_{min}\bracket{\bm{H}_{t}}}\frac{1}{n} \sum_{i\in \mathcal{S}} \card{\mathcal{D}_{i}} \bracket{1 + \sqrt{2 \ln{\frac{1}{\delta_{i}}}}}\sqrt{\frac{1}{\card{\mathcal{D}_{i}}}}\max_{j}\norm{\bm{n}_{j}} \\ &\leq \frac{1}{1-\lambda} \frac{1}{\sigma_{min}\bracket{\bm{H}_{t}}}\frac{1}{n}\bracket{1 + \sqrt{2 \ln{\frac{1}{\tilde{\delta}}}}}\max_{j}\norm{\bm{n}_{j}}\sqrt{\sum_{i\in \mathcal{S}}m\card{\mathcal{D}_{i}}}\\ &= \frac{1}{1-\lambda} \frac{1}{\sigma_{min}\bracket{\bm{H}_{t}}}\bracket{1 + \sqrt{2 \ln{\frac{1}{\tilde{\delta}}}}}\sqrt{\frac{m}{n}}\max_{j}\norm{\bm{n}_{j}} \;. \end{align*} \end{small} For convenience, we denote: $\mathcal{G} = \frac{1}{1-\lambda} \frac{1}{\sigma_{min}\bracket{\bm{H}_{t}}}\bracket{1 + \sqrt{2 \ln{\frac{1}{\tilde{\delta}}}}}\max_{j}\norm{\bm{n}_{j}}\;,$ and Term 1 is bounded by $\text{Term 1} \leq \frac{m}{n}\mathcal{G}^2$. As for Term 2, based on the analysis in \cite[Lemma 6]{wang2018giant}, we have \begin{small} \begin{align*} \left\|\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t}-\bm{p}^{*}\right)\right\| &\leq \norm{\frac{1}{n}\sum_{i\in\mathcal{S}}\card{\mathcal{D}_{i}}\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t,i}-\bm{p}^{*}\right)} \leq \frac{1}{n}\sum_{i\in\mathcal{S}}\card{\mathcal{D}_{i}}\norm{\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t,i}-\bm{p}^{*}\right)} \leq \zeta_{1} \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}} \;, \end{align*} \end{small} with $\zeta_{1}=\tau\left(\lambda+\frac{\lambda^{2}}{1-\lambda}\right)$ and $\tau=\frac{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)}{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)+n\gamma}$. Then Term 2 is bound by: \begin{small} \begin{align*} \text{Term 2} = 3 \left\|\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t}-\bm{p}^{*}\right)\right\|^{2} \leq 3\zeta_{1}^{2} \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}}^{2} = - 3\zeta_{1}^{2} \phi\bracket{\bm{p}^{*}}. \end{align*} \end{small} As for Term 3, it can be reformulated as follows: \begin{small} \begin{align*} \text{Term 3} =3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\tilde{\bm{p}}_{t} - \bm{p}_{t}\right)\right\|^{2} = 3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\frac{1}{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}\bm{p}_{t,i}-\frac{1}{n}\sum_{i\in\mathcal{S}}\card{\mathcal{D}_{i}}\bm{p}_{t,i}\right)\right\|^{2}\;. \end{align*} \end{small} According to the analysis in \cite[Section 3.1]{friedlander2012hybrid}, it follows: \begin{small} \begin{align*} \text{Term 3} \leq& 12\bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}}^{2}\bracket{\norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}_{t,i} - \bm{H}_{t}^{\frac{1}{2}}\bar{\bm{p}}_{t,i}} + \norm{\bm{H}_{t}^{\frac{1}{2}}\bar{\bm{p}}_{t,i} - \bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}} + \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}}}^{2} \\ \stackrel{(a)}{\leq}& 12 \bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}}^{2}\bracket{\sqrt{\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}}\mathcal{G} + \norm{\bm{H}_{t}^{\frac{1}{2}}\bar{\bm{p}}_{t,i} - \bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}} + \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}}}^{2} \\ \stackrel{(b)}{\leq}& 12 \bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}}^{2}\bracket{\sqrt{\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}}\mathcal{G} + \bracket{\zeta_{1}+ 1}\norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}}}^{2} \\ \leq& 24\bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}}^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\mathcal{G}^{2} - 24\vartheta^{2}\bracket{\zeta_{1}+ 1}^{2}\phi\bracket{\bm{p}^{*}} \end{align*} \end{small} where $\zeta_{1}=\tau\left(\lambda+\frac{\lambda^{2}}{1-\lambda}\right)$, $\tau=\frac{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)}{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)+n\gamma}$, $\vartheta = \max _{t}\bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}} < 1$, $\left(a\right)$ and $\left(b\right)$ are obtained in the way similar to the analysis of Term 1 and Term 2. As for Term 4, we have: \begin{small} \begin{align*} \text{Term 4} = 3\norm{\bm{H}_{t}^{\frac{1}{2}}\frac{1}{\bracket{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bm{a}_{t}^\mathsf{H}\bm{E}_{t}}^{2} \leq \frac{3}{\sigma_{\min}\left(\bm{H}_{t}\right)}\left\|\frac{1}{\bracket{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bm{a}_{t}^\mathsf{H}\bm{E}_{t}\right\|^{2}\;. \end{align*} \end{small} We can get the final result by combining the bound of Term 1, 2, 3 and 4 together: \begin{small} \begin{align*} \phi\left(\hat{\bm{p}}_{t}\right)-\phi\left(\bm{p}^{*}\right) \leq \epsilon^{2}-\zeta^{2} \phi\left(\bm{p}^{*}\right) \Rightarrow \phi\left(\bm{p}^{*}\right) \leq \phi\left(\hat{\bm{p}}_{t}\right) \leq \epsilon^{2}+\left(1-\zeta^{2}\right) \phi\left(\bm{p}^{*}\right)\;, \end{align*} \end{small} where $\epsilon$ and $\zeta$ are defined as \eqref{zeta} and \eqref{epsilon}. \section{Proof of Theorem 1} Based on Lemma 3 and Lemma 4, we have: \begin{small} \begin{align*} \bm{\Delta}_{t+1}^{\top} \bm{H}_{t} \bm{\Delta}_{t+1} \leq& L\left\|\bm{\Delta}_{t+1}\right\|\left\|\bm{\Delta}_{t}\right\|^{2}+\frac{\zeta^{2}}{1-\zeta^{2}} \bm{\Delta}_{t}^{\top} \bm{H}_{t} \bm{\Delta}_{t}+2 \epsilon^{2} \leq L\left\|\bm{\Delta}_{t+1}\right\|\left\|\bm{\Delta}_{t}\right\|^{2}+\left(\frac{\zeta^{2}}{1-\zeta^{2}} \sigma_{\max }\left(\mathbf{H}_{t}\right)\right)\left\|\bm{\Delta}_{t}\right\|^{2}+2 \epsilon^{2}\;. \end{align*} \end{small} According to the analysis in \cite[Appendix A]{ghosh2020distributed}, this leads to: \begin{small} \begin{equation} \begin{aligned} \left\|\bm{\Delta}_{t+1}\right\| \leq& \max \left\{\sqrt{\frac{\sigma_{\max }\left(\bm{H}_{t}\right)}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(\frac{\zeta^{2}}{1-\zeta^{2}}\right)}\left\|\bm{\Delta}_{t}\right\|, \frac{L}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left\|\bm{\Delta}_{t}\right\|^{2}\right\} +\frac{2 \epsilon}{\sqrt{\sigma_{\min }\left(\mathbf{H}_{t}\right)}}\;. \end{aligned} \label{inequality} \end{equation} \end{small} As for the error term $\epsilon$, we have: \begin{small} \begin{align*} \epsilon =& \Bigg\{ \frac{3}{\sigma_{\min}\left(\bm{H}_{t}\right)}\left\|\frac{1}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bm{a}_{t}^\mathsf{H}\bm{E}_{t}\right\|^{2} + \left[24\left(1 - \frac{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}\right] \mathcal{G}^{2} \Bigg\}^{\frac{1}{2}} \\ \leq& \sqrt{\frac{3}{\sigma_{\min}\left(\bm{H}_{t}\right)}}\frac{d}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\left\|\bm{a}_{t}\right\|\left\|\bm{e}_{t}\right\| + \sqrt{24\left(1 - \frac{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}} \cdot \mathcal{G} \;. \end{align*} \end{small} To handle the random variable $\bm{e}_{t}$ in $\epsilon$, we take expectations over $\bm{e}_{t}$ on both sides of~\eqref{inequality} : \begin{small} \begin{align*} \mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq& \max \left\{\sqrt{\frac{\sigma_{\max }\left(\bm{H}_{t}\right)}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(\frac{\zeta^{2}}{1-\zeta^{2}}\right)}\left\|\bm{\Delta}_{t}\right\|, \frac{L}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left\|\bm{\Delta}_{t}\right\|^{2}\right\}+\frac{2\sqrt{3}}{\sigma_{\min}\left(\bm{H}_{t}\right)}\frac{ d\left\|\bm{a}_{t}\right\|\mathbb{E}\left(\left\|\bm{e}_{t}\right\|\right)}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}} \\ &+\sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\| \\ \stackrel{(c)}{\leq}& \max \left\{\sqrt{\frac{\sigma_{\max }\left(\bm{H}_{t}\right)}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(\frac{\zeta^{2}}{1-\zeta^{2}}\right)}\left\|\bm{\Delta}_{t}\right\|, \frac{L}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left\|\bm{\Delta}_{t}\right\|^{2}\right\}+\frac{2\sqrt{3}}{\sigma_{\min}\left(\bm{H}_{t}\right)}\frac{ d\sigma\left\|\bm{a}_{t}\right\|}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}} \\ &+ \sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\| \;. \end{align*} \end{small} \end{appendices} \bibliographystyle{ieeetr}
39fcb18e2fb11c0cec4909b746e165db22e44e2c
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section*{Introduction} Let us study the simply connected Lie group $G$. By the \emph{moduli space} we consider the orbit space of the action of $\RR^\times\Aut(\gg)$ on the space $\mathfrak{M}(G)$ of left invariant metrics on $G$, represented by its inner products on the corresponding Lie algebra $\gg$. Here, $\Aut(\gg)$ denotes the automorphism group of the corresponding Lie algebra and its orbits induce the isometry classes, while $\RR^\times$ is the scalar group giving rise to the scaling. There are two, in some way dual, approaches to the classification problem. The first one is to start from the (pseudo-)orthonormal basis of Lie algebra and act by the isometry group (and hence preserving the canonical form of the metric) on the commutators to make them as simple as possible. The second one is to start from basis of Lie algebra with simple commutators and act by the automorphism group of the Lie algebra (hence preserving the commutators) to make the metric take the most simple form. For the more detailed outline of each approach, we refer to~\cite{Tamaru1, Tamaru2}. The moduli space approach to the problem of classification was first introduced in Milnor's classical paper~\cite{Milnor} where left invariant Riemannian metrics on three-dimensional unimodular Lie groups were considered. Much later, the classification was completed in Lorentz case~\cite{CorderoParker}. In higher dimensions, there are numerous results in both Riemannian and pseudo-Riemannian setting. However, even in small dimensions, the moduli space of pseudo-Riemannian metrics can be quite large, hence is rarely practical or possible to obtain the complete classification of metrics. Naturally, the case of nilpotent Lie groups is very thoroughly investigated (for example, see~\cite{Lauret1,Bokan1,Sukilovic1,Homolya, Eberlein,Vuk2015}). Following our previous interests, in this paper the cotangent bundle of the Heisenberg group $H_{2n+1}$ is considered. Since the Heisenberg group is two-step nilpotent, its cotangent bundle has the same property. Although the moduli space of metrics on the cotangent bundle can be constructed using both nondegenerate and degenerate metrics on the original Lie group, in practice the process heavily depends on the subtle geometrical and algebraic analysis. For example, in case of Lie group $T^*H_3$ we obtained 19 non-equivalent families of left invariant metrics of arbitrary signature (see~\cite{SVB} for more details). Therefore, in higher dimensions it is feasible to consider Riemannian signature and only some special cases of pseudo-Riemannian metrics. The paper is organized as follows. First, we briefly recall the construction of the cotangent bundle $\thn$ of the Lie algebra $\hn$ corresponding to the Heisenberg group $H_{2n+1}$. The explicit form of the automorphism group is described in Lemma~\ref{le:auto}. In Section~\ref{sec:class} we classify all non isometric left invariant Riemannian metrics on $\thn$ (see Theorem~\ref{th:metrike}). Throughout the paper we identify the notion of metric on Lie group and the inner product on its Lie algebra. We obtained only one $n(2n+1)$-parameter family of Riemannian metrics. This family is correlated with the family of Riemannian metrics on Heisenberg group from~\cite{Vuk2015}. Motivated by their applications in mathematics and physics, Section~\ref{sec:adinv} is devoted to ad-invariant metrics. Cotangent Lie algebras are endowed with the canonical ad-invariant metric. This metric is of neutral signature and since the setting is two-step nilpotent, it is flat. We prove the uniqueness of this metric in Lemma~\ref{le:adinv}. In Section~\ref{sec:pseudoK} we classify pseudo-K\"{a}hler metrics. Theorem~\ref{th:complex} states that, up to the action of automorphisms and sign, there exists only one complex structure $\JJ_0$ on $\thn$. This generalizes the result obtained by Salamon~\cite{Salamon} in his classification of complex structures on nilpotent Lie algebras, where he considered the Lie algebra $\th3$. This complex structure is three-step nilpotent (see~\cite{Cordero}), but since the center of the algebra $\thn$ is odd dimensional, $\JJ_0$ cannot be abelian complex structure, i.e. complex structure satisfying $[x,y]=[\JJ x, \JJ y]$. In Theorem~\ref{th:forme} we find that the space of symplectic forms compatible with $\JJ_0$ has a dimension $\frac{3n^2 + n + 2}{2}$, $n>1$. Interestingly, for $n=1$, the dimension of $\JJ$-invariant closed 2-forms is five (see Remark~\ref{re:forme}). This case was considered in the paper~\cite{CSO}. Finally, we classify pseudo-K\"{a}hler metrics and show that they all belong to the same family of Ricci-flat metrics (Theorem~\ref{th:pseudoK}). \section{Preliminaries} \label{sec:prelim} Let us briefly recall the construction of cotangent Lie algebra. The \emph{cotangent algebra} $T^*\gg$ of the Lie algebra $\gg$ is a semidirect product of $\gg$ and its cotangent space $\gg ^*$ by means of the coadjoint representation \begin{align*} T^* \gg := \gg \ltimes_{\ad^*} \gg^*, \end{align*} i.e. the commutators are defined by \begin{align} \label{eq:cotangent} [(x,\phi), (y,\psi)]:= ([x,y], \ad^*(x)(\psi) - \ad^*(y)(\phi)), \quad x,y\in \gg,\enskip \phi, \psi \in \gg^*. \end{align} The coadjoint representation $\ad^* : \gg \to \mathrm{gl} (\gg^*)$ is given by \begin{align*} (\ad^*(x) (\phi))(y):= - \phi (\ad(x)(y)) = - \phi([x,y]). \end{align*} Now, we specialise this construction to the Heisenberg algebra $\hn$ which is the Lie algebra of (2n+1)-dimensional Heisenberg group $H_{2n+1}.$ Let us denote the matrix of standard complex structure on $\RR ^{2n}$ by \begin{align} \label{eq:J} J = J_{2n} = \begin{pmatrix} 0 & -E\\ E & 0 \end{pmatrix} \end{align} where $E$ is $n\times n$ identity matrix. The standard symplectic form in vector space $\RR ^{2n}$ can be written in the form \begin{align*} \omega (x,y) = x^\t Jy, \enskip x,y \in \RR ^{2n}. \end{align*} The Heisenberg group is two-step nilpotent Lie group $H_{2n+1}$ defined on the base manifold $\RR ^{2n}\oplus \RR$ by multiplication \begin{align*} (x, \mu )\cdot (y, \lambda):= (x + y , \mu + \lambda + \omega (x,y)). \end{align*} The corresponding Lie algebra \begin{align*} \hn = \RR ^{2n}\oplus \RR = \RR ^{2n}\oplus \ZZ = \{ (x, \lambda) \, | \, x\in R^{2n}, \lambda \in \RR\} \end{align*} is given by the following commutator equation \begin{align} \label{eq:hnkom} [(x, \mu ),(y, \lambda)] = (0, \omega (x,y)). \end{align} Note that $\ZZ = \RR \langle z\rangle $ is one-dimensional center and one-dimensional commutator subalgebra of $\hn .$ To simplify notation we write~\eqref{eq:hnkom} in the equivalent form \begin{align*} [x + \mu z, y + \lambda z] = \omega (x,y) z. \end{align*} If $e_1, \dots , e_n, f_1, \dots , f_n$ represents the standard basis of $\RR ^{2n}$, then nonzero commutators of $\hn$ are \begin{align*} [e_i, f_i] = z, \enskip i = 1, \dots , n. \end{align*} Let $ \RR ^{*2n} = \RR \langle e_1^*, \dots , e_n^*, f_1^*, \dots , f_n^* \rangle$ and $\ZZ ^* = \RR \langle z^* \rangle$ be dual vector spaces of one-forms spanned by dual basis vectors. Denote the dual space of $\hn$ by \begin{align*} \hnz = \RR ^{*2n}\oplus \ZZ^* = \{ (x^*, \mu ^*) \, | \, x^*\in R^{2n}, \mu ^* \in \RR\} = \{ x^* + \mu ^* z^*\}. \end{align*} Now, the cotangent space $\thn$ of $\hn$, as a vector space, can be written as a direct sum \begin{align} \label{eq:thn_decomp} \gg = \thn = \hn \oplus \hnz = \RR^{2n} \oplus \ZZ^* \oplus \RR ^{*2n}\oplus \ZZ \cong \RR^{4n+2}. \end{align} Note, that we changed the order of summands to better fit the structure of Lie algebra. Namely, one can check that according to~\eqref{eq:cotangent} the commutator on $\thn$ is given by \begin{align} \label{eq:thnkom1} [(x,\mu ^*, x^*, \mu), (y,\lambda ^*, y^*, \lambda)] = (0,0, \lambda^*J^*(x)-\mu^* J^*(y), \omega(x,y)), \end{align} where \begin{align*} J^*: \RR ^{*2n}\to \RR ^{*2n}, \quad J^*(X) := (JX)^* \end{align*} is represented by matrix $J$ given in~\eqref{eq:J}, in basis $ e_1^*, \dots , e_n^*, f_1^*, \dots , f_n^*$. The center and commutator subalgebra of $\thn$ coincide with $\RR ^{*2n}\oplus \ZZ $. By that reason we have changed the order of summands in~\eqref{eq:thn_decomp} to group central (and commutator) vectors together. Note that the algebra $\thn$ is also two-step nilpotent. To simplify the notation we write commutator~\eqref{eq:thnkom1} of $\thn$ in equivalent form \begin{align} \label{eq:thnkom2} [x+ \mu ^* z^* + x^* + \mu z, y + \lambda ^* z^* + y^* + \lambda z] = \lambda^*J^*(x)-\mu^* J^*(y) + \omega(x,y) z. \end{align} \begin{lemma} \label{le:auto} The group of automorphism of algebra $\gg = \thn$ of the form~\eqref{eq:thn_decomp} in standard basis is \begin{align} \label{eq:autoF} &\Aut (\thn ) = \left\{ F = \begin{pmatrix} F_1 & 0 \\ F_3 & F_4 \end{pmatrix} \, \vert\, \, F_1, F_4\in Gl_{2n+1}(\RR ), \, F_3 \in M_{2n+1}(\RR )\, \right\}, \\ \label{eq:autoF1} &F_1= \begin{pmatrix} \bar F_1 & v_1 \\ u_1^\t & f_1 \end{pmatrix},\quad F_4= \begin{pmatrix} f_1 f_4 {\bar F_1}^{-\t} - (Jv_1)(Ju_1)^\t & -f_4 {\bar F_1}^{-\t} u_1 \\ -f_4v_1^\t {\bar F_1}^{-\t} & f_4 \end{pmatrix},\quad \bar F_1^\t J\bar F_1 = f_4 J, \end{align} $\enskip v_1, u_1 \in \RR ^{2n}, \, f_1, f_4 \in \RR\backslash\{0\}. $ Its dimension is $\dim \Aut (\thn ) = 6 n^2 + 9n + 3.$ \end{lemma} \begin{proof} For element $g \in \gg$ denote by $A_g$ the matrix of operator $ad(g)$ in standard basis. Each $g\in \gg$ decomposes as $g = \nu + \zeta$, $\nu \in \RR ^{2n}\oplus \ZZ^*, \zeta \in \RR ^{*2n}\oplus \ZZ.$ Note that $ad (\zeta ) \equiv 0$ for the central part. If $\nu = x + \mu^* z^*$ the matrix of $ad (g)$ is \begin{align} \label{eq:uslov} A_g = \begin{pmatrix} 0 & 0 \\ A_\nu & 0 \end{pmatrix},\quad A_\nu = \begin{pmatrix} -\mu^* J & Jx \\ x^\t J & 0 \end{pmatrix}. \end{align} The condition that $F\in \Aut (\gg)$ can we written in the eqivalent form \begin{align} \label{eq:auto} F[g,h] = [Fg, Fh], \enskip g,h \in \gg \quad \Longleftrightarrow \quad A_{Fg}F = FA_g, \enskip g\in \gg. \end{align} We are looking for the matrix of automorphism in a block matrix form \begin{align*} F = \begin{pmatrix} F_1 & F_2 \\ F_3 & F_4 \end{pmatrix}. \end{align*} Automorphisms preserve the center $ \RR ^{*2n}\oplus \ZZ$ of $\gg$ and therefore $F_2=0.$ Relations~\eqref{eq:auto} impose no condition on $F_3$ and hence $F_3\in M_{2n+1}(\RR)$ is arbitrary. The remaining condition is \begin{align} \label{eq:uslov1} A_{F_1\nu}F_1 = F_4 A_\nu \enskip \mbox{for each}\enskip \nu = x + \mu^* z^*. \end{align} We further decompose matrices $F_1$ and $F_4$ as \begin{align} \label{eq:F14} F_k = \begin{pmatrix} \bar F_k & v_k \\ u_k^\t & f_k \end{pmatrix}, \end{align} $\bar F_k\in M_{2n}(\RR), v_k, u_k \in \RR^{2n}, f_k \in \RR, k=1,4.$ Next, we use condition~\eqref{eq:uslov1} for matrices~\eqref{eq:F14} and operator~\eqref{eq:uslov}. The bottom left component is \begin{align*} (\bar F_1 X + \mu^*v_1)^\t J\bar F_1 = (-\mu^*u_4^\t + f_4 X^\t ) J \end{align*} and has to be satisfied for $x\in \RR^{2n}$ and $\mu^* \in \RR.$ It is equivalent to the following two conditions \begin{align} \label{eq:uslovidolelevo} \bar F_1^\t J\bar F_1 = f_4 J, \quad\quad u_4 = -f_4\bar F_1^{-1} v_1. \end{align} The bottom right component is \begin{align*} (\bar F_1X)^\t Jv_1 = u_4^\t JX \end{align*} and because of relations~\eqref{eq:uslovidolelevo} it is satisfied for any $v_1, X\in \RR^{2n}.$ Therefore, $v_1\in \RR^{2n}$ is arbitrary. The upper left and upper right components are, respectively \begin{align*} -(u_1^\t X + \mu^*f_1)J\bar F_1 + J(\bar F_1X + \mu^*v_1)\mu_1^\t = (-\mu^*\bar F_4 + v_4x^\t ) J, \quad \bar F_4JX = J(-u_1^\t Xv_1 + f_1\bar F_1X), \end{align*} for all $X\in \RR^{2n}.$ Combining them with previous relations yields \begin{align} \label{eq:uslovigore} \bar F_4 = f_1 f_4 {\bar F_1}^{-\t} - (Jv_1)(Ju_1)^\t ,\quad \quad v_1 = -f_4 {\bar F_1}^{-\t} u_1 \end{align} and $u_1\in \RR ^{2n}$ is arbitrary. Numbers $f_1, f_4$ can't be equal to zero since $F$ is nonsigular. The relations~\eqref{eq:uslovidolelevo} and~\eqref{eq:uslovigore} imply that the automorphisms has form as in the statement of the Lemma. Two calculate the dimension of the group note that matrix $\bar F_1$ is ``almost'' symplectic and therefore depends on $n(2n+1)$ paremeters. Since $F_3\in M_{2n+1}(\RR)$, $u_1, v_1\in \RR ^{2n}$, $f_1,f_4\in \RR\backslash\{0\}$ are arbitrary, and $F_4$ is completely dependent on $F_1$, the dimension is: \begin{align*} n(2n+1) + (2n+1)^2 + 2n + 2n + 2 = 6 n^2 + 9n + 3. \end{align*} \end{proof} \begin{remark} In~\cite{SVB} group of automorphism of Lie algebra $\rm{T}^*\mathfrak{h}_{3}$ (special case for $n=1$) are given. Group of automorphisms of Heisenberg algebra $\hn$ is subgroup of $\Aut (\thn )$ and can be described as semidirect product of symplectic group $Sp(2n, \RR),$ subgroup of translations isomorphic to $\RR ^{2n}$ and $1$-dimensional ideal. For more details, see~\cite{Vuk2015}. \end{remark} \section{Classification of left invariant Riemannian metrics}\label{sec:class} In this section we classify non-isometric left invariant Riemannian metrics on $\gg = \thn$. If $\gg$ is a Lie algebra and $\langle \cdot, \cdot \rangle$ inner product on $\gg$ the pair $(\gg, \langle \cdot, \cdot \rangle)$ is called a \emph{metric Lie algebra}. The structure of metric Lie algebra uniquely defines left invariant Riemannian metric on the corresponding simple connected Lie group $G$ and vice versa. Two metric Lie algebras are \emph{isomorphic} if there are isomorphic as Lie algebras and that isomorphism is isometry of their inner products. Metric algebras are said to be \emph{isometric} if there exists an isomorphism of Euclidean spaces preserving the curvature tensor and its covariant derivatives. This translates to the condition that metric algebras are isometric if and only if they are isometric as Riemannian spaces (see~\cite[Proposition 2.2]{Aleksijevski}). Although two isomorphic metric algebras are also isometric, the converse is not true. In general, two metric algebras may be isometric even if the corresponding Lie algebras are non-isomorphic. The test to determine whether any two given solvable metric algebras (i.e. solvmanifolds) are isometric was developed by Gordon and Wilson in~\cite{Gordon}. However, by the results of Alekseevski\u{\i}~\cite[Proposition 2.3]{Aleksijevski}, in the completely solvable case, isometric means isomorphic. Since Lie algebra $\gg$ is nilpotent and therefore completely solvable, non-isometric metrics on $\gg$ are the non-isomorphic ones. They are obtained by action of group $\Aut (\gg)$ on space of metrics. Fix basis of $\thn$ described in Section \ref{sec:prelim}. Riemannian inner product on $\langle \cdot, \cdot \rangle$ is then represented by nonsingular symmetric matrix $S \in M_{4n+2}(\RR)$ of signature $(4n+2,0).$ The action of $F\in \Aut (\thn )$ on inner products is given by \begin{align} \label{eq:dejstvo} S' = F^\t SF. \end{align} Matrix $S$ has $(4n+3)(2n+1) = 8n^2+10n+3$ parameters. According to $\dim \Aut (\thn)$ from Lemma~\ref{le:auto} it is expected that moduli space of non-isometric inner products is of dimension $n(2n+1).$ This is what we show in Theorem~\ref{th:metrike}. Write $S$ in block-matrix form \begin{align*} S = \begin{pmatrix} S_1 & S_2 \\ S_2^\t & S_4 \end{pmatrix}, \quad S_1^\t = S_1, S_4^\t = S_4. \end{align*} Let $F \in \Aut(\thn)$ be of the form~\eqref{eq:autoF}. After the action~\eqref{eq:dejstvo} the top right matrix of $S'$ is \begin{align*} S_2' = F_1^\t (S_2F_4) + F_3^\t (S_4F_4). \end{align*} Matrix $S_4$ represents the restriction of the inner product on subspace $\RR ^{*2n}\oplus \ZZ.$ Since inner product is Riemannian, the restriction is non-degenerate and thus $S_4$ is nonsingular. By choosing $F_3 = -S_2F_1S_4^{-1}$ we achieve $S_2'=0$ and therefore we can suppose that \begin{align} \label{eq:s1s4} S = S' = \begin{pmatrix} S_1 & 0 \\ 0 & S_4 \end{pmatrix}, \quad S_1^\t = S_1,\quad S_4^\t = S_4. \end{align} Now, the action of $F$ on $S$, with $F_3=0$ is given by \begin{align*} S_k' = F_k^\t S_k F_k, \enskip k= 1,4, \end{align*} where $F_1$ and $F_4$ are related by~\eqref{eq:autoF1}. We write $(2n+1)\times (2n+1)$ matrices $F_k$ and $S_k$ as block matrices \begin{align*} F_k = \begin{pmatrix} \bar F_k & v_k \\ u_k^\t & f_k \end{pmatrix}, \quad \quad S_k = \begin{pmatrix} \bar S_k & t_k \\ t_k^\t & \omega _k \end{pmatrix}, \quad {\bar S_k}^\t = \bar S_k, t_k\in \RR ^{2n}, \quad k=1,4. \end{align*} The top right vector in $S_k'$ given is given by \begin{align*} t_k' = u_k( t_k^\t v_k + \omega _k f_k) + F_k^\t \bar S_k v_k + \bar F_k^\t t_kf_k , \quad k=1,4. \end{align*} The number $\omega _k,\, k = 1,4$ is different from zero (it is the norm of the vector $z^*$ and $z$, respectively). With appropriate choice of number $f_k$ one can achieve that $t_k^\t v_k + \omega _k f_k \neq 0,\ k=1,4.$ Hence, there is a choice automorphism $F$ with $u_1$ such that top right vector $t_1'$ in $S_1'$ is zero and with $u_4,$ or eqivalently $v_1$, such that top right vector $t_4'$ in $S_4'$ is zero. Therefore, we can suppose that metric has form~\eqref{eq:s1s4} with \begin{align*} S_k = \begin{pmatrix} \bar S_k & 0 \\ 0 & \omega _k \end{pmatrix}, \quad {\bar S_k}^\t = \bar S_k, \quad k=1,4. \end{align*} To further simplify the metric consider automorphism $F$ of the form~\eqref{eq:autoF} with $u_1=v_1 =0$ (and hence $u_4=v_4 =0$). The action reduces to \begin{align*} S_k' = \begin{pmatrix} {\bar F_k}^\t \bar S_k \bar F_k & 0 \\ 0 & f_k^2 \omega _k \end{pmatrix},\enskip k=1,4, \end{align*} with $F_1^\t J\bar F_1 = f_4 J.$ As first, consider upper left block of $S$, i.e. $k=1.$ Symplectic matrix $\bar F_1$ can diagonalize positive symmetric matrix $\bar S_1$ (see~\cite{Williamson,Vuk2015} for details regarding independent action of $\bar S_1$ and $f_4$) to obtain \begin{align*} {\bar F_k}^\t \bar S_k \bar F_k = D(\sigma) = \diag (\sigma _1, \ldots , \sigma_ n, \sigma _1, \ldots , \sigma _n), \enskip \sigma _1\geq \ldots\geq \sigma _n >0. \end{align*} By choosing $f_4 = \frac{1}{\sigma _n}$ one can achieve $\sigma _n=1$ and for $f_1 = \frac{1}{\sqrt{\omega _1}}$ we obtain \begin{align} \label{eq:s1p} S_1' = \diag (D(\sigma),1) = \diag (\sigma _1, \dots , \sigma _{n-1}, 1, \sigma _1, \dots \sigma _{n-1}, 1,1). \end{align} Now consider bottom right block, i.e. $k=4.$ Since $\bar F_1, f_1,f_4$ and hence $\bar F_4,$ are already chosen, there is no much freedom left. However, symplectic rotations $R_\phi:\RR ^{2n}\to \RR^{2n}$ \begin{align}\label{eq:srot} e_i \mapsto \cos \phi_i\, e_i -\sin \phi _i\, f_i,\qquad f_i \mapsto \sin \phi_i\, e_i +\cos \phi _i\, f_i, \end{align} by angles $\phi _1, \dots, \phi _n \in \RR$ belong to $\Aut(\hn) \subseteq \Aut (\thn)$ and preserve inner product~\eqref{eq:s1p}. These rotations induce rotations in $\RR^{*2n}.$ By choosing appropriate angles one can achieve that $e_i^*$ and $f_i^*$ are orthogonal, i.e. $(\bar S_4')_{i(n+i)} = 0$, $i = 1, \dots ,n$. Free parameters in the canonical form of the metric are: $n-1$ parameter $\sigma _i,$ entries of symmetric $2n\times 2n$ matrix $\bar S_4'$ ($n$ of them is equal to zero) and parameter $\omega _4.$ Therefore the dimension of moduli space of non-equivalent metrics is \begin{align*} (n-1) + (n (2n+1) - n) + 1 = n(2n+1) \end{align*} as expected. Hence, we proved the following theorem. \begin{theorem} \label{th:metrike} Dimension of the moduli space of Riemannian metrics on Lie algebra $\thn$ is $n(2n+1).$ Every such metric is represented by $(4n+2)\times (4n+2)$ block matrix \begin{align}\label{eq:metrike} S = \begin{pmatrix} D(\sigma) & 0 & 0 & 0 \\ 0 & 1 & 0 & 0\\ 0 & 0 & \bar S_4 & 0\\ 0 & 0 & 0 & \omega _4 \end{pmatrix}, \end{align} $\omega _4>0$, $ D(\sigma) = \diag (\sigma _1, \dots , \sigma_{n-1}, 1, \sigma _1, \dots , \sigma _{n-1}, 1), \enskip \sigma _1 \geq \dots \geq \sigma _{n-1} \geq 1$, $\bar S_4$ is symmetric positive definite matrix of dimension $2n\times 2n$ satisfying $(\bar S_4)_{i(n+i)} = 0, \enskip i=1,\dots n.$ \end{theorem} \begin{remark} Symplectic rotations~\eqref{eq:srot} represent unique automorphisms preserving~\eqref{eq:s1p} if all $\sigma_k$ are distinct. If some of them are equal, there exist wider class of automorphism preserving~\eqref{eq:s1p} that further simplifies the matrix $\bar S_4$. \end{remark} \section{Ad-invariant metrics}\label{sec:adinv} The next step would be to consider pseudo-Riemannian case. However, as previously mentioned, the corresponding moduli space of metrics will grow quite large with the increase of the dimension. Nevertheless, it is known that every cotangent bundle of a Lie group $G$ admits an ad-invariant metric defined by the duality pairing on the corresponding Lie algebra $T^*\gg=\gg\ltimes\gg^*$: \begin{align}\label{eq:adinv} \langle (x, x^*), (y,y^*)\rangle = x^*(y) + y^*(x),\enskip x,y\in\gg,\ x^*,y^*\in\gg^*. \end{align} The metric~\eqref{eq:adinv} is of neutral signature and it makes both algebras $\gg$ and $\gg^*$ totally isotropic, meaning $\gg^\perp = \gg$ and ${\gg^*}^\perp = \gg^*$. \begin{lemma}\label{le:adinv} The metric~\eqref{eq:adinv} is unique ad-invariant metric on $\thn$ and it is flat. \end{lemma} \begin{proof} The condition of ad-invariance: \begin{align*} \langle[x,y],z]\rangle + \langle y, [x,z]\rangle = 0,\enskip x,y,z\in\thn, \end{align*} gives us that the corresponding metric is given by the symmetric matrix: \begin{align*} S=\begin{pmatrix} \bar S & \alpha E\\ \alpha E & 0 \end{pmatrix}, \enskip \bar S = \bar S^\t\in M_{2n+1}(\RR),\ \alpha\neq 0. \end{align*} If we apply the automorphism $F$ of the form~\eqref{eq:autoF}-\eqref{eq:autoF1} with \begin{align*} F_1 = E,\enskip F_4 = \frac{1}{\alpha} E, \enskip F_3 = -\frac{1}{2\alpha}\bar S, \end{align*} we obtain that $\bar S = 0$ and $\alpha = 1$, i.e. every ad-invariant metric is equivalent to the metric~\eqref{eq:adinv}. The flatness of the metric follows trivially from the fact that the curvature tensor $R$ for ad-invariant metric is given by \begin{align*} R(u,v) = -\frac{1}{4}\ad_{[u,v]},\enskip u,v\in\thn. \end{align*} Therefore, the ad-invariant metric is flat if and only if the corresponding Lie algebra is two-step nilpotent. \end{proof} The previous results confirm the much extensive results on the uniqueness of the ad-invariant metrics recently obtained in~\cite{Conti}. \section{Classsification of pseudo-K\"{a}hler metrics on $\thn$}\label{sec:pseudoK} Almost complex structure $\JJ$ is linear map $\JJ :\thn \to \thn$ that satisfies $\JJ ^2 = -Id.$ Recall that complex structure $\JJ$ is integrable complex structure, i.e. it satisfies $N_\JJ (X,Y) = 0$ for all $X,Y \in \thn $ where $N_\JJ$ is the Nijenhuis tensor defined by \begin{align} \label{eq:nijenuis} N_{\JJ}(X,Y) = [X,Y] + \JJ [\JJ X, Y] + \JJ [X,\JJ Y] - [\JJ X, \JJ Y]. \end{align} If $\Omega$ is 2-form and $\JJ$ is an almost complex structure on $\gg$ we say that $\Omega$ is $\JJ$-invariant if \begin{align} \label{eq:Jinvariant} \Omega (X,Y) = \Omega (\JJ X, \JJ Y), \end{align} for all $X,Y, \in \gg.$ The metric $\langle \cdot, \cdot \rangle $ defined by complex structure $\JJ$ and $\JJ$-invariant closed 2-form $\Omega$ by \begin{align}\label{eq:herm} \langle X, Y \rangle := \Omega (\JJ X, Y) \end{align} is called pseudo-K\"ahler. \begin{theorem} \label{th:complex} Up to automorphisms the complex structure on $\thn$ is up to a sign unique, and represented by matrix \begin{align} \label{eq:complex} \JJ _0= \begin{pmatrix} J & 0 & 0 & 0 \\ 0 & 0 & 0 & 1\\ 0 & 0 & J & 0\\ 0 & -1 & 0 & 0 \end{pmatrix}, \end{align} where $J$ is the $2n\times 2n$ matrix of standard complex structure given by~\eqref{eq:J}. \end{theorem} \begin{proof} Vanishing of Nienhuis tensor~\eqref{eq:nijenuis} can be equivalently expressed in terms of $\ad$ operator \begin{align} \label{eq:complexAd} \ad(X) - \JJ \ad (\JJ X) - \JJ \ad (X)\JJ - \ad(\JJ X)\JJ = 0, \end{align} for all $X \in \thn.$ Each $X\in \thn$ decomposes as $X = \nu + \zeta$, $\nu \in \RR ^{2n}\oplus \ZZ^*, \zeta \in \RR ^{*2n}\oplus \ZZ$ and the matrix $A_X\circ \ad (X)$ depends only on $\nu,$ as in~\eqref{eq:uslov}. With respect to the same decomposition write the matrix of $\JJ$ in the form \begin{align} \label{eq:Jblokzapis} \JJ = \begin{pmatrix} J_1 & J_2 \\ J_3 & J_4 \end{pmatrix}. \end{align} The condition~\eqref{eq:complexAd} is now equivalent to the following matrix equations: \begin{align*} & J_2 A_\nu J_2 = 0, & &J_2A_{J_1\nu + J_2 \zeta} + J_2 A_\nu J_1 = 0,&\\ & A_{J_1\nu + J_2\zeta}J_2- J_4A_\nu J_2 = 0, & &A_\nu + J_4A_{J_1\nu + J_2 \zeta} + J_4 A_\nu J_1 - A_{J_1\nu + J_2\zeta}J_1 = 0,& \end{align*} for all $\nu \in \RR ^{2n}\oplus \ZZ^*, \zeta \in \RR ^{*2n}\oplus \ZZ.$ Careful analysis of these equations yields the following solution \begin{align} \label{eq:usloviN} J_1 = \begin{pmatrix} \varepsilon J & 0 \\ 0 & n_1 \end{pmatrix}, \quad J_2 = \begin{pmatrix} 0 & 0 \\ 0 & n_2 \end{pmatrix}, \quad J_3 = \begin{pmatrix} \bar J_3 & k_3 \\ m_3^\t & n_3 \end{pmatrix}, \quad J_4 = \begin{pmatrix} \varepsilon J & 0 \\ 0 & 0 \end{pmatrix}, \end{align} with $\varepsilon = \pm 1, \, n_1, n_2, n_3 \in \RR, \, k_3, m_3 \in \RR^{2n}, \, \bar J_3 \in M_{2n}(\RR).$ If we apply condition $\JJ ^2 = - Id$, we obtain \begin{align} \label{eq:usloviJ2} m_3 = k_3 = 0, \quad n_1 = 0, \quad n_3 = -\frac{1}{n_2}, \quad \bar J_3 J + J \bar J_3 = 0. \end{align} Now, we apply the automorphism $F$ of the form~\eqref{eq:autoF}-\eqref{eq:autoF1} with \begin{align*} \bar F_1 = J,\enskip u_1 = v_1 = 0,\enskip f_1 = n_2, f_4 = \varepsilon, \enskip F_3 = \begin{pmatrix} \frac{\bar J_3}{2} & 0 \\ 0 & 0 \end{pmatrix}, \end{align*} to the structure $\JJ$ of the form~\eqref{eq:Jblokzapis} and~\eqref{eq:usloviN} satisfying~\eqref{eq:usloviJ2}, and obtain \begin{align*} F^{-1} \JJ F = \varepsilon \JJ _0, \quad \varepsilon = \pm 1, \end{align*} as in the statement of the theorem. \end{proof} Complex structure $\JJ$ is said to be \emph{Hermitian} if it preserves the metric: \begin{align*} \langle \JJ u, \JJ v\rangle=\langle u, v\rangle, \enskip u, v\in\gg. \end{align*} In the fixed basis where $\JJ_0$ has the form~\eqref{eq:complex}, the direct computation shows that the following lemma holds. \begin{lemma}\label{le:herm} For the Hermitian complex structure $\JJ_0$ the corresponding Riemannian metric is given by~\eqref{eq:metrike} with $\omega_4 = 1$ and $\bar S_4$ being positive definite matrix of dimension $2n\times 2n$ satisfying \mbox{$(\bar S_4)_{i(n+i)} = 0$,} $i=1,\dots n$, and $J\bar S_4=\bar S_4 J$. \end{lemma} Now, we describe all $\JJ _0$-invariant closed 2-forms on the Lie algebra $\gg= \thn$. In Section~\ref{sec:prelim} we introduced the standard basis of Lie algebra $\thn$: \begin{align*} e_1, \dots , e_n, f_1, \dots , f_n, z^*, e_1^*, \dots , e_n^*, f_1^*, \dots , f_n^*, z. \end{align*} Denote the dual basis on $\gg ^* = ({\thn})^*$ by \begin{align}\label{eq:formebaza} e^1, \dots , e^n, f^1, \dots , f^n, \zeta ^*, e^1_*, \dots , e^n_*, f^1_*, \dots , f^n_*, \zeta. \end{align} \begin{theorem}\label{th:forme} All $\JJ _0$ invariant closed 2-forms on $\thn$, $(n>1)$ are of the form \begin{align}\label{eq:forme} \Omega =\, & A^1_{ij}(e^i\wedge e^j + f^i\wedge f^j ) + A^2_{ij} e^i\wedge f^j + K_{ij}(e^i\wedge e^j_* + f^i\wedge f^j_*) \nonumber\\ & + d_i\, e^i\wedge f^i_* - \frac{\mu}{2} (e^i\wedge e^i_* + f^i\wedge f^i_*) + \mu \, \zeta ^* \wedge \zeta, \end{align} where $A^1_{ij} = - A^1_{ji}$, $A^2_{ij} = A^2_{ji}$, $K_{ij} = -K_{ji}$, $d_i\in \RR$, $\mu \in \RR$ and summation is assumed over repeated indices. The dimension of the space of such forms is $\frac{3n^2 + n + 2}{2}$, $n>1.$ \end{theorem} \begin{proof} The commutators~\eqref{eq:thnkom2} can be written in the form \begin{align*} de^i &=0, \enskip d f^i =0, & d\zeta ^* &= 0, & &\\ de^i_* &= f^i\wedge \zeta ^*, & df^i_* &= -e^i\wedge \zeta ^*, & d\zeta &= e^i\wedge f^i. \end{align*} The proof is by straightforward computation and will be omitted. Start from the general 2-form $\Omega$ over the basis~\eqref{eq:formebaza}. Impose the condition~\eqref{eq:Jinvariant} for complex structure $\JJ = \JJ _0$ given by~\eqref{eq:complex}. Finally, the condition $d\Omega =0$ bring us to the form~\eqref{eq:forme}. \end{proof} \begin{remark}\label{re:forme} For $n=1$, i.e. in case of 6-dimensional Lie algebra $T^*\mathfrak{h}_{3}$ the result is obtained in~\cite{SVB}. The dimension of $\JJ$-invariant closed 2-forms is five. Such forms has general for~\eqref{eq:forme} with additional terms \begin{align*} a_1(e^1\wedge \zeta ^* - f^1\wedge \zeta) + a_2(f^1\wedge \zeta ^* + e^1\wedge \zeta),\enskip a_1, a_2\in \RR. \end{align*} These terms come from a different decomposition of the space of 3-forms in basis~\eqref{eq:formebaza}. \end{remark} As noted in the Introduction, the complex structure $\JJ_0$ is not abelian, hence the Hermitian metric from Lemma~\ref{le:herm} cannot be pseudo-K\"{a}hler (see~\cite[Theorem A]{Benson} and~\cite{CFG}). However, we show that there exists a family of Ricci-flat pseudo-K\"{a}hler metrics. \begin{theorem}\label{th:pseudoK} The Lie algebra $\thn$ admits Ricci-flat pseudo-K\"{a}hler metrics that are not flat. Every pseudo-K\"{a}hler metric on $\thn$ is equivalent to $S=-\JJ _0\Omega$, where $\JJ _0$ is complex structure~\eqref{eq:complex} and $\Omega$ is symplectic form given by~\eqref{eq:forme}. \end{theorem} \begin{proof} The form of the pseudo-K\"{a}hler metric follows directly from~\eqref{eq:herm}. Since, we have already fixed the basis in a way that the complex form $\JJ$ takes the form~\eqref{eq:complex}, the choice of automorphisms preserving $\JJ_0$ is quite restricted. The obtained simplification is insignificant comparing to the difficult notation required, hence we choose not to perform it. Next, we need to examine the curvature properties of those metrics. The Ricci tensor $\rho$ on the nilpotent Lie group can be expressed in terms of operators $\ad$ and $\ad^*$: \begin{align*} \rho(u,v) = -\frac{1}{4}\tr(j_u\circ j_v)-\frac{1}{2}\tr(\ad_u\circ\ad^*_v), \end{align*} where $j_u v=\ad^*_v u$ for arbitrary left invariant vector fields $u, v$. By direct calculation we get that both summands are equal to zero, hence the metric is Ricci-flat. Now, the only thing left is to show that at least one component of curvature tensor $R$ is non-zero. For example, long, but straightforward computation gives us that $R(e_1, f_1)$ contains non-trivial components. \end{proof} \begin{thank} This research was supported by the Science Fund of the Republic of Serbia, Grant No. 7744592, Integrability and Extremal Problems in Mechanics, Geometry and Combinatorics - MEGIC. \end{thank}
3cfe5f9fcfad97321b573bfcdf2af6483fbfee57
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{System Identification} \label{sec:SysID} In the following, we assume that the model parameters are unknown and need to be identified. To this end, we apply some probing input signal $u_{[0,T-1]}$ over a time period $T\in\mathbb{I}_{\geq 1}$ to the system~\eqref{eq:sys_state} and obtain noisy state measurements $\tilde{x}_k=x_k+\epsilon_k$, $k\in\mathbb{I}_{[0,T]}$ with i.i.d. noise $\epsilon_k\sim\mathcal{N}(0,\Sigma_\epsilon)$. Generalizations to noisy output measurements are discussed in Section~\ref{sec:data_driven_3}). We assume that the matrices characterizing the variance of the disturbances, i.e., $\Sigma_{\mathrm{w}},\Sigma_\epsilon,E,G_{\mathrm{w}}$, are known. First, we focus on the identification of a multi-step predictor (Sec.~\ref{sec:SysID_1}). Then, we consider the special case of state space models (Sec.~\ref{sec:SysID_2}) and contrast the results (Sec.~\ref{sec:SysID_3}). \subsection{Multi-step predictors} \label{sec:SysID_1} As noted early~\cite{favoreel1999spc}, subspace identification computes the matrices $G_{\mathrm{u}}$, $G_0$ as intermediate quantities and hence there is no need to identify a state space model. The direct identification of the multi-step predictor~\eqref{eq:model_convoluted_split} can be written as a linear regression problem with the parameters $\theta_k:=\vec{[G_{0,k},G_{\mathrm{u},k}]}\in\mathbb{R}^{n^2+nkm}$. The following lemma provides an MLE to identify each predictor $\theta_k$ individually. \begin{lemma} \label{lemma:id_correlated} Suppose we have a uniform prior over the parameters $\theta_k$. Consider the noisy regressor $\tilde{\Phi}^k_j:=[\tilde{x}_j^\top,u_{[j,j+k-1]}^\top]\otimes I_n\in\mathbb{R}^{n\times nkm+n^2}$, the covariance matrix $\tilde{\Sigma}_{\mathrm{w,corr},k}$ according to~\eqref{eq:Sigma_corr_conv} below, and suppose that $\Sigma_{\theta,k}^{-1}:=\tilde{\Phi}^{k,\top}_{[0,T-k]}\tilde{\Sigma}_{\mathrm{w,corr},k}^{-1}\tilde{\Phi}^k_{[0,T-k]}\succ 0$.\footnote{% In case $\tilde{\Sigma}_{\mathrm{w,corr},k}$ is singular, the identification problem should be projected on the corresponding subspace.} Then, for any $\delta\in(0,1)$, we have $\prob{\theta_k-\hat{\theta}_k\in\Theta_{\delta,k}}\geq \delta$ with \begin{align} \label{eq:ellipse} \Theta_{\delta,k}=\{\theta|~\theta^\top \Sigma_{\theta,k}^{-1}\theta\leq \chi^2_{nkm+n^2}(\delta)\}, \end{align} and the weighted least-squares estimate \begin{align} \label{eq:LS_corr} \hat{\theta}_k:=&\arg\min_{\theta}\|\tilde{x}_{[k,T]}-\tilde{\Phi}^k_{[0,T-k]}\theta\|_{\tilde{\Sigma}_{\mathrm{w,corr},k}^{-1}}^2\\ =&\Sigma_{\theta,k}\tilde{\Phi}^{k,\top}_{[0,T-k]}\tilde{\Sigma}_{\mathrm{w,corr},k}^{-1}\tilde{x}_{[k,T]}.\nonumber \end{align} \end{lemma} \begin{proof} This result is inspired by the MLE in~\cite[Lemma 3.1]{umenberger2019robust} and classical techniques to account for correlated data~\cite[Sec.~5]{aastrom1971system}. Following the steps in~\cite[A.1.1]{umenberger2019robust}, the dynamics~\eqref{eq:model_convoluted_split} satisfy $x_{j+k}=\Phi^k_j\theta_k+G_{\mathrm{w},k}w_{[j,j+k-1]}$ with the regressor $\Phi^k_j=[x_j^\top,u_{[j,j+k-1]}^\top]\otimes I_n$. Given the noisy state $\tilde{x}_{k+j}=x_{k+j}+\epsilon_{k+j}$ and regressor $\tilde{\Phi}^k_j=\Phi^k_j+[\epsilon_j^\top,0_{1\times km}]\otimes I_n$, we have $\tilde{x}_{k+j}=\tilde{\Phi}^k_j\theta_k+\tilde{w}^k_j$, with the residual $\tilde{w}^k_j=G_{\mathrm{w},k}w_{[j,j+k-1]}-G_{0,k}\epsilon_j+\epsilon_{k+j}$. By stacking these regression equations we get $\tilde{x}_{[k,T]}=\tilde{\Phi}^k_{[0,T-k]}\theta_k+\tilde{w}_{[0,T-k]}$. The residual $\tilde{w}_{[0,T-k]}$ is a linear combination of independent Gaussian variables $w_k$, $\epsilon_k$ and hence also follows a Gaussian distribution, i.e., $\tilde{w}_{[0,T-k]}\sim\mathcal{N}(0,\tilde{\Sigma}_{\mathrm{w,corr},k})$, with covariance $\tilde{\Sigma}_{\mathrm{w,corr},k}=\expect{\tilde{w}^k_{[0,T-k]}\tilde{w}_{[0,T-k]}^{k,\top}}$. The matrix $\Sigma_{\mathrm{w,corr},k}$ is a band-diagonal matrix with the elements \begin{align} \label{eq:Sigma_corr_conv} \expect{\tilde{w}^k_j\tilde{w}^{k,\top}_j}=&G_{\mathrm{w},k}\mathrm{diag}_k(\Sigma_{\mathrm{w}})G_{\mathrm{w},k}^\top+G_{0,k}\Sigma_{\epsilon}G_{0,k}^\top+\Sigma_\epsilon,\nonumber\\ \expect{\tilde{w}^k_j\tilde{w}^{k,\top}_{i+j}}= G_{\mathrm{w},k}\begin{bmatrix} 0_{i\cdot q\times (k-i)q}&0_{i\cdot q\times i\cdot q}\\ \mathrm{diag}_{k-i}(\Sigma_{\mathrm{w}})&0_{(k-i)q\times iq} \end{bmatrix}G_{\mathrm{w},k}^\top,\nonumber\\ &i\in\mathbb{I}_{[1,k-1]},\nonumber\\ \expect{\tilde{w}^k_j\tilde{w}^{k,\top}_{j+k}}=&- \Sigma_\epsilon G_{0,k}^\top,~ \expect{\tilde{w}^k_j\tilde{w}^{k,\top}_{j+i}}=0_q,~ i>k. \end{align} The likelihood is given by \begin{align*} &\prob{\tilde{w}^k_{[0,T-k]}=\tilde{x}_{[k,T]}-\tilde{\Phi}^k_{[k,T-k]}\theta_k}\\ \propto& \exp\left[-\dfrac{1}{2}\|\tilde{x}_{[k,T]}-\tilde{\Phi}^k_{[0,T-k]}\theta_k\|_{\tilde{\Sigma}_{\mathrm{w,corr},k}^{-1}}^2\right]\\ \stackrel{\eqref{eq:LS_corr}}{\propto}&\exp\left[-\dfrac{1}{2}\|\theta_k-\hat{\theta}_k\|_{\tilde{\Sigma}_{\theta,k}^{-1}}^2\right], \end{align*} and hence the weighted least-squares estimate~\eqref{eq:LS_corr} yields the MLE. The uniform prior over $\theta_k$ ensures that the posterior distribution is proportional to the likelihood (cf.~\cite[Equ.~(18)]{umenberger2019robust}) and hence $\theta_k\sim\mathcal{N}(\hat{\theta}_k,\Sigma_{\theta,k})$. The set~\eqref{eq:ellipse} follows from the multivariate Gaussian distribution. \end{proof} This result provides a simple identification method in terms of a weighted least-squares estimate and provides a high-probability bound on the parameter error {$\tilde{\theta}_k:=\theta_k-\hat{\theta}_k$}. However, to directly apply the result we need to know the covariance matrix $\tilde{\Sigma}_{\mathrm{w,corr},k}$, which explicitly depends on $G_{0,k}$, i.e., the impulse response to be identified. This is comparable to the \textit{generalized least-squares} method, where the correlation information is used to filter the data prior to applying the least-squares estimate (cf.~\cite[Sec.~5]{aastrom1971system}). As this information is typically not known (exactly) a-priori, the corresponding parameters can be jointly optimized in the MLE, resulting in a highly nonlinear optimization problem, which can be solved using the \textit{expectation-maximisation} technique~\cite{gibson2005robust}. Note that neglecting this correlation results in a bias in the least-squares estimate, compare also the overview on linear system identification~\cite[Sec.~5]{aastrom1971system}. For long predictions $k\gg 1$, this result simplifies if we have only measurement noise $\epsilon_k$ and no disturbances $w_k$. In this case, the covariance $\Sigma_{\mathrm{w,corr}}$ has only two off-diagonal terms corresponding to $-\Sigma_{\epsilon}G_{0,k}$. For open-loop stable systems, we have $\lim_{k\rightarrow\infty}\|G_{0,k}\|=0$ or in case of FIR models we directly have $G_0=0$. Hence, in case of open-loop systems without additive disturbances, the bias of a simple least-squares estimation tends to zero for $k\rightarrow\infty$. \subsection{State space model} \label{sec:SysID_2} Note that $\theta_1=\vec{[G_{0,1},G_{\mathrm{u},1}]}=\vec{[A,B]}\in\mathbb{R}^{n(n+m)}$, i.e., the MLE in Lemma~\ref{lemma:id_correlated} also covers the state space problem as a special case. Specifically, in this case the structure of the corresponding covariance matrix simplifies with $\tilde{\Sigma}_{\mathrm{w}}=E\Sigma_{\mathrm{w}}E^\top+\Sigma_\epsilon+A\Sigma_\epsilon A^\top$ and \begin{align} \label{eq:Sigma_corr_state} \tilde{\Sigma}_{\mathrm{w,corr},1}:= \begin{bmatrix} \tilde{\Sigma}_{\mathrm{w}}&-\Sigma_{\epsilon}A^\top&0_{n\times n(T-2)}\\ -A\Sigma_{\epsilon}&\tilde{\Sigma}_{\mathrm{w}}&\ddots\\ 0_{n(T-2)\times n}&\ddots&\ddots\\ \end{bmatrix}, \end{align} The following corollary shows that we can use a simple least-squares estimate for state space models if we assume noise-free state measurements. \begin{corollary} \label{cor:id_state} Suppose we have a uniform prior over the parameters $\theta_1$ and noise-free measurements ($\Sigma_{\epsilon}=0$). Consider the regressor $\Phi_k^1=[x_k^\top,u_k^\top]\otimes I_n\in\mathbb{R}^{n(n+m)}$ and suppose $\Sigma_{\theta,1}^{-1}=\sum_{k=0}^{T-1}\Phi_k^{1,\top} \tilde{\Sigma}_{\mathrm{w}}^{-1}\Phi^1_k\succ 0$ with $\tilde{\Sigma}_{\mathrm{w}}:=E\Sigma_{\mathrm{w}}E^\top$. Then, for any $\delta\in(0,1)$, we have $\prob{\theta_1-\hat{\theta}_1\in\Theta_{\delta,1}}\geq \delta$ with $\Theta_{\delta,1}$ according to~\eqref{eq:ellipse} and the least-squares estimate \begin{align} \label{eq:LS_noiseFree} \hat{\theta}_1=\arg\min_{\theta}\sum_{k=0}^{T-1}\|{x}_{k+1}-\Phi^1_k\theta\|_{\tilde{\Sigma}_{\mathrm{w}}^{-1}}^2. \end{align} \end{corollary} \begin{proof} For $\Sigma_{\epsilon}=0$, the matrix $\tilde{\Sigma}_{\mathrm{w,corr},1}$ is block-diagonal with elements $\tilde{\Sigma}_{\mathrm{w}}$. Hence, the least-squares estimate and the covariance matrix can be equivalently written as a sum. \end{proof} This result essentially recovers the MLE bounds from~\cite[Prop.~2.1]{umenberger2019robust}. The ellipsoidal bound on the parameters $\theta$ also implies an ellipsoidal bound on the system matrices (cf.~\cite[Lemma.~3.1]{umenberger2019robust}), which may be easier to use for robust control. \subsection{Discussion} \label{sec:SysID_3} We formulated the identification problem as an MLE with a weighted least-squares estimate, resulting in a (high-probability) bound on the parameter error. However, the presented bounds and estimates can only be applied if the correlation in the disturbances is known. In general, a joint identification of the parameters and this covariance matrix is needed, which results in a nonlinear problem (cf.~{\cite[Sec.~5]{aastrom1971system}), which can be solved using \textit{expectation-maximisation}~\cite{gibson2005robust}. \subsubsection*{Scalability, conditioning, prior} A crucial difference between the two parametrizations is the number of required parameters. In particular, for the state space model we have $\theta\in\mathbb{R}^{n^2+nm}$ and the parameters often directly relate to physical quantities (e.g., damping constant). This allows for a meaningful integration of priors on the parameters, which can reduce the sample complexity. On the other hand, directly identifying a multi-step predictor requires $\theta_k\in\mathbb{R}^{nmk+n^2}$, i.e., the number of parameters scales linearly with the horizon $k$. This issue can be relaxed by considering truncated FIR models (cf.~\cite{lundstrom1995limitations}, \cite[App.~A]{tanaskovic2014adaptive}) or structured parametrizations using OBF~\cite{heuberger1995generalized}. Multi-step predictors allow to naturally impose general open-loop stability priors, e.g., in terms of over-shoot constants and decay rates (without specifying a Lyapunov function). Hence, in case of unstable/marginally-stable systems or physical priors on model parameters, identifying a state space model has benefits. On the other hand, the direct identification of multi-step predictors allows to encode priors in terms of open-loop stability. For long horizons, multi-step predictors can provide better accuracy (cf.~\cite{shook1991identification}, \cite[Thm.~1]{terzi2022robust}) at the cost of an increased complexity. \subsubsection*{Impact of noise or disturbances on identification} The state space identification problem becomes simpler if we assume noise-free state measurements (cf. Cor.~\ref{cor:id_state}). On the other hand, the identification of multi-step predictors (Lemma~\ref{lemma:id_correlated}) for long horizons ($k\gg 1$) simplifies if only measurement noise is present. For comparison, early MPC approaches based on impulse responses, e.g. dynamic matrix control~\cite{cutler1980dynamic}, are restricted to "disturbances on the output"~\cite{lundstrom1995limitations}. OBFs~\cite{heuberger1995generalized}, a structured parametrization of~\eqref{eq:model_convoluted}, also allow for a simple identification under measurement noise~\cite{heirung2017dual,soloperto2019dual}. The identification of multi-step predictors is also related to the (implicit) data-driven models based on Hankel matrices~\cite{coulson2021distributionally,berberich2020data,dorfler2021bridging,huang2021robust,yin2021maximum,yin2021data,iannelli2021experiment}, which typically also consider noisy output measurements without disturbances. A corresponding MLE with an ellipsoidal confidence bound was recently derived in~\cite{yin2021maximum,yin2021data}, which is also applicable to unbiased impulse response estimation~\cite[Sec.~6]{yin2021maximum}. In particular, this approach also considers only output measurement noise without disturbances, the MLE is nonlinear including non-diagonal weights to account for cross correlation, which require prior knowledge of $G_{0,k}$. In~\cite[Sec.~3.4]{furieri2021near}, a multi-step predictor~\eqref{eq:model_convoluted} subject to both noisy measurements and disturbances is identified using simple a least-squares estimate or the MLE~\cite{yin2021maximum}, however, without deriving corresponding error bounds. We note that by using non-overlapping data-segments (structured in a page matrix), the cross correlation in Lemma~\ref{lemma:id_correlated} can be removed. For the special case of state space models, this corresponds to skipping every second measurement. In both parametrizations, the resulting uncorrelated residuals allow for a simple least-squares estimate. \subsubsection*{Robust identification methods} The challenge inherent in MLE with correlated disturbances can also be avoided by considering \textit{robust} identification methods. In particular, given a compact bound on the disturbances, set-membership estimation can be used to identify the \textit{non-falsified} set that contains the true parameters, which is frequently used in robust adaptive MPC formulations~\cite{tanaskovic2014adaptive,terzi2019learning,terzi2022robust,lorenzen2019robust,lu2021robust,Koehler2019Adaptive}. In particular, the approaches in~\cite[Sec.~5.4]{lu2021robust} and \cite{terzi2019learning} are applicable to both noisy measurements and disturbances; \cite[Cor.~3]{lu2021robust} provides convergence results for fixed complexity estimates; and \textit{multi-step predictors}~\eqref{eq:model_convoluted_split} are explicitly considered in~\cite{terzi2019learning,terzi2022robust}. Note that most of the discussion in this paper regarding predictive control based on multi-step predictors equally applies to such a robust setup. \subsubsection*{Input experiment design} The derived estimation bounds are such that collecting more (informative) data reduces the parametric uncertainty. A related problem is choosing the probing input signal $u_{[0,T-1]}$, which is studied in dual control or optimal experiment design. Given, e.g., Corollary~\ref{cor:id_state}, a natural approach is to ensure a lower bound on the persistence of excitation, i.e., $\sum_{k=0}^{T-1} \Phi_k^\top \tilde{\Sigma}_{\mathrm{w}}^{-1}\Phi_k\succeq \beta I$, given a rough model description. This issue is, e.g., addressed in~\cite{umenberger2019robust,lu2021robust}, which introduce conservatism due to convex relaxations, and only obtain approximations~\cite{umenberger2019robust} or require more complex robust propagation methods~\cite[Sec~3.4]{lu2021robust}. On the other hand, if the problem is addressed for multi-step predictors~\eqref{eq:model_convoluted} with only measurement noise, the variance can be deterministically predicted, which is, e.g., exploited in~\cite{heirung2017dual,soloperto2019dual,iannelli2021experiment}. \section{Introduction} \label{sec:intro} Model predictive control (MPC) is an optimization-based control strategy, which is applicable to general MIMO systems and directly accounts for state and input constraints~\cite{rawlings2017model}. Typically, first a parametric prediction model is identified. In addition to noise and disturbances, the resulting parametric error then needs to be considered to ensure satisfaction of safety critical constraints. In this paper, we study data-driven predictive control problems using two different model parametrizations: state space models and \textit{multi-step predictors}, i.e., models that skip the sequential state propagation and directly predict $k$-steps into the future. \subsubsection*{Related work} Historically, MPC emerged from the process control industry using impulse/step response models, which are simple to identify/adapt~\cite{richalet1978model,cutler1980dynamic}. These approaches have early been extended to robustly account for the parametric uncertainty of such finite impulse response (FIR) models~\cite{zheng1993robust}. However, the underlying assumptions result in intrinsic limitations~\cite{lundstrom1995limitations}, and hence, over the last three decades, state space models have become the de facto standard in (theoretical) research on MPC~\cite{mayne2000constrained,kouvaritakis2016model,rawlings2017model}. A variety of results are available to ensure robustness w.r.t. parametric uncertainty in state space models by using \textit{tube-based} approaches~\cite{primbs2009stochastic,fleming2014robust,lorenzen2019robust,Koehler2019Adaptive,lu2021robust,kouvaritakis2016model,schwenkel2021model}. More recently, a number of predictive control approaches have been proposed that directly exploit \textit{multi-step predictors}, as also done in early MPC approaches~\cite{richalet1978model,cutler1980dynamic,zheng1993robust}: \begin{itemize} \item dual/adaptive MPC using FIR models or more general orthonormal basis functions (OBFs~\cite{heuberger1995generalized}) in~\cite{tanaskovic2014adaptive,heirung2017dual,soloperto2019dual}; \item \textit{data-driven/enabled predictive control} based on an implicit model characterization using Hankel matrices~\cite{berberich2020data,coulson2021distributionally,huang2021robust,dorfler2021bridging}, compare also~\cite{yin2021maximum,yin2021data,iannelli2021experiment}; \item set-membership estimation for multi-step predictors in MPC~\cite{terzi2019learning,lauricella2020data,terzi2022robust}; \item feedback optimization in MPC using \textit{system responses}~\cite{chen2020robust,furieri2021near}, compare also~\cite{bujarbaruah2020robust}; \item nonlinear MPC using parametric~\cite{gruber2013computationally,genecili1995design} and non-parametric~\cite{maddalena2021kpc,thorpe2022data} multi-step predictors. \end{itemize} The main commonality is that multi-step predictors allow for simple bounds on the prediction error, compare Section~\ref{sec:data_driven_4} for a more detailed discussion of the individual approaches. More generally, forecasting problems (e.g., based on machine learning) are similarly divided between \textit{sequential/recursive} strategies and \textit{direct/independent} strategies~\cite{taieb2012review}. \subsubsection*{Contribution} We consider a stochastic optimal control problem for linear systems, as typically arising in MPC, and provide a tutorial-style exposition based on state space models and multi-step predictors, respectively.\footnote{% Although MPC relies on a receding horizon implementation, we initially focus on the open-loop problem to simplify the exposition. Closed-loop implementations with corresponding caveats are discussed in Section~\ref{sec:data_driven_3}.} First, we reformulate this problem as equivalent quadratic programs (QPs) for both parametrizations (Sec.~\ref{sec:problem}). Then, we use a maximum likelihood estimate (MLE) for the system identification (Sec.~\ref{sec:SysID}). Finally, we study the stochastic optimal control problem with uncertain parameter estimates and derive a novel data-driven stochastic MPC formulation (Sec.~\ref{sec:data_driven}). Therein, we demonstrate that multi-step predictors allow for a simpler (partially tight) reformulation to account for the parametric uncertainty. On the other hand, accounting for parametric uncertainty in state space models typically requires a \textit{sequential propagation}~\cite{primbs2009stochastic,fleming2014robust,lorenzen2019robust,Koehler2019Adaptive,lu2021robust,kouvaritakis2016model}, which can result in significant conservatism. Throughout the paper, we provide extensive discussions on the advantages and limitations of the two parametrizations (Sec.~\ref{sec:problem_4}, \ref{sec:SysID_3}, \ref{sec:data_driven_3}), and the relation to existing work (Sec.~\ref{sec:data_driven_4}). \IEEEpubidadjcol \subsubsection*{Notation} The probability of an event $A$ and the expected value of a random variable $x$ are denoted by $\prob{A}$ and $\expect{x}$, respectively. We denote a variable $w$ with Gaussian distribution with mean $\mu$ and variance $\Sigma$ by $w\sim\mathcal{N}(\mu,\Sigma)$. The quantile function of the chi-squared distribution with $n$ degrees of freedoms is given by $\chi_n^2(p)$ with probability $p\in[0,1]$. The set of integers in the interval $[a,b]\subseteq\mathbb{R}$ is denoted by $\mathbb{I}_{[a,b]}$. For a sequence of matrices $x_t\in\mathbb{R}^{n\times m}$, $t\in\mathbb{I}_{[t_1,t_2]}$, $t_1,t_2\in\mathbb{I}_{\geq 0}$, we denote the stacked matrix by $x_{[t_1,t_2]}\in\mathbb{R}^{n(t_2+1-t_1)\times m}$. The trace of a square matrix $A$ is denoted by $\tr{A}$. By $\vec{A}\in\mathbb{R}^{nm}$ we denote a vector that stacks the columns of the matrix $A\in\mathbb{R}^{n\times m}$. The Kronecker product is denoted by $\otimes$. The identity matrix is given by $I_n\in\mathbb{R}^{n\times n}$ and a matrix of zeros by $0_{n\times m}\in\mathbb{R}^{n\times m}$. We denote a block-diagonal matrix with square matrices $A\in\mathbb{R}^{n\times n}$ on its block-diagonal by $\mathrm{diag}_k(A)\in\mathbb{R}^{kn\times kn}$, $k\in\mathbb{I}_{\geq 0}$. Positive definiteness of a matrix $Q$ is denoted by $Q\succ 0$. We denote the symmetric matrix square-root by $A^{1/2}$ for $A\succ 0$. We write $\|x\|_Q^2=x^\top Q x$ for $Q\succ 0$. \section{Data-driven predictive control with parametric uncertainty} \label{sec:data_driven} In the following, we revisit the stochastic optimal control problem (Sec.~\ref{sec:problem}) given the uncertain parameter estimates (Sec.~\ref{sec:SysID}). To this end, we use the concept of \textit{robustness in probability}, i.e., we consider $\tilde{\theta}_k\in\Theta_{\delta,k}$, $\delta>p$ (Lemma~\ref{lemma:id_correlated}) robustly and enforce the chance constraints~\eqref{eq:chance_constraints} with a larger probability $\tilde{p}=p/\delta\in(p,1)$ (cf. \cite[Lemma~V.3]{wabersich2021probabilistic}). We first focus on the state space model (Sec.~\ref{sec:data_driven_1}) and then the multi-step predictors (Sec.~\ref{sec:data_driven_2}). Finally, we discuss related work (Sec.~\ref{sec:data_driven_4}) and contrast the results (Sec.~\ref{sec:data_driven_3}). \subsection{State space model} \label{sec:data_driven_1} The predicted states are Gaussian ${x}_k\sim\mathcal{N}(\overline{x}_k,\Sigma_{\mathrm{x},k})$ (Sec.~\ref{sec:problem}), however, $\overline{x}_k$ and $\Sigma_{\mathrm{x},k}$ depend on the uncertain parameters $\theta_1=\vec{[A,B]}$. Conceptually, we can solve Problem~\eqref{eq:stoch_opt} using the following problem \begin{align} \label{eq:stoch_opt_robust} &\min_{u_{[0,N-1]}\in\mathbb{U}^N}\max_{\tilde{\theta}_1\in\Theta_{\delta,1}}\sum_{k=0}^{N-1}\|\overline{x}_{k+1}\|_Q^2+\|u_k\|_R^2+\tr{Q\Sigma_{\mathrm{x},k+1}}\nonumber\\ \text{s.t. }&H_{\mathrm{x},j}^\top\overline{x}_k\leq 1-c_{\tilde{p}}\|H_{\mathrm{x},j}\|_{\Sigma_{\mathrm{x},k}}, j\in\mathbb{I}_{[1,r]},k\in\mathbb{I}_{[0,N]},\\ &\Sigma_{\mathrm{x},k+1}=A \Sigma_{\mathrm{x},k}A^\top+E\Sigma_{\mathrm{w}}E^\top,~ k\in\mathbb{I}_{[0,N-1]},~\tilde{\theta}_1\in\Theta_{1,\delta},\nonumber\\ &\overline{x}_{k+1}=A\overline{x}_k+Bu_k,~k\in\mathbb{I}_{[0,N-1]},~\tilde{\theta}_1\in\Theta_{1,\delta},\nonumber \end{align} with $c_{\tilde{p}}:=\sqrt{\chi_1^2(2\tilde{p}-1)}$. This deterministic $\min-\max$ problem is a non-conservative solution to Problem~\eqref{eq:stoch_opt}, given $\prob{\tilde{\theta}_1\in\Theta_{1,\delta}}\geq \delta$. However, $\Sigma_{\mathrm{x},k}$ and $\overline{x}_k$ are highly nonlinear in $\tilde{\theta}_1$ and the problem is in general intractable. We briefly mention standard approaches from the MPC literature to compute a feasible (but suboptimal) solution to~\eqref{eq:stoch_opt_robust}. By ignoring the time-invariance of $\theta$, an upper bound for $\Sigma_{\mathrm{x},k}$ can be computed offline(!) using semi-definite programs (SDP), compare, e.g., \cite[Lemma~4.1, Thm.~4.2]{umenberger2019robust}, \cite{primbs2009stochastic}. Determining the reachable set for the mean $\overline{x}_k$ is addressed in tube-based MPC formulations for multiplicative/parametric uncertainty~\cite{primbs2009stochastic,fleming2014robust,lorenzen2019robust,Koehler2019Adaptive,lu2021robust}, \cite[Sec.~5.5]{kouvaritakis2016model}. These approaches use a fixed parametrization (polytopes/ellipses) and provide sufficient conditions for an over-approximation of the reachable set. The size of this "tube/funnel" depends on the nominal input $u_{[0,N-1]}$ and is computed by adding linear/conic constraints over the prediction horizon. \subsection{Multi-step predictors} \label{sec:data_driven_2} The following lemma shows how to enforce the chance constraints~\eqref{eq:chance_constraints} despite the parametric uncertainty. \begin{lemma} \label{lemma:convoluted_robust} Suppose the conditions in Lemma~\ref{lemma:id_correlated} hold and the input sequence $u_{[0,k-1]}$ satisfies \begin{align} \label{eq:convoluted_tightening} &H_{\mathrm{x},j}^\top(\hat{G}_{0,k}\overline{x}_0+\hat{G}_{\mathrm{u},k}u_{[0,k-1]})+c_{\tilde{p}}\overline{h}_{j,k}\\ &+\sqrt{\chi^2_{nkm+n^2}(\delta)}\left\|\Sigma_{\theta,k}^{1/2}\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix}\otimes H_{\mathrm{x},j}\right\|\leq 1,~j\in\mathbb{I}_{[1,r]},\nonumber \end{align} with $\overline{h}_{j,k}$ according to~\eqref{eq:convoluted_tightening_constant} below. Then, the chance constraints~\eqref{eq:chance_constraints} hold. \end{lemma} \begin{proof} Define $\mathrm{vec}([\tilde{G}_{0,k},\tilde{G}_{u,k}])=\tilde{\theta}_k$. Given that $\prob{\tilde{\theta}_k\in\Theta_{\delta,k}}\geq \delta$ is independent of $w_{[0,N-1]}$, $x_0$, the chance constraints~\eqref{eq:chance_constraints} hold if \begin{align} H_{\mathrm{x},j}^\top\begin{bmatrix}G_{0,k},G_{u,k}\end{bmatrix}\begin{bmatrix}\overline{x}_0\\u_{[0,k-1]}\end{bmatrix}+c_{\tilde{p}}\|H_{\mathrm{x},j}\|_{\Sigma_{\mathrm{x},k}}\leq 1, \end{align} for all $\tilde{\theta}_k\in\Theta_{\delta,k}$, $j\in\mathbb{I}_{[1,r]}$ with $\Sigma_{\mathrm{x},k}=G_{\mathrm{w},k} \mathrm{diag}_k(\Sigma_{\mathrm{w}})G_{\mathrm{w},k}^\top+G_{0,k}\Sigma_{\mathrm{x},0}G_{0,k}^\top$. For the mean trajectory $\overline{x}_k$, the properties of the Kronecker product yield \begin{align*} &H_{\mathrm{x},j}^\top[\tilde{G}_{0,k},\tilde{G}_{u,k}]\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix} =\left(\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix}^\top\otimes H_{\mathrm{x},j}^\top\right)\tilde{\theta}_k\\ \leq &\left\|\left(\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix}^\top \otimes H_{\mathrm{x},j}^\top\right)\Sigma_{\theta,k}^{1/2}\right\|\|\Sigma_{\theta,k}^{-1/2}\tilde{\theta}_k\|\\ \stackrel{\eqref{eq:ellipse}}{\leq} & \sqrt{\chi^2_{nkm+n^2}(\delta)}\left\|\Sigma_{\theta,k}^{1/2}\left(\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix}\otimes H_{\mathrm{x},j}\right)\right\|. \end{align*} Similarly, for the variance we obtain \begin{align*} &\Sigma_{\mathrm{x},0}^{1/2}\tilde{G}_{0,k}^\top H_{\mathrm{x},j} =(\Sigma_{\mathrm{x},0}^{1/2} \otimes H_{\mathrm{x},j}^\top)\vec{\tilde{G}_{0,k}}\\ =&(\Sigma_{\mathrm{x},0}^{1/2} \otimes H_{\mathrm{x},j}^\top)[I_{n^2},0_{n^2\times kmn}]\tilde{\theta}_k. \end{align*} Correspondingly, we get \begin{comment} \begin{align*} &\|\Sigma_{\mathrm{x},k}^{1/2}H_{\mathrm{x},j}\| =\left\|\begin{bmatrix}\mathrm{diag}_k(\Sigma_{\mathrm{w}}^{1/2})&0\\0&\Sigma_{\mathrm{x},0}^{1/2}\end{bmatrix} \begin{bmatrix}G_{\mathrm{w},k}^\top\\ G_{0,k}^\top\end{bmatrix}H_{\mathrm{x},j}\right\|\\ =&\|H_{\mathrm{x},j}^\top (G_{\mathrm{w},k}\mathrm{diag}_k(\Sigma_{\mathrm{w}}^{1/2})+G_{0,k}\Sigma_{\mathrm{x},0}^{1/2})\|\\ =&\|H_{\mathrm{x},j}^\top (G_{\mathrm{w},k}\mathrm{diag}_k(\Sigma_{\mathrm{w}}^{1/2})+\hat{G}_{0,k}\Sigma_{\mathrm{x},0}^{1/2})\\ &+(\Sigma_{\mathrm{x},0}^{1/2} \otimes H_{\mathrm{x},j}^\top)[I_{n^2},0_{n^2\times kmn}]\tilde{\theta}_k\|\leq \overline{h}_{j,k} \end{align*} \end{comment} \begin{align*} &\|\Sigma_{\mathrm{x},k}^{1/2}H_{\mathrm{x},j}\| =\left\|\begin{bmatrix}\mathrm{diag}_k(\Sigma_{\mathrm{w}}^{1/2})&0\\0&\Sigma_{\mathrm{x},0}^{1/2}\end{bmatrix} \begin{bmatrix}G_{\mathrm{w},k}^\top\\ G_{0,k}^\top\end{bmatrix}H_{\mathrm{x},j}\right\|\\ =&\| (\mathrm{diag}_k(\Sigma_{\mathrm{w}}^{1/2})G_{\mathrm{w},k}^\top+\Sigma_{\mathrm{x},0}^{1/2}G_{0,k}^\top)H_{\mathrm{x},j}\|\\ =&\| (\mathrm{diag}_k(\Sigma_{\mathrm{w}}^{1/2})G_{\mathrm{w},k}^\top+\Sigma_{\mathrm{x},0}^{1/2}\hat{G}_{0,k}^\top)H_{\mathrm{x},j}\\ &+(\Sigma_{\mathrm{x},0}^{1/2} \otimes H_{\mathrm{x},j}^\top)[I_{n^2},0_{n^2\times kmn}]\tilde{\theta}_k\|\leq\overline{h}_{j,k}. \end{align*} with \begin{align} \label{eq:convoluted_tightening_constant} \overline{h}_{j,k}:=&\max_{\tilde{\theta}_k\in\Theta_{\delta,k}}\| (\mathrm{diag}_k(\Sigma_{\mathrm{w}}^{1/2})G_{\mathrm{w},k}^\top+\Sigma_{\mathrm{x},0}^{1/2}\hat{G}_{0,k}^\top)H_{\mathrm{x},j}\nonumber\\ &+(\Sigma_{\mathrm{x},0}^{1/2} \otimes H_{\mathrm{x},j}^\top)[I_{n^2},0_{n^2\times kmn}]\tilde{\theta}_k\|. \end{align} By combining these bounds, we obtain \begin{align*} &H_{\mathrm{x},j}^\top(G_{0,k}\overline{x}_0+G_{u,k}u_{[0,k-1]})+c_{\tilde{p}}\|H_{\mathrm{x},j}\|_{\Sigma_{\mathrm{x},k}}\\ \leq& H_{\mathrm{x},j}^\top(\hat{G}_{0,k}\overline{x}_0+\hat{G}_{u,k}u_{[0,k-1]})+c_{\tilde{p}}\overline{h}_{j,k}\\ +&\sqrt{\chi^2_{nkm+n^2}(\delta)}\left\|\Sigma_{\theta,k}^{1/2}\left(\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix}\otimes H_{\mathrm{x},j}\right)\right\|, \end{align*} for all $\tilde{\theta}_k\in\Theta_{\delta,k}$. Thus, Inequality~\eqref{eq:convoluted_tightening} implies~\eqref{eq:chance_constraints}. \end{proof} For the derived mean and variance bound, there exist parameters $\tilde{\theta}_k\in\Theta_{\delta,k}$, such that the bounds hold individually with equality (although the combined bound~\eqref{eq:convoluted_tightening} is not tight). Computing the constants~\eqref{eq:convoluted_tightening_constant} requires maximizing a quadratic function over an ellipsoid, which is an SDP~\cite[Prop.~2.2]{yildirim2006minimum}, and a simple upper bound is given by: \begin{align} \label{eq:convoluted_tightening_constant_alternative} &\overline{h}_{j,k}\leq \sqrt{\chi^2_{nkm+n^2}(\delta)}\|(\Sigma_{\mathrm{x},0}^{1/2} \otimes H^\top_{\mathrm{x},j})[I_{n^2},0_{n^2\times kmn}]\Sigma_{\theta,k}^{1/2}\|\nonumber\\ &+\left\|H_{\mathrm{x},j}^\top \begin{bmatrix}G_{\mathrm{w},k},\hat{G}_{0,k}\end{bmatrix} \begin{bmatrix}\mathrm{diag}_k(\Sigma_{\mathrm{w}}^{1/2})&0\\0&\Sigma_{\mathrm{x},0}^{1/2}\end{bmatrix}\right\|. \end{align} Given the parameter estimates $\hat{\theta}_k$ with variance $\Sigma_{\theta,k}$ (Lemma~\ref{lemma:id_correlated}) and constants $\overline{h}_{j,k}$~\eqref{eq:convoluted_tightening_constant} for each prediction step $k\in\mathbb{I}_{[1,N]}$, we can pose the following problem: \begin{align} \label{eq:stoch_opt_convoluted_robust} &\min_{u_{[0,N-1]}\in\mathbb{U}^N}~\sum_{k=0}^{N-1}\|\overline{x}_{k+1}\|_Q^2+\|u_k\|_R^2\\ \text{s.t. }&H_{\mathrm{x},j}^\top\overline{x}_k+ \sqrt{\chi^2_{nkm+n^2}(\delta)}\left\|\Sigma_{\theta,k}^{1/2}\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix}\otimes H_{\mathrm{x},j}\right\|\nonumber\\ &\leq 1-c_{\tilde{p}}\overline{h}_{j,k},~ j\in\mathbb{I}_{[1,r]},~k\in\mathbb{I}_{[0,N]},\nonumber\\ &\overline{x}_{k}=\hat{G}_{0,k}\overline{x}_0+\hat{G}_{\mathrm{u},k}u_{[0,k-1]},~k\in\mathbb{I}_{[1,N]}.\nonumber \end{align} \begin{corollary} Suppose the conditions in Lemma~\ref{lemma:id_correlated} hold. Problem~\eqref{eq:stoch_opt_convoluted_robust} is a QP subject to second-order cone constraints. Any feasible input sequence $u_{[0,N-1]}$ for Problem~\eqref{eq:stoch_opt_convoluted_robust} satisfies the chance constraints~\eqref{eq:chance_constraints}. \end{corollary} \begin{proof} The chance constraints~\eqref{eq:chance_constraints} follow directly from Lemmas~\ref{lemma:id_correlated} and \ref{lemma:convoluted_robust}. This result exploits that we have individual chance constraints~\eqref{eq:chance_constraints} for each $k\in\mathbb{I}_{[1,N]}$ and hence do \textit{not} require the joint distribution of $(\theta_k,\theta_{k+1})$. \end{proof} Problem~\eqref{eq:stoch_opt_convoluted_robust} addresses the chance constraints. A performance bound may require a modified cost~\cite{furieri2021near,huang2021robust}. \subsection{Existing approaches using multi-step predictor bounds} \label{sec:data_driven_4} In the following, we detail some approaches from the literature that, similar to Lemma~\ref{lemma:convoluted_robust}, directly exploit parametric error bounds on the multi-step predictor. \subsubsection*{Impulse response models} Early MPC implementations, especially in process control, are focused on impulse/step response models~\cite{richalet1978model,cutler1980dynamic,lundstrom1995limitations}. Corresponding \textit{robust} designs for FIR models with parametric uncertainty have also been derived using $\min-\max$ problems~\cite{zheng1993robust}. By additionally considering set-membership estimation to identify the parametric error, a robust data-driven/adaptive MPC for FIR models is derived in~\cite{tanaskovic2014adaptive}. For a more general parametrization with OBFs~\cite{heuberger1995generalized}, and assuming only output measurement noise, robust/chance constraints under parametric uncertainty can also be enforced without conservatism~\cite{heirung2017dual,soloperto2019dual}. Notably, the parameter dimension with OBF can be significantly smaller, which reduces the computational complexity of the vertex enumeration. \subsubsection*{Data-driven/enabled predictive control} The direct identification of multi-step predictors~\eqref{eq:model_convoluted_split} has already been proposed in SPC~\cite{favoreel1999spc}. More recently, a variation of this approach known as \textit{data-driven/enabled predictive control} has received significant attention~\cite{berberich2020data,coulson2021distributionally}. The basic idea is to specify an implicit model by stacking the measured data in a Hankel matrix, which is directly used within the optimization problem, instead of the usual sequential model identification and predictive control. In~\cite{huang2021robust,coulson2021distributionally}, it is shown that this implicit model also allows for simple reformulations of the $\min-\max$/distributionally-robust problem, similar to Lemma~\ref{lemma:convoluted_robust}. In a related result, \cite{yin2021maximum,yin2021data} provide an MLE with simple bounds on the prediction. Notably, most of these results focus on measurement noise instead of disturbances, compare the discussion in Section~\ref{sec:SysID_3} on system identification. When comparing data-driven/enabled predictive control approaches~\cite{coulson2021distributionally,berberich2020data,huang2021robust} with standard model-based MPC, we note that the difference is \textit{not} only attributable to the fact that a \textit{direct} data-driven design is used (cf.~\cite{dorfler2021bridging} for a detailed discussion on potential benefits); but also due to the fact that \textit{multi-step predictors} are (implicitly) specified. \subsubsection*{Set-membership estimation} In~\cite{terzi2019learning,lauricella2020data,terzi2022robust}, set-membership estimation is used for multi-step predictors of the form~\eqref{eq:model_convoluted_split}. These approaches consider polytopic bounded noise and disturbances, resulting in polytopic sets $\tilde{\theta}_k\in\Theta_{\delta,k}$. Prediction bounds can then be directly obtained with linear inequality constraints (cf.~\cite{lauricella2020data}), which are guaranteed to be less conservative than corresponding bounds from a state space model~\cite[Thm.~1]{terzi2022robust}. In contrast to Problem~\eqref{eq:stoch_opt_convoluted_robust}, the resulting MPC approaches over-approximate the prediction error with a constant bound to allow for simpler robust MPC methods~\cite{terzi2019learning} and ensure recursive feasibility~\cite{terzi2022robust}. \subsubsection*{System level synthesis (SLS)} SLS is a method to jointly optimize over feedback policies by parametrizing the problem using the (closed-loop) multi-step predictors $G_{\mathrm{u}}$,$G_0$, $G_{\mathrm{w}}$, which are called \textit{system responses}~\cite{chen2020robust}, compare also the Input-Output Parametrization (IOP)~\cite{furieri2021near}. In~\cite{furieri2021near}, multi-step predictors~\eqref{eq:model_convoluted} are directly identified and a simple constraint tightening, similar to Lemma~\ref{lemma:convoluted_robust}, is obtained. In~\cite{bujarbaruah2020robust,chen2020robust}, the authors consider parametric errors in the state space formulation and then (partially) over-approximate it with a parametric uncertainty on the multi-step predictors~\eqref{eq:model_convoluted} to allow for a similarly simple robustification. Specifically, similar to Lemma~\ref{lemma:convoluted_robust}, the constraint tightening in~\cite[Equ.~(13)]{bujarbaruah2020robust} is proportional to a weighted norm of $\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix}$. \subsection{Discussion} \label{sec:data_driven_3} \subsubsection*{Complexity and conservatism} For both model parametrizations, the considered derivation (Sec.~\ref{sec:data_driven_1}/\ref{sec:data_driven_2}) introduces conservatism by: a) separately bounding the variance and mean (which allows for a pre-computation of the variance related terms); b) using $\prob{\tilde{\theta}_k\in\Theta_{\delta,k}}\geq \delta$ (Lemma~\ref{lemma:id_correlated}) instead of directly working with the distribution $\theta_k\in\mathcal{N}(\hat{\theta}_k,\Sigma_{\theta,k})$. Apart from this simplification, the derivation in Lemma~\ref{lemma:convoluted_robust} is tight. Another major benefit of Problem~\eqref{eq:stoch_opt_convoluted_robust} is its simplicity, i.e., compared to Problem~\eqref{eq:stoch_opt_convoluted} we only require the following changes: \begin{itemize} \item The probability level is increased with $\tilde{p}>p$. \item The constraint is further tightened by a scaled norm of the vector $\Sigma_{\theta,k}^{1/2}\begin{bmatrix} \overline{x}_0\\u_{[0,k-1]} \end{bmatrix}\otimes H_{\mathrm{x},j}\in\mathbb{R}^{nkm+n^2}$. \item Constants $\overline{h}_{j,k}\geq \|H_{\mathrm{x},j}\|_{\Sigma_{\mathrm{x},k}}$ can be computed offline using~\eqref{eq:convoluted_tightening_constant} or \eqref{eq:convoluted_tightening_constant_alternative}. \end{itemize} Regarding the computational complexity, the additional vector-norm in the constraint tightening results in second-order cone constraints. In case of polytopic parameter sets $\Theta_{\delta,k}$, a similar derivation results in a linearly constrained QP. Considering the state space problem~\eqref{eq:stoch_opt_robust}, standard tube-based approaches to robustly account for parametric uncertainty (cf.~\cite{kouvaritakis2016model,primbs2009stochastic,fleming2014robust,lorenzen2019robust,Koehler2019Adaptive,lu2021robust}) also result in a QP subject to linear or second-order-cone constraints, depending if the set $\Theta$ is a polytope or ellipsoid. Notably, these approaches retain the sparsity structure. Tube-based methods require an additional offline step to design a suitable polytope/ellipsoid for the tube parametrization. Considering specifically the polytopic setting, a more complex polytope may reduce the conservatism but significantly increases the computational complexity (cf.~\cite[Tab.~5.2]{kouvaritakis2016model}), thus resulting in a non-trivial offline tuning problem. In addition, there exist degrees of freedom in the tube propagation that require a trade-off between conservatism and computational complexity (cf.~\cite[Tab.~1]{Koehler2019Adaptive}). The sequential nature of the tube-propagation with its fixed parametrization can result in significant conservatism, which is difficult to quantify a-priori. Less conservative/tight reachability bounds for state space models with parametric uncertainty require more sophisticated robust control tools, e.g., integral quadratic constraints. However, exploiting such tools in MPC is part of ongoing research~\cite{schwenkel2021model}. \subsubsection*{Receding horizon implementation} One of the core principles of MPC is generating feedback by repeatedly solving open-loop optimization problems~\cite{mayne2000constrained,kouvaritakis2016model,rawlings2017model}. Thus, \textit{recursive feasibility} is of paramount importance, which can be ensured with well-established methods for state space formulations~\cite{mayne2000constrained,kouvaritakis2016model,rawlings2017model}. For the following discussion on recursive feasibility, we restrict ourselves to the \textit{robust} setting, as the unbounded disturbances in stochastic MPC require extra care~\cite{primbs2009stochastic,farina2016stochastic,hewing2020recursively}. A crucial feature of the sequential disturbance propagation in tube-based MPC (cf.~\cite{kouvaritakis2016model,fleming2014robust,lorenzen2019robust,Koehler2019Adaptive,lu2021robust}) is the fact that recursive feasibility directly holds, assuming a proper parametrization and terminal set constraint. On the other hand, directly utilizing the multi-step predictor bounds (cf. Lemma~\ref{lemma:convoluted_robust}), does in general \textit{not} ensure recursive feasibility. This issue can be addressed using: shrinking/adaptive horizons or a multi-rate/multi-step implementations~\cite{bujarbaruah2020robust,chen2020robust,terzi2022robust}; intersecting different over-approximations of the reachable set~\cite{maddalena2021kpc,lauricella2020data}; considering FIR/OBF models~\cite{tanaskovic2014adaptive,heirung2017dual,soloperto2019dual} (cf. also Volterra series~\cite{gruber2013computationally,genecili1995design}). This issue arises partially due to incompatible models, e.g., $\hat{G}_{0,k}\hat{G}_{0,k}\neq \hat{G}_{0,2k}$, and has similarities to the known problems associated with move-blocking MPC~\cite{gondhalekar2010least}. Due to the different closed-loop implementation, it is not a-priori clear if the reduced \textit{open-loop} conservatism of multi-step predictors (Sec.~\ref{sec:data_driven_2}) results in improved \textit{closed-loop} performance. \subsubsection*{Input-output (IO) models} The assumption of noisy state measurements $\tilde{x}_k$ can be relaxed to noisy output measurements $\tilde{y}_k=y_k+\eta_k\in\mathbb{R}^{n_{\mathrm{y}}}$. For example, assuming (final state) observability~\cite[Def.~4.29]{rawlings2017model} (e.g., ARX model), a non-minimal state is given by $x_k=(y_{[k-\nu,k-1]},u_{[k-\nu,k-1]})\in\mathbb{R}^{\nu(m+n_{\mathrm{y}})}$ with the lag $\nu\leq n$~\cite{coulson2021distributionally}. Hence, a noisy state measurement $\tilde{x}_k=x_k+\epsilon_k$ is directly available with the correlated(!) noise $\epsilon_k=(\eta_{[k-\nu,k-1]},0_{ m\nu\times 1})$. The correlation requires a modification of the MLE (Sec.~\ref{sec:SysID}), cf.~\cite{yin2021maximum,yin2021data}. The MLE can also be directly applied to noisy output measurements using a Kalman filter~\cite{aastrom1971system,gibson2005robust}. The fact that the resulting state space model is not necessarily \textit{minimal} can complicate the offline design required in tube-based state space approaches~\cite{kouvaritakis2016model,fleming2014robust,lorenzen2019robust,Koehler2019Adaptive,lu2021robust}. On the other hand, a minimal state space representation is \textit{not} directly relevant for multi-step predictors and most of these approaches consider the IO setting~\cite{tanaskovic2014adaptive,heirung2017dual,soloperto2019dual,berberich2020data,coulson2021distributionally,huang2021robust,yin2021maximum,yin2021data,iannelli2021experiment,terzi2019learning,lauricella2020data,terzi2022robust,furieri2021near,favoreel1999spc}. It is tempting to distinguish "standard" MPC schemes~\cite{mayne2000constrained,kouvaritakis2016model,rawlings2017model} and more recent "data-driven" MPC methods~\cite{berberich2020data,coulson2021distributionally} in terms of input-state vs. IO setting. However, based on the exposition in this paper, we postulate that a major difference is the model parametrization: sequential state space models vs. (implicit) direct multi-step predictors. \subsubsection*{Nonlinear systems} While we focus on linear systems throughout the paper, similar conclusions can be drawn for nonlinear systems, where some of the differences become even more pronounced. Nonlinear multi-step predictors, i.e., $x_{i+k}=f_k(x_i,u_{[i,i+k-1]},w_{[i,i+k-1]})$, can be identified using linearly parametrized models, e.g., Volterra series~\cite{genecili1995design,gruber2013computationally}, or non-parametric approaches, e.g., kernel methods~\cite{maddalena2021kpc,thorpe2022data}, analogous to nonlinear state-space models.\footnote{% The direct identification of the impulse response used in~\eqref{eq:model_convoluted_split} can also be viewed as a \textit{non-parametric} problem, especially for $N\rightarrow\infty$~\cite{aastrom1971system}.} The fact that such models do \textit{not} require any conservative/complex disturbance propagation is even more critical in the nonlinear case. However, the complexity issues of multi-step predictors for large prediction horizons $N$ are also amplified for nonlinear problems. Furthermore, the difference in the prior information for state space models and multi-step predictors are more important in the nonlinear setting. \section{Stochastic predictive control} \label{sec:problem} We first state the control problem (Sec.~\ref{sec:problem_1}) and convert it into a deterministic QP (Sec.~\ref{sec:problem_2}). Then, we introduce the multi-step predictors, derive an equivalent QP (Sec.~\ref{sec:problem_3}), and provide a discussion (Sec.~\ref{sec:problem_4}). \subsection{Problem setup} \label{sec:problem_1} We consider a linear discrete-time system of the form \begin{align} \label{eq:sys_state} x_{k+1}=Ax_k+Bu_k+Ew_k,\quad k\in\mathbb{I}_{\geq 0}, \end{align} with state $x_k\in\mathbb{R}^n$, input $u_k\in\mathbb{U}\subseteq\mathbb{R}^m$, disturbances $w_k\in\mathbb{R}^q$, time $k\in\mathbb{I}_{\geq 0}$, and input constraint set $\mathbb{U}$. The disturbances are i.i.d. Gaussian variables $w_k\sim\mathcal{N}(0,\Sigma_{\mathrm{w}})$ and the initial state is uncertain with $x_0\sim\mathcal{N}(\overline{x}_0,\Sigma_{\mathrm{x},0})$, which is independent of $w_k$. We consider the following stochastic optimal control problem \begin{subequations} \label{eq:stoch_opt} \begin{align} &\min_{u_{[0,N-1]}\in\mathbb{U}^N}\expect{\sum_{k=0}^{N-1}\|x_{k+1}\|_Q^2+\|u_k\|_R^2}\\ \label{eq:chance_constraints} \text{s.t. }&\prob{H_{\mathrm{x},j}^\top x_k\leq 1}\geq p,~ j\in\mathbb{I}_{[1,r]},~ k\in\mathbb{I}_{[0,N]} \end{align} \end{subequations} with $Q,R\succ 0$, $H_{\mathrm{x},j}\in\mathbb{R}^n$, $j\in\mathbb{I}_{[1,r]}$, and probability $p\in(0,1)$ for the chance constraints~\eqref{eq:chance_constraints}. We consider the \textit{stochastic} and \textit{open-loop} control problem to allow for a simple system identification using MLE (Sec.~\ref{sec:SysID}) and an easier comparison between the two model parametrizations, respectively. Generalizations of this problem setup (e.g., receding horizon, robust, input-output models) are discussed in Sections~\ref{sec:SysID_3}, \ref{sec:data_driven_4}, \ref{sec:data_driven_3}. In order to introduce the problem, we assume that the model parameters are known. The problem of system identification and predictive control with probabilistic bounds on the model parameters is treated in Sections~\ref{sec:SysID} and \ref{sec:data_driven}, respectively. \subsection{State space model} \label{sec:problem_2} Problem~\eqref{eq:stoch_opt} is commonly used in stochastic MPC and we derive a deterministic formulation following~\cite[Sec.~3.2.1]{farina2016stochastic}, \cite{hewing2020recursively}. For a given input sequence $u_{[0,N-1]}\in\mathbb{U}^N$ and initial state $x_0\in\mathcal{N}(\overline{x}_0,\Sigma_{\mathrm{x},0})$, the predicted states are Gaussian variables $x_k\sim\mathcal{N}(\overline{x}_k,\Sigma_{\mathrm{x},k})$, $k\in\mathbb{I}_{[1,N]}$. The mean and variance can be recursively computed as $\overline{x}_{k+1}=A\overline{x}_k+Bu_k$ and $\Sigma_{\mathrm{x},k+1}=A \Sigma_{\mathrm{x},k}A^\top+E\Sigma_{\mathrm{w}}E^\top$, $k\in\mathbb{I}_{[0,N-1]}$. The probabilistic constraint~\eqref{eq:chance_constraints} is equivalent to $H_{\mathrm{x},j}\overline{x}_k\leq 1-c_p\|H_{\mathrm{x},j}\|_{\Sigma_{\mathrm{x},k}}$, with $c_p:=\sqrt{\chi_1^2(2p-1)}$. Furthermore, we have $\expect{\|x_k\|_Q^2}=\|\overline{x}_k\|_Q^2+\tr{Q\Sigma_{\mathrm{x},k}}$. By pre-computing the variance $\Sigma_{\mathrm{x},k}$ and neglecting the constant terms in the cost, Problem~\eqref{eq:stoch_opt} is equivalent to the following QP: \begin{align} \label{eq:stoch_opt_state} &\min_{u_{[0,N-1]}\in\mathbb{U}^N}~\sum_{k=0}^{N-1}\|\overline{x}_{k+1}\|_Q^2+\|u_k\|_R^2\\ \text{s.t. }&H_{\mathrm{x},j}^\top\overline{x}_k\leq 1-c_p\|H_{\mathrm{x},j}\|_{\Sigma_{\mathrm{x},k}} ,~ j\in\mathbb{I}_{[1,r]},~k\in\mathbb{I}_{[0,N]},\nonumber\\ &\overline{x}_{k+1}=A\overline{x}_k+Bu_k,~k\in\mathbb{I}_{[0,N-1]}.\nonumber \end{align} \subsection{Multi-step predictors} \label{sec:problem_3} \textit{Multi-step predictors} are given by \begin{align} \label{eq:model_convoluted} x_{[1,N]}=G_{\mathrm{u}}u_{[0,N-1]}+G_{0}x_0+G_{\mathrm{w}}w_{[0,N-1]}, \end{align} where the matrices $G_{\mathrm{u}},G_0,G_{\mathrm{w}}$ directly map to the future state sequence, instead of sequentially applying the one-step prediction of the state space model~\eqref{eq:sys_state}. The rows in~\eqref{eq:model_convoluted} correspond to different horizon steps $k\in\mathbb{I}_{[1,N]}$ with \begin{align} \label{eq:model_convoluted_split} &x_k=G_{0,k}x_0+G_{\mathrm{u},k}u_{[0,k-1]}+G_{\mathrm{w},k}w_{[0,k-1]},~G_{0,k}=A^k,\nonumber\\ &G_{\mathrm{u},k}= \begin{bmatrix} A^{k-1}B,\dots,B \end{bmatrix},~ G_{\mathrm{w},k} =\begin{bmatrix} A^{k-1}E,\dots, E \end{bmatrix}. \end{align} This model corresponds to a compressed/condensed version of the recursive application of the state space model~\eqref{eq:sys_state}, as is often used for the numerical solution of the QP~\eqref{eq:stoch_opt_state} (cf.~\cite[Chap.~7, Sec.~8.8.4]{rawlings2017model}). This model structure is prevalent in MPC schemes based on FIR models~\cite{richalet1978model,cutler1980dynamic,zheng1993robust,tanaskovic2014adaptive} or subspace predictive control (SPC)~\cite{favoreel1999spc}, and is recently employed in many (robust) predictive control approaches~\cite{tanaskovic2014adaptive,heirung2017dual,soloperto2019dual,berberich2020data,coulson2021distributionally,huang2021robust,dorfler2021bridging, yin2021maximum,yin2021data,iannelli2021experiment,terzi2019learning,lauricella2020data,terzi2022robust,furieri2021near,chen2020robust,bujarbaruah2020robust,maddalena2021kpc,thorpe2022data} (cf. discussion Section~\ref{sec:data_driven_4}). Considering the model~\eqref{eq:model_convoluted_split} with initial state $x_0\sim\mathcal{N}(\overline{x}_0,\Sigma_{\mathrm{x},0})$, we obtain $x_k\sim\mathcal{N}(\overline{x}_k,\Sigma_{\mathrm{x},k})$ with $\overline{x}_k=G_{\mathrm{u},k}u_{[0,k-1]}+G_{0,k}\overline{x}_0$ and $\Sigma_{\mathrm{x},k}=G_{0,k}\Sigma_{\mathrm{x},0}G_{0,k}^\top +G_{\mathrm{w},k}\mathrm{diag}_k(\Sigma_{\mathrm{w}})G_{\mathrm{w},k}^\top$, $k\in\mathbb{I}_{[1,N]}$. Thus, we can reformulate Problem~\eqref{eq:stoch_opt} as the following QP: \begin{align} \label{eq:stoch_opt_convoluted} &\min_{u_{[0,N-1]}\in\mathbb{U}^N}~\sum_{k=0}^{N-1}\|\overline{x}_{k+1}\|_Q^2+\|u_k\|_R^2\\ \text{s.t. }&H_{\mathrm{x},j}^\top\overline{x}_k\leq 1-c_p\|H_{\mathrm{x},j}\|_{\Sigma_{\mathrm{x},k}},~ j\in\mathbb{I}_{[1,r]},~k\in\mathbb{I}_{[0,N]},\nonumber\\ &\overline{x}_{k}=G_{0,k}\overline{x}_0+G_{\mathrm{u},k}u_{[0,k-1]},~k\in\mathbb{I}_{[1,N]}.\nonumbe \end{align} \subsection{Discussion} \label{sec:problem_4} First, note that both optimization problems are exact solutions to the stochastic optimal control problem. \begin{lemma} \label{lemma:stoch_eqiv} The stochastic optimal control problem~\eqref{eq:stoch_opt}, and the two deterministic QPs~\eqref{eq:stoch_opt_state} and~\eqref{eq:stoch_opt_convoluted} result in the same minimizing input sequence $u_{[0,N-1]}$. \end{lemma} With the state space model, the mean and variance are sequentially computed by applying a one-step discrete-time model, while Equation~\eqref{eq:model_convoluted_split} directly yields the multi-step prediction. Problem~\eqref{eq:stoch_opt_state} has a sparse structure, which is computationally more efficient for long horizons $N$ (cf.~\cite[Sec.~3]{kouzoupis2018recent}). Given that all the matrices are available offline, we can also derive Problem~\eqref{eq:stoch_opt_convoluted} by condensing Problem~\eqref{eq:stoch_opt_state}, i.e., by eliminating the dynamics equations through substitution. Beyond the stochastic control problem~\eqref{eq:stoch_opt}, the state space formulation also allows for an easy computation of control Lyapunov functions and invariant sets, which are typically employed in a receding horizon MPC implementation~\cite{rawlings2017model}. Thus, in case of a given system model, there is no clear drawback in using the state space model. This also explains why many modern MPC textbooks (cf., e.g.,~\cite{kouvaritakis2016model,rawlings2017model}) consider only state space models. However, we discuss later (Sec.~\ref{sec:data_driven}) that parametric uncertainties in state space models can significantly complicate the design, which is not necessarily the case for multi-step predictors. \section{Conclusion} \label{sec:conclusion} We have provided a tutorial-style exposition of data-driven stochastic predictive control using state space models or multi-step predictors. In particular, we have investigated the challenges associated with parametric uncertainty in both model parametrizations. Tube-based methods for state space models need to trade-off computational complexity and conservatism, and require additional offline designs with various free design parameters. On the other hand, we derived simple (partially tight) bounds for multi-step predictors (Lemma~\ref{lemma:convoluted_robust}), which do not suffer from similar conservatism. However, an a-priori comparison of the \textit{closed-loop} performance in a receding horizon implementation is challenging due to the required modifications with multi-step predictors (e.g., multi-rate implementation). A direct comparison of the computational complexity is also difficult, as even within tube-based approaches the complexity can vary by orders of magnitude (cf.~\cite[Tab.~1]{Koehler2019Adaptive}). Nonetheless, tube based approaches retain the sparse structure of the state space formulation and hence result in a reduced computational complexity for long horizons $N$ (cf.~\cite[Sec.~3]{kouzoupis2018recent}). In addition to these differences, main factors that should guide the choice of parametrizations are: \begin{itemize} \item magnitude of the parametric uncertainty; \item simplicity in receding horizon implementation; \item scalability for long prediction horizons; \item different model priors and the prevalence of disturbances or noise in the parameter identification. \end{itemize} \subsubsection*{Open-issues} Lemma~\ref{lemma:convoluted_robust} could be improved by directly using $\theta_k\sim\mathcal{N}(\hat{\theta}_k,\Sigma_{\theta,k})$. Numerical comparisons regarding computational complexity and closed-loop performance would be beneficial. Given the respective benefits, unifying the parametrizations in a hybrid model structure is a promising research direction (cf., \textit{DiRec/DIRMO} strategies~\cite{taieb2012review}).
12572b45d10fd42a62977d280e265fa9f560a5a2
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section*{Introduction} \lettrine{D}{eep} neural models for optimal spacecraft guidance and control have been recently proposed \cite{sanchez2018real, dario_ekin_earth_venus, li2019neural, federici2021deep, hovell2020deep, cheng2018real} and studied as a possible alternative to more classical architectures. Previously, researchers had proposed the use of \lq\lq neurocontrollers\rq\rq\ \cite{mohammadzaheri2012critical} as part of the guidance and control system, but mostly using a neural model to track some precomputed reference guidance signal. More recent works succeeded in learning directly the solution to Bellman's equations \cite{bardi1997optimal} hence synthesising an optimal state feedback for the underlying nonlinear equations of motion and thus allowing the use of networks for guidance and control simultaneously. These new types of networks, which we call Guidance and Control Networks (G\&CNETs), have a modest computational cost during inference, with clear applications for on-board, autonomous guidance and control \cite{dario_ekin_earth_venus, sanchez2018real, tailor2019learning}. Training them, on the other hand, is mostly done via supervised learning and requires the generation and use of a great number of optimal trajectories to be used as labels to learn from. The generation of a suitable dataset is key to the success in training any neural model to achieve the precision requested by real mission design constraints. To this end, an indirect method based on Pontryagin's approach \cite{pontryagin, jiang2012practical} can be used to generate (and later learn from) and label optimal decisions. As a consequence, the solution to many Two Points Boundary Value Problems (TPBVPs) needs to be computed. Even in the optimistic case of good co-states guesses being available \cite{li2019autonomous, li2019neural} and homotopy methods employed, these numerical procedures are time consuming and limit the amount of reference trajectories one can learn from \cite{cheng2018real, li2019neural}. A similar conclusion can be made also when direct methods are used to generate optimal examples. The development of neural models representing the optimal policy of some interplanetary transfer, such as G\&CNETs, is not the only case where the availability of a large amount of optimal solutions is needed. Attempts to learn directly machine learning models (mostly deep neural models) for the propellant consumption, the $\Delta V$, the arrival mass or the time of flight have also been performed. These can all be seen, from an optimal control point of view, as attempts to learn with different degrees of approximation the value function of some underlying fundamental optimal control problem. Complex low-thrust interplanetary trajectories between objects of the main belt \cite{hennes2016fast, li2020deep}, transfers to Earth co-orbiting asteroids \cite{mereta2017machine} as well as orbiting debris scenarios\cite{shen2021simple} have been considered as applications in the past. A critic to these approaches for value function learning has been recently worded as: \lq\lq ... one has to balance the advantage of computation speed against a remarkable time for data sets generating and network training.\rq\rq \cite{shen2021simple}. In this work we utilise a constant acceleration interplanetary rendezvous problem, to show the use of the data augmentation technique called Backward Generation of Optimal Examples \cite{dario_ekin_earth_venus} as a methodology to reduce the time required to generate datasets by orders of magnitude. The method allows to generate optimal samples avoiding entirely the solution of TPBVPs by simply integrating backward in time the augmented system of differential equations derived from Pontryagin's theory. We then also show how, contrary to a common sentiment, accuracies compatible with real world requirements can be reached both when learning the optimal policy and the value function. The paper is structured as follows. We begin giving the necessary details and formalism on the optimal control problem considered throughout the paper. In doing so we also follow recent practical guidelines \cite{jiang2012practical} for solving low-thrust problems via the maximum principle, which reveal to have added specific advantages for the augmentation technique. We then show how to apply the backward generation of optimal examples to augment a single nominal optimal trajectory found and discuss the results obtained training several G\&CNETs for different initial orbits. In the following section we move on to consider the value function problem and discuss the results one can obtain when augmenting each trajectory in a dataset aimed at representing the time of transfer from orbits in the asteroid belt to a target rendezvous. \section*{Methods} \subsection*{The optimal control problem} \label{sec:ocp} Consider a time optimal, constant acceleration rendezvous with a body in a perfectly circular orbit. This problem was recently brought to the attention of a wide international community during the 11th edition of the Global Trajectory Optimisation Competition (GTOC11) where it represented low-thrust transfers of objects from the belt. Let us introduce a rotating frame $\mathcal F = \left[\hat{\mathbf i}, \hat{\mathbf j}, \hat{\mathbf k}\right]$ having angular velocity $\boldsymbol \omega= \sqrt{\frac{\mu}{R^3}} \hat {\mathbf k}$ so that the target body position is, in $\mathcal F$, stationary and indicated with $R\hat{\mathbf i}$. The dynamics is thus described by the following simple set of ordinary differential equations: \begin{equation} \label{eq:dyn} \left\{ \begin{array}{l} \dot{\mathbf{r}} = \mathbf{v} \\ \dot{\mathbf{v}} = -\frac{\mu}{r^3}\mathbf{r}-2\boldsymbol \omega\times\mathbf v-\boldsymbol \omega\times\boldsymbol \omega\times\mathbf r +\Gamma\mathbf{\hat{t}}(t) \end{array} \right. \end{equation} where $\mu$ is the gravitational constant of the Sun and $\Gamma$ a constant acceleration assumed to be acting along some direction (to be controlled) described by the unit vector $\mathbf{\hat{t}}$. We will consider, for the rest of this work, $\Gamma = 0.1$ mm/s$^2$ which is a value compatible with successful interplanetary low-thrust missions such as Dawn \cite{russell2011dawn}, Bepi-Colombo \cite{benkhoff2010bepicolombo} or Smart-1 \cite{foing2006smart}. We consider the problem of finding $t_f$ and a (piece-wise continuous) function $\mathbf{\hat{t}}(t)$ with $t \in [t_0, t_f]$ so that, under the dynamics defined in Eq.(\ref{eq:dyn}), the state is steered from any initial state $\mathbf r_0, \mathbf v_0$ to the target state $\mathbf r_t = R\hat{\mathbf i}, \mathbf v_t = \mathbf 0$ in a minimal amount of time, thus minimizing the following cost function: $J = t_f-t_0 = \int^{t_f}_{t_0} dt$. Following Pontryagin's Minimum Principle \cite{pontryagin} and some of the practical guidelines suggested by Jiang and Baoyin \cite{jiang2012practical} we introduce the following Hamiltonian: \begin{equation} \label{eq:hamiltonian} \mathcal H(\mathbf{r},\mathbf{v},\boldsymbol{\lambda}_r,\boldsymbol{\lambda}_v,\mathbf{\hat{t}})= \boldsymbol{\lambda}_r\cdot \mathbf{v}+\boldsymbol{\lambda}_v\cdot\bigg(-\frac{\mu}{r^3}\mathbf{r}-2\boldsymbol \omega\times\mathbf v-\boldsymbol \omega\times\boldsymbol \omega\times\mathbf r+\Gamma\mathbf{\hat{t}}\bigg)+\lambda_J \end{equation} where we have introduced the co-states functions $\mathbf{\lambda_r}$ and $\mathbf{\lambda_v}$ and an additional $\lambda_J$ constant coefficient that multiplies the actual cost function considered $J=\lambda_J (t_f-t_0)$. The additional coefficient $\lambda_J$ results in increased numerical stability and, as we shall see, offers a useful extra degree of freedom for data augmentation. Since the Hamiltonian must be minimized by the optimal control (i.e. $\mathbf{\hat{t}}^*$) during an optimal trajectory, it is straight forward to derive the classical necessary condition: $$ \mathbf{\hat{t}}^*=-\frac{ \boldsymbol{\lambda}_{\mathbf v}}{\lambda_v} $$ The augmented dynamics is then derived from the Hamiltonian performing the derivatives $\dot {\mathbf x} = \frac{\partial \mathcal H}{\partial \mathbf x}$, $\dot {\boldsymbol \lambda} = - \frac{\partial \mathcal H}{\partial \boldsymbol \lambda}$: \begin{equation} \label{eq:augdyn} \left\{ \begin{array}{l} \dot{\mathbf{r}} = \mathbf{v} \\ \dot{\mathbf{v}} = -\frac{\mu}{r^3}\mathbf{r}-2\boldsymbol \omega\times\mathbf v-\boldsymbol \omega\times\boldsymbol \omega\times\mathbf r-\Gamma\frac{ \boldsymbol{\lambda}_{\mathbf v}}{\lambda_v}\\ \dot{\boldsymbol\lambda}_{\mathbf{r}} = \mu \left(\frac{\boldsymbol{\lambda}_{\boldsymbol v}}{r^3} - 3(\boldsymbol \lambda_{\boldsymbol v}\cdot\mathbf r)\frac{\mathbf r}{r^5} \right) - \boldsymbol\omega\times\boldsymbol\omega\times\boldsymbol \lambda_v\ \\ \dot{\boldsymbol\lambda}_{\mathbf{v}} = - \boldsymbol{\lambda}_{\mathbf r} +2\boldsymbol\omega\times\boldsymbol\lambda_v \end{array} \right. \end{equation} According to Pontryagin's theory, the optimal transfer will necessarily be a solution to the above differential equations with the added condition $\mathcal H=0$ as we consider a free time problem. The inverse is also true: any solution to the above system of differential equations, respecting the added condition on the Hamiltonian, is an optimal trajectory and can thus be used to learn from, regardless of where it actually starts from. A point of view that, as we shall see, is at the basis of the backward generation of optimal examples here used to form the database of state action pairs. \begin{figure}[t] \centering \includegraphics[width=0.8\textwidth]{nominal.png} \caption{Nominal trajectory used for policy learning} \label{fig:nominal} \end{figure} \subsection*{Finding one optimal trajectory} In order to find one solution to the optimal control problem outlined in the previous section, we introduce the following shooting function: \begin{equation} \label{eq:shooting} \phi(\boldsymbol \lambda_{r_0}, \boldsymbol \lambda_{v_0}, \lambda_J, t_f) = \left\{\mathbf r(t_f) - \mathbf r_t, \mathbf v(t_f) - \mathbf v_t, \mathcal H,||\boldsymbol \lambda || -1 \right\} \end{equation} where $\mathbf r(t_f)$ and $\mathbf v(t_f)$ (and $\mathcal H$) are obtained by numerically propagating Eq.(\ref{eq:augdyn}) from the assigned initial conditions $\mathbf r_0, \mathbf v_0, \boldsymbol \lambda_{r_0}, \boldsymbol \lambda_{v_0}$ for a time $t_f$. The shooting function is a system of eight non-linear relations between the variables $\boldsymbol \lambda_{r_0}, \boldsymbol \lambda_{v_0}, \lambda_J, t_f$: its root is here found numerically applying the sequential quadratic programming solver SNOPT \cite{gill2005snopt} and defines entirely an optimal trajectory. Note that the condition on the initial co-state norm is not strictly necessary in this case, but it helps with the numerical stability of the root finder. As an example, let us here consider an orbit having, at epoch $t_0$, the following osculating orbital Keplerian elements in the inertial frame: $a = 2.687$ AU, $e = 0.23$, $i = 0.116$ rad., $\Omega = 3.137$ rad., $\omega = 4.453$ rad. and eccentric anomaly $E = 3.01$ rad. Without loss of generality we assume that, at $t_0$, the rotating frame is coincident to the inertial frame, so that a rotation matrix between the two frames will take the simple form: $$ \mathbf R(t)= \left[ \begin{array}{ccc} \cos{\omega (t-t_0)} & \sin {\omega (t-t_0)} & 0 \\ -\sin{\omega (t-t_0)} & \cos {\omega (t-t_0)} & 0 \\ 0 & 0& 1 \end{array} \right] $$ Given the Keplerian osculating elements at $t$ in the inertial frame we thus find the initial conditions $\mathbf r_0, \mathbf v_0$ in the rotating frame $\mathcal F$ and find the root of Eq.(\ref{eq:shooting}) when the target orbit is at $R=1.3$ AU. The resulting trajectory is shown in Figure \ref{fig:nominal} and has a total time of flight of $t_f^*=4.62$ years. Being a solution to the shooting equation is a necessary condition for optimality but not a sufficient one. As a consequence, there may be multiple roots for the shooting equation corresponding to different transfer strategies. This corresponds to the existence of multiple local minima and is a problem hard to tackle rigorously within Pontryagin's theory. Typically these multiple roots can be found restarting the root finder from different initial guesses for the co-states, an approach that, although not rigorous, is often taken and deemed as unavoidable. For this particular nominal trajectory we verified experimentally that no other root exists via multiple restarts, but as we shall see later when assembling a large dataset of nominal trajectories, it is challenging to guarantee mathematically that this is the case. \subsection*{Augmenting one optimal trajectory} \label{sec:augmenting} To create a dataset of optimal trajectories one typically would solve multiple times the shooting function in Eq.(\ref{eq:shooting}) using different values of $\mathbf r_0$ and $\mathbf v_0$. In this way, a significant amount of computational resources are needed. In more difficult cases, where a homotopy technique is necessary (see \cite{bertrand2002new} for an example) and local minima and convergence are issues, it may just be impossible to compute the number of optimal trajectories required to train an accurate model. A far more efficient method is to use the Backward Generation of Optimal Examples \cite{dario_ekin_earth_venus}. This technique can be seen as a data augmentation technique where each sample in a dataset of optimal trajectories can be used, at low computational cost, to generate many more different samples. In order to apply this technique to the particular case at hand, we indicate the final values of the co-states $\boldsymbol \lambda_r$, $\boldsymbol \lambda_v$ relative to one optimal trajectory with $\boldsymbol \lambda_f$. We thus introduce the update rule: \begin{equation}\label{eq:pert} \boldsymbol \lambda_{f}^{+} = \boldsymbol \lambda_{f} + \boldsymbol \lambda_{f}\cdot\boldsymbol\Delta \end{equation} Where $\boldsymbol\Delta$ is a perturbation vector chosen as to satisfy all of the conditions dictated by Pontryagin's principle, in our case only $\mathcal H_f = 0$. In this work we will often use for each element of the perturbation vector a uniformly distributed number $\mathcal U(-\delta, \delta)$. The benefit of having introduced the normalisation factor $\lambda_J$ appears now clearly. In fact, setting Eq.(\ref{eq:hamiltonian}) to zero, we see how we are allowed to choose all of the perturbations on the co-states freely since we can always set $\lambda_J^{new}$ as follow: $$ \lambda_J^{+} = -\boldsymbol{\lambda}_{\mathbf r_f}^{+}\cdot \mathbf{v}_f-\boldsymbol{\lambda}_{\mathbf v_f}^{+}\cdot\bigg(-\frac{\mu}{r_f^3}\mathbf{r}_f-2\boldsymbol \omega\times\mathbf v_f-\boldsymbol \omega\times\boldsymbol \omega\times\mathbf r_f-\Gamma\frac{ \boldsymbol{\lambda}_{\mathbf v_f}^{+}}{{\lambda}_{v_f}^{+}}\bigg) $$ and thus guarantee, for any arbitrary perturbation vector, that $\mathcal H_f = 0$. Note that with respect to the case treated in \cite{dario_ekin_earth_venus} we have here simplified the overall complexity of the dataset generation further by avoiding the solution of a nonlinear equation representing the transversality condition on the Hamiltonian. Once a new valid value $\boldsymbol \lambda_{f}^{+}$ for the final co-states is available we propagate backward Eq.(\ref{eq:augdyn}) and thus obtain an optimal trajectory to be added to the dataset. In this work we use a Taylor technique \cite{biscani2021revisiting} to perform a highly accurate numerical propagation and we are able to generate 10,000 optimal trajectories in the order of seconds: orders of magnitude less than directly solving the corresponding shooting function. Of course, it must be noted, the exact initial conditions of all these optimal trajectories are not chosen, but a consequence of the new final co-states values. \section*{Neural representation of the optimal policy} In this section we train a neural model $\mathcal N$ to represent the optimal policy $\mathbf{\hat{t}}^*$ as a function of the spacecraft state $\mathbf r, \mathbf v$. The resulting neural state feedback $\mathbf{\hat{t}}^* = \mathcal N(\mathbf r, \mathbf v)$, called a G\&CNET, is then used in Eq.(\ref{eq:dyn}) to simulate the spacecraft dynamics. \subsection*{The dataset} \begin{figure}[tb] \centering \includegraphics[width=0.9\textwidth]{bundle.png} \caption{Bundle of ~200 optimal trajectories obtained applying the backward generation of optimal examples. Co-state perturbation is 1 \permil (black), 8\% (yellow).} \label{fig:bundle} \end{figure} We generate a dataset of optimal state-action pairs augmenting one single nominal trajectory via the Backward Generation of Optimal Examples. The generic single entry in our dataset thus contains the values $[X_i,Y_i] = (x_i,y_i,z_i,{v_x}_i,{v_y}_i,{v_z}_i),({t_x}_i^*,{t_y}_i^*,{t_z}_i^*)$. These are computed generating 200,000 optimal trajectories sampled in 100 points equally distanced in time. The resulting dataset thus contains 20,000,000 optimal state-action pairs. Half of the dataset is generated perturbing the final co-states $\lambda_f^{+}$ using $\delta = 0.001$ and back-propagating the augmented equations of motion for a time $(1+c)t^*_f$ with the constant $c$ uniformly distributed $c\in[0,1]$. The resulting bundle, shown in Figure \ref{fig:bundle}, grows very thin as the spacecraft approaches the final rendezvous. As a result, small deviations from the nominal trajectory may lead, during a real transfer, the spacecraft state to be outside of the training data and the resulting error to grow to unacceptable levels. To overcome this issue, the remaining half of the dataset is generated using a larger perturbation $\delta = 0.08$. The resulting dataset is visualised in Figure \ref{fig:bundle}, where the different colours correspond to the two halves of the dataset. We note how the larger perturbation leads to trajectories that may also depart significantly from the nominal trajectory. Interestingly, during our experiments, we found these trajectories important to a successful training procedure, likely as they thicken the bundle during the second half of the interplanetary transfer. The CPU time required to assemble the entire dataset, on a standard modern CPU (Intel\textregistered\ Core\texttrademark\ i5-6600K CPU, 3.50 GHz), is less than one minute. We also generate a completely independent test set containing 4,000 whole trajectories computed using $\delta = 0.0005$ and back-propagating the augmented equations of motion for a time $(1+c)t^*_f$. The smaller perturbation vector used to generate the test set is aimed at making sure to only probe the model within the bounds of the training data. It is here worth mentioning, though, that we also used and generated a test set with the same perturbation vector as that used to generate the training set and obtained, essentially, similar results. All numerical integrations are performed using Heyoka \cite{biscani2021revisiting}, a Taylor based method, and setting the numerical tolerance to machine level, i.e. $\epsilon = 1\cdot 10^{-16}$. \begin{figure}[t] \centering \tikzset{% every neuron/.style={ circle, draw, minimum size=0.6cm }, neuron missing/.style={ draw=none, scale=4, text height=0.333cm, execute at begin node=\color{black}$\vdots$ }, } \begin{tikzpicture}[x=1.5cm, y=1cm, >=stealth] \foreach \m/\l [count=\y] in {1,2,3,4,5,6} \node [every neuron/.try, neuron \m/.try] (input-\m) at (0,2.5-\y) {}; \foreach \m [count=\y] in {1,missing,2} \node [every neuron/.try, neuron \m/.try ] (hidden-\m) at (1.3,1.5-\y*1.25) {}; \foreach \m [count=\y] in {1,missing,2} \node [every neuron/.try, neuron \m/.try ] (hidden2-\m) at (2.6,1.5-\y*1.25) {}; \foreach \m [count=\y] in {1,missing,2} \node [every neuron/.try, neuron \m/.try ] (hidden3-\m) at (3.9,1.5-\y*1.25) {}; \foreach \m [count=\y] in {1,missing,2} \node [every neuron/.try, neuron \m/.try ] (hidden4-\m) at (5.2,1.5-\y*1.25) {}; \foreach \m [count=\y] in {1,2,3} \node [every neuron/.try, neuron \m/.try ] (output-\m) at (6.5,1-\y) {}; \foreach \l [count=\i] in {x,y,z,v_x,v_y,v_z} \draw [<-] (input-\i) -- ++(-1,0) node [above, midway] {$\l$}; \foreach \l [count=\i] in {x,y,z} \draw [->] (output-\i) -- ++(1,0) node [above, midway] {$t_\l$}; \foreach \i in {1,2,3,4,5,6} \foreach \j in {1,...,2} \draw [->] (input-\i) -- (hidden-\j); \foreach \i in {1,...,2} \foreach \j in {1,...,2} \draw [->] (hidden-\i) -- (hidden2-\j); \foreach \i in {1,...,2} \foreach \j in {1,...,2} \draw [->] (hidden2-\i) -- (hidden3-\j); \foreach \i in {1,...,2} \foreach \j in {1,...,2} \draw [->] (hidden3-\i) -- (hidden4-\j); \foreach \i in {1,...,2} \foreach \j in {1,2,3} \draw [->] (hidden4-\i) -- (output-\j); \foreach \l [count=\x from 1] in {(Softplus) \\ Hidden, (Softplus) \\ Hidden,(Softplus) \\ Hidden,(Softplus) \\ Hidden, (Linear) \\ Output} \node [align=center, above] at (\x*1.3,2) {\l \\ layer}; \end{tikzpicture} \caption{Feed forward neural network architecture} \label{fig:ffnn} \end{figure} \subsection*{The neural model} We consider learning the optimal thrust from the spacecraft states as a supervised learning task and we make use of a simple feed forward neural network, as introduced in \cite{sanchez2018real, dario_ekin_earth_venus} for some related tasks. A softplus activation function is used for the input and the hidden layers, allowing to obtain a continuous representation of the optimal controls differentiable to high order \cite{tailor2019learning}. We use four hidden layers of 700 neurons each. For the output layer we use a linear activation function, avoiding possible saturation issues. The network inputs are the states ($x$, $y$, $z$, $v_x$, $v_y$, $v_z$) and the outputs are the thrust direction ($t_x$, $t_y$, $t_z$), see Figure~\ref{fig:ffnn}. We will also use the notation $\mathcal N(\mathbf r, \mathbf v) = \hat{\mathbf t}_{nn}$ to indicate the network predictions. As a loss function we make use of the cosine similarity between the estimated thrust direction vector $\mathbf{\hat{t}}_{nn}$ and the ground truth $\mathbf{\hat{t}}^*$. In particular, the cosine similarity is defined as: $$ \text{cosine\_similarity}\left(\mathbf{\hat{t}}^*, \mathbf{\hat{t}}_{nn}\right) = \frac{\mathbf{\hat{t}}^*\cdot \mathbf{\hat{t}}_{nn}}{\mathbf{\vert\hat{t}}^*\vert\vert \mathbf{\hat{t}}_{nn}\vert} $$ and the loss used: $$ \mathcal L\left(\mathbf{\hat{t}}_{nn},\mathbf{\hat{t}}^*\right) = 1-\text{cosine\_similarity}\left(\mathbf{\hat{t}}_{nn}, \mathbf{\hat{t}}^*\right) $$ This formulation of the loss function allows the network to focus on predicting the thrust direction only, ignoring any effect of the predicted norm. Together with the last linear layer used, this allows for an efficient training. We use $80\%$ of the dataset for training, and the remaining $20\%$ for validation. The network weights are learned using the Adam optimizer \cite{kingma2014adam} with a starting learning rate $l=0.5\cdot 10^{-4}$ and no weight decay. A learning rate schedule was imposed by reducing the rate by a factor $f=0.9$ after $p=10$ consecutive epochs without any improvement on the loss as computed on a random batch of the validation data. Numerical experiments were performed with other losses as well as alternative representations of the thrust direction, revealing, in our case, this setup to be the most accurate. \subsection*{Results and discussion} \begin{figure}[tb] \centering \includegraphics[width=\textwidth]{loss.png} \caption{Loss during a typical training (left). Networks predictions vs. ground truth during one optimal trajectory in the test set (centre and right).} \label{fig:loss} \end{figure} \noindent We train several neural models following the methodology outlined in the previous sections. In Figure \ref{fig:loss} we report the loss decrease during a typical training, as well as an example of the predictions made by the neural network on a previously unseen optimal trajectory from the test set. In particular, the network prediction is transformed into spherical coordinates $\theta = \arccos{t_z}$ and $\varphi = \arctan{\frac{t_y}{t_x}}$ and compared to the optimal ground truth. The final loss value decreases below $10^{-3}$ and corresponds, as evaluated on the test set, to an average error of $0.59$ degrees in the prediction of the optimal direction. In order to assess if this error is small enough to allow the network to successfully steer the spacecraft optimally, we simulate the spacecraft dynamics in Eq.(\ref{eq:dyn}) when $\hat{\mathbf i}(t) = \mathcal N(\mathbf r(t), \mathbf v(t))$, that is when the thrust direction is instantaneously given by the network predictions. We consider all initial conditions in the test set, numerically integrating the equations of motion from there. We record the system state achieved at the time $t_f^*$ as well as at the time when the target semi-major axis $a_t$ is acquired exactly, at a time past $t_f^*$. The results, for the nominal trajectory used as test case in the previous sections, are given in Table \ref{tab:errors} (case N) and show how the spacecraft is able to rendezvous with the target body with good accuracy when the low-thrust profile follows the trained neural model. The network, acting as a state-feedback, is able to cancel out, rather than accumulate, the prediction errors possibly made during the transfer. To confirm quantitatively the method accuracy and study its reliability, we repeat the very same experiment starting from 9 different nominal trajectories, identified with the capital letters A,B,..I, having all the same orbital elements, but a different initial eccentric anomaly and hence a difference phasing to the target. In all cases the trained G\&CNET is able to steer the spacecraft to the target rendezvous reliably and with similar accuracies. When integrating until $t_f^*$, the spacecraft is left within $~500,000$ Km and with a residual relative velocity of the order of $~100$ [m/s]. In the better cases (trajectories B, F) residuals of less than $~20$ m/s are reached on the final velocity and of the order of 100,000 km on the position. These residuals are compatible with an operational use of the network for automated on-board guidance and control. It has to be noted here that the numbers appearing in table \ref{tab:errors} have been assembled using the very same dataset generation and training parameters, e.g. $\delta$, $c$, $l$. Since the sensitivity of the training accuracy to these parameters is rather significant, it is expected that during a real design phase one would be able to tune these parameters to the specific case (and dynamics) as to obtain a G\&CNET fulfilling operational constraints to the requested accuracies. \begin{table}[tb] \centering \caption{Mean errors at target when propagating the neural dynamics. The numerical integration stops either at $t^*_f$ or when the spacecraft achieves the target orbital energy (i.e. semi major axis $a_t$).\label{tab:errors}} \begin{tabular}{c|c|c|cccccc} Case & $E_0$, rad & &$\vert\vert\boldsymbol \delta \mathbf r\vert\vert$, AU & $\vert\vert\boldsymbol \delta \mathbf v\vert\vert$, km/s & $\delta a$, AU & $\delta e$ & $\delta i$, deg&$\delta t$, years\\\hline \hline \multirow{2}{*}{N} & \multirow{2}{*}{$3.01 $} & stop at $t_f^*$& $1.15 \cdot 10^{-3}$ &$7.65 \cdot 10^{-2}$&$7.60\cdot 10^{-4}$&$2.88 \cdot 10^{-3}$&$1.57 \cdot 10^{-2}$ & 0 \\ & & stop at $a_t$& $1.16 \cdot 10^{-3}$ &$7.46 \cdot 10^{-2}$&0&$2.77 \cdot 10^{-3}$&$1.60 \cdot 10^{-2}$ & $2.52 \cdot 10^{-3}$\\ \hline\hline \multirow{2}{*}{A} & \multirow{2}{*}{$0.0 $} & stop at $t_f^*$& $1.48 \cdot 10^{-3}$ &$4.65 \cdot 10^{-2}$&$3.16 \cdot 10^{-5}$&$ 1.55\cdot 10^{-3}$&$ 1.13 \cdot 10^{-2}$ & 0 \\ & & stop at $a_t$& $1.49 \cdot 10^{-3}$ &$4.68 \cdot 10^{-2}$&0&$ 1.56\cdot 10^{-3}$&$ 1.14\cdot 10^{-2}$ & $ 4.87\cdot 10^{-5}$\\ \hline \multirow{2}{*}{B} & \multirow{2}{*}{$0.698 $} & stop at $t_f^*$& $5.09 \cdot 10^{-4}$ &$1.68 \cdot 10^{-2}$&$1.39 \cdot 10^{-4}$&$5.63 \cdot 10^{-4}$&$1.79 \cdot 10^{-2}$ & 0 \\ & & stop at $a_t$& $4.94 \cdot 10^{-4}$ &$1.66 \cdot 10^{-2}$&0&$5.57 \cdot 10^{-4}$&$1.79 \cdot 10^{-2}$ & $4.98 \cdot 10^{-4}$\\ \hline \multirow{2}{*}{C} & \multirow{2}{*}{$1.396 $ } & stop at $t_f^*$& $2.73 \cdot 10^{-3}$ &$1.58 \cdot 10^{-1}$&$2.27 \cdot 10^{-3}$&$5.93 \cdot 10^{-3}$&$7.98 \cdot 10^{-2}$ & 0 \\ & & stop at $a_t$& $2.76 \cdot 10^{-3}$ &$1.48 \cdot 10^{-1}$&0&$5.43 \cdot 10^{-3}$&$8.23 \cdot 10^{-2}$ & $7.60 \cdot 10^{-3}$\\ \hline \multirow{2}{*}{D} & \multirow{2}{*}{$2.094 $} & stop at $t_f^*$& $3.50 \cdot 10^{-3}$ &$1.50 \cdot 10^{-1}$&$2.20 \cdot 10^{-3}$&$5.87 \cdot 10^{-3}$&$ 2.37 \cdot 10^{-2}$ & 0 \\ & & stop at $a_t$& $ 3.41\cdot 10^{-3}$ &$1.44 \cdot 10^{-1}$&0&$5.40 \cdot 10^{-3}$&$2.37\cdot 10^{-2}$ & $7.11 \cdot 10^{-3}$\\ \hline \multirow{2}{*}{E} & \multirow{2}{*}{$2.793 $} & stop at $t_f^*$& $1.81 \cdot 10^{-3}$ &$8.94 \cdot 10^{-2}$&$8.77 \cdot 10^{-4}$&$3.39 \cdot 10^{-3}$&$1.04 \cdot 10^{-2}$ & 0 \\ & & stop at $a_t$& $1.84 \cdot 10^{-3}$ &$8.79 \cdot 10^{-2}$&0&$3.30 \cdot 10^{-3}$&$1.08 \cdot 10^{-2}$ & $ 2.96 \cdot 10^{-3}$\\ \hline \multirow{2}{*}{F} & \multirow{2}{*}{$3.491$} & stop at $t_f^*$& $1.21 \cdot 10^{-3}$ &$1.56 \cdot 10^{-2}$&$2.09 \cdot 10^{-4}$&$5.57 \cdot 10^{-4}$&$6.40 \cdot 10^{-3}$ & 0 \\ & & stop at $a_t$& $1.15 \cdot 10^{-3}$ &$1.49 \cdot 10^{-2}$&0&$5.0 \cdot 10^{-4}$&$6.12 \cdot 10^{-3}$ & $7.21 \cdot 10^{-4}$\\ \hline \multirow{2}{*}{G} & \multirow{2}{*}{$4.189$} & stop at $t_f^*$& $6.46 \cdot 10^{-4}$ &$3.54 \cdot 10^{-2}$&$4.90 \cdot 10^{-4}$&$1.17 \cdot 10^{-3}$&$7.02 \cdot 10^{-3}$ & 0 \\ & & stop at $a_t$& $6.31 \cdot 10^{-4}$ &$3.18 \cdot 10^{-2}$&0&$9.69 \cdot 10^{-4}$&$5.14 \cdot 10^{-3}$ & $1.51 \cdot 10^{-3}$\\ \hline \multirow{2}{*}{H} & \multirow{2}{*}{$4.887$} & stop at $t_f^*$& $1.28 \cdot 10^{-3}$ &$5.22 \cdot 10^{-2}$&$2.49\cdot 10^{-4}$&$2.0 \cdot 10^{-3}$&$8.48 \cdot 10^{-3}$ & 0 \\ & & stop at $a_t$& $1.28 \cdot 10^{-3}$ &$5.19 \cdot 10^{-2}$&0&$1.98 \cdot 10^{-3}$&$8.52 \cdot 10^{-3}$ & $7.99\cdot 10^{-4}$\\ \hline \multirow{2}{*}{I} & \multirow{2}{*}{$5.585 $} & stop at $t_f^*$& $3.18 \cdot 10^{-3}$ &$1.41 \cdot 10^{-1}$&$6.02 \cdot 10^{-4}$&$3.78 \cdot 10^{-3}$&$3.64 \cdot 10^{-2}$ & 0 \\ & & stop at $a_t$& $3.20 \cdot 10^{-3}$ &$1.42 \cdot 10^{-1}$&0&$3.81 \cdot 10^{-3}$&$3.77 \cdot 10^{-2}$ & $2.11 \cdot 10^{-3}$\\ \hline \end{tabular} \end{table} \section*{Neural representation of the value function} \begin{figure}[tb] \centering \includegraphics[width=0.9\textwidth]{belt.png} \caption{Initial conditions in the value function learning dataset. Astronomical units used.} \label{fig:belt} \end{figure} In this section we train a neural model $\mathcal N$ to represent the value function, or cost-to-go for our problem, that is $v(\mathbf r, \mathbf v) = J = t_f-t_0$: the optimal time of flight as a function of the state. Note that, in theory, if we were able to learn the value function exactly, the optimal policy could also be derived from Hamilton-Jacobi-Bellman (HJB) equations as: $$ \mathbf t^* = \argmin_{|\mathbf t|=1}(\nabla_{\mathbf r} v \cdot \dot{\mathbf r} + \nabla_{\mathbf v} v \cdot \dot{\mathbf v}) \rightarrow \mathbf t^* = - \frac{\nabla_{\mathbf v} v}{\vert\nabla_{\mathbf v} v\vert} $$ this fact, in a different context, was recently successfully used by Izzo and Ozturk who used the HJB equations to directly inform the network training~\cite{dario_ekin_earth_venus}. The technique, developed independently but related to the emerging field of physically informed neural networks \cite{raissi2017physics}, made use of a training set of optimal trajectories defined in an ample bundle surrounding one nominal solution. In general, when the aim is to represent the optimal policy (i.e. the optimal low-thrust profile) in proximity to one nominal trajectory, for example for guidance and control purposes, the approach pursued in the previous section (i.e. a G\&CNET) is already able to produce very accurate results and while alternatives exist, they will not here be pursued. Instead, we here seek to approximate the value function for the purpose of predicting the optimal rendezvous time-of-flight from any initial starting condition in a wide area of the entire state space, as opposed to targeting only a bundle around one nominal trajectory. In particular we focus here in a scenario where any orbit in an asteroid belt has to rendezvous to a target object placed in a circular, zero-inclined orbit. \subsection*{The dataset} We generate a dataset of optimal state-time-of-flight pairs by solving the shooting function in Eq.(\ref{eq:shooting}) for 4,000 different values of $\mathbf r_0, \mathbf v_0$. We generate these values by randomly sampling the osculating Keplerian elements in the inertial frame and then converting them into the Cartesian state in $\mathcal F$. The sampling bounds are chosen as to cover a good portion of the inner and middle asteroid belt with $a \in [2,3]$ AU, $e\in[0, 0.25]$, $i\in [0,5]$ deg. and $\Omega, \omega, E \in [0, 360]$ deg. In Figure \ref{fig:belt} the initial conditions are visualised as well as the target position for the rendezvous. The generic single entry in our dataset thus contains the values $[X_i, Y_i] = [(x_i,y_i,z_i,{v_x}_i,{v_y}_i,{v_z}_i), (t_{f_i}^*)]$. In this setup, the problem of local minima must be addressed with particular care as to avoid inserting in the dataset wrongful and deceiving information as well as avoiding database biases. To this aim, we try to solve each of the 4,000 shooting functions in $N_{trials} = 120$ separate experiments , corresponding to the number of CPUs available to us. In each case, a maximum of $N_{res}=30$ restarts are tried to find one solution starting from randomly sampled co-states in $[-1,1]$ and times-of-flight in $[1.5, 3.]$ years. Out of the 120 guesses, if at least $N_{sol}=50$ result in a solution we then find, among them, the one corresponding to the smallest time of flight and insert it in the dataset, else we generate a new initial condition for the state and try again. We report that roughly 8\% of the initial conditions failed to meet this criteria (i.e. for those cases $N_{sol}<50$) and were thus substituted. Note that this kind of filter is likely to create a bias on the dataset towards simpler problems, as it discards the instances leading to a poor convergence of the root finder which may be also correlated to difficult cases for the regression, but the small fraction of discarded conditions was deemed to be acceptable for our purposes. We also report that in the creation of the dataset roughly 20\% of cases resulted in multiple locally optimal solutions (mostly two, of which we inserted in the dataset the one with smallest $t_f^*$) while the rest converged consistently (all $N_{trials}$ times) to the very same transfer. This procedure, although computationally expensive (taking less than half a day of computations on our supercomputer), allows to compile a dataset that includes correctly difficult cases for a low-thrust transfer such as those, for example, close to the hyper-surface of the state space separating trajectories requiring a different number of revolutions. These are in fact the conditions that often result in local minima or mis-convergence and that, if excluded, would result in a biased (and easier) dataset. If these conditions were instead included without caring for the possibility of local minima, the dataset would contain deceiving information for the model training. Eventually, we use 75\% trajectories for training and the remaining as a test set. We then produce also a second dataset, augmenting all the 3,000 training trajectories using the backward generation of optimal examples. For each nominal trajectory we produce 32 new optimal examples perturbing the final co-states by $\delta=0.0001$ and integrating back in time up to the optimal $t_f^*$. The resulting augmented dataset is created in less than 10 seconds on a standard CPU and contains 96,000 optimal transfers from the belt to the target. We release openly both dataset produced as well as the exact train/test split used in this manuscript on the CERN owned platform Zenodo~\footnote{The dataset can be downloaded here: \url{ https://doi.org/10.5281/zenodo.6365326} and was assigned the following d.o.i. \url{10.5281/zenodo.6365326} }. \subsection*{The neural model} We consider the task of learning the value function (i.e. the optimal time of flight) for the 1,000 trajectories of the test set as a supervised learning task, essentially a nonlinear regression problem. We use a simple feed-forward neural network with rectified linear units (ReLu) and 4 hidden layers with 100 neurons each. From the Cartesian elements $X$ contained in the dataset, we compute the modified equinoctial elements \cite{walker1985set}. In order to avoid issues related to the discontinuity of its representation, instead of the true longitude $L$, we use $\cos L, \sin L$ and we indicate the new set of attributes, now with an increased dimension, with $X_{eq}$. As a last step we scale all attributes uniformly in the range $[-1,1]$ via the simple transformation: \begin{equation} \begin{array}{l} X_{in} = 2 (X_{eq} - X_{min})/(X_{max} - X_{min}) - 1\\ \end{array} \end{equation} For the optimizer we use the same setup (Adam \cite{kingma2014adam}) as in the experiments on the optimal policy, changing only the initial learning rate to $l = 0.5\cdot 10^{-3}$. Note that this regression problem, having a relatively small size, can also be tackled using different machine learning approaches (see for example \cite{mereta2017machine}) potentially offering improvements over the neural model here described. The neural approach here used, on the other hand, is of particular interest when coupled with the data augmentation technique employed, the backward generation of optimal examples, which creates a much larger training set to exploit. \subsection*{Results and discussion} \begin{figure}[tb] \centering \includegraphics[width=1.0\textwidth]{prediction_error.png} \caption{Error on the training/test set.} \label{fig:err_value_func_learn} \end{figure} The results for the best models trained over both the original and the augmented dataset are visualised in Figure \ref{fig:err_value_func_learn}. In general we note how, in relative terms, the error on the value function is now much larger than the one we obtained in a previous section when we trained the network to represent the optimal policy (even though still smaller than 4\% on average). This is expected and consequential to two different reasons. Firstly, we are tackling a much more difficult problem in that the diversity of the trajectories used is vastly larger, covering the entire asteroid belt, not only the neighbourhood of one nominal trajectory. Secondly, we are here learning from a much smaller and less dense dataset, a consequence of the fact that many nominal trajectories have here to be computed, not only one. Nevertheless, the accuracy of $25.42$ days is greatly higher than, for example, the $468.56$ days one obtains using the Edelbaum approximation \cite{edelbaum1965optimum}. This shows how the neural model developed is capable of capturing the complex phenomenon of phasing as well as effects connected to the orbits eccentricity and spatial orientation, aspects entirely neglected by the Edelbaum approach. A second fact worth noting is the advantage offered by the use of data augmentation. While all the augmented trajectories are in some neighbourhood of one entry of the original dataset, and thus add only a limited amount of new information, their presence allows for a significant improvement on the prediction (26\% decrease in MAE). It is worth mentioning here that a larger dataset, such as that produced by the data augmentation, also means higher training times for the model, something that would likely be accepted in a real application given the substantial gain introduced and the fact that the database augmentation cost, in terms of computational time is essentially, negligible. On the right plot of Figure \ref{fig:err_value_func_learn} we see the generalization capabilities of the model on the test set. These are trajectories whose initial elements are still sampled uniformly in the same bounds as the training set, but that have never been encountered while training the model. It is interesting to note how very large errors are made by the model on a few trajectories, mostly in the test set, but also in the training set. We thus performed an investigation on these outliers as to understand their origin. We find that in the test set there are 13 data points whose error on the predicted time of flight is larger than 300 days. For these 13 cases we find that the prediction of the trained neural model can be explained by one of three reasons. \begin{itemize} \item The predicted time of flight is actually correct and the label in the dataset, instead, correspond to a local minimum which slipped through our dataset creation pipeline. This actually happened for 6 of the 13 outliers: the majority of cases. This is particularly interesting as it hints at a possible use of the neural model to find or suggest possible cases where some full optimization model converges to a local minima. \item The predicted time of flight corresponds, within a few days, to a local minima. This actually happened for 2 of the 13 outliers. \item The predicted time of flight does not represent any real optimal trajectory. This actually happened for 5 of the 13 outliers. While these cases are always bound to exist in the learned mode, removing erroneous labels in the training set and increasing the dataset size is likely beneficial to alleviate this issue. \end{itemize} In Figure \ref{fig:localglobal} we visualise one of the troublesome transfers, erroneously inserted in the dataset, but correctly predicted by the trained model, together with the correct globally optimal strategy. For this case, our root finder (applied to the shooting function) converged to the global solution only after many restarts, confirming this transfer as a particularly difficult case to find for any dataset creation procedure. One could of course try to mitigate this problem when creating a dataset by employing more restarts, but no number guarantees the absence of these occurrences. On the other hand, as here shown, the trained model does provide hints as to where they may occur, something that can be exploited \emph{a posteriori}. \begin{figure}[tb] \centering \includegraphics[width=0.6\textwidth]{localglobal.png} \caption{An outlier in the neural model predictions over the test set. The globally optimal transfer is shown on the left, while the one consistently found by our numerical approach (and thus ending up in the dataset) is shown on the right.} \label{fig:localglobal} \end{figure} \section*{Conclusion} The time optimal low-thrust problem for a constant acceleration rendezvous has been studied in the context of neural modelling. Both the optimal policy and value function representation are studied. We find that a G\&CNET, a deep feed forward neural network trained on optimal examples, is able to represent to great accuracy the optimal policy. Our results suggest that the on-board use of similar neural models for the spacecraft guidance and control is able to fulfil well possible operational requirements on the velocity and position residuals, thus constituting a valid alternative to currently proposed methods. We also show how the dataset of optimal trajectories employed to backpropagate the model errors can be created in seconds rather than days, if the data augmentation technique called backward generation of optimal examples is used. In the case of value function learning we find that a neural model is able to represent the value function in a vast region of the state space corresponding to the entire asteroid belt and with errors that are below 4\% on average and mostly concentrated in a few outliers related to the presence of local minima solutions and, ultimately, of very complex globally optimal transfer strategies that compete with much simpler locally optimal ones. We show that employing the data augmentation technique also in this case allows to significantly improve the predictions made by the neural model, leading to a 26\% decrease in MAE. While the dynamical model used in this paper as a test case is not appropriate for many cases of practical interest, it served its purpose of resulting in quick optimisation procedures and thus allowing to refine the overall work logic and results. We hope that our work will facilitate, in the future, the training of neural models representing more complex cases.
c366f7f4506a4ca834bbd5de63ded13fde5f5204
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Neural sequence-to-sequence systems deliver state-of-the-art performance for automatic speech recognition (ASR). When using appropriate modeling units, e.g., byte-pair encoded characters, these systems are in principle open vocabulary systems. In practice, however, they often fail to recognize words not seen during training, e.g., named entities, numbers or technical terms. To alleviate this problem, \cite{huber2021instant} proposed to supplement an end-to-end ASR system with a word/phrase memory and a mechanism to access this memory to recognize the words and phrases correctly. After the training of the ASR system, and when it has already been deployed, a relevant word can be added or subtracted instantly without the need for further training. This is achieved by, a) a memory-attention layer which predicts the availability and location of relevant information in the memory, and b) a memory-entry-attention layer which extracts the information of a memory entry. In this paper we study, a) methods to acquire specialized words for this memory and, b) the trade-off between improvement in recognition accuracy of new words and the potential danger of false alarms for those added words. Therefore, we extensively evaluate this system in an online low-latency setup. The ASR model described above outputs uncased text without punctuation. Therefore, we run a casing and punctuation model afterwards which reconstructs the casing of each word and inserts the punctuation. This model consists of a transformer encoder \cite{vaswani2017attention,pham2019very} which is run after the beam-search and outputs for each word if the word should be uppercased and if any punctuation should be emitted after the word or not. To use the model in an online low-latency setup \cite{nguyen2021superhuman}, we do the following: The model waits for a chunk of acoustic frames with at least a predetermined duration to arrive. Then beam search is run with this input chunk. The beams (called unstable hypotheses) are then given to a stability detection component which returns a stable hypothesis, e.g. the common prefix of all hypotheses. After that, the part of audio corresponding to the stable hypothesis is cut out (via an alignment) and the model waits for more audio frames. \section{Experiments and Results} We extended the model proposed in \cite{huber2021instant} with the ability to correctly do the casing of the new words supplied through the new words list. This is done by adapting the casing and punctuation model by using internals of the ASR model, namely the attention over the memory entries. For each word the beam-search has outputted, all the predicted memory entries (from the memory-attention layers) are compared with the word. If there is a match, the casing from the new words list is taken. Therefore, whenever a new word is recognized by the model, the correct casing from the new words list is outputted. Furthermore, we evaluate the system in two different scenarios: First, when an operator adds new words to the system, and second, when new words are extracted from other sources, e.g. slides. \subsection{Data} For the first scenario, we use eight talks from the ELITR testset \cite{sltev:eacl:2021} with a total length of 3.7 hours. For the second scenario, we use ten talks from the EMNLP 2020 conference\footnote{\url{https://2020.emnlp.org}} with a total length of 1.6 hours. Along with the EMNLP talks, the papers and the slides of the talks are available. The text from the papers (excluding the references) is extracted with pdftotext\footnote{\url{https://en.wikipedia.org/wiki/Pdftotext}}, the text from the slides is extracted with Tesseract\footnote{\url{https://github.com/tesseract-ocr/tesseract}}, since we only had access to screenshots of the slides. We also cleaned the transcripts of all talks from typos, so that they could serve as a reliable reference. \begin{figure}[t] \centering \includegraphics[trim={0 0 14cm 0},clip,width=0.9\linewidth]{images/plot_ELITR.pdf} \caption{Recall and precision for the evaluation of the memory ASR-worker on the ELITR testset.} \label{fig:testsetELITR} \end{figure} \begin{figure}[t] \centering \includegraphics[trim={14cm 0 0 0},clip,width=0.9\linewidth]{images/plot_ELITR.pdf} \caption{mWER and F1-score for the evaluation of the memory ASR-worker on the ELITR testset.} \label{fig:testsetELITR2} \end{figure} \subsection{Extraction of the New Words List} We tried different methods to extract a list of new words from the document, and we ended up taking all the words of the document which are not in the training data of the ASR model. This method is simple and performed well when looking at the output words\footnote{Furthermore this method is very effective in finding errors in the transcript.}. For example in the talk \texttt{rehm\_long},\footurl{https://github.com/ELITR/elitr-testset/tree/master/documents/rehm-language-technologies} we have extracted the following list of new words: pipelining, Friem, iAnnotate, MQM, LSPs, eServices, semantification, Aljoscha, Cortana, workflows, DFKI, annotating, NLP. With this method, we extracted 134 terms from the ELITR testset reference transcripts, 148 from the EMNLP testset reference transcripts, 865 from the EMNLP papers and 584 from the EMNLP slides. Note that, in contrast to the new-words testset in \cite{huber2021instant}, the list of new words is created automatically and might differ from a list of new or rare words a human might select. \subsection{Evaluation with the Help of an Operator} \begin{figure}[t] \centering \includegraphics[trim={0.15cm 0 17.9cm 0},clip,width=1.0\linewidth]{images/plot_EMNLP.pdf} \caption{Recall and precision for the evaluation of the memory ASR-worker on the EMNLP testset.} \label{fig:testsetEMNLP} \end{figure} \begin{figure}[t] \centering \includegraphics[trim={18.1cm 0 0.25cm 0},clip,width=1.0\linewidth]{images/plot_EMNLP.pdf} \caption{mWER and F1-score for the evaluation of the memory ASR-worker on the EMNLP testset. } \label{fig:testsetEMNLP2} \end{figure} In this scenario, we evaluate the system, when the list of new words is extracted from the reference transcript (Oracle). This simulates an operator introducing new misrecognized words in the memory. We use eight talks of the ELITR testset for the evaluation. Dependent on the approach used (x axis in \cref{fig:testsetELITR,fig:testsetELITR2}), either an empty list of new words (Empty), i.e. the baseline, or the full list of new words (Oracle) is used. For the approaches ``* af. occ.'' and ``* be. occ.'', a new word is added to the list of new words \textit{after} the first \textit{occurrence} or \textit{before} the first \textit{occurrence} of that word, respectively. These two approaches simulate an operator correcting the output and either the corrected segment is reevaluated or not. The first condition reflects the case when the operator can quickly react to errors but cannot fix them once the segment has been shipped, the second condition represents the situation when either the shipping is delayed a little to give the operator a chance to introduce the correction, or when the overall system setup allows updating previous outputs. The second situation is common e.g. in re-translating systems such as ELITR \cite{bojar-etal-2021-elitr}. Furthermore, we noticed, that sometimes false positives occurred, i.e. a word in the new words list is confused with a common word and outputted even though it is not in the audio and the reference transcript at that point. In the approaches marked with ``* ext. *'', we therefore \textit{extended} the list of new words and added these common words also to the new words list. This should help the model to distinguish between the common word and the new word. These approaches simulate an operator adding common words to the memory when a false positive is observed. The mWER segmenter \cite{matusov2005evaluating} is used to align the output segments with the reference segments. In \cref{fig:testsetELITR,fig:testsetELITR2}, we can see the results. The recall, precision and F1 score is measured on the new words. The baseline model with empty memory performs poorly. For the other approaches, we see that it certainly helps to add the new word before the occurrence. The approaches with extended memory list produce substantially fewer false positives with the approach ``Oracle ext. be. occ.'' reaching an F1 score of $0.80\pm 0.02$. Furthermore, we see that all approaches have similar word error rates (mWER) suggesting that the word error rate is not an appropriate measure for evaluating if important words are correctly recognized. Note that the talks are challenging and the transcript is not very clean and therefore the word error rates are relatively high. We noticed that the performance of the ASR worker when used in online low-latency mode is not deterministic. This happens because the packets of audio are sent over the network and they can, dependent on the network latency, arrive earlier or later. Therefore, when the predetermined duration of audio is reached, the model can start processing a slightly smaller or longer audio input sequence. Thus, as described above, the stable hypothesis found by the stability detection is not deterministic and therefore the same holds true for the ASR output. Therefore, we report mean and standard deviation performance over 16 runs as shown in \cref{fig:testsetELITR,fig:testsetELITR2}. \subsection{Evaluation with Additional Sources} In this scenario, we evaluate the system when the list of new words is extracted from additional sources. We conducted experiments on ten talks from the EMNLP 2020 conference. The list of new words was extracted from the paper or the slides (with optical character recognition), respectively, with the same method described above. For the approach ``Curr. slides'', the new words list was extracted from the previous, current and the upcoming slide. In \cref{fig:testsetEMNLP,fig:testsetEMNLP2}, we see similar results for the approaches that were already evaluated on the ELITR testset (e.g. F1 scores of $0.66\pm 0.01$ vs. $0.65\pm 0.02$ for the oracle approaches). For the approaches ``Paper'' and ``* slides'', we evaluate the performance on all the new words of the transcript and on the new words of the transcript intersected with the new words from the source. We differentiate between these two evaluation methods to show the effect of the new uttered word being actually available in the source or not. The performance on the new words of the approach ``Paper'' is not much worse than the oracle approach (F1 scores of $0.66\pm 0.01$ vs. $0.56\pm 0.01$), especially when considering the evaluation only of new words present in the paper ($0.63\pm 0.01$), compared to an F1 score of $0.09\pm 0.00$ for the approach ``Empty''. The performance when extracting the new words list from the slides is worse when evaluating on all new words from the transcript, possibly due to the used optical character recognition. When evaluating only on new words present in the slides, the performance is better than the corresponding approach of extracting the new words from the paper. Combining the new words from the paper and the slides did not yield improvements. The word error rate (mWER) stays almost the same for all approaches, however one can see that for the approaches with many words in the memory, the word error rate is a bit higher. We investigate this phenomenon further in section \ref{sec:add-exp}. \subsection{Additional Experiments} \label{sec:add-exp} We investigated the usage of a large memory and took a certain number of random words from the training dataset as memory. Then we decoded the tedlium testset \cite{hernandez2018ted}. The results can be seen in \cref{fig:testsetMemorySize}: a huge number of words in the memory result in a drastically worse word error rate. This happens since a lot of false positives are occurring. \begin{figure}[t] \centering \includegraphics[trim={0 0 0 0},clip,width=1.0\linewidth]{images/plot_largemem.pdf} \caption{Evaluation of the memory ASR-worker on the tedlium testset with a large number of random words from the training dataset in the memory.} \label{fig:testsetMemorySize} \end{figure} Therefore, our approach is best used with a small number of new words the model should focus on. As the final experiment, we examined the situation when a new word in the memory is not found (by the memory-attention layers). This can happen if the pronunciation of the word differs considerable from the ``common pronunciation'' as learned by the general model. To help the model recognize the new word anyway, we propose not to search for the new word but for the word the model outputs instead. So for example if we want to recognize ``his name is ron weasly" but the model would output ``his name is ron weesley" even if the word ``weasly" is in the memory, we would use the confused form ``weesley" in the memory-attention layer which searches through the memory and eventually use ``weasly" for memory-entry-attention layer which extracts information from from the memory. Note that in this case, the scenario for the practical use is severely different. Instead of the information that a novel word will probably occur somewhere in the transcript, one now needs to have the information that at a specific point a word is wrong and another word is correct at that location. We went through the false negatives of the new words testset from \cite{huber2021instant} and applied this approach. As a result, we obtained that the accuracy on the new words testset increased from 90.4\% to 94.1\%. \section{Conclusion} We demonstrated an efficient method of acquiring a new words list given a source such as supplementary paper or slides and evaluated the trade-off between improving the recognition accuracy of new words and the occurrence of too many false positives in an online low-latency environment. We documented that standard WER does not reflect the success of recognition of these typically very important words. We obtained an F1 score of up to $0.80$ evaluated on the recognition of new words. \section{Acknowledgements} We want to thank SlidesLive,\footnote{\url{https://library.slideslive.com/}} who provided us with the transcripts of the EMNLP talks. The projects on which this paper is based were funded by the European Union under grant agreement No 825460 (ELITR), the Federal Ministry of Education and Research (BMBF) of Germany under the numbers 01IS18040A (OML) and 01EF1803B (RELATER) and the Czech Science Foundation under the grant 19-26934X (NEUREM3). \bibliographystyle{IEEEtran}
3cd56b140d89a0f82129a66ab782fb8bafd5447f
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction}\label{sec:introduction} \begin{figure}[t] \centering \includegraphics[width=0.45\textwidth]{figures/teaser.pdf} \caption{Our method is trained to approximate the output of an ensemble, by using structured uncertainty prediction networks (SUPN) to predict a mean and covariance for a multivariate Gaussian distribution. This explicit distribution enables a variety of tasks including: sampling, conditioning and model introspection. } \label{fig:teaser} \end{figure} Single prediction neural networks are ubiquitous in computer vision and have demonstrated extensive capability for a variety of tasks. However, researchers are increasingly interested in capturing the uncertainty in estimation tasks to combat over-confidence and ambiguity; such concerns are important when building robust systems that connect computer vision approaches to down-stream applications. The deployment of neural networks for safety-critical tasks, such as autonomous driving, requires an accurate measure of uncertainty. While Bayesian Neural Networks~\cite{mackay1995probable} are often a model of choice for uncertainty estimation, ensembles~\cite{lakshminarayanan2017simple} have been proposed as a simple alternative. Empirically, ensembles have been shown to produce good measures of uncertainty for vision tasks~\cite{li2020improving, poggi2020uncertainty} and allow practitioners to exploit associated application-specific inductive biases, for example established architectures, directly. \paragraph{Limitations of implicit approaches} Despite their popularity, ensembles have a number of drawbacks that we group into three themes. Firstly, they come at an increased cost compared with deterministic networks. At training time, they require training multiple deep models, while at test time, multiple inference passes are required. MC-dropout \cite{gal2016dropout} saves computation at training time, but it still requires multiple passes at inference time. Secondly, these approaches only provide an implicit distribution over probable model outputs. Any uncertainty captured is only accessible through ancestral sampling. Accordingly, one cannot calculate conditional samples, or assess the likelihood of a new sample given the learned model. Finally, and of increasing importance to the community, introspection of the trained models is very difficult. When combining computer vision with larger systems, there is virtue to summarising the posterior distribution in a formal and compact form that can be visualised and appropriately used to inform downstream tasks. The computational challenges have prompted work on producing a single model to approximate the output of an ensemble; so called ``ensemble distillation''~\cite{malinin2020ensemble, li2020improving,bulo2016dropout,shen2021real}. \paragraph{Lack of structure in distillation methods} Previous methods focus on: classification problems~\cite{malinin2020ensemble, li2020improving}, approximating only the mean of the ensemble~\cite{bulo2016dropout}, or modelling independent per-pixel variance~\cite{shen2021real}. In contrast, while we also adopt a single model to reduce the computational cost, we propose to learn a model that approximates the ensemble by formally capturing structure in the output space; this is more appropriate for dense prediction tasks. When making per-pixel predictions, it is common to use models that capture spatial correlation in the output space. In particular, models such as Markov or Conditional Random Fields~\cite{prince2012computer}, which capture correlations between neighbouring pixels, have been extensively used in computer vision. However, capturing the structure of the output space is less explored in the context of modelling uncertainty. Previous work has focused on per-pixel heteroscedastic uncertainty, by using a Gaussian~\cite{kendall2017uncertainties, shen2021real} or Laplace~\cite{klodt2018supervising} likelihood model with diagonal covariance. Since these models do not capture correlations between pixels, samples suffer from salt-and-pepper (independent) noise. \paragraph{Capturing structure explicitly} Previously, adopting per-pixel uncertainty representations usually follows from the expectation that direct estimation of a full covariance structure is intractable in both storage $\mathcal{O}(\text{pixels}^2)$ and computation $\mathcal{O}(\text{pixels}^3)$. Recently, however, Dorta~\etal~\cite{dorta2018structured} introduced Structured Uncertainty Pprediction Networks (SUPN) for generative models. The paper extended a Variational Auto Encoder (VAE)~\cite{kingma2013auto} with a likelihood model that is Gaussian with a full covariance matrix. The authors show how this can be predicted efficiently by using a sparse approximation of the Cholesky decomposition of the \emph{precision} matrix. Working in the domain of the precision allows a dense covariance structure to be obtained whilst also respecting our prior that long range structure is derived from the propagation of local image statistics. By encoding a full covariance matrix, the samples obtained from such a model capture these long range correlations in the image domain and are free from salt-and-pepper (independent) noise. \paragraph{Contributions} In this work, we build on SUPN~\cite{dorta2018structured} and show that a deep network can be trained in a regression setting to predict a structured Gaussian distribution that approximates the output distribution of methods that capture model uncertainty, such as ensembles~\cite{lakshminarayanan2017simple} and MC-dropout~\cite{gal2016dropout}. We introduce a novel efficient approach to drawing conditioned or unconditioned samples from a structured multivariate Gaussian distribution with a sparsely structured precision matrix. By taking full advantage of the closed form nature of the Gaussian distribution, our method allows introspection and enables conditioning at test time, which proves cumbersome for other methods. Importantly, our approach is not limited to Gaussian likelihoods over the prediction space (see~\S~\ref{sec:non-gauss-likelihood}). \paragraph{Evaluation} We demonstrate the efficacy of our method for the task of depth estimation. Experiments show that the new advantages can be obtained without sacrificing quantitative performance, with results comparable to the original ensemble; we consider metrics over both accuracy and the capture of uncertainty. The samples are found to follow the ensembles without being limited in the number that can be drawn. The compact representation is capable of encoding a rich distribution with only a modest increase in computation over a single deterministic network. Furthermore, we demonstrate using our explicit representation to perform conditional sampling and illustrate the ability to inspect the model and visualise the correlation structure learned. \section{Background} Our goal is to model $p(\mLabels \given \mInputs)$, where $\mInputs$ is the observed image and $\mLabels$ is a per-pixel prediction, \eg a semantic labelling or depth map. While most deterministic deep models can be seen as capturing the mean $\mMean(\mInputs)$ of this distribution, we are interested in models that also capture the variance $\mCovariance(\mInputs)$. \subsection{Uncertainty in Deep Models} Previous work for probabilistic modelling using neural networks, can be broadly grouped into three categories: (1) Bayesian approaches that model uncertainty of the network parameters, (2) methods that empirically approximate Bayesian approaches by predicting multiple hypothesis, and (3) approaches that model $p(\mLabels \given \mInputs)$ directly by predicting a parametric distribution. The literature on uncertainty modelling in neural networks is vast and we direct the interested reader to a recent review~\cite{abdar2020review}. \paragraph{Modelling uncertainty in the parameters} Bayesian neural networks~\cite{mackay1995probable} model uncertainty by modelling the probability distribution of the learned weights~$\mModelParams$ of the network. The resulting posterior $p(\mLabels \given \mInputs)$ is then obtained by marginalising over the weights: \begin{equation} p(\mLabels \given \mInputs, \mDataset) = \int p(\mLabels \given \mInputs, \mModelParams) \, p(\mModelParams \given \mDataset)~d \mModelParams \,, \label{eq:bayesian_networks} \end{equation} where $\mModelParams$ are the model parameters, and we make explicit the dependence on the dataset $\mDataset$. While this approach is able to model arbitrary distributions $p(\mLabels|\mInputs)$, and generate samples which are correlated in output space, it also suffers some limitations. The majority of approaches rely on mean-field approximations over the weights to maintain tractability. In addition, it is difficult to condition on any of the output values due to the absence of a parametric distribution over the posterior. MC-dropout~\cite{gal2016dropout} approximates Bayesian networks by using dropout at both training and test time. Dropout was first proposed to reduce over-fitting in deep neural networks~\cite{srivastava2014dropout} and it proceeds by randomly setting some of the weights of the network to zero. It has been shown, \cite{gal2016dropout}, that this random dropping of weights at test time is akin to sampling from the distribution $p(\mModelParams \given \mDataset)$ and may be used to approximate the integral in~ \eqref{eq:bayesian_networks}. \paragraph{Multiple hypothesis} Ensemble methods make use of multiple models and combine them to get a single prediction. Deep ensembles can be trained using bootstraping~\cite{lakshminarayanan2017simple}, \ie splitting the training set into multiple random subsets and training each model in the ensemble independently. Alternatively, to save computation, a deep ensemble can be trained by taking multiple snapshots~\cite{huang2017snapshot} from the same training procedure, requiring a cyclic learning rate. Ensembles have been shown to provide good measures of uncertainty~\cite{lakshminarayanan2017simple}. They can be seen as approximating Bayesian networks by replacing the integral in~\eqref{eq:bayesian_networks} by a sum over a discrete number of models. As discussed in \S~\ref{sec:introduction}, training and inference procedures can become expensive in terms of maintaining an increasing number of networks; practical approaches are often limited in the number of distinct models that, in turn, restricts the number test-time samples. \paragraph{Predictive uncertainty via parametric distributions} The other alternative to modelling uncertainty is to use a feed-forward neural network to predict the parameters of a parametric distribution~\cite{kendall2017uncertainties}. For regression tasks, $p(\mLabels|\mInputs)$ is typically described by a Gaussian likelihood, where the mean and variance are outputs of the neural network: \begin{equation} p(\mLabels \given \mInputs) \sim \mNormal\big(\mLabels \given \mMean(\mInputs), \mCovariance(\mInputs) \big) \,, \label{eq:gaussianl_likelihood} \end{equation} where $\mCovariance(\mInputs)$ is usually approximated by a diagonal matrix where the diagonal elements are predicted by the network. Kendall and Gal~\cite{kendall2017uncertainties} discuss how the predicted variance can be seen as a loss attenuation factor, reducing the loss for outliers; this predicted per-pixel variance is shown to correlate with error in the predictions. Evaluating predictive uncertainty is more efficient since a single pass of the network at test time is sufficient to fully determine the measure of uncertainty. However, independent per-pixel uncertainty estimates fail to capture spatial correlation that is known to exist in images; samples from these models are destined to be unrealistic and suffer from salt-and-pepper noise. \paragraph{Ensemble distillation} Recently, there has been a growing interest in approximating the probabilistic output of an ensemble by a single model\cite{malinin2020ensemble, li2020improving,bulo2016dropout,shen2021real}. This process is commonly named ``distillation''. Most of the focus has been on classification \cite{malinin2020ensemble, li2020improving}, where the goal is to predict the class of the image. While these methods show impressive results in detecting out-of-distribution images, they are not easily extended for dense prediction tasks. Other methods focus on approximating only the mean of the ensemble distribution \cite{bulo2016dropout}, or modelling independent per-pixel variance \cite{shen2021real}. In contrast, our model also does ensemble distillation, but can capture structure in the output space. \paragraph{Uncertainty in depth prediction models} The goal of self-supervised depth estimation is to train a network to predict single image depth maps without explicit depth supervision \cite{godard2017monodepth, godard2019digging}. Instead, self-supervised approaches use geometric constraints between two calibrated stereo cameras to learn depth prediction. At test time, these methods do not require a stereo pair, only a single image. Given the inherit ambiguity of predicting depth from a single image, depth prediction is a natural use case for uncertainty estimation in dense prediction tasks. In \cite{poggi2020uncertainty} the authors review and compare different approaches for uncertainty prediction for self-supervised depth prediction. They focus on methods that predict multiple hypothesis, such as dropout~\cite{gal2016dropout} and ensembles~\cite{lakshminarayanan2017simple}, methods that predict per-pixel independent heteroscedastic uncertainty~\cite{klodt2018supervising}, and combinations of both. In the experiments, we use the pre-trained networks provided by \cite{poggi2020uncertainty} to evaluate the efficiency of our method in approximating ensembles. In particular, we use their most successful model, which combines an ensemble with predictive uncertainty. Their ensembles are trained using bootstrapping \cite{lakshminarayanan2017simple}, and they use an uncorrelated Laplace distribution for predictive parametric uncertainty. Xia~\etal~\cite{xia2020generating} show how a probabilistic model for depth prediction can be explored by downstream tasks such as inference with additional information. They model uncertainty at a patch level in a model akin to a Markov Random Field. In contrast to our approach, the method requires solving a complex optimization problem at inference time. \subsection{Predicting Structured Gaussian Distributions} \label{sec:SUPN} To approximate an ensemble, we train a network to predict the parameters of a Gaussian distribution. Given an input image $\mInputs$ the network outputs the parameters of a Gaussian distribution $\mMean(\mInputs)$ and $\mCovariance(\mInputs)$. We focus on dense prediction tasks. For these tasks, if $N$ is the number of pixels in the input image, the size of $\mMean$ is also $N$ while a full $\mCovariance$ matrix has $N^{2}$ parameters. The quadratic scaling of the number of parameters of the covariance matrix leads to the common remedy of a diagonal matrix, which requires only $N$ parameters. However, this simplifying assumption prohibits the capture of correlations between pixels. \paragraph{Structured Uncertainty Prediction Networks} Our approach builds on the work, \cite{williams1996using, dorta2018structured}, where the parameterisation used is the Cholesky decomposition of the precision matrix, \ie the network predicts $\mCholPrec$ directly, where $\mCholPrec \trans{\mCholPrec} = \inv{\mCovariance}$ and $\mCholPrec$ is a lower triangular matrix. For completeness, we review some of the properties of the parameterisation presented in \cite{dorta2018structured}, which we use in our work. When choosing a parameterisation, there are a few criteria that should be taken into account: how easy it is to evaluate the likelihood function required for training, how easy it is to sample from the distribution at inference time and how easy is to impose that the covariance matrix (or equivalently precision matrix) is symmetric and positive definite? Direct prediction of the Cholesky factor guarantees that the precision matrix is symmetric. To guarantee that it is positive definite, the diagonal values of the Cholesky decomposition are required to be positive; an easy constraint to enforce in practice. This choice of parameterisation allows for easy computation of the log-likelihood of the multivariate Gaussian distribution. However, sampling is more difficult to perform, since access to the covariance is required. We discuss a new efficient method for sampling in \S~\ref{sec:sampling}. \paragraph{Sparsity} Despite the advantages of using this parameterisation and the fact that the Cholesky is a lower triangular matrix, the number of elements still grows quadratically with respect to the number of pixels, $N$, making it prohibitive to directly estimate for large images. We follow SUPN~\cite{dorta2018structured} in imposing sparsity in the Cholesky matrix $\mCholPrec$. For each pixel, we only populate the Cholesky matrix for pixels which are in a small neighborhood, while keeping the matrix lower-triangular. We include an illustration in the supplemental material. This sparse Cholesky matrix can be compactly represented by only predicting the non-zero values; for a $3 \times 3$ neighborhood, this corresponds to predicting the diagonal map plus 4 off-diagonal maps. Importantly, this representation can be encoded efficiently into popular APIs such as Tensorflow and PyTorch using standard convolutional operations. \paragraph{Deep Gaussian MRFs} Our model can be seen as a Gaussian Markov Random Field, since the sparsity pattern on the precision matrix directly implies the Markov property: a variable is conditional independent of all other variables given its neighbours. Similar to our approach, \cite{chandra2016fast, vemulapalli2016gaussian, rtf2012} use a regression model to predict the parameters of a Gaussian Conditional Random Field that captures structure in output space. They show improved results for semantic segmentation. However, they focus on predicting the MAP solution and % do not make use of the full probability distribution. \newcommand{\mIdentity}[0]{\mathbf{I}} \section{Method} Our goal is to train a single network that approximates the multiple outputs of an ensemble. We assume this ensemble is given as a pre-trained network(s), % \eg from \cite{lakshminarayanan2017simple} or \cite{huang2017snapshot}. We predict a structured multivariate Gaussian using the sparse representation discussed in \S~\ref{sec:SUPN}. \subsection{Training} Given % $I$ training images $\{\mInputs_i \given i \in [1, \mNumImages]\}$, the pre-trained ensemble is run for the full training set, to obtain $S$ distinct predictions per image $\{\mLabels_i^s \given s \in [1, S] \}$, where $S$ is the size of the ensemble or number of MC-dropout samples. \paragraph{Log-likelihood loss} Our network is trained to % minimise the negative log-likelihood of the training set: \begin{equation} \mathcal{L} = - \sum_{i=1}^{\mNumImages}\sum_{s=1}^{S} \, \log \mNormal\big(\mLabels_i^s \given \mMean(\mInputs_i), \mCovariance(\mInputs_i) \big) \,, \end{equation} where $\mNormal\big(\mLabels_i^s \given \mMean(\mInputs_i), \mCovariance(\mInputs_i) \big)$ is the probability density function of a multivariate Gaussian distribution. \subsection{Inference} In common with ensembles and MC-dropout, we can use our model to obtain samples from the predictive distribution $p(\mLabels \given \mInputs)$. In contrast with ensembles, our model is not restricted on the number of samples that can be taken; we discuss an efficient sampling procedure in~\S~\ref{sec:sampling}. More importantly, since our model predicts a closed form probability function, it allows for additional inference tasks which are not possible with ensembles or MC-dropout. \paragraph{Evaluation of the predictive log-likelihood} Our model allows evaluating the log-likelihood for a given dense prediction. This is useful for model comparison. \paragraph{Conditional distribution} The output Gaussian distribution can be used to compute the conditional distribution of some pixel labels, given the label for other pixels. The ability of drawing conditional samples has practical applications, for example: for depth completion, where the depth of a small number of pixels is provided by an external sensor, such as a LIDAR scanner; or for interactive image segmentation, where the label of a few pixels is provided by a user. \subsection{Efficient Sampling}\label{sec:sampling} Sampling from a Multivariate Gaussian distribution with a diagonal covariance matrix $\mCovariance = \mDiag(\sigma_1, \dots, \sigma_{\mNumPixels})$ can proceed with a straight forward sampling approach where each dimension (pixel) is independent: \newcommand{\mLogitSample}[0]{\tilde\mLogit^{(\indSamp)}}% \begin{equation} \mLogitSample_{\indPix} = \mMean_{\indPix} + \sigma_{\indPix} \, \tilde\varepsilon^{(\indSamp)}_{\indPix} , \quad \tilde\varepsilon^{(\indSamp)}_{\indPix} \sim \mNormal(0, 1) \, . \end{equation} If the Gaussian distribution has a general covariance, however, then the sample cannot be computed independently for each pixel and must be drawn through a square root matrix of the covariance, such as the Cholesky factor: \newcommand{\mLogitsSample}[1]{\tilde\mLogits^{(#1)}}% \newcommand{\mNoiseSample}[1]{\boldsymbol{\tilde\varepsilon}^{(#1)}} \begin{equation} \mLogitsSample{\indSamp} = \mMean + \mCholCovar \, \mNoiseSample{\indSamp} , \quad \mNoiseSample{\indSamp} \sim \mNormal(\mathbf{0}, \mIdentity_{\mNumPixels}) \, , \label{eq:loss} \end{equation} where $\mCholCovar \trans{\mCholCovar} = \mCovariance$. Computation of the dense covariance matrix from the sparse precision, followed by the Cholesky operation would involve a computational complexity of $\bigO(\mNumPixels^3)$ and $\bigO(\mNumPixels^2)$ storage making it infeasible. \paragraph{Efficient calculation via the Jacobi method} Fortunately, adopting a sparse structure over the Cholesky precision matrix $\mCholPrec$ means that we can perform a matrix multiplication efficiently. We can exploit this to take approximate samples using a truncated (to $\mNumJacobiIter$ iterations) version of the Jacobi iterative solver to invert $\mCholPrec$. This results in a tractable algorithm for obtaining approximate samples of sufficient quality. We can take multiple samples from the same distribution simultaneously while retaining efficiency. We start with a set of $\mNumSamples$ standard Gaussian samples, \newcommand{\mRawSamples}[0]{\boldsymbol{\tilde E}}% \newcommand{\mJacobiSamples}[0]{}% \begin{align} \mRawSamples = [\mNoiseSample{1}, \dots, \mNoiseSample{\mNumSamples} ] , \quad \mNoiseSample{\indSamp} \sim \mNormal(\mathbf{0}, \mathbf{I}_{\mNumPixels}) \, . \end{align} We then note that the transposed, inverse of the precision Cholesky matrix can be used as a sampling matrix since \begin{equation} \mCovariance = \inv{\mPrecision} = \inv{(\mCholPrec \trans{\mCholPrec})} = \transInv{\mCholPrec} \inv{\mCholPrec} \, , \end{equation} indicating that $\transInv{\mCholPrec}$ is the LHS of a square root matrix for $\mCovariance$. Thus we draw low variance Monte Carlo samples as \begin{equation} \mAllLogitsSamples = [\mLogitsSample{1}, \dots, \mLogitsSample{\mNumSamples}] = \mMean + \transInv{\mCholPrec} \mRawSamples \, . \end{equation} \newcommand{\mAllZeroMeanJacobiSamples}[0]{\mathbf{S}}% To invert $\trans{\mCholPrec}$ efficiently, we use $\mNumJacobiIter$ Jacobi iterations; these are particularly efficient to apply with a sparse matrix that is already lower triangular. We initialise $\mAllZeroMeanJacobiSamples^{(0)} = \mRawSamples$ and then, at each iteration, update the samples with \newcommand{\mJacobiD}[0]{D_{\Lambda}}% \newcommand{\mJacobiU}[0]{U_{\Lambda}}% \begin{align} \mAllZeroMeanJacobiSamples^{(\indJacobi + 1)} \leftarrow \inv{\mJacobiD} \big( \mRawSamples - \mJacobiU \, \mAllZeroMeanJacobiSamples^{(\indJacobi)} \big) \, , \label{eqn:sampling_with_precision} \end{align} where $\mJacobiD := \mDiag(\trans{\mCholPrec})$ and $\mJacobiU := \trans{\mCholPrec} - \mJacobiD$, a strictly upper triangular matrix. The final samples are then obtained by the addition of the mean such that $\mAllLogitsSamples = \mMean + \mAllZeroMeanJacobiSamples$. \newcommand{\mFilterBank}[0]{\mathbf{f}} \newcommand{\mAllFilterBanks}[0]{\mathbf{F}} \newcommand{\mLogDiag}[0]{\boldsymbol{\phi}} \newcommand{\mOffDiag}[0]{\boldsymbol{\psi}} \newcommand{\mOffDiagShuffled}[0]{\boldsymbol{\psi}_{\mathrm{shuff}}} \newcommand{\mNumFilters}[0]{L} \begin{algorithm}[t] \SetAlgoLined \KwResult{Samples drawn from a correlated multivariate Gaussian (with sparse precision) } Samples: $\mAllZeroMeanJacobiSamples^{(0)} \leftarrow \mRawSamples \sim \mNormal(\mathbf{0}, \mIdentity_{N})$, $N := W \times H$\; Local connection filters: $\mAllFilterBanks = \{\mFilterBank_{l}\}_{l=1}^{\mNumFilters}$\; Log diagonal terms: $\mLogDiag \in \mathbb{R}^{N}$\; Off diagonal terms: $\mOffDiag \in \mathbb{R}^{\mNumFilters \times N}$\; \algoHRule \For{$j \leftarrow 0$ \KwTo $J-1$}{ $\mathbf{V} \leftarrow \textrm{Conv2D}(\mAllZeroMeanJacobiSamples^{(j)}, \mAllFilterBanks)$\; $\mathbf{v} \leftarrow \sum_{l=1}^{L} [\mathbf{V} \odot \mOffDiag]_{n,l}$\; $\mAllZeroMeanJacobiSamples^{(j+1)} \leftarrow \big[\exp(\mLogDiag)\big]^{-1} \odot (\mRawSamples - \mathbf{v})$ } \algoHRule Output: $\mAllZeroMeanJacobiSamples^{(J)} \approx \big( \transInv{\mCholPrec} \mRawSamples \big) \sim \mNormal(\mathbf{0}, \inv{\mPrecision})$\; \caption{Jacobi sampling for the multivariate Gaussian distribution} \label{algo:jacobi} \end{algorithm} \newcommand{\mLogitsKnown}[0]{\mLogits_{\mathrm{K}}} \newcommand{\mLogitsUnknown}[0]{\mLogits_{\mathrm{U}}} \newcommand{\mKnown}[0]{\boldsymbol{\alpha}} \newcommand{\mUnknown}[0]{\boldsymbol{\beta}} \newcommand{\mMask}[0]{\mathbf{m}} \newcommand{\mMaskKnown}[0]{\mMask_{\mathrm{K}}} \newcommand{\mMaskUnknown}[0]{\mMask_{\mathrm{U}}} \paragraph{Efficient conditional sampling} As we have a closed form representation of the output distribution: \begin{equation} \mLogits \sim \mNormal(\mMean, \mCovariance), \;\mCovariance = \transInv{\mCholPrec} \inv{\mCholPrec} \, , \end{equation} we can find the expression for a resulting conditional distribution where we specify values for a subset of the pixels and sample from the resulting distribution over the remaining pixels. Let us partition the pixels into a set of known values $\mLogitsKnown$ and unknown values $\mLogitsUnknown$; pixels (arbitrarily) belong to either one set or the other under a pixel-wise mask: \begin{equation} [\mMaskKnown]_{n} = \left\{ \begin{array}{cl} 1, & n \in \mathcal{K} \\ 0, & n \in \mathcal{U} \end{array} \right. ,\; \mMaskUnknown = 1 - \mMaskKnown \,. \end{equation} Thus, with slight abuse of notation, we recover the full set of values as $\mLogits = \mMaskKnown \odot \mLogitsKnown + \mMaskUnknown \odot \mLogitsUnknown$. The conditional distribution for the unknown values, given that the known values $\mLogitsKnown = \mKnown$, is the Gaussian conditional density: \begin{align} p(\mLogitsUnknown \given \mLogitsKnown = \mKnown) &\phantom{:}\sim \mNormal(\mathbf{b}, \mathbf{B}) \,,\\ \mathbf{b} &:= \mMean_{\mathrm{U}} + \mCovariance_{\mathrm{UK}} \mCovariance_{\mathrm{KK}} (\mKnown - \mMean_{\mathrm{K}}) \,,\\ \mathbf{B} &:= \mCovariance_{\mathrm{UU}} - \mCovariance_{\mathrm{UK}} \inv{\mCovariance_{\mathrm{KK}}} \mCovariance_{\mathrm{KU}} \, , \end{align} where the subscripts dictate the appropriate partitions of the mean vector or blocks of the covariance matrix. Evaluating this directly, in matrix form, would again be prohibitively expensive, especially considering the matrix inversions (from precision to covariance matrices). Thankfully we can use a modified form of the Jacobi sampling method combined with Matheron's rule for conditional sampling. Matheron's rule states that if $(\mathbf{a}, \mathbf{b})$ are samples from the joint distribution $p(\mLogitsKnown, \mLogitsUnknown)$ then the random variable $\mathbf{b}$ conditioned on $\mathbf{a} = \mKnown$ can be found by: \begin{equation} (\mathbf{b} \mid \mathbf{a} = \mKnown) \leftarrow \mathbf{b} + \mCovariance_{\mathrm{UK}} \inv{\mCovariance_{\mathrm{KK}}} (\mKnown - \mathbf{a}) \,. \label{eqn:matheron_rule} \end{equation} We can use straight forward identities to convert Matheron's rule into an update equation in terms of the precision: \begin{align} \begin{bmatrix} \mPrecision_{\mathrm{KK}} & \mPrecision_{\mathrm{KU}} \\ \mPrecision_{\mathrm{UK}} & \mPrecision_{\mathrm{UU}} \end{bmatrix} \cdot \begin{bmatrix} \mCovariance_{\mathrm{KK}} & \mCovariance_{\mathrm{KU}} \\ \mCovariance_{\mathrm{UK}} & \mCovariance_{\mathrm{UU}} \end{bmatrix} =& \begin{bmatrix} \mIdentity & \mathbf{0} \\ \mathbf{0} & \mIdentity \end{bmatrix} \,, \\ \Rightarrow \mPrecision_{\mathrm{UK}} \, \mCovariance_{\mathrm{KK}} + \mPrecision_{\mathrm{UU}} \, \mCovariance_{\mathrm{UK}} =& \, \mathbf{0} \\ \Rightarrow \mCovariance_{\mathrm{UK}} \, \inv{\mCovariance_{\mathrm{KK}}} = - \inv{\mPrecision_{\mathrm{UU}}} \, \mPrecision_{\mathrm{UK}} & \,. \label{eqn:matheron_prec_form} \end{align} We have ready access to efficient evaluation of the sparse $\trans{\mCholPrec}$, as discussed in the Jacobi method. With suitable book-keeping, we can produce the appropriately shuffled local connection filters $\mAllFilterBanks_{\mathrm{shuff}} \leftarrow \textrm{Shuffle}(\mAllFilterBanks)$ and permuted off-diagonal terms $\mOffDiagShuffled \leftarrow \textrm{Shuffle}(\mOffDiag)$ to provide a similar evaluation of the sparse $\mCholPrec$. This product results in a sparse banded diagonal structure in the precision matrix $\mPrecision$. The appropriate blocks of this sparse matrix can be accessed and used to solve for the conditional update of~\eqref{eqn:matheron_rule} using a precision form of the update~\eqref{eqn:matheron_prec_form}. \subsection{Extension to Non-Gaussian Likelihoods} \label{sec:non-gauss-likelihood} For many dense prediction tasks, a multivariate Gaussian distribution is not an appropriate likelihood over the observations directly. However, SUPN is still applicable for this use case, by fitting the multivariate Gaussian distribution to the logit space, \ie to the layer just before the last non-linear layer. This is then followed by an appropriate activation function. For example, for depth prediction, the outputs of the network should be non-negative and the activation function used is a scaled sigmoid, following monodepth2 \cite{godard2019digging}. Similarly, for the task of segmentation, the fitting of the SUPN could be done in logit space and soft-max would be used as the activation function. \subsection{Implementation Details} \paragraph{Architecture} We build upon the U-Net architecture used by Monodepth2 \cite{godard2019digging}, \ie an encoder-decoder architecture where the encoder is a ResNet18 and there are skip connections between the encoder and the decoder. We add an additional decoder to predict the Cholesky parameters. This decoder takes skip connections from the mean decoder as input. The additional decoder concatenates coordinate maps in the convolutional blocks~\cite{liu2018intriguing} to provide additional spatial information. We designed an off-diagonal prediction approach where the scale of the values is initially very small, $\approx \exp(-4)$, but adapts during training. We found this inductive bias, in lieu of formal priors, was required to predict high quality covariances. We use a $5\times5$ neighborhood for the Cholesky decomposition; please see the supplementary details for architecture details and ablation experiments. \paragraph{Model size} Our model encodes the distillation of an ensemble of large models into a single framework; we use only 24\% more parameters than a single network (out of 8 in the ensemble). \paragraph{Multi-scale loss} For depth prediction, we use a multi-scale loss similar to Monodepth2 \cite{godard2019digging}, where the loss in \eqref{eq:loss} is applied across different scales. \paragraph{Complexity} Fixed sparsity ensures that all operations are $\mathcal{O}(N)$ for both computation and storage. Sampling is $\mathcal{O}(J)$ (we used $J = 1000$); empirically, the total time for a full Jacobi sample was 0.6s. \section{Experiments} For the experiments, we show our method applied to monocular depth estimation. We use the KITTI dataset~\cite{geiger2013vision} and base our implementation on the Monodepth2 repository~\cite{godard2019digging} and the repository from~\cite{poggi2020uncertainty}. \paragraph{Pre-trained ensembles} We use the pre-trained models provided by \cite{poggi2020uncertainty}. In particular, the ensembles created through bootstrapping together with predictive uncertainty. Two different approaches are used for predictive uncertainty. Both use a diagonal multivariate Laplace distribution, but differ in the way they are trained: \textsc{Log} is trained by directly optimizing the log-likelihood of a self-supervised depth model; while \textsc{Self} uses a pretrained network for depth prediction, without uncertainty estimation, as the teacher model. \paragraph{Metrics} For evaluating the accuracy of the estimated depth maps we use a subset of the metrics commonly used for the Kitti dataset: absolute relative error, root mean squared error (RMSE) and the A1 metric. For evaluation of the uncertainty estimates, we use the metrics used in \cite{poggi2020uncertainty}: area under the sparsification error (AUSE) and area under the random gain (AURG). Both these metrics rely on using per-pixel uncertainty estimates to rank pixels from less confident to more confident. For AUSE, this ranking is compared with an oracle ranking that sorts pixels from higher error to lower error, using the different ground truth metrics for ranking. A small AUSE means that the ranking provided by the uncertainty estimate is similar to this oracle ranking. AURG compares the ranking based on estimated uncertainty with a random ranking, large values are preferred for this metric. Since both these established metrics only consider per-pixel estimates, we also evaluate the posterior log-likelihood of test samples from the ensembles under our model. To provide a baseline, we also train a version of our model with only a diagonal covariance structure (per-pixel), which cannot model structure. Comparing against this baseline allows us to determine if the model has correctly captured the distribution of test samples and avoided overfitting. We also measure the log-likelihood to other ensembles to ensure that the SUPN variants estimate distributions that generalise well to support other plausible samples. \begin{table*}[t] \caption{\textbf{Accuracy comparison}: Quantitative comparison of quality on commonly used depth metrics (see supplement for the remaining metrics in \cite{godard2019digging}). The ``Best'' metrics sample 40 different predictions for our model, and from the 8 ensembles for the baseline, and choose the best under each metric. Standard deviations are given in brackets. The box plot illustrates the substantial overlap in distributions.} \label{tab:accuracy_unconditioned} \centering \begin{minipage}{0.23\textwidth} \includegraphics[width=\textwidth]{figures/rebuttal_rmse_box_plot.pdf}\\ \footnotesize Box plot illustrating the strong distribution overlap between the original ensemble and the trained SUPN model for Boot+Log RMSE mean. \end{minipage}\hfill \begin{adjustbox}{max width=0.75\textwidth} \begin{tabular}{lrrrrrr} \toprule Model name & AbsRel Mean $\downarrow$& AbsRel Best $\downarrow$ & RMSE Mean $\downarrow$ & RMSE Best $\downarrow$ & A1 Mean $\uparrow$ & A1 Best $\uparrow$ \\ \midrule MD2 Boot+Log & 0.092 (0.035) & 0.084 (0.031) & 3.850 (1.370) & 3.600 (1.260) & 0.911 (0.064) & 0.923 (0.055) \\ MD2 Boot+Self & 0.088 (0.034) & 0.083 (0.031) & 3.795 (1.397) & 3.574 (1.323) & 0.918 (0.060) & 0.929 (0.051)\\ \midrule Diagonal & 0.101 (0.044) & 0.103 (0.043) & 4.000 (1.457) & 4.020 (1.444) & 0.896 (0.076) & 0.894 (0.074) \\ SUPN Boot+Log & 0.104 (0.047) & 0.095 (0.039) & 4.071 (1.489) & 3.577 (1.191) & 0.892 (0.080) & 0.909 (0.069) \\ SUPN Boot+Self & 0.103 (0.049) & 0.096 (0.046) & 4.091 (1.442) & 3.800 (1.396) & 0.894 (0.078) & 0.906 (0.073) \\ \bottomrule \end{tabular} \end{adjustbox} \end{table*} \begin{table*}[t] \caption{\textbf{Pixelwise uncertainty metrics}: AUSE (area under the sparsification error), lower is better. AURG (area under the random gain), higher is better. Uncertainy for SUPN estimated from std-deviation of 10 samples. Results marked with a * differ from the published work by \cite{poggi2020uncertainty}, as to make it comparable we do not use the Monodepth 1 post-processing. LL (Log-Likelihood) columns provide the log-likelihood of samples from the respective ensembles under the diagonal (baseline) and SUPN models. Standard deviations are given in brackets.} \label{tab:accuracy_uncertainty} \centering \begin{adjustbox}{max width=\textwidth} % \newcommand{\lloffset}[0]{$\times10^{5}$} \begin{tabular}{lrrrrrrrr} \toprule Model name & AbsRel AUSE $\downarrow$ & AbsRel AURG $\uparrow$ & RMSE AUSE $\downarrow$ & RMSE AURG $\uparrow$ & A1 AUSE $\downarrow$ & A1 AURG $\uparrow$ & LL Boot+Log \lloffset $\uparrow$ & LL Boot+Self \lloffset $\uparrow$ \\ \midrule MD2 Boot+Log & 0.038 (0.020) & 0.021 (0.019) & 2.449 (0.877) & 0.820 (0.929) & 0.046 (0.048) & 0.037 (0.040) & & \\ MD2 Boot+Self & 0.029 (0.018) & 0.028 (0.019) & 1.924 (1.006) & 1.316 (1.000) & 0.028 (0.041) & 0.049 (0.037) & & \\ \midrule MD2 Boot+Log* & 0.041 (0.019) & 0.018 (0.020) & 2.927 (1.327) & 0.324 (1.019) & 0.050 (0.049) & 0.032 (0.037) \\ MD2 Boot+Self* & 0.040 (0.021) & 0.017 (0.018) & 2.906 (1.458) & 0.331 (1.08) & 0.045 (0.045) & 0.031 (0.035) & & \\ \midrule Diagonal & 0.085 (0.050) & -0.020 (0.030) & 5.075 (1.924) & -1.697 (0.799) & 0.138 (0.083) & -0.440 (0.053) & 1.77 (11.48) & 1.15 (12.78) \\ SUPN Boot+Log & 0.037 (0.027) & 0.030 (0.025) & 1.555 (1.307) & 1.856 (1.355) & 0.040 (0.063) & 0.058 (0.047) & 40.60 (1.35) & 38.18 (2.93)\\ SUPN Boot+Self & 0.050 (0.037) & 0.017 (0.028) & 2.786 (1.796) & 0.674 (1.544) & 0.062 (0.074) & 0.034 (0.055) & 36.51 (2.31) & 38.87 (1.63)\\ \bottomrule \end{tabular} \end{adjustbox} \end{table*} \subsection{Quantitative Results} \paragraph{Depth accuracy} In Table \ref{tab:accuracy_unconditioned} we show a quantitative comparison between the two variants of ensembles and the corresponding versions of our model, trained to approximate them. We compare the methods using the depth estimation metrics. While the mean performance of the ensembles is slightly superior to our approximate models, the results are comparable within the margin of error. The box plot in Table~\ref{tab:accuracy_unconditioned} highlights the strong overlap in the error distribution of the ensemble and SUPN models, indicating that despite the significant reduction in the number of parameters, SUPN is able to approximate the performance of the ensemble. Our models compare favourably with a diagonal only model. This is particularly noticeable in the metrics for the best sample. Samples from our model consistently outperform samples from a diagonal only Gaussian. \begin{figure*}[ht!] \centering \renewcommand{\arraystretch}{0.3} \begin{adjustbox}{max width=0.85\textwidth} \begin{tabular}{ccc} \includegraphics[width=0.3\textwidth]{figures/correlation_cond_points643_crop.png} & \includegraphics[width=0.3\textwidth]{figures/correlation_cond_points171_crop.png} & \includegraphics[width=0.3\textwidth]{figures/correlation_cond_points516_crop.png} \\ \includegraphics[width=0.3\textwidth]{figures/cond_bs643_1.png} & \includegraphics[width=0.3\textwidth]{figures/cond_bs171_1.png} & \includegraphics[width=0.3\textwidth]{figures/cond_bs516_1.png} \\ \includegraphics[width=0.3\textwidth]{figures/cond_bs643_2.png} & \includegraphics[width=0.3\textwidth]{figures/cond_bs171_2.png} & \includegraphics[width=0.3\textwidth]{figures/cond_bs516_2.png} \end{tabular} \end{adjustbox} \caption{Visualisation of learned covariances between example pixels (red crosses) and other pixel locations for SUPN \textsc{Boot+Log}. Red indicates high positive correlation, blue is strong negative correlation. % For clarity, these plots are scaled into the standard deviation range (via a signed square root operation) and plotted over a range [-0.05, 0.05]. These examples illustrate the long range correlations that can be captured from very local structure ($5 \times 5$ pixel regions) in the precision matrix. For more examples, see the supplementary video. }\label{fig:cov} % \end{figure*} \paragraph{Uncertainty estimation} Table~\ref{tab:accuracy_uncertainty} provides a quantitative comparison in terms of uncertainty metrics. SUPN consistently outperforms the teacher ensemble model for both \textsc{Log} and \textsc{Self}. The log-likehood values demonstrate that the correlated structure capture by SUPN is better able to explain the test outputs of the ensembles that the baseline diagonal model. The samples routinely have higher support under the SUPN model which suggests that some of the other measures are not accurately measure the quality of the structure present in the posterior predictions of the model. As expected, the performance of the SUPN approaches on the test set for the corresponding samples are slightly better but we note that overall the values are similar between the two methods indicating that the correlations captured are not overfit to the specific ensembles. \subsection{Qualitative Results} \begin{figure*}[t] \centering \includegraphics[width=\textwidth]{figures/example_bootlog_highres_tight.pdf}\\ \renewcommand{\arraystretch}{0.3} \begin{adjustbox}{max width=\textwidth} \begin{tabular}{CCCC} (a) Input image & (b) Mean disparity & (c) \textsc{Boot+Log} diff & (d) SUPN \textsc{Boot+Log} diff \end{tabular} \end{adjustbox} \caption{Example depth samples (see supplementary video for more). (b)~Average normalised disparity predicted by the ensemble models. Difference between the mean and one of the (c)~\textsc{Boot+Log} ensemble or (d)~SUPN \textsc{Boot+Log}; the samples appear qualitatively similar.} \label{fig:samples} \end{figure*} \begin{figure*}[h!] \centering \renewcommand{\arraystretch}{0.3} \begin{adjustbox}{max width=0.63\textwidth} \begin{tabular}{ccc} \includegraphics[width=0.58\textwidth]{figures/trim_cond_235_mask.png} & \includegraphics[width=0.58\textwidth]{figures/cond_235_mean_uncond.png} & \includegraphics[width=0.58\textwidth]{figures/cond_235_mean_cond.png} \\ \includegraphics[width=0.58\textwidth]{figures/trim_cond_519_mask.png} & \includegraphics[width=0.58\textwidth]{figures/cond_519_mean_uncond.png} & \includegraphics[width=0.58\textwidth]{figures/cond_519_mean_cond.png} \\ \includegraphics[width=0.58\textwidth]{figures/trim_cond_25_mask.png} & \includegraphics[width=0.58\textwidth]{figures/cond_25_mean_uncond.png} & \includegraphics[width=0.58\textwidth]{figures/cond_25_mean_cond.png} \\[5pt] \huge (a) Image + conditioning locations & \huge (b) Mean disparity & \huge (c) Conditional mean disparity \end{tabular} \end{adjustbox} \begin{adjustbox}{max width=0.35\textwidth} \begin{tabular}{c} \begin{tabular}{lrrr} \toprule Model name & AbsRel $\downarrow$& RMSE $\downarrow$ & A1 $\uparrow$ \\ \midrule Ensemble & 0.088 (0.034) & 3.795 (1.397) & 0.918 (0.060) \\ \midrule SUPN & 0.104 (0.047) & 4.071 (1.489) & 0.892 (0.080) \\ \midrule SUPN 25$^*$ & 0.086 (0.036) &3.893 (1.541) & 0.922 (0.053) \\ SUPN 50$^*$ & 0.076 (0.031) &3.607 (1.433) &0.936 (0.041) \\ SUPN 100$^*$ & 0.064 (0.028) & 3.251 (1.290) &0.949 (0.033) \\ SUPN 200$^*$ & 0.054 (0.022) &2.873 (1.100) &0.960 (0.028) \\ \bottomrule \end{tabular} \\[102pt] \large (d) Quantitative conditioning accuracy \end{tabular} \end{adjustbox} \caption{Conditional prediction using sparse ground truth depth information. (a) shows 25 randomly sampled conditioning locations that have valid depth (b) shows the original mean disparity, while (c) shows the conditional mean disparity. d) Quantifies the accuracy improvement of our SUPN Boot+Log model when conditioned on $N^*$ random ground truth depth pixels, repeated 10 times per image. } \label{fig:cond_dist} \end{figure*} Figure~\ref{fig:samples} illustrates samples from the \textsc{Boot+Log} ensemble, and the SUPN approximation; the samples are visually similar and exhibit considerable long-range structure. \paragraph{Introspection} As discussed in \S~\ref{sec:introduction}, one of the advantages of an explicit distribution is that it allows for introspection. Figure~\ref{fig:cov} illustrates how the covariance between a specified pixel, and any other, can be explicitly computed. These visualisations are the corresponding row of the covariance matrix obtained using the sampling process of~\eqref{eqn:sampling_with_precision} twice (with $\mCholPrec$ and then $\trans{\mCholPrec}$) to a one-hot vector encoding the pixel of interest on the RHS (instead of $\mRawSamples$) and no mean. \paragraph{Conditional Distributions} Figure~\ref{fig:cond_dist} illustrates our model's ability to condition samples on arbitrary output pixels, which is not possible in most deep probabilistic models. In this example, we use some samples from the ground truth depth as additional conditioning on the predicted distribution, and show the conditional mean. \section{Discussion and Limitations} Similar to other distillation methods, the performance of our method is upper-bounded by the performance of the original ensemble model. This might become an issue when the ensemble is small, and doesn't capture the full diversity of data. We've observed visually that the log-likelihood alone is not always a good predictor of sample quality, \ie a sample might have high log-likelihood while looking implausible, this may be due to a lack of variation in the ensemble predictions. This could potentially be overcome by using priors on the predicted Gaussian distribution, and future work will consider subsequently training the model on the specified task, using the drawn samples. As a deterministic approximation to the output of an ensemble, we seek to capture all forms of uncertainty captured by the ensemble (e.g.~aleatoric and epistemic). We acknowledge that we do not consider the epistemic uncertainty in the approximation separately, however our work may be considered orthogonal to work in this area, e.g.~BNNs, and could be readily combined. \paragraph{Potential negative impact} We think that uncertainty estimation is a valuable endeavor in improving deep models, and that our approach of using explicit distributions is a step in the right direction, providing tangible benefits. However, the predicted distributions have yet to be evaluated on out-of-distribution data. As with most machine learning models, we cannot expect generalisation of our SUPN prediction networks to very different data. Clearly, this approach will require extensive validation before deployment in safety-critical applications, such as autonomous driving. \paragraph{Conclusion} We presented a method for uncertainty estimation by distillation of ensemble models. We showed that our structured Gaussian model can be predicted by a single pass of a convolutional neural network, we have proposed an efficient method for drawing samples. Our method was validated on the task of depth prediction from a single image. Our distilled model is able to perform similarly to the original ensemble on uncertainty metrics, while requiring fewer parameters and allowing arbitrary numbers of samples to be drawn. We have illustrated that the samples capture long-range correlations in the image domain, which is in stark contrast to prior works that use diagonal covariance matrices. We demonstrated the benefit of our predicted distribution in terms of enabling arbitrary test-time conditioning and allowing for direct introspection of the inferred distribution. We hope that our paper sparks interest in predictive uncertainty models that are able to model correlation in the output space, with many practical applications in computer vision and integration with subsequent down-stream tasks. {\small \bibliographystyle{ieee_fullname}
0744a1540739a2ebfdf8b5984a6712a37d632b78
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Novelty detection has been addressed widely in the machine learning literature, its basic form aims at building a decision rule in order to distinguish a normal set of data points (or inliers/ negative examples) from novel patterns (or unseen/ positive examples/ novelties). At training time only examples of inliers are available, this type of learning goes by the name of inductive novelty detection. Labeled examples of novelties are unavailable during training in this case. Some notable contributions in this field include one-class classifiers that attempt to draw a discriminative boundary around the normal data such as one-class support vector machine (OCSVM) \citep{scholkopf} and deep learning related methods - especially with the advancements of adversarial learning \citep{goodfellow} - that rely on the fidelity of recontruction of the original signal \citep{schlegl,zenati,zenati2,akcay,akcay2}. One limitation of those inductive methods is their need for hyperparameter tuning; the absence of novel examples in this setup during training makes this problem hard to overcome. The traditional inductive learning seeks to infer a decision function by using a training set and minimizing the error rate on the whole distribution of examples. Transductive learning \citep{vapnik} on the other hand is motivated by the idea that the latter approach is unnecessarily complex and that we only care about the decision function so far as the test set is concerned, and hence the (unlabeled) test set should be incorporated at training time. Novelty detection methods that adopt the latter approach are referred to as transductive, one early example adopting this setting is semi-supervised novelty detection introduced by \citep{blanchard10a}. In this study we propose TransductGAN, a novel transductive novelty detection method using Generative Adversarial Network (GAN) \citep{goodfellow}. Our model combines an adversarial autoencoder \citep{DBLP:journals/corr/MakhzaniSJG15} that maps the data to a latent space with a GAN. It attempts to simultaneously separate the inliers from the novelties in the latent space and learns how to generate both categories of data using two distinct distributions. A standard binary classifier can then be trained using the artificially generated novel samples along with the inlier set in order to perform anomaly detection. A diagram of TransductGAN is provided in Figure \ref{TransductGAN}. We refer to the proportion of novelties present in the unlabeled set as the contamination rate. TransductGAN and more generally transductive novelty detection methods are unsuitable for online applications as they assume access to a complete test set. Applications of interest include areas where we benefit from looking at data in a post-event format, and where the novelties are not rare as in the case of anomaly detection (although we will demonstrate empirically that our model outperforms the inductive state-of-the-art methods with a contamination rate as small as 5\%). An example of applications could be the emergence of new topics or themes on social media platforms, such discoveries could help drive the news coverage on more standard media channels. Another application could be in commercial deep neural network systems that are used for classification, and where pre-processing of data is required to maintain performance quality of pre-trained models. This can be achieved by detecting novelties in test data that were not present when models were initially trained (i.e. by monitoring the emergence of a new class). Another example is the discovery of new user profiles that have become interested in acquiring a certain product, this could help boost targeted advertising. In this study we focus on image data. The main contributions of our work are: \begin{itemize} \item a novel architecture capable of learning how to generate inliers and novelties simultaneously using distinct distributions in the latent space \item by being able to generate the novel points artificially we can train a binary classifier and tune the hyperparameters without explicitly accessing the actual outliers, this overcomes the hurdle faced by many inductive methods of how to tune their hyperparameters in the absence of novel data examples \item the introduction of the adversarial autoencoder allows us to use more informative features from the latent space when training a binary classifier \item our model exhibits superior performance over several state-of-the-art inductive models, and outperforms a vanilla model that is closely related to a state-of-the-art transductive method \item full reproducibility of our model is available on github \end{itemize} \section{Background} \subsection{Wasserstein generative adversarial networks with gradient penalty} The generative adversarial network (GAN) in its original form \citep{goodfellow} comprises a generator taking as input a latent vector to produce an image output. This network competes against a discriminator tasked with identifying the fake images (produced by the generator) from the real images. By being able to produce samples identical to the real ones at convergence, the generator implicitly captures the distribution of the real image data. Although a GAN can produce visually appealing images, they are hard to train and can suffer from convergence failure or can generate poor quality images. Subsequent work \citep{DBLP:journals/corr/SalimansGZCRC16,DBLP:journals/corr/MetzPPS16,arjovsky2017wasserstein,DBLP:journals/corr/PooleASA16,DBLP:journals/corr/abs-1803-05573} has been devoted to boosting training stability. In their work on Wasserstein GAN \citep{arjovsky2017wasserstein}, the authors highlighted that the divergences that are being minimized in the original GAN framework may not be continuous with respect to the generator's parameters which might explain the training difficulty. They instead use the earth mover distance and argue that under mild assumptions this type of loss is continuous and almost differentiable everywhere. They propose a weight clipping of the discriminator in order to enforce those assumptions. The work was further extended with the introduction of Wasserstein GAN with gradient penalty (WGAN-GP) in \citep{DBLP:journals/corr/GulrajaniAADC17} where a gradient penalty was introduced as an alternative to the weight clipping; in this work the authors propose to penalize the norm of the gradient of the discriminator with respect to its input and demonstrate this strategy yields an enhanced performance. \subsection{Adversarial Autoencoders} The adversarial autoencoder (AAE) \citep{DBLP:journals/corr/MakhzaniSJG15} is a regularized autoencoder where an adversarial network is tasked with ensuring that the latent code vector distribution is matched with a prior distribution that is defined by the user. The AAE includes an encoder-decoder network that maps the data from the input space to a latent space and a discriminator network that controls the distribution in the latent space. Two losses are used to train the model, the traditional reconstruction based loss that operates in the input space and an adversarial loss that operates on the latent code. The advantage of the AAE is its ability to generate meaningful samples from any part of the latent distribution and its superiority in that regard compared to more traditional methods such as variational autoencoders \citep{kingma2014autoencoding} has been demonstrated. \section{Related work} \subsection{Inductive methods} During training, inductive methods in novelty detection rely on the availability of a negative dataset \( X_n \) that could be either pure or contaminated with novelties or outliers. In our study we assume that the negative dataset is always uncontaminated. There exists a variety of anomaly detection algorithms and comprehensive literature reviews presenting those algorithms as part of a taxonomy already exist, a few examples include \citep{PIMENTEL2014215,DBLP:journals/corr/abs-1901-03407}. The approaches can broadly be categorised into probabilistic models, distance-based, reconstruction-based, domain-based and information theory-based models. We will compare our methods against state-of-the-art models that are either reconstruction-based or domain-based. The main challenge with the other categories is their poor performance on complex high-dimensional data. Some notable contributions with regards to the domain-based model include OCSVM \citep{scholkopf}, it attempts to find the boundary enclosing the inlier class by separating it from the origin using a hyperplane with maximum margin. The reconstruction-based models rely on modelling the data samples in a latent, lower-dimensional space and on the ability to reconstruct the original samples thereafter. The novelty measure relies on the fidelity of reconstruction, i.e. it relies on some similarity measure between the original sample and its reconstructed version. Algorithms that are able to perform such tasks include neural networks and subspace-based methods. The main advantages of using such models is their scalability, with a large enough sample size they tend to surpass the more traditional methods. One state-of-the-art method is AnoGAN, introduced by Schlegl \textit{et al.} in \citep{schlegl}. It uses a deep convolutional GAN (DCGAN, \citep{radford2015unsupervised}) to perform anomaly detection using imaging data. It trains the DCGAN using the inlier data only in the first phase. In the second phase it learns a mapping from the image space to the latent space for each sample in the test set iteratively via backpropagation, using the weighted sum of a residual loss and a discrimination loss. AnoGAN's main contribution is the anomaly scoring that involves mapping from the image to the latent space; it remains a computationally expensive procedure that also requires parameter tuning. Efficient GAN-based anomaly detection (EGBAD) \citep{zenati} was introduced soon after and proposes to use a bi-directional GAN (BiGAN) \citep{DBLP:journals/corr/DonahueKD16,dumoulin2016adversarially} in order to overcome the costly process in AnoGAN of recovering the latent representation for a given input. BiGAN simultaneously learns an encoder that maps an input sample to a latent representation along with a generator and discriminator using inlier data. The discriminator takes as input the image sample (either generated or from training) along with its latent representation (either the encoder output or the generator input). With the exception of the introduction of the BiGAN model that allows to reduce the computational costs, the procedure to derive the anomaly score is similar to that of AnoGAN with improved performance. The hyperparameter tuning is still an open issue. The GANomaly model was introduced in \citep{akcay} and is inspired by the AAE network. GANomaly employs a variation of this model that uses an added encoder and where the discriminator now operates over the image space. The objectives of GANomaly are similar to the ones presented in the previous two approaches, namely it attempts to use the inlier set to train the model and uses an anomaly score to identify the anomalous samples within the (contaminated) test data. Three types of losses are used to train the model. Firstly, an adversarial loss measures the \(L_2\) distance between the feature representation in the discriminator (hence using the feature matching loss) of the original (image) inputs and the generated images. Secondly, a contextual loss measures the \(L_1\) distance between the input and the generated output and allows the generator to learn contextual information about the input data. And finally an encoder loss minimizes the distance between the latent representation of the input and the latent representation of the generated output. The overall objective function becomes a weighted sum of the three losses. During testing only the encoder loss is used by the model as an novelty indicator. GANomaly's performance was tested on a variety of real-world data and has surpassed other state-of-the-art methods such as EGBAD, AnoGAN as well as more basic methods such as variational autoencoders-based anomaly detection \citep{An2015VariationalAB}. It should be mentioned that the weights of the objective function were tuned to yield an optimal performance, and in that regard the labels of the test set were used to drive the performance up. \subsection{Transductive methods} Transductive methods for novelty detection were originally introduced in \citep{Scott08transductiveanomaly} as a special case of their semi-supervised novelty detection algorithm (SSND) \citep{blanchard10a} where the unlabeled set is incorporated into the the task and where the end goal is to predict the labels of the unlabeled (or test) set. In that study the problem is reduced to a binary classification task subject to a user-specified constraint on the false positive rate. More recently, Tifrea \textit{et al.} introduced ensembles with regularized disagreement (ERD) \citep{DBLP:journals/corr/abs-2012-05825} by training multiple multi-class classifiers on the union of labeled and unlabeled sets. The unlabeled set is assigned random labels and the disagreement between the classifiers is used as a measure of novelty. The method assumes no knowledge of the contamination rate, however the class labels of the labeled set are assumed to be available (i.e. information about the class labels beyond the fact they are inliers). Other transductive state-of-the-art novelty detection methods that make use of the inlier class labels include \citep{DBLP:journals/corr/abs-1908-04951} where the authors train a two-head deep convolutional neural network (CNN) with one common feature extractor and two classifiers; the discrepancy of prediction between the two classifiers is used at test time to separate the inliers from the novel data. The authors have not provided any implementation for this method. \subsection{PU learning methods} PU learning refers to the classification of unlabeled samples given data from one class during training. A recent survey of PU learning methods can be found in \citep{DBLP:journals/corr/abs-1811-04820}. The class that is usually available in this setup is the novel/ positive class, but PU learning can also be applied to novelty detection in an unlabeled dataset with access to only the negative data during training, and some studies \citep{pmlr-v37-plessis15} consider transductive novelty detection as defined in \citep{blanchard10a} to be a special case of PU learning. The unlabeled data is usually handled in to ways, the first set of methods \citep{Liu02partiallysupervised,10.5555/1630659.1630746} attempt to identify negative examples in the unlabeled set before training a binary classifier using the positive and newly identified negative samples. This approach is very much dependent on heuristic strategies and does not guarantee an optimal solution. The second set of methods \citep{10.5555/951949.952139,10.5555/3041838.3041895} treat the unlabeled set as negative with a weight assigned to each sample, finding the optimal weight is usually costly and the classifiers trained on those datasets suffer from an estimation bias. Several methods have since emerged that seek to build an unbiased PU classifier \citep{10.5555/2968826.2968905,pmlr-v37-plessis15,kiryo2017positiveunlabeled}, the most recent of which, the non-negative PU estimator (nnPU) \citep{kiryo2017positiveunlabeled}, was proven to be the most robust against overfitting in the presence of a flexible classifier. More recently, GAN-based models have become state-of-the-art in PU learning applications and a couple of methods are closely related to our model as they also attempt to generate counter-examples. In \citep{DBLP:journals/corr/abs-1711-08054} a generative positive-unlabeled (GenPU) model is proposed that makes use of a series of discriminators and generators to produce both positive and negative samples; GenPU requires prior knowledge of the contamination rate in the unlabeled set. The authors have not provided any implementation of that model. Following this work, Chiaroni \textit{et al.} have proposed a two-stage GAN model (D-GAN) that learns the counter-examples distribution before training a binary classifier using the fake generated negative examples and the already available positive examples. D-GAN incorporates a biased PU risk in the discriminator loss function that constrains the generator to learn the positive samples distribution exclusively. The study also demonstrates that the standard GAN loss function in use also alleviates the need of prior knowledge of the contamination rate. \section{TransductGAN} \begin{figure} \centering \includegraphics[scale=0.6]{TransGAN.PNG} \caption{TransductGAN. \textit{The network includes an adversarial autoencoder that ensures the latent projection's distributions match with the priors as per equation \ref{eq:p_u}, and a transductive network that learns to map samples from \(p_n(\textbf{z})\) and \(p_p(\textbf{z})\) into negative and positive examples respectively. The two networks are trained simultaneously. The training of \(D_{X_n}\) is optional and only needed if generating samples from the negative data is required.}}\label{TransductGAN} \end{figure} \subsection{Model objectives} TransductGAN's objectives are to be able to learn two distinct distributions, one (optionally) for the inlier data and another for the novel data while having access to a negative dataset and an unlabeled dataset. It is able to achieve that by making use of a latent space. TransductGAN is a transductive adversarial network that includes an adversarial autoencoder that matches the aggregated posterior distribution of the latent space with a bimodal distribution, and a generative model that learns how to map each mode in the latent space to either positive or negative data outputs. By being able to separate the projections of the positive and negative data in the latent space, TransductGAN is able to generate both novel and negative data separately. A binary classifier (e.g. a support vector machine) can then be trained to identify the novel data points in the unlabeled set. This operation takes place in the absence of any labeled positive data examples. More formally, let us define the input as \(x \in \mathbbm{R}^m\) and its projection in the latent space (i.e. the output of the encoder \(E\) in Figure \ref{TransductGAN}) as \(z \in \mathbbm{R}^{n}\) with \(m>>n\). We have access to the negative dataset \(X_n=\{x_n^i\}_{i=1}^{n_n} \sim P_{x_n}\) and an unlabeled dataset that includes novel data \(X_u=\{x_u^i\}_{i=1}^{n_u} \sim P_{x_u}\). Let us also define \(y \in \{-1,+1\}\) as the class label (novel or negative). The class conditional positive density (representing the positive samples in the latent space) is: \begin{equation} q_p(z)=q(z|y=1), \end{equation} and the class conditional negative density (representing the negative data samples) in the latent space: \begin{equation} q_n(z)=q(z|y=-1). \end{equation} \noindent The unlabeled density in the latent space is hence defined as: \begin{equation} q_u(z)=\pi q_p(z) + (1-\pi) q_n(z). \end{equation} \noindent \(\pi\) is the prior for the positive class also known as the contamination rate, we assume we have access to this figure and that it is strictly positive \(\pi>0\): \begin{equation} \pi=p(y=1) \end{equation} \noindent The prior distribution we want to impose directly are \(p_n(z)\) for the negative dataset with \(N(\mu_n,\Sigma_n)\) and \(p_u(z)\) for the unlabeled dataset, and indirectly \(p_p(z)\) for the positive dataset with \(N(\mu_p,\Sigma_p)\). The unlabeled prior can also be defined as: \begin{equation} \label{eq:p_u} p_u(z)=\pi p_p(z) + (1-\pi)p_n(z) \end{equation} \noindent We assume we have access to \(n_n\) negative samples and \(n_u\) unlabeled samples. \subsection{Training methods} The proposed model for learning how to generate negative and positive samples is summarised in Figure \ref{TransductGAN}. The first part of the model is an adversarial autoencoder that includes the networks \(E\), \(G\), and the critic networks \(D_{z_u}\) and \(D_{z_n}\). \(E\) and \(G\) are trained to minimize a reconstruction loss, or a minimal \(L_2\) distance between an image and its reconstructed version: \begin{equation} L_{reconstruction}=\min_{E} \min_{G} \mathbb{E}_{x \sim P_x} \|x-G(E(x))\|_2 \end{equation} \noindent In the above \(P_{x}\) could refer to either \(P_{X_u}\) or \(P_{X_n}\). When using \(X_u\), \(D_{z_u}\) and \(E\) are trained to match the projections of \(X_u\) onto the latent space with \(p_u(z)\) defined in equation \ref{eq:p_u}, a Wasserstein loss with a gradient penalty (WGAN-GP) \citep{DBLP:journals/corr/GulrajaniAADC17} is used in order to ensure that. And similarly when using \(X_n\), \(D_{z_n}\) and \(E\) are trained to match the projections of \(X_n\) onto the latent space with \(p_n(z)\). In both cases, the latent loss can be defined as: \begin{equation} L_{regularization}=\min_{E} \max_{D} \mathbb{E}_{x \sim P_x}[D(E(x))]-\mathbb{E}_{z \sim p(z)}D(z)+\lambda \mathbb{E}_{\hat{z} \sim P_{\hat{z}}}[(\|\nabla_{\hat{z}} D(\hat{z})\|_2 - 1)^2] \end{equation} \noindent In the above, depending on whether we are using \(X_u\) or \(X_n\) during training, \(P_{x}\) refers to either \(P_{X_u}\) or \(P_{X_n}\). \(p(z)\) refers to either \(p_u(z)\) or \(p_n(z)\) and the critic network \(D\) refers to either \(D_{z_u}\) or \(D_{z_n}\). Similarly to the gradient penalty definition in \citep{DBLP:journals/corr/GulrajaniAADC17}, the sampling \(P_{\hat{z}}\) is a uniform distribution along straight lines between pairs of points sampled from \((q_u(z),p_u(z))\) or \((q_n(z),p_n(z))\). By imposing \(p_u(z)\) and \(p_n(z)\) on \(q_u(z)\) and \(q_n(z)\) respectively, \(q_p(z)\) will implicitly match with \(p_p(z)\). The second part of the model focuses on \(G\), \(D_{X_u}\) and \(D_{X_n}\). The generator \(G\) will be trained to produce fake positive samples \(G(z_p)\), and (optionally) fake negative samples \(G(z_n)\). Let us define \(X_{u}^{'}\) to be the result of a concatenation operation between \(X_{n}\) and \(G(z_p)\) with proportions of \(1- \pi\) and \(\pi\) respectively. With regards to generating \(G(z_p)\), the intuition is that \(X_u\) is formed by samples from both the negative set \(X_n\) and unknown positive samples \(X_p\), we ensure \(X_n\) already forms a subset of \(X_u^{'}\), the generator \(G\) is then left with the task of complementing \(X_u^{'}\) with samples not already provided by \(X_n\), i.e. samples that are similar to the novel samples \(X_p\). The role of \(D_{x_u}\) is to challenge \(G\) to produce a set \(G(z_p)\) that is indistinguishable from \(X_p\). With regards to generating \(G(z_n)\), this follows a standard GAN training approach where \(G\) is trained to generate fake negative samples that should look like \(X_n\), and \(D_{X_n}\) is trained to challenge \(G\) on that task. The adversarial loss, also a WGAN-GP, is defined as: \begin{equation} L_{adv}=\min_{G} \max_{D} \mathbb{E}[D(X^{'})]-\mathbb{E}[D(X)]+\lambda \mathbb{E}_{\hat{x} \sim P_{\mathbf{\hat{x}}}}[(\|\nabla_{\hat{x}} D(\mathbf{\hat{x}})\|_2 - 1)^2] \end{equation} \noindent In the above, depending on whether we are using \(z_u\) or \(z_n\) during training, \(X^{'}\) refers to either \(X_u^{'}\) or \(G(z_n)\). \(X\) refers to either \(X_u\) or \(X_n\) and the critic network \(D\) refers to either \(D_{X_u}\) or \(D_{X_n}\). Similarly to the gradient penalty definition in \citep{DBLP:journals/corr/GulrajaniAADC17}, the sampling \(P_{\hat{x}}\) is a uniform distribution along straight lines between pairs of points sampled from \((X_{u}^{'},X_u)\) or \((G(z_n),X_n)\). A pseudocode of TransductGAN is provided in algorithm \ref{alg:TransductGAN}. Once the TransductGAN training is completed, a binary classifier can be trained using the latent projections of \(X_n\) onto the latent space as one class and the latent projections of the fake positive images as the other class as per Algorithm \ref{alg:novelty_detector}. \begin{algorithm} \caption{TransductGAN. We use default values of \(\lambda=10\), \(n_{critic}=5\) \citep{DBLP:journals/corr/GulrajaniAADC17}.} \begin{algorithmic}\label{alg:TransductGAN} \Require the contamination rate \(\pi\), the gradient penalty coefficient \(\lambda\), the number of critic iterations per generator iteration \(n_{critic}\), the batch size \(m\). \Require initial critics parameters \(\theta_{D_{z_u}}\), \(\theta_{D_{z_n}}\), \(\theta_{D_{X_u}}\), \(\theta_{D_{X_n}}\), initial encoder parameters \(\theta_{E}\) and initial generator parameters \(\theta_{G}\). \State sample \(m\) samples from \(X_u\) \State minimize \(L_{rec}\) wrt \(\theta_{E}\) and \(\theta_{G}\) and update parameters accordingly \State sample \(z \sim p_{u}(z)\) \State minimize \(L_{reg}\) wrt \(\theta_{E}\) and update parameters accordingly \For {\(i=1,...,n_{critic}\)} \State maximize \(L_{reg}\) wrt \(\theta_{D_{z_u}}\) and update parameters accordingly \EndFor \State sample \(m\) samples from \(X_n\) \State minimize \(L_{rec}\) wrt \(\theta_{E}\) and \(\theta_{G}\) and update parameters accordingly \State sample \(z \sim p_{n}(z)\) \State minimize \(L_{reg}\) wrt \(\theta_{E}\) and update parameters accordingly \For {\(i=1,...,n_{critic}\)} \State maximize \(L_{reg}\) wrt \(\theta_{D_{z_n}}\) and update parameters accordingly \EndFor \State sample \(m\) samples from \(X_u\) \State sample \(int(\pi*m\)) samples \(z \sim p_{p}(z)\) \State combine \(G(z)\) with \((m-int(\pi*m))\) samples from \(X_{n}\) to form \(X_{u}^{'}\) \State minimize \(L_{adv}\) wrt \(\theta_{G}\) and update parameters accordingly \For {\(i=1,...,n_{critic}\)} \State maximize \(L_{adv}\) wrt \(\theta_{D_{X_{u}}}\) and update parameters accordingly \EndFor \State sample \(m\) samples from \(X_n\) \State sample \(z \sim p_{n}(z)\) \State minimize \(L_{adv}\) wrt \(\theta_{G}\) and update parameters accordingly \For {\(i=1,...,n_{critic}\)} \State maximize \(L_{adv}\) wrt \(\theta_{D_{X_n}}\) and update parameters accordingly \EndFor \end{algorithmic} \end{algorithm} \begin{algorithm} \caption{Binary classifier for novelty detection. }\label{alg:novelty_detector} \begin{algorithmic} \Require Training of TransductGAN as per Algorithm \ref{alg:TransductGAN} \State sample \(5000\) samples \(z_p\) from \( p_{p}(z)\) \State sample \(5000\) samples \(X_n\) from \(X_n\) \State train a two-class SVM with linear kernel with \(E(G(z_p))\) as one class and \(E(X_n)\) as another \State apply classifier on \(E(X_u)\) as novelty detector \end{algorithmic} \end{algorithm} \begin{algorithm} \caption{Vanilla model. We use default values of \(\lambda=10\), \(n_{critic}=5\) \citep{DBLP:journals/corr/GulrajaniAADC17}.}\label{alg:vanilla} \begin{algorithmic} \Require the contamination rate \(\pi\), the gradient penalty coefficient \(\lambda\), the number of critic iterations per generator iteration \(n_{critic}\), the batch size \(m\). \Require initial critics parameters \(\theta_{D_{X_u}}\) and initial generator parameters \(\theta_{G}\). \State sample \(m\) samples from \(X_u\) \State sample \(int(\pi*m\)) samples \(z \sim N(\mu, \Sigma)\) \State combine \(G(z)\) with \((m-int(\pi*m))\) samples from \(X_{n}\) to form \(X_{u}^{'}\) \State minimize \(L_{adv}\) wrt \(\theta_{G}\) and update parameters accordingly \For {\(i=1,...,n_{critic}\)} \State maximize \(L_{adv}\) wrt \(\theta_{D_{X_{u}}}\) and update parameters accordingly \EndFor \end{algorithmic} \end{algorithm} \begin{algorithm} \caption{Binary classifier for novelty detection with vanilla model. }\label{alg:novelty_detector_vanilla} \begin{algorithmic} \Require Training of vanilla model as per Algorithm \ref{alg:vanilla} \State sample \(5000\) samples \(z\) from \(N(\mu,\Sigma)\) \State sample \(5000\) samples from \(X_n\) \State train a two-class SVM with radial basis function kernel with \(G(z)\) as one class and \(X_n\) as another \State apply classifier on \(E(X_u)\) as novelty detector \end{algorithmic} \end{algorithm} \section{Experimental results} \subsection{Datasets} \subsubsection{MNIST \citep{lecun}.} This dataset of handwritten digits has a training set of 60000 examples, and a test set of 10000 examples and includes 10 classes. In our novelty detection formulation we will treat one of the classes as novel and remove it from the training set, the rest of the classes will be treated as normal. We will iterate through all the class combinations when reporting our results. \subsubsection{CIFAR10 \citep{krizhevsky}.} This dataset consists of 50000 training images and 10000 test images of 10 classes. We will proceed as with MNIST regarding our novelty detection formulation. \subsection{Performance measure} Our performance will be measured using the area under the curve of the Receiver Operating Characteristic (AUROC). The Receiver Operating Characteristic curve plots the true positive rate against the false positive rate as we vary the threshold of our classifier. We will also include image outputs of the produced novel images. \subsection{Network architectures} The transductive network architecture as highlighted in red in Figure \ref{TransductGAN} follows the same implementation \footnote{https://github.com/igul222/improved\_wgan\_training} as was provided by \citep{gulrajani2017improved}. Our open source implementation provides further details about the adversarial network implementation. \begin{figure}[hbt!] \centering \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=\textwidth]{mnist_outlier/mnist_real/0.png} \caption{Real novel images} \label{fig:mnist0} \end{subfigure} \hfill \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=\textwidth]{mnist_outlier/mnist_5/0.png} \caption{Fake novel images (5\%)} \label{fig:mnist1} \end{subfigure} \hfill \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=\textwidth]{mnist_outlier/mnist_10/0.png} \caption{Fake novel images (10\%)} \label{fig:mnist2} \end{subfigure} \hfill \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=\textwidth]{mnist_outlier/mnist_30/0.png} \caption{Fake novel images (30\%)} \label{fig:mnist3} \end{subfigure} \caption{MNIST example with '0' as novel class. For the fake examples, the value in brackets corresponds to the contamination rate in the test set that was used during training.} \label{fig:mnist4} \end{figure} \begin{figure}[hbt!] \centering \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=\textwidth]{cifar_outlier/cifar_real/ship.png} \caption{Real novel images} \label{fig:cif0} \end{subfigure} \hfill \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=\textwidth]{cifar_outlier/cifar_5/ship.png} \caption{Fake novel images (5\%)} \label{fig:cif1} \end{subfigure} \hfill \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=\textwidth]{cifar_outlier/cifar_10/ship.png} \caption{Fake novel images (10\%)} \label{fig:cif2} \end{subfigure} \hfill \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=\textwidth]{cifar_outlier/cifar_30/ship.png} \caption{Fake novel images (30\%)} \label{fig:cif3} \end{subfigure} \caption{CIFAR10 example with ship as novel class. For the fake examples, the value in brackets corresponds to the contamination rate in the test set that was used during training.} \label{fig:cif4} \end{figure} \subsection{Methods for comparison} We will compare our model against OCSVM, EGBAD and GANomaly. We use the scikit implementation of OCSVM \footnote{https://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html} with the 'scale' default kernel width value. We follow the same training procedures stated in the original publications regarding EGBAD and GANomaly's results. EGBAD's results with CIFAR10 were taken from \citep{akcay}. The D-GAN implementation made available by the authors did not include the version they used with MNIST and CIFAR10 datasets; our attempt to reproduce their results resulted in a mode collapse with classification results no better than random so we have not included these in our comparison. We have however built a vanilla model of TransductGAN that is very close to D-GAN with the exception that it requires prior knowledge of the contamination rate (its performance could hence be seen as a best case scenario of D-GAN), it adopts an architecture that is similar to the transductive TransductGAN in order to ensure a fair comparison. The vanilla network does not make use of a latent space and trains a binary classifier (a SVM with a radial basis function kernel) based on the fake (positive) generated samples from the generator and the negative images \(X_n\), it is summarised in Figure \ref{vanilla}) and an outline of the overall procedure is provided in Algorithm \ref{alg:vanilla} and Algorithm \ref{alg:novelty_detector_vanilla}. \begin{figure} \centering \includegraphics[scale=0.55]{vanilla_trans_gan.PNG} \caption{Vanilla transductive model. \textit{The network is only based on a GAN model and does not exploit learning in the latent space as with TransductGAN. The generator will learn to generate positive fake images that will be used along with the negative images \(X_n\) to train a binary classifier. The algorithm is outlined in Algorithm \ref{alg:vanilla} and the classification task is summarised in Algorithm \ref{alg:novelty_detector_vanilla}.}}\label{vanilla} \end{figure} \begin{table}[hbt!] \resizebox{1.25\textwidth}{!}{ \begin{tabular}{llllllllll} &OCSVM&GANomaly&EGBAD&TransductGAN(5\%)&Vanilla(5\%)&TransductGAN(10\%)&Vanilla(10\%)&TransductGAN(30\%)&Vanilla(30\%)\\ \hline 0&0.853(0)&0.882&0.86&0.983(0.002)&0.985(0.003)&0.991(0.002)&0.995(0)&0.996(0.001)&0.998(0)\\ 1&0.315(0.001)&0.663&0.314&0.994(0.001)&0.997(0)&0.996(0)&0.996(0)&0.998(0)&0.998(0)\\ 2&0.775(0.002)&0.952&0.835&0.954(0.001)&0.944(0.009)&0.985(0.002)&0.981(0.001)&0.997(0.002)&0.997(0)\\ 3&0.655(0.004)&0.794&0.712&0.949(0.007)&0.955(0.007)&0.975(0.005)&0.972(0.004)&0.996(0.002)&0.995(0.001)\\ 4&0.498(0.003)&0.803&0.655&0.952(0.008)&0.948(0.005)&0.978(0.004)&0.976(0.005)&0.994(0.001)&0.997(0)\\ 5&0.589(0.003)&0.864&0.713&0.917(0.007)&0.924(0.007)&0.975(0.002)&0.962(0.004)&0.994(0.001)&0.996(0)\\ 6&0.691(0.003)&0.852&0.753&0.983(0.003)&0.987(0)&0.994(0.002)&0.994(0)&0.996(0.001)&0.998(0)\\ 7&0.582(0.009)&0.697&0.525&0.96(0.005)&0.954(0.003)&0.976(0.005)&0.974(0.001)&0.993(0.001)&0.996(0)\\ 8&0.544(0.002)&0.792&0.728&0.936(0.006)&0.921(0)&0.967(0.001)&0.964(0.003)&0.992(0)&0.992(0.001)\\ 9&0.349(0.005)&0.534&0.547&0.938(0.012)&0.902(0.018)&0.968(0.005)&0.912(0.063)&0.988(0.002)&0.99(0.001)\\ \hline &0.585&0.783&0.664&0.956&0.952&0.98&0.973&0.994&0.996 \end{tabular} } \caption{ROC (AUC) results summary - MNIST. Results for TransductGAN are from the z features. Three different random seeds are used with standard deviations shown in brackets for TransductGAN, the vanilla model and OCSVM.} \label{tbl-2} \end{table} \begin{table} [hbt!] \resizebox{1.25\textwidth}{!}{ \begin{tabular}{llllllllll} &OCSVM&GANomaly&EGBAD&TransductGAN(5\%)&Vanilla(5\%)&TransductGAN(10\%)&Vanilla(10\%)&TransductGAN(30\%)&Vanilla(30\%)\\ \hline plane&0.54(0.01)&0.622&0.582&0.763(0.003)&0.625(0.005)&0.81(0.004)&0.786(0.009)&0.86(0.002)&0.84(0)\\ car&0.657(0.002)&0.632&0.527&0.7(0.009)&0.756(0.018)&0.85(0.002)&0.77(0.007)&0.906(0.004)&0.843(0.037)\\ bird&0.384(0.011)&0.513&0.386&0.6(0.018)&0.39(0.011)&0.66(0.007)&0.633(0.015)&0.766(0.008)&0.713(0.018)\\ cat&0.577(0.012)&0.575&0.455&0.586(0.045)&0.56(0.013)&0.655(0.004)&0.64(0)&0.786(0.009)&0.69(0.025)\\ deer&0.32(0.005)&0.591&0.385&0.55(0.007)&0.376(0.055)&0.686(0.007)&0.62(0.008)&0.796(0)&0.713(0.006)\\ dog&0.57(0.005)&0.625&0.490&0.65(0.021)&0.62(0.01)&0.715(0.011)&0.68(0.018)&0.816(0.006)&0.753(0.004)\\ frog&0.397(0.001)&0.668&0.359&0.613(0.022)&0.493(0.073)&0.736(0.015)&0.643(0.007)&0.86(0.011)&0.746(0.011)\\ horse&0.54(0.005)&0.650&0.527&0.636(0.021)&0.606(0.007)&0.74(0.011)&0.696(0.012)&0.856(0.009)&0.78(0.031)\\ ship&0.51(0.009)&0.622&0.411&0.8(0.007)&0.736(0.008)&0.87(0.006)&0.836(0.019)&0.9(0.001)&0.89(0.003)\\ truck&0.66(0.006)&0.615&0.554&0.696(0.027)&0.77(0.007)&0.81(0.009)&0.776(0.005)&0.876(0.005)&0.816(0.028)\\ \hline &0.515&0.611&0.468&0.6596&0.5935&0.7533&0.7053&0.8426&0.7786 \end{tabular} } \caption{ROC (AUC) results summary - CIFAR10. Three different random seeds are used with standard deviations shown in brackets for TransductGAN, the vanilla model and OCSVM.} \label{tbl-3} \end{table} \subsection{Discussion} The results of our experiments are presented in Table \ref{tbl-2} (MNIST) and Table \ref{tbl-3} (CIFAR10). Each row corresponds to a different novelty class and the last row summarises the average performance in terms of AUROC score. On average, our TransductGAN model outperforms GANomaly (the best performing inductive model) by 22.09\% (MNIST) and 7.95\% (CIFAR10) when the contamination rate in the test set is 5\%. With a contamination rate of 10\% TransductGAN outperforms GANomaly by 25.15\% (MNIST) and by 23.28\% (CIFAR10). When the latter figure increases to 30\%, TransductGAN outperforms GANomaly by 26.94\% (MNIST) and 37.9\% (CIFAR10). This highlights the suitability of our model in cases where the novelties are not rare, however even in cases where the contamination rate drops to 5\% our model still outperforms GANomaly. Unsurprisingly, the higher the contamination rate the better the performance as the model is able to learn from a wider pool of novel data points. This is further confirmed by assessing the improvement in image quality of the fake novel samples in Figure \ref{fig:mnist3} and Figure \ref{fig:cif3} as the contamination rate increases. It should also be noted that EGBAD and GANomaly's performances rely on hyperparameter tuning as noted in their respective publications, the tuning was carried to yield optimal performance which suggests the test set labels were used in the process. Our model, although transductive, does not make use of the test set labels at any training stage. Finally, our model also offers the advantage of generating examples of good quality novel images as shown in Figure \ref{fig:mnist3} and Figure \ref{fig:cif3}. Some further examples of novel image generation are included in Appendix \ref{appa}. As mentioned previously, we were not able to carry any direct comparison to state-of-the-art transductive methods due to the difference in experimental design where we do not make use of the class labels in the training set (as opposed to the work of \citep{DBLP:journals/corr/abs-2012-05825} for example). The state-of-the-art PU learning method (D-GAN) did not have a full implementation available, and although it has an advantage over our method (i.e. the fact it does not require any prior knowledge of the contamination rate in the test set), it only works with a specific type of discriminator loss (the cross-entropy). Previous studies have shown the limitations of using this type of loss and have highlighted issues such as mode collapse or non-informative gradients. Optimal transport type of losses \citep{arjovsky2017wasserstein,DBLP:journals/corr/abs-1803-05573} have shown more stability in the training process, our model has the flexibility of using any of those losses during training. We have compared our method to a vanilla version of TransductGAN that is closely related to D-GAN. Its performance results are displayed under the 'Vanilla' columns (with varying rates of contamination) in Table \ref{tbl-2} and Table \ref{tbl-3}. With regards to MNIST, our model outperforms the vanilla version by 0.51\% and 0.8\% for a contamination rate of 5\% and 10\% respectively, it underperforms the vanilla version by -0.15\% for a contamination rate of 30\%. On average across all contamination rates, it outperforms the vanilla model by 0.39\%. This low performance comparison level is due to the MNIST results already being \(>0.95\) for the vast majority. With regards to CIFAR10, our model outperforms the vanilla version by 10.03\%, 6.37\% and 7.59\% for a contamination rate of 5\%, 10\% and 30\% respectively, this demonstrates a superior performance across all contamination levels. \section{Conclusion and future work} We have introduced a novel architecture that learns to generate inliers and novel data using separate distributions by combining an adversarial autoencoder with a GAN under a transductive mode. A binary classifier is trained in the second stage using the latent features of the encoder network to distinguish the novel samples from the inliers. By being able to generate the novel data points artificially we overcome the hurdle of hyperparameter tuning that is faced by state-of-the-art inductive methods. Our model outperforms the latter methods and is capable of reproducing good quality visual representations of the novel images. Our model also outperforms a vanilla model that is closely related to D-GAN; this highlights the advantage that the latent space projections offer in TransductGAN over the image space features in the vanilla model. TransductGAN is most suitable for situations where the novelties are not rare but also shows competitive results when the contamination rate drops to low levels. It also requires prior knowledge of the contamination rate which is a disadvantage over other state-of-the-art PU learning methods, but it allows for the use of more powerful loss functions with enhanced stability during training. Future work will focus on learning the contamination rate and assessing cases where the contamination rate falls to levels below 5\%. Future work will also extend to include labels of the inlier set during training when these are available; this should yield an enhanced performance and allow us to compare our model against a wider range of transductive models. \section*{Acknowledgements} \noindent JMM is supported by the Wellcome Trust under Grant No. WT102845/Z/13/Z. NT is funded by the Engineering and Physical Sciences Research Council. We would like to thank Giulia Luise and Florent Chiaroni for insightful comments.
e448754fd54238238b4a766b563f4a7c7d3b0191
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec::introduction} Voronoi diagram is a partition of a set into subsets containing elements that are close to each other according to a certain metric. Even though they date centuries, Voronoi tessellations have been found immensely helpful in various applications ranging from health to computer graphics to natural sciences. The first documented application of Voronoi tessellations appeared in \cite{JohnSnowCholera} on the 1854 cholera epidemic in London in which it is demonstrated that proximity to a particular well was strongly correlated to deaths due to the disease \cite{LiliJu2011}. In more recent decades, Voronoi tessellations have almost become a common basis tool for path planning algorithms by multi-robot systems in the field of coverage control \cite{CortesMartinezMobileSensing}. In line with the popularity of Centroidal Voronoi tessellations (CVT), remarkable amount of contributions have been made to further their development. \cite{ConstrainedCVT_QiangDu} refines the notion of Constrained CVTs and derives various properties like their characterization as energy minimizers. Focusing on one-dimensional Voronoi diagrams, \cite{OneDimVD_Franz} develops an optimal algorithm for computing collinear weighted Voronoi diagrams that is conceptually simple and attractive for practical implementations. \cite{InverseVornoiGoberna} studies the inverse Voronoi problem in-depth. Despite the wide applicability and vast development in the literature pertaining to CVTs, there remain challenges and open questions, especially in high dimensional spaces. For dimensions greater than one, rigorously verifying a given centroidal Voronoi tessellation is a local minimum can prove difficult, for example \cite{UniquenessCVT_Urschel} uses variational techniques to give a full characterization of the second variation of a centroidal Voronoi tessellation and provides sufficient conditions for a centroidal Voronoi tessellation to be a local minimum. Moreover, in high dimensional spaces, the number of CVTs under certain conditions and their quality is elusive, and their computation remains difficult. In this paper, we show how one can employ CVTs in one-dimensional spaces to construct a tessellation in a higher dimensional space. Then we prove that such a tessellation is a CVT in the higher dimensional space under certain conditions. Such a construction is a simple and yet a powerful technique that is guaranteed to render at least one of the many non-unique CVTs in high dimensions in a fast and efficient way with minimal computational requirements. The desired number of centroids in the higher dimensional space is a product of the number of centroids in the one-dimensional spaces. Accordingly, if the dimension is too large, one can limit the number of centroids in one-dimensional spaces in order to keep the total number of centroids meaningful. Doing so also has the advantages of further reduction in computational time. The paper is structured as follows. In Section \ref{sec::preliminaries} we formally define CVTs, discuss their uniqueness properties, and existing methods to compute them. In Section \ref{sec:ComputationCVTHigherDimensions} we construct a tessellation in a higher dimensional space and prove that it is also a CVT. In Section \ref{sec::numericalresults} we provide numerical results of CVTs under different high dimensional spaces, densities and number of centroids. Finally, we present some conclusions and remarks on future work in Section \ref{sec::conclusion}. \iffalse Disadvantages: 1. If using SNLE to obtain the CVT in 1D, then the computation grows with the number of generators. This is because we need to solve an equation for each centroid. So if N centroids is high, then solving a system of high N number of equations is computationally taxing. 2. However, if other methods like Lloyds are used to determine the CVT in 1D, then it is not as computationally taxing. 3. If "still-to-be-resolved" point 1 turns true: that is, we can't use this for spaces like circles. From either case, we can just use the CVT from 1D, repeat that for all the dimensions we have, and club them together to obtain a CVT in the higher dimension in a straight-forward manner. Since CVTs are not unique in higher dimensional spaces, this method ensures we get at least one of the many CVTs in that higher dimension space. Overarching idea is that we can at least get these really well drawn out perfect grids in higher dimensions in a fast and efficient way that we know will be one of the many CVTs. Still to be resolved: 1. Can we do weird spaces like a circle where one dimension is a function of another? Do we need to use some sort of constrained CVTs? \fi \section{Preliminaries} \label{sec::preliminaries} Consider a region $\Omega \subset \mathbb{R}^n, \ n \geq 1$. Let $N \in \mathbb{N}$, $V_i \subset \Omega, \ \forall i \in I_N$, and denote index set as $I_N = \{1, 2, \hdots, N\}$. Let $\rho(.)$ denote a measure of information or the probability density over $\Omega$. \begin{itemize} \item[1] Tessellation: $\{V_i\}_{i\in I_N}$ is a tessellation of $\Omega$ if $V_i \cap V_j = \emptyset$ for $i \neq j$, and $\cup_{i\in I} {V}_i = {\Omega}$. \item[2] Voronoi region and generators: The Voronoi region ${V}_{z_i}$ of the Voronoi generator $z_i$ is ${V}_{z_i} = \{x \in \Omega : ||x - z_i|| < ||x-z_j||, \ i \neq j \ \text{and} \ i,j \in I_N \}$. \item[3] Voronoi tessellation: The set of Voronoi regions $\textbf{V}_{\textbf{z}} = \{V_{z_i}\}_{i \in I_N}$ of $\{z_i\}_{i \in I_N}$ is called a Voronoi tessellation $\{ \textbf{z},\textbf{V}_{\textbf{z}}\}$. \end{itemize} The mass centroid of a region $V_i \subset \Omega$ under the probability density function $\rho(.)$ is defined as: \begin{equation} z_{V_i,\rho}^c = \frac{\int_{V_i} x \rho(x) dx}{\int_{V_i}\rho(x) dx} \label{eq:MassCentroidDefn} \end{equation} \noindent A Voronoi tessellation in which the generators are the mass centroids of their respective Voronoi regions is called a \textit{Centroidal Voronoi Tessellation} (CVT), \cite{CVT_QiangDu}. The CVT obtained for 3 generators in the region $\Omega = [0,15]$ under Uniform and Normal distributions -- $\mathcal{U}(0,15)$ and $\mathcal{N}(7.5,1)$ -- are shown in Fig. \ref{fig:CVT_defn}. The generators under Uniform ad Normal distribution over $\Omega$ are marked in star and square symbols respectively. \begin{figure} \centering \includegraphics[width=\columnwidth]{CVT_defn.png} \caption{Centroidal Voronoi Tessellations of $[0,15]$ under Uniform and Normal distributions, denoted in star and square symbols respectively.} \label{fig:CVT_defn} \end{figure} \subsection{Uniqueness of CVT} \label{subsec:UniquenessofCVT} Given a region $\Omega \subset \mathbb{R}^n$, a positive integer $N$, and a density function $\rho(x)$ on $\Omega$, consider the functional $\mathcal{F}$ with any $N$ points $\{z_i\}_{i \in I_N} \in \Omega$ and any tessellation $\{V_i\}_{i \in I_N}$ of $\Omega$ as its input arguments: \begin{equation} \mathcal{F}((z_i,V_i), i \in I_N) = \sum_{i \in I_N} \int_{x\in V_i} \rho(x) ||x-z_i||^2 dx \label{eq:functionalF_QiangDu} \end{equation} \noindent Proposition $3.1$ in \cite{CVT_QiangDu} states that a necessary condition for the function $\mathcal{F}$ to be minimized is that $\{V_i\}_{i \in I_N}$ are the Voronoi regions corresponding to $\{z_i\}_{i \in I_N}$, and simultaneously, $\{z_i\}_{i \in I_N}$ are the centroids of their respective Voronoi regions. In other words, the minimizer of $\mathcal{F}$ is a Centroidal Voronoi Tessellation. Additionally, if the tessellation in \eqref{eq:functionalF_QiangDu} is fixed to be the Voronoi tessellation of $\{z_i\}_{i \in I_N}$, then the following functional $\mathcal{K}$ has the same minimizer as $\mathcal{F}$, \cite{CVT_QiangDu}. \begin{equation} \mathcal{K}((z_i), i \in I_N) = \sum_{i \in I_N} \int_{x\in V_{z_i}} \rho(x) ||x-z_i||^2 dx \label{eq:functionalK_QiangDu} \end{equation} \noindent This functional $\mathcal{K}$ is also referred to as the energy of the tessellation or the quantization energy. It is stated and proved in Lemma $3.4$ in \cite{CVT_QiangDu} that $\mathcal{K}$ is continuous and that it possesses a global minimum. Moving from existence of the CVT to its uniqueness, \cite{CVT_QiangDu} also mentions that $\mathcal{K}$ may have local minimizers. It is showed in \cite{CVT_Fleischer} that the solution of \eqref{eq:functionalK_QiangDu} is unique in one-dimensional regions with a logarithmically concave continuous probability density function of finite second moment. As reiterated in \cite{UniquenessCVT_Urschel}, for $n=1$, the logarithmic concavity condition implies that any CVT is a local minimum, and further, that there is a unique CVT that is both a local and a global minimum of $\mathcal{K}(\textbf{z})$, where $\textbf{z} = \{z_i\}_{i\in I_N}$. Accordingly, since the two distributions -- Uniform and Normal -- considered in Fig. \ref{fig:CVT_defn} on the one-dimensional region $\Omega = [0,15]$ are log-concave with finite second moment, we have that the CVTs showed therein are the global minima for the two distributions. The solution of \eqref{eq:functionalK_QiangDu} is also called scalar quantizer for $n=1$ and vector quantizer for higher dimensions. The conditions for uniqueness of vector quantizers for the general case, that is, without any assumptions on the region, density or the number of quantizers $N$, remains an open area of research. However, it is proved in \cite{UniquenessCVT_Urschel} that for $N=2$, there does not exist a unique CVT for any density for $n > 1$. For a graphic illustration on non-uniqueness of CVTs, consider a rectangle in $\mathbb{R}^2$ with six generator points under Uniform distribution. As shown in Fig. \ref{fig:NonUniqueCVT_example}, there are multiple CVTs: all the four Voronoi tessellations shown are centroidal, and additional CVTs can be obtained through rotations. \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{NonUniqueCVT.png} \caption{CVT is not necessarily unique in $\mathbb{R}^2$: Four centroidal Voronoi tessellations, each of six generators, in a rectangle in $\mathbb{R}^2$ with uniform density. Voronoi regions are shown in different colors while their centroids are marked as black dots.} \label{fig:NonUniqueCVT_example} \end{figure} To summarize, the solution of \eqref{eq:functionalK_QiangDu} is unique in one-dimensional regions for log-concave density functions but there does not exist a unique CVT for any density for dimensions greater than one \cite{UniquenessCVT_Urschel}. \subsection{Computation of CVT} \label{sec::ComputeCVTmethods} Given a region $\Omega \subset \mathbb{R}^n$, a number of generators $N$, and a density function $\rho(x)$ over $\Omega$, there are various iterative algorithms to compute a CVT in $\Omega$. As noted in the previous Section, in general, the CVT need not be unique for any dimensional region unless certain conditions are imposed on the density function. Accordingly, the solutions rendered by all the algorithms, to compute the CVT, need not be the unique global minimizers. In this Section, we first describe perhaps the most widely employed of all the algorithms: Lloyd's algorithm, and then show a computation method to obtain the exact solution of the problem of finding the CVT in one-dimensional regions. Introduced in \cite{CVT_Lloyd_original} to find the optimal quantization in pulse-code modulation, Lloyd's algorithm, also known as Voronoi iteration or relaxation, has been modified or adapted in various fields. At the core of it, Lloyd's algorithm is an iteration between constructing Voronoi tessellations and their centroids: \begin{framed} \noindent Given: $\Omega \subset \mathbb{R}^n$, $N$, $\rho(x)$ \\ Initialize: Generators $\textbf{z} = \{z_i\}_{i \in I}$, where each $z_i \in \Omega$ \begin{itemize} \item[1] Construct the Voronoi tessellation $\textbf{V}_\textbf{z}$. \item[2] Compute the mass centroids $z^c_{\textbf{V}_{\textbf{z},\rho}}$ of $\textbf{V}_\textbf{z}$. \item[3] If the computed centroids meet certain stopping criteria then terminate. If not, then set $\textbf{z} = z^c_{\textbf{V}_{\textbf{z},\rho}}$, and return to Step 1. \end{itemize} \end{framed} \noindent Since we are looking for a CVT, the search/iterations stop when the centroids of the Voronoi regions are the generators. Accordingly, the stopping criteria can be defined to have the generators same as the centroids with some tolerance. Even though Lloyd's algorithm is iterative and approximate, it has certain desirable convergence properties. \cite{ConvergenceLloyd_QiangDu} rigorously proves various global convergence properties of the Lloyd's algorithm and surveys all the results concerning the convergence of the Lloyd's algorithm. Specifically for one-dimensional spaces with log-concave density function, the local convergence using the Lloyd's algorithm has been proved in \cite{CVT_1d_uniquenessKieffer}. Another method to obtain a CVT in a one-dimensional region is SNLE (system of nonlinear equations). Perhaps the most straightforward way to compute a CVT, the core idea behind SNLE, which is the analytical computation of the CVT in one-dimensional region, is to parameterize the Voronoi regions in terms of their centroids: $V_i = [ \frac{z_{i-1}+z_i}{2}, \frac{z_i+z_{i+1}}{2}] , \forall i \in I_N$. The mass centroids from \eqref{eq:MassCentroidDefn}, with $z_{V_i,\rho}^c$ denoted as $z_i^c$ for ease of notation, can then be written in terms of the parameterized regions: \begin{equation} z_{i}^c = \frac{\int_\frac{z_{i-1}^c+z_i^c}{2}^{\frac{z_i^c+z_{i+1}^c}{2}} x \rho(x) dx}{\int_\frac{z_{i-1}^c+z_i^c}{2}^{\frac{z_i^c+z_{i+1}^c}{2}}\rho(x) dx} \label{eq:Centroids_Parameterizing_1D} \end{equation} Writing \eqref{eq:Centroids_Parameterizing_1D} for all the centroids results in $N$ equations and $N$ number of unknowns: $z_i^c$'s. This is the system of nonlinear equations (SNLE), whose solution is the set of centroids of the CVT. In one-dimensional regions, the centroids are directly used to define the corresponding Voronoi partitions. While the Lloyd's algorithm and SNLE obtain the CVT in a deterministic way, MacQueen's method developed in \cite{JMacQueen} takes a probabilistic approach. It was developed to partition an $n$-dimensional population into $k$ sets on the basis of a sample, and the process is also called $k-$means. As noted in \cite{CVTQiangDuParallel}, despite the elegance of MacQueen's method, the algorithm can be slow to converge due to a single random sampling point. Accordingly, \cite{CVTQiangDuParallel} presents a new method that can be viewed as a probabilistic version of Lloyd’s method and/or a generalization of the random MacQueen’s method. Some other algorithms that have faster convergence than Lloyd's have been proposed in \cite{CVT_LlyodsAlt_FastConvergenceLiu}, \cite{CVT_LloydsAlt_FastConvergenceWang}, \cite{CVT_LlyodsAlt_FastConvergenceHateley}. However, the computation of CVT in higher dimensional spaces still remains a challenge. \cite{CVTQiangDuParallel} considers parallel implementations of Lloyd's, MacQueen's and a method developed therein, and presents the CVT results for regions up to two dimensions while noting that the method can be extended to higher dimensions. Although \cite{CVT_LlyodsAlt_FastConvergenceHateley} results in faster convergence to a CVT, it does not easily extend to higher dimensions. In the next Section, we present a way to extend SNLE (or any method to obtain one-dimensional CVTs) to obtain a higher dimensional CVT. \section{COMPUTATION OF CVT IN HIGHER DIMENSIONS} \label{sec:ComputationCVTHigherDimensions} In this Section, we first propose a simple method to obtain a tessellation in any higher dimensional space from CVTs in one-dimensional spaces. Then, we present the proof that a tessellation constructed in such a way is also a CVT. Consider a region $\Omega \subset \mathbb{R}^n, \ n > 1$, and $\Omega = \Omega_1 \times \Omega_2 \times \hdots \times \Omega_n$. Let $\rho(.)$ be the probability density function over $\Omega$, and $\rho_i(.)$ be the density function over $\Omega_i$, $\forall i \in I_n = \{1,2,\hdots, n\}$. That is, $\rho(.)$ is the joint density, and $\{\rho_i(.)\}_{i \in I_n}$ are the marginal densities. Let the number of generators in a CVT of $\Omega_i$ under $\rho_i(.)$ be $N_i$, and let the number of generators in a CVT of $\Omega$ under $\rho(.)$ be $N$, where $N = N_1 \times \hdots \times N_n$. Denote a CVT in $\Omega_i$ as $\{\textbf{z}^*_i, \textbf{V}_{\textbf{z}^*_i}\}$. Here, $\textbf{z}^*_i = \{z^*_{i,j}\}_{j \in I_{N_i}}$ is the set of all the centroids of the CVT in $\Omega_i$, and $\textbf{V}_{\textbf{z}^*_i} = \{V_{z^*_{i,j}}\}_{j \in I_{N_i}}$ is the set of their respective Voronoi regions. Similarly, denote a CVT in $\Omega$ as $\{\textbf{z}^*,\textbf{V}_{\textbf{z}^*}\}$, where $\textbf{z}^* = \{z_k^*\}_{k \in I_N}$ denotes the centroids, $\textbf{V}_{\textbf{z}^*} = \{V_{z^*_k}\}_{k \in I_N}$ denotes their corresponding Voronoi regions. Note that $\textbf{z}^* \in \mathbb{R}^N$ while $\textbf{z}^*_i \in \mathbb{R}^{N_i} $, and $z^*_k \in \mathbb{R}^n$ while $z^*_{i,j} \in \mathbb{R}$. Denote each element of $z^*_k \in \mathbb{R}^n$ by indexing as $z^*_k(1), z^*_k(2), \hdots, z^*_k(n)$. Additionally, note that $V_{z^*_k} \subset \mathbb{R}^n$ while $V_{z^*_{i,j}} \subset \mathbb{R}$. Let $I_{n\times N}$ denote the matrix containing all combinations of vectors $I_{N_i}, \forall i \in I_n$. For example, if $n=2, N_1 = 2, N_2 = 3,$ then $N = 2\times3=6$ and \begin{equation} I_{n\times N} = \begin{bmatrix} 1 & 1 & 1 & 2 & 2 & 2 \\ 1 & 2 & 3 & 1 & 2 & 3 \end{bmatrix} \end{equation} With all the notations defined, we now present a straightforward method of constructing a tessellation in $\Omega$ from CVTs in $\Omega_i's$: \begin{framed} \hspace{1cm} \textbf{Tessellation construction in $\Omega$} \noindent For each dimension $i \in I_n$, construct a CVT in $\Omega_i$: $\{\textbf{z}^*_i, \textbf{V}_{\textbf{z}^*_i}\}$ \noindent Obtain the $n$ coordinates of each centroid in $\Omega$ and its Voronoi region as: $\forall k \in I_N:$ \hspace{0.5cm}$\forall i \in I_n:$ \hspace{1cm} $z^*_k = z^*_{ I_{n \times N}(i,k)}$ \hspace{1cm} $V_{z^*_k}= V_{z^*_{ I_{n \times N}(i,k)}}$ \noindent The set of all the centroids $\{z_k^*\}_{k \in I_N}$ and their Voronoi regions $\{V_{z^*_k}\}_{k \in I_N}$ make the tessellation in $\Omega$: $\{\textbf{z}^*,\textbf{V}_{\textbf{z}^*}\}$ \end{framed} Having obtained the tessellation, we show in the following theorem that $\{\textbf{z}^*,\textbf{V}_{\textbf{z}^*}\}$ constructed from $\{\textbf{z}^*_i, \textbf{V}_{\textbf{z}^*_i}\}_{i \in I_n}$ is a CVT in $\Omega$. {\textbf{Theorem:}} If events in $\Omega_i$ are independent of those in $\Omega_j$, $\forall i \neq j, \ i,j \in I_n$, then for some $k_i \in I_{N_i}, \forall i \in I_n$ and $\forall k \in I_N,$ we have: \begin{equation} z^*_k = (z^*_{1,k_1}, \ z^*_{2,k_2}, \hdots, z^*_{n,k_n}) \label{eq:TheoremCentroidStatement} \end{equation} \begin{equation} V_{z^*_k} = V_{z^*_{1,k_1}} \times V_{z^*_{2,k_2}} \times \hdots \times V_{z^*_{n,k_n}} \label{eq:TheoremVoronoiStatement} \end{equation} {\textbf{Proof:}} Consider $x \in V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_n}}$, $\forall i \in I_n$, and denote $x = (x_1, \hdots, x_n)$. Because $V_{z^*_{i,k_i}}$ is the Voronoi region of $z^*_{i,k_i}$, $\forall i \in I_n$, we have for any $j_i \in I_{N_i}$: \begin{align} ||x_i - z^*_{i,k_i}||_2 \leq ||x_i - z^*_{i,j_i}||_2 \nonumber \\ \implies (x_i - z^*_{i,k_i})^2 \leq (x_i - z^*_{i,j_i})^2 \label{eq:VoronoiRegionRnProof1} \end{align} Summing \eqref{eq:VoronoiRegionRnProof1} $\forall i \in I_n$, \begin{align} (x_1 - z^*_{1,k_1})^2 + & \hdots + (x_n - z^*_{n,k_n})^2 \leq \\ \ \ (x_1 & - z^*_{1,j_1})^2 + \hdots + (x_n - z^*_{n,j_n})^2 \\ \implies \sqrt((x_1 - z^*_{1,k_1})^2 &+ \hdots + (x_n - z^*_{n,k_n})^2) \leq \\ \sqrt((x_1 & - z^*_{1,j_1})^2 + \hdots + (x_n - z^*_{n,j_n})^2) \label{eq:VoronoiRegionRnProof2} \end{align} Let $\hat{z}^*_k = (z^*_{1,k_1}, z^*_{2,k_2}, \hdots, z^*_{n,k_n})$, then \eqref{eq:VoronoiRegionRnProof2} results in: \begin{align} ||x-\hat{z}^*_k||_2 \ \ \leq \ \ ||x-z^*_j|| \nonumber \\ \implies V_{\hat{z}^*_k} = V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_1}} \label{eq:VoronoiRegionRnProof2} \end{align} \noindent That is, $V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_1}}$ is the Voronoi region of $\hat{z}^*_k$. We are yet to prove that $\hat{z}^*_k$ is a centroid of a CVT in $\Omega$ under $\rho(.)$, that is, $z^*_k = \hat{z}^*_k$. Consider the $i^{th}$ coordinate of $\hat{z}^*_k$. Since $z^*_{i,k_i}$ is the centroid of $V_{z^*_{i,k_i}}$, by definition of centroid, we have: \begin{align} z^*_{i,k_i} &= \frac{\int_{V_{z^*_{i,k_i}}} x_i \rho_1(x_i)}{\int_{V_{z^*_{i,k_i}}} \rho_n(x_i) dx_i} \nonumber \\ &= \frac{\int_{V_{z^*_{1,k_1}}} \rho_1(x_1)dx_1}{\int_{V_{z^*_{1,k_1}}} \rho_1(x_1)dx_1} \times \hdots \times \frac{\int_{V_{z^*_{i,k_i}}} x_i\rho_i(x_i)dx_i}{\int_{V_{z^*_{i,k_i}}} \rho_i(x_i)dx_i} \nonumber \\ &\hspace{2cm} \times \hdots \frac{\int_{V_{z^*_{n,k_n}}} \rho_n(x_n)dx_n}{\int_{V_{z^*_{n,k_n}}} \rho_n(x_n)dx_n} \label{eq:MassCentroidRnProof1} \end{align} Because the events in $\Omega_i$ are independent of those in $\Omega_j$, $\forall i \neq j, \ i,j \in I_n$, we have $\rho(x_1, \hdots, x_n) = \rho_1(x_1), \hdots, \rho_n(x_n)$. Substituting this relation in \eqref{eq:MassCentroidRnProof1} implies: \begin{align*} z^*_{i,k_i} &= \frac{\int_{V_{z^*_{1,k_1}}} \hdots \int_{V_{z^*_{n,k_n}}} x_i \rho(x_1, \hdots, x_n) dx_1 \hdots dx_n }{\int_{V_{z^*_{1,k_1}}} \hdots \int_{V_{z^*_{n,k}}} \rho(x_1, \hdots, x_n) dx_1 \hdots dx_n } \end{align*} \noindent which, by definition of mass centroids, is the $i^{th}$ coordinate of the $k^{th}$ of the $N$ centroids -- $z^*_k$ -- in $\Omega$ with density $\rho(.)$. That is, $z^*_k(i) = z^*_{i,k_i}$. Since this holds for all $i \in I_n$ coordinates, we have $z^*_k = \hat{z}^*_k = (z^*_{1,k_1}, z^*_{2,k_2}, \hdots, z^*_{n,k_n})$, and hence proving \eqref{eq:TheoremCentroidStatement}. On the other hand, since $V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_1}}$ is the Voronoi region of $\hat{z}^*_k$ from \eqref{eq:VoronoiRegionRnProof2}, and $z^*_k = \hat{z}^*_k$, we have $V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_1}}$ is the Voronoi region of $z^*_k$, hence proving \eqref{eq:TheoremCentroidStatement}. Since this holds for all $N$ centroids in $\Omega$, we have that $\textbf{z}^* = \{z^*_k\}_{k \in I_N}$ and $\textbf{V}_{\textbf{z}^*} = \{V_{z^*_k}\}_{k \in I_N}$ is a CVT in $\Omega$ with density $\rho(.)$. $\hfill \square$ Recall the non-uniqueness of CVTs in $\mathbb{R}^2$ from Fig. \ref{fig:NonUniqueCVT_example}, that shows some of the CVTs for $N=6$ generators in a rectangle in $\mathbb{R}^2$ with uniform density. We construct the CVT in Fig. \ref{fig:NonUniqueCVT_example}(d) under different conditions. Consider $\Omega = [0,20] \times [0,10]$ in $\mathbb{R}^2$ with density $\rho(.) \sim \mathcal{N}(\mu,\Sigma)$, where $\mu = (12,7)$ and $\Sigma=[4 \ \ 0; 0 \ \ 1]$. Denote the CVT as $\{\textbf{z}^*,\textbf{V}_{\textbf{z}^*}\}$, where $\textbf{z}^* = (z^*_1, \hdots, z^*_6)$, and $z^*_k \in \mathbb{R}^2, \forall k \in I_6 = \{1, \hdots, 6\}$. On the other hand, let $N_1 = 3$ and $N_2 = 2$. Consider the unique CVT in $\Omega_1 = [0,20]$ for $\rho_1(.) \sim \mathcal{N}(12,4)$, which is denoted $\{\textbf{z}_1^*,\textbf{V}_{\textbf{z}_1^*}\}$. Note $\textbf{z}_1^* = (z^*_{1,1}, z^*_{1,2}, z^*_{1,3})$, and $z^*_{1,j} \in \mathbb{R}, \forall j \in I_3$. Similarly, consider the unique CVT in $\Omega_2 = [0,10]$ for $\rho_1(.) \sim \mathcal{N}(7,1)$, which is denoted $\{\textbf{z}_2^*,\textbf{V}_{\textbf{z}_2^*}\}$. Note $\textbf{z}_2^* = (z^*_{2,1}, z^*_{1,2})$, and $z^*_{1,j} \in \mathbb{R}, \forall j \in I_2$. These generators are shown in Fig \ref{fig:Is1plus1equalto2_step1}: the region $\Omega_1$ and the CVT generators in it are showed in pink, and the region $\Omega_2$ and the CVT generators in it are showed in blue. While this method of obtaining a CVT in higher dimensions by employing a combination of CVTs in $\mathbb{R}$ does not result in every possible CVT of the higher dimension under the given conditions, we are guaranteed to obtain at least one of them in a straightforward manner with minimal computation. \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{Is1plus1equalto2_step1.png} \caption{CVTs in $\Omega_1$ and $\Omega_2$ with densities $\mathcal{N}(12,4)$ and $\mathcal{N}(7,1)$ respectively.} \label{fig:Is1plus1equalto2_step1} \end{figure} \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{Is1plus1equalto2.png} \caption{CVT in $\Omega$ with density $\mathcal{N}(\mu,\Sigma)$ where $\mu = [12; 7]$ and $\Sigma = [4 \ \ 0; 0 \ \ 1]$ .} \label{fig:Is1plus1equalto2_step1} \end{figure} \section{NUMERICAL RESULTS} \label{sec::numericalresults} In this Section, we present a set of numerical results to demonstrate the ease of extension in higher dimensions through the time required to compute the CVT and the CVT energy. Additionally, for 2 and 3 dimensional spaces we also present the tessellations graphically. To obtain the CVTs in one-dimensional spaces, one can employ Lloyd's algorithm or solve the system of nonlinear equations; the latter being more desirable when $N_i's$ are low. Consider the region $\Omega _1 = \Omega _2 = [-1, 1]$ and $\Omega = \Omega_1 \times \Omega_2 \subset \mathbb{R}^2$. Following the cases taken up in \cite{CVTQiangDuParallel}, we let the density function over $\Omega$ be $e^{-10x^2}$. The CVT of 256 centroids, obtained from $16$ in each dimension, in the aforementioned $\Omega$ is shown in Fig. \ref{fig:CVT_2D_16x16_expminus10xsq}. As designed and expected, the tessellation has a well drawn out grid-like structure with the intensity of centroids being higher in the center of $\Omega$. The resulting tessellation is a CVT with (low) energy of $2.9 \times 10^{-4}$ and was obtained in computational time as less as $13.18$ minutes in an ordinary laptop -- MacBook Air 2015 with 2.2 GHz Dual-Core Intel Core i7. \begin{figure} \centering \includegraphics[width=\columnwidth]{CVT_2D_16x16_expminus10xsq.eps} \caption{CVT of 256 centroids in a two-dimensional square under $\rho_1(x_1) = \rho_2(x_2) = e^{-10x^2}$ } \label{fig:CVT_2D_16x16_expminus10xsq} \end{figure} Next case of demonstration is in the region $\Omega = [0,20] \times [0,20]$ with a Gaussian density of means $\begin{bmatrix} 5 \\ 6.5 \end{bmatrix}$ and variance $\begin{bmatrix} 2 \ \ 0 \\ 0 \ \ 1 \end{bmatrix}$. Here, we consider $N_1 = 60$ and $N_2 = 50$, implying total number of centroids in $\Omega$ being $N=3000$. The resulting CVT with energy $0.0112$ is shown in Fig. \ref{fig:CVT_2D_60x50_GammaGaussianWorkComp}. \begin{figure} \centering \includegraphics[width=\columnwidth]{CVT_2D_60x50_GammaGaussianWorkComp.eps} \caption{CVT of 3000 centroids in $\Omega = [0,20]\times [0,20]$ with Gaussian density.} \label{fig:CVT_2D_60x50_GammaGaussianWorkComp} \end{figure} Moving to 3 dimensional spaces, we consider $\Omega = [0,10]\times [0,10] \times [0,10]$ under Gaussian density with mean $\mu$ and variance $\Sigma$ as: \begin{equation*} \mu = \begin{bmatrix} 6 \\ 5 \\ 1 \end{bmatrix} \hspace{1cm} \Sigma = \begin{bmatrix} 2 \ \ 0 \ \ 0 \\ 0 \ \ 1 \ \ 0 \\ 0 \ \ 0 \ \ 1 \end{bmatrix} \end{equation*} \noindent The resulting well-aligned grid looking CVT with $16$ centroids in each dimension, with energy $0.1616$, is shown in Fig. \ref{fig:CVT_3D_16x16x16_Gaussian62_51_3p51}. \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{CVT_3D_16x16x16_Gaussian62_51_3p51.eps} \caption{Scalability and generalizability to any density: CVT of 4096 centroids in a 3D space under Gaussian density.} \label{fig:CVT_3D_16x16x16_Gaussian62_51_3p51} \end{figure} One of the areas where higher dimensional CVTs have found an application is in the field of evolutionary optimization. Recently introduced, MAP-elites \cite{MAP_elites} is an algorithm that illuminates search spaces in evolutionary optimization, allowing researchers to understand how interesting attributes of solutions combine to affect performance. To scale up the MAP-elites algorithm, authors in \cite{CVT_MAP_elites} employ centroidal Voronoi tessellations, and therein, following \cite{CVTQiangDuParallel}, they employ MacQueen's method to obtain the CVTs and show the sufficiency of using $5000$ centroids. In line with their result, we keep the total number of centroids around the same. Accordingly, we vary $N_i, \forall i \in I_n$ such that $N = \prod_i N_i$ is around $5000$. The corresponding results are given in Table \ref{tab:HighDimensionQiangDu} where we see that the computation time decreases with the increase in dimension $n$. This is because with increase in $n$, we decrease $N_i$ to keep $N$ around $5000$. Hence, the computation of CVT in one-dimensional spaces with fewer centroids is faster. The low energy of all the tessellations is also worth noting. \begin{table}[] \begin{tabular}{@{}cccc@{}} \toprule Dimension, $n$ & $N = \prod_i N_i$ & CVT energy & Time (minutes) \\ \midrule 4 & $4096 = 8^4$ & $0.68 \times 10^{-3}$ & $6.174$ \\ 5 & $4096 = 4^3 \times 8^2$ & $1.2 \times 10^{-3}$ & $4.248$ \\ 8 & $6561 = 3^8 $ & $0.74 \times 10^{-3}$ & $0.641$ \\ 12 & $4096 = 2^{12}$ & $0.21 \times 10^{-3}$ & $0.480$ \\ \bottomrule \end{tabular} \label{tab:HighDimensionQiangDu} \caption{Tessellation energy and time taken for computing the tessellation for $\Omega_i = [-1,1], \forall i \in I_n$ under density $e^{-10x^2}$ over each $\Omega_1$.} \end{table} \section{CONCLUSIONS} \label{sec::conclusion} In order to fully rank the quality of all the CVTs under a certain higher dimensional space (read fixed region, number of centroids, and density), the knowledge of all the CVTs and their tessellation energy is required. However, the problem in such a comparison is the difficulty in obtaining CVTs in higher dimension spaces. Nevertheless, the tessellations constructed from CVTs in one-dimensional spaces, that appear to be well drawn out grid-like structures, are proved to be one of the many CVTs in such spaces of dimensions greater than 1. Hence, we are guaranteed to obtain at least one of the many non-unique CVTs in the higher dimensional space. Additionally, as seen in the simulation results, the tessellation energy of such CVTs is quantifiably low and are obtained with minimal computational requirement. The method described does not make specific assumptions on the density function, it is scalable to a large number of centroids, and is flexible in terms of dimensions and discretization over each dimension. However, the (only) key assumption in the construction of CVTs in a higher dimensional spaces from CVTs in one-dimensional spaces is the independence of the densities of the latter spaces. This limits the applicability of the developed idea in areas where CVTs are constrained to a surface, say computing CVT on a sphere, and will be a point of investigation for our future work. \addtolength{\textheight}{-12cm}
bdb17348fbea0ba02d2e58ef4395d6a5206120c4
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} There are some properties such as negative permitivity and permeability which are absent in materials which are present in nature. Introducing metamaterials helps us to achieve all these properties \cite{kshetrimayum2004brief}\cite{capolino2017theory}\cite{walser2000metamaterials}. This unique properties of metamaterials are mainly observed at it's resonant frequencies \cite{bukhari2019metasurfaces}.\\ Metamaterials can be treated as an LC circuit. Both inductance and capacitance depends on structure of metamaterial, polarisation of incident wave, thickness of substrate and refractive index of substrate used \cite{sangala2020single}\cite{chowdhury2011broadband}\cite{tao2008highly}. Although, we are familiar with variation of these properties for specific structures \cite{marwaha2016accurate}\cite{george2018mathematical}\cite{elander2011mathematical}\cite{bose2012mathematical}, we don't have any universal theoretical model helping us to get the exact relations. \\ Use of metamaterials is widely done at many places such as sensor identification, high-frequency battlefield communication, frequency filter and many more \cite{valipour2021metamaterials}\cite{rappaport2019wireless}\cite{singh2015review}. One such application is using it as a perfect unity absorber. These metamarial absorbers are further widely used is applications such as thermal emitters, photovoltaic cells, optical imaging devices, etc \cite{diem2009wide} \cite{munday2011large} \cite{hu2010plasmonic}. The first metamaterial absorber was experimentally confirmed by Landy et al. \cite{landy2008perfect} in 2008. Since than, a lot of work has been done in creating novel metamaterial absorbers \cite{wang2020multiple}\cite{gandhi2021ultra}\cite{liu2020ultrathin}\cite{luo2021multiband}\cite{elakkiya2020seven} to be used in different applications as stated before. \\ In today's era where telecommunication industry is developing exponentially, it is important to also have near unity absorbers in different bands of 6G \cite{chi2020progresses}\cite{li2021recent}. In our previous work \cite{https://doi.org/10.48550/arxiv.2203.13442}, we had propose a novel metamaterial absorber in WR 1 and WR 1.5 bands. However, there is a strong need to have near unity absorbers in remaining bands of 6G. Hence, in this study we propose a novel metamaterial structure which will act as a near unity absorber in specific frequencies of WR 3 band. Along with that, we also provide a study on change in central frequencies due to variation in Geometrical parameters and change in polarisation. \section{Design and Simulations} This section focuses on schematic of proposed design. Along with that, this section will also includes the necessary boundary conditions and assumptions considered in this study. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/Design.png} \caption{Proposed Design} \label{fig:fig1} \end{figure} The proposed design as shown in Figure \ref{fig:fig1} has symmetry along both X and Y axis. The proposed design is simulated over Kapton with thickness of 25$\mu$m having refractive index of $1.88 + 0.04i$. \begin{table}[ht] \begin{center} \begin{tabular}{|c|c|c| } \hline Parameter & Value\\ \hline p & 300 \\ \hline a & 202.5 \\ \hline c & 224 \\ \hline s & 90 \\ \hline g & 22.5 \\ \hline t & 15 \\ \hline \end{tabular} \end{center} \caption{Value of Parameters in $\mu$m as shown in Figure\ref{fig:fig1}} \label{table:1} \end{table} All the values of parameters as shown in Figure\ref{fig:fig1} can be seen in Table\ref{table:1}. The parameters given in Table\ref{table:1} happen to be optimized parameters to get resonant frequency of 235~GHz.\\ To simulate the proposed design, use of COMSOL MULTIPHYSICS \textregistered, is done. Utmost care is taken while considering boundary conditions so as to reduce the required computational power. The used conditions are elaborated below: \begin{itemize} \item Perfectly Electric Conductor: It is a special case of electric field boundary condition that sets tangential component of electric field to zero. It is generally used in modelling a lossless metallic surface \cite{multiphysics1998introduction}. \item Periodic Condition: Periodic condition is used to make unit cell structure periodic along particular direction \cite{multiphysics1998introduction}. \end{itemize} In the proposed simulation, the structure is periodic along both X and Y direction. Along with that, use of Perfectly Electric Condition (PEC) condition is done on the design as well as the end of the substrate. Adding PEC boundary condition at the bottom of the substrate allows us to omit air domain after substrate helping us to reduce the computational power.\\ To vary the parameters as listed in Table\ref{table:1}, use of parametric sweep is done. The parametric sweep feature as provided by COMSOL\cite{multiphysics1998introduction} helps us to iterate the process of finding a solution over complete set of variable. This, not only helps us in reducing the manual work but also helps in comparing the results at one place. Table\ref{table:2} tells us about the range in which individual parameters are varied. \begin{table}[ht] \begin{center} \begin{tabular}{|c|c|c| } \hline Parameter & Minimum Value & Maximum Value\\ \hline a & 160 & 260 \\ \hline c & 180 & 280 \\ \hline s & 40 & 140 \\ \hline g & 5 & 50 \\ \hline \end{tabular} \end{center} \caption{Minimum and Maximum values of parameter} \label{table:2} \end{table} Further to calculate absorbance in percentage, we make use of simple formulation between absorbance, transmission and reflection which is $$\text{i.e Absorptivity } = 1 - \text{abs}(S_{11})^2 - \text{abs}(S_{21})^2$$ where $S_{11}$ and $S_{21}$ are reflection and transmission coefficients. However, as in simulation we make use of PEC at the bottom, the incident wave cant pass through it making $S_{21}$ as 0 and simplifying the formula to $$\text{i.e Absorptivity in }\% = 1 - \text{abs}(S_{11})^2$$ \\ The proposed design is studied in both X and Y polarisation. Further, all the data is extracted in a text file which is further plotted using Origin Pro 2021. \section{Results and Discussion} This section comprises of simulated optimised results. Apart from that we will be also discussing on effects of geometrical parameters on Absorbance in both X and Y polarisation. \subsection{Y Polarisation} \subsubsection{Optimized Parameters} As seen in Figure \ref{fig:fig2}, almost 96.3\% of incident EM field is absorbed at frequency of 258 GHz or 0.258 THz. Apart from that there's one more small resonance happening at 0.536 THz with absorptivity of 35.12\%. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/Optimized_S11_Y.png} \caption{Frequency vs Absorbance plot for Y polarisation} \label{fig:fig2} \end{figure} The initial low frequency mode as seen in Figure \ref{fig:fig2} is mainly due to inductance produced after the confinement of electric field on horizontal arms as shown in Figure \ref{fig:fig3} \begin{figure}[hbt!] \includegraphics[width = 9.5 cm]{images/Optimized_Ez_Y.png} \caption{$E_z$ component of Electric field on metamaterial at low frequency mode} \label{fig:fig3} \end{figure} The supporting fact for above happening is evident from Figure \ref{fig:fig4} where we have shown surface current density. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/Optimized_SCD_Y.png} \caption{Surface Current Density on metamaterial at low frequency mode in Y polarisation} \label{fig:fig4} \end{figure} We see that the current follows a unidirectional path along Y axes. This is consistent with polarisation of Electric field. Apart from that, we also see high current density is both inner and outer vertical arms which leads to attenuation of emitted radiation causing a very high absorbance at low frequency mode.\\ On contrary to that the higher frequency mode appears due to creation of capacitance between inner and outer horizontal arms as seen in Figure \ref{fig:fig5}. \begin{figure}[hbt!] \includegraphics[width = 9.5 cm]{images/Optimized_Ez_Y1.png} \caption{$E_z$ component of Electric field on metamaterial at high frequency mode in Y polarisation} \label{fig:fig5} \end{figure} Also in this case, there is flip in direction of current in all vertical arms. This happens to be in opposite direction of the polarisation. With that, the current density is comparatively less than that of what we saw in initial lower frequency mode. This can be concluded by looking into Figure \ref{fig:fig4} and Figure \ref{fig:fig6} \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/Optimized_SCD_Y1.png} \caption{Surface Current Density on metamaterial at high frequency mode in Y polarisation} \label{fig:fig6} \end{figure} \subsubsection{Variation in Parameters} To study effect of Geometrical parameters like height (c), width (a), gap (g) and size of square (s) as seen in Figure \ref{fig:fig1}, we vary them with minimum and maximum values as shown in Table \ref{table:2} \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/HeightS11_Y.png} \caption{Contour plot of absorbance on varying height in Y polarisation} \label{fig:fig7} \end{figure} Figure \ref{fig:fig7} refers to variation of resonant frequency on changing height. We see that on increasing the height, the initial mode frequency gets redshifted. As the period remains constant and the height increases, the gap between 2 unit cells decrease resulting into more capacitance and as we know, more is the capacitance, less wil be the resonant frequency. On the other hand, in higher mode, along with redshift we also see decrease in absorbance and at one point the peak vanishes. This happens because the gap between the upper two parallel arms increases as the length is increased and this reduces the mode that can be sustained within the gap between the two arms. Thus at one point it can become weak enough to vanish. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/WidthS11_Y.png} \caption{Contour plot of absorbance on varying width in Y polarisation} \label{fig:fig8} \end{figure} The redshift is also observed on increasing the width as seen in Figure \ref{fig:fig8}. However, in this case the reason for this happening is increase in inductance due to increase in horizontal arm length. On contrary to Figure \ref{fig:fig7}, in Figure \ref{fig:fig8} we see that higher mode vanishes on increasing the width. This can happen as the width is increased, the two side of the cell will start coming closer and then there is a coupling between the two progressively increasing as the width increases. This can result in the appearance of the mode, which is capacitively excited and as the arms draw closer, the capacitance decreases, increasing the frequency. This the mode appears suddenly as the width becomes larger and the mode becomes stronger. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/GapS11_Y.png} \caption{Contour plot of absorbance on varying gap in Y polarisation} \label{fig:fig9} \end{figure} We further vary gap to understand confirm the production of capacitance in the gap. However, if that was the case then there would had been blueshift in resonant frequency due to decrease in capacitance. But there's no such observation in the initial mode (See Figure \ref{fig:fig9}, hence we can safely say that there's negligible amount of capacitance created in first mode. It is obvious from the figure that when gap will vary, the length remains the same, so frequency should not change. This can also be verified from Figure \ref{fig:fig3} where we don't see any confinement of electric field. On other hand, in high frequency mode, a considerable amount of capacitance is been created as seen in Figure \ref{fig:fig5}. Hence, there's small amount of redshift happening at higher frequency as evident from Figure \ref{fig:fig9} \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/SquareS11_Y.png} \caption{Contour plot of absorbance on varying size of square in Y polarisation} \label{fig:fig10} \end{figure} From Figure \ref{fig:fig10}, we observe that similar to gap, the internal square plays no major role in initial mode. This is expected as the first mode is due to the upper and lower arm gap capacitance. However, at high frequency, on increasing the inner square size, mode gets redshifted before vanishing away. However it reappears after getting close to exterior loop. This will happen if the inner square , after increasing it's size can start interacting with the upper and lower arm excitation mode. The increasing size of the central portion can result in the modified coupling of the upper-lower arms. So the Frequency start reducing and will vanish at a particular combination of Size and arms length. Now if the size of the inner square increases further, now the capacitance between the upper and lower arms will start dominating, and there will be arise of new frequency modes.Other way to look at it is, the capacitance start increasing with size, decreasing the resonance frequency of the high frequency mode. \subsection{X Polarisation} \subsubsection{Optimized Parameters} From Figure \ref{fig:fig11}, we see that on exciting electric field in X direction, there only one mode occurring in bandwidth of 500 GHz at 292 GHz with absorptivity of 93.85 \%. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/Optimized_S11_X.png} \caption{Frequency vs Absorbance plot for X polarisation} \label{fig:fig11} \end{figure} In this case, the only mode visible is majorly due to the inductance produce in vertical arms as seen in Figure \ref{fig:fig12}. \begin{figure}[hbt!] \includegraphics[width = 9.5 cm]{images/Optimized_Ez_X.png} \caption{$E_z$ component of Electric field on metamaterial at low frequency mode in X polarisation} \label{fig:fig12} \end{figure} The surface current density as observed in Figure \ref{fig:fig13} is unidirectional towards the direction of polarisation. With that, the surface charge density is also negligible in inner square. Apart from that the major reason behind high absorptivity at this frequency is due to attenuation of incident wave because of high current density as seen in Figure \ref{fig:fig13} \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/Optimized_SCD_X.png} \caption{Surface Current Density on metamaterial at low frequency mode in X polarisation} \label{fig:fig13} \end{figure} \subsubsection{Variation in Parameters} We further vary the geometrical parameters as shown in Table \ref{table:2} to study effect of these parameters on absorbance. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/HeightS11_X.png} \caption{Contour plot of absorbance on varying height in X polarisation} \label{fig:fig14} \end{figure} Figure \ref{fig:fig14} refers to change in absorptivity on varying the height. For all the values of height considered in this study we have one single mode in frequency from 0.1 to 0.55 THz. However, as we move towards higher frequency there are some instances of higher frequency mode which currently isn't our interest. We also observe a red shift is resonance frequency. This is due to increase in inductance on increasing the arm length. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/WidthS11_X.png} \caption{Contour plot of absorbance on varying width in X polarisation} \label{fig:fig15} \end{figure} Similarly, on increasing the width we observe a redshift. Here, the redshift occurs mainly because of increase in capacitance which happens due to closeness of exterior arms in every unit cell. Apart from that as in X polarisation, the initial gap doesn't play any role there is no instance of second mode in this case. Th supporting instance for this claim is evident from Figure \ref{fig:fig13} and Figure \ref{fig:fig16}. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/GapS11_X.png} \caption{Contour plot of absorbance on varying gap in X polarisation} \label{fig:fig16} \end{figure} In Figure \ref{fig:fig16}, we see that there's no change in resonance frequency on changing the gap size. This happens due to direction of Electric field being parallel to gap. As both the ends of gap will be on equipotential surface in case of X polarisation, theres no capacitance created in this case resulting into no effect of absorbance due to gap. \begin{figure}[hbt!] \includegraphics[width = 8.5 cm]{images/SquareS11_X.png} \caption{Contour plot of absorbance on varying size of square in X polarisation} \label{fig:fig17} \end{figure} Similar thing can be observed on changing the size of square as shown in Figure \ref{fig:fig17}, However, in this case we also see a higher mode which starts appearing from 0.5 THz. The mode exists at the higher frequency, but is not visible in our simulations data. However, as the middle square changes it's size, the capacitive coupling must be getting reduced, increasing the capacitance, decreasing the resonance frequency. This trend is clearly seen in the figure, where the second mode keeps red shifting, eventually vanishing when the coupling is no more effective. \section{Conclusion} In this study, we propose a novel metamaterial structure to be used in 6G band. This design happens to be one of the optimal candidate for 6G applications mainly due to it's low complexity. We further provide a study on effect on resonance frequency on changing of geometric parameters like width, height, gap and size of square in both X and Y polarisation. The results as achieved on changing the dimensions tell us that the same design with some more optimal dimensions can also be used in multiple applications,. \bibliographystyle{IEEEtran}
16762a08de13f3e70e5fbbb44a9bcc18c792d0e8
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\subsection{A Core Language with Effects and Handlers} For the sake of simplicity, we take the core language described in \cite{Pretnar2015:EFF} with additional base types corresponding to observations and actions and a simple type system without type effects. We will not talk about the details of the underlying effect, such as randomness, I/O, or exceptions. Those effects are obviously needed in practice, but adding them to the theory would be standard, so for the sake of simplicity we ignore those, and when we write a type $T \rightarrow T'$, this function should be understood as a function that can use those standard effects. The grammar for terms and types is in Figure~\ref{f:effgrammar}. \begin{figure} \begin{framed} \begin{align*} \text{(Values) } V &::= x \midd \lambda x. C \midd (V,V) \midd () \midd \underline{c} \midd \underline{f} \midd H \\ \text{(Handlers) } H &::= \key{handler} \{ \key{return} x \mapsto C, \op{op}_1(x;k) \mapsto C, \dots, \op{op}_n(x;k) \mapsto C \} \\ \text{(Computations) } C &::= \key{return} V \midd \pi_i(V) \midd \op{op}(V;x.C) \midd \key{let} x = C ~\key{in} C \midd V~V \midd \key{with} V ~\key{handle} C \\ \text{(Types) } T &::= \type{B} \midd \type{Unit} \midd T \times T \midd T \rightarrow T \midd T \Rightarrow T\\ \end{align*} \vspace{-30pt} \end{framed} \caption{Syntax and Types of Terms} \label{f:effgrammar} \end{figure} In other words, we work with a $\lambda$-calculus with pairs base types (ranged over by $\type{B}$), constants and functions for those base types, denoted by $\underline{c}$ and $\underline{f}$. Any symbol $c \in \mathcal{C}$ is associated to a base type $\type{B}$, while any symbol $f \in \mathcal{F}$ comes equipped with a function type $\type{B}_1 \times \cdots \times \type{B}_n \rightarrow \type{B}$. Moreover, we have algebraic operations, each operation symbol $\op{op}$ coming with a type $\op{op} : T_p \rightsquigarrow T_a \in \Sigma$ where $T_p$ is the type of parameters and $T_a$ is the arity. In a computation $\op{op}(V;x.C)$, the variable $x$ is bound in $C$. Those operations are handled by handlers. An handler has the following form $$ \key{handler} \{ \key{return} x \mapsto C_r, \op{op}_1(x;k) \mapsto C_1, \dots, \op{op}_n(x;k) \mapsto C_n \} $$ Here, the computations $C_1,\ldots,C_n$ are pieces of code meant to handle the corresponding algebraic operation, while $C_r$ is meant to handle a return clause. We use the arrow $\Rightarrow$ to denote handler types, contrary to the function type that uses $\rightarrow$. When one wants to use the aforementioned handler for the purpose of managing some algebraic operations, we do by way of a term in the form $$ \key{with} V ~\key{handle} C $$ in which $C$ is executed in a protected environment such that any algebraic operations produced by $C$ is handled by the handler $V$, provided it is one among those declared in it. The typing rules for this language are given in Figure~\ref{f:efftype}. In a computation $\op{op}(V;x.C)$, $C$ can be seen as a continuation for the computation, with type $T_a \rightarrow T$, this is why in the typing of handler, the second parameter $k$ has this type. The typing rule for the handler with simple types looks like a function application, where the handler transforms a computation of type $T_2$ to a computation of type $T_1$. \begin{figure} \begin{framed} \begin{center} \AXC{} \UIC{$\Gamma, x : T \vdash x : T$} \DP \qquad \AXC{$\Gamma, x : T_1 \vdash C : T_2$} \UIC{$\Gamma \vdash \lambda x. C : T_1 \rightarrow T_2$} \DP \qquad \AXC{$\Gamma \vdash V_1 : T_1$} \AXC{$\Gamma \vdash V_2 : T_2$} \BIC{$\Gamma \vdash (V_1,V_2) : T_1 \times T_2$} \DP \\ \vspace{3mm} \AXC{} \UIC{$\Gamma \vdash () : \type{Unit}$} \DP \qquad \AXC{$c : \type{B} \in \mathcal{C}$} \UIC{$\Gamma \vdash \underline{c} : \type{B}$} \DP \qquad \AXC{$f : \type{B}_1 \times \cdots \type{B}_n \rightarrow \type{B} \in \mathcal{F}$} \UIC{$\Gamma \vdash \underline{f} : \type{B}_1 \times \cdots \type{B}_n \rightarrow \type{B}$} \DP \qquad \\ \vspace{3mm} \AXC{$\{(\op{op}_i : T^p_i \rightsquigarrow T^a_i) \in \Sigma \qquad \Gamma, x : T_i^p, k : T_i^a \rightarrow T_c \vdash C_i : T_c\}_{1 \le i \le n}$} \AXC{$\Gamma, x : T_v \vdash C_r : T_c $} \BIC{$\Gamma \vdash \key{handler} \{ \key{return} x \mapsto C_r, \op{op}_1(x;k) \mapsto C_1, \dots, \op{op}_n(x;k) \mapsto C_n \} : T_v \Rightarrow T_c $} \DP \\ \vspace{3mm} \AXC{$\Gamma \vdash V : T$} \UIC{$\Gamma \vdash \key{return} V : T$} \DP \qquad \AXC{$\Gamma \vdash V : T_1 \times T_2$} \UIC{$\Gamma \vdash \pi_i(V) : T_i$} \DP \\ \vspace{3mm} \AXC{$(\op{op} : T_p \rightsquigarrow T_a) \in \Sigma$} \AXC{$\Gamma \vdash V : T_p$} \AXC{$\Gamma, x : T_a \vdash C : T $} \TIC{$\Gamma \vdash \op{op}(V;x.C) : T$} \DP \\ \vspace{3mm} \AXC{$\Gamma \vdash C_1 : T_1 $} \AXC{$\Gamma, x : T_1 \vdash C_2 : T_2 $} \BIC{$\Gamma \vdash \key{let} x = C_1 ~\key{in} C_2 : T_2$} \DP \qquad \AXC{$\Gamma \vdash V_1 : T_2 \rightarrow T_1$} \AXC{$\Gamma \vdash V_2 : T_2$} \BIC{$\Gamma \vdash V_1~V_2 : T_1$} \DP \\ \vspace{3mm} \AXC{$\Gamma \vdash V : T_2 \Rightarrow T_1$} \AXC{$\Gamma \vdash C : T_2$} \BIC{$\Gamma \vdash \key{with} V ~\key{handle} C : T_1$} \DP \end{center} \end{framed} \caption{Typing Rules} \label{f:efftype} \end{figure} Then, the dynamic semantics is given in Figure~\ref{f:effsemantics}. Algebraic operations can commute with the $\key{let}$ constructor and handlers for other operations. As for handlers, the return computation is handled by the return clause, and an algebraic operation is handled by the corresponding computation in the handler, where the continuation $k$ is replaced by the actual continuation $C$ with the same handler. \begin{figure} \begin{framed} \begin{center} \small \AXC{} \UIC{$\pi_i(V_1,V_2) \rightarrow V_i$} \DP \qquad \AXC{$C_1 \rightarrow C_1'$} \UIC{$\key{let} x = C_1 ~\key{in} C_2 \rightarrow \key{let} x = C_1' ~\key{in} C_2 $} \DP \\ \vspace{3mm} \AXC{} \UIC{$\key{let} x = \op{op}(V;y.C_1) ~\key{in} C_2 \rightarrow \op{op}(V;y.\key{let} x = C_1 ~\key{in} C_2) $} \DP \qquad \AXC{} \UIC{$\key{let} x = \key{return} V ~\key{in} C_2 \rightarrow C_2 \sub{x}{V} $} \DP \\ \vspace{3mm} \AXC{} \UIC{$(\lambda x. C)~V \rightarrow C \sub{x}{V}$} \DP \qquad \AXC{$V = (\underline{c_1},\dots,\underline{c_n}) $} \AXC{$ c = f(c_1,\dots,c_n) $} \BIC{$\underline{f}~V \rightarrow \underline{c}$} \DP \\ \vspace{3mm} For the following rules, we denote $H = \key{handler} \{ \key{return} x \mapsto C_r, \op{op}_1(x;k) \mapsto C_1, \dots, \op{op}_n(x;k) \mapsto C_n \}$ \\ \vspace{3mm} \AXC{$C \rightarrow C'$} \UIC{$\key{with} H ~\key{handle} C \rightarrow \key{with} H ~\key{handle} C'$} \DP \\ \vspace{3mm} \AXC{$\op{op} \notin \set{\op{op}_1,\dots,\op{op}_n}$} \UIC{$\key{with} H ~\key{handle} \op{op}(V;x.C) \rightarrow \op{op}(V;x.\key{with} H ~\key{handle} C)$} \DP \\ \vspace{3mm} \AXC{} \UIC{$\key{with} H ~\key{handle} \key{return} V \rightarrow C_r \sub{x}{V}$} \DP \\ \vspace{3mm} \AXC{} \UIC{$\key{with} H ~\key{handle} \op{op}_i(V;x.C) \rightarrow C_i \sub{x}{V} \sub{k}{\lambda x. \key{with} H ~\key{handle} C }$} \DP \end{center} \end{framed} \caption{Semantics} \label{f:effsemantics} \end{figure} With this, we have a complete description of a core language with effects, handlers and base types. In practice, we also want other standard constructors for booleans (if then else), lists or other data structures, but this can be easily added to the core language without any theoretical difficulties. It is then relatively standard to prove the subject reduction of this type system, proving some simple kind of safety: \begin{theorem}[Subject Reduction] If $\Gamma \vdash C : T$ and $C \rightarrow C'$ then $\Gamma \vdash C' : T$ \end{theorem} \begin{proof} The proof is standard. We start by proving a weakening lemma (if $\Gamma \vdash C : T$ then $\Gamma, x : T' \vdash C : T$) and a value substitution lemma (if $\Gamma, x:T \vdash C : T'$ and $\Gamma \vdash V : T$ then $\Gamma \vdash C \sub{x}{V} : T' $) by induction on judgment, and then we can prove subject reduction by induction on the relation $C \rightarrow C'$. The weakening lemma is useful for the cases when an algebraic operation $\op{op}$ commute with a $\key{let}$or an $\mathbf{handle}$, and the substitution lemma is useful for substitutions, which are always for values as one can see in Figure~\ref{f:effsemantics}. \end{proof} However, with those simple types it is not possible to prove that any typable computation reduces to a computation of the shape $\key{return} V$, because a non handled operation $\op{op}$ cannot be reduced. To have those kind of safety theorems, we need type effects, as we will see in the next section. \subsection{Setting the Stage: Types and Algebraic Operations for RL} Let us now instantiate more clearly the set of base types and operations for our approach. We consider that: \begin{itemize} \item Base types should contain at least $\type{Bool},\type{Real},A_E,O_E,A_{\mathit{RL}},O_{\mathit{RL}}$, respectively the types for booleans, real number for rewards, \emph{actions}, \emph{observations} and their abstract counterparts. \item Constants for booleans and real numbers are standard. For $A_E, A_{\mathit{RL}}$ and $O_{\mathit{RL}}$, we consider finite sets of constants, and $A_E, A_{\mathit{RL}}$ should have the same size. As for $O_E$, the set of constants depends on the environment so we have no fixed choice. \item We have standard functions for booleans and real numbers, and equality for all those base types. We may also have additional functions for $O_E$ depending on the environment. \item For the set of operations symbols, we suppose that we have at least the main four operations described before \begin{align*} \op{choice} &: \type{Unit} \rightsquigarrow A_E \\ \op{reward} &: \type{Real} \rightsquigarrow \type{Unit} \\ \op{observe} &: \type{Unit} \rightsquigarrow O_E \\ \op{do} &: A_E \rightsquigarrow \type{Unit} \end{align*} And, in order to make the abstraction more formal, we also add \begin{align*} \op{choice_{\mathit{RL}}} &: \type{Unit} \rightsquigarrow A_{\mathit{RL}} \\ \op{reward_{\mathit{RL}}} &: \type{Real} \rightsquigarrow \type{Unit} \end{align*} Moreover, we also need to add effects corresponding to the abstract interface. As this interface is not fixed, we chose for the sake of the example the one we used on the naive algorithm. So we add those operations: \begin{align*} \op{observe_{\mathit{RL}}} &: \type{Unit} \rightsquigarrow O_{\mathit{RL}} \\ \op{getactions_{\mathit{RL}}} &: O_{\mathit{RL}} \rightsquigarrow A_{\mathit{RL}}~\type{List} \end{align*} \end{itemize} This describes all we need in order to formalize our approach. However, in practice, we do not want all the actors (environment, user and learner) to have access to all those operations at all time. A typical example is that the learner must not use $\op{observe}$ or have access to $O_E$ as it would break abstraction, and thus modularity. As a first approach, we define subsets of this language, by defining subsets of base types, functions and algebraic operation, so that we can define clearly which actor has access to which constructors. In the next section on safety, we will formalize this with a type system. \begin{itemize} \item The whole language described above, with all base types and operations is denoted $\lambda_{\mathit{eff}}^I$. This calculus will be used to define the interface, as an interface should be able to see both the constructors for the environment and for the learner in order to make the bridge. \item We denote by $\lambda_{\mathit{eff}}^E$ the subset of this whole language without types and operations related to the learner (all types and operations with $\mathit{RL}$ in the name, such as $A_{\mathit{RL}}$, $\op{choice}_{\mathit{RL}}$, \dots). This language will be used for the main program and the handler for $\op{do}$ and $\op{observe}$, as it is basically the language with no concrete information about the learner. \item Dually, we denote by $\lambda_{\mathit{eff}}^{\mathit{RL}}$ the language with \emph{only} the operations related to the learner. Also, in $\lambda_{\mathit{eff}}^{\mathit{RL}}$, we consider that we do not have any functions nor constants for $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$ except equality and the operations in the abstract interface. Indeed, this language will correspond to the learner, and as explained before, we want the learner to be independent from its environment. An important point to make this possible, is that the learner should be modular (or ideally, polymorphic) in the types $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$, and so having access to the constants of those types would break this principle. In particular, with this definition of $\lambda_{\mathit{eff}}^{\mathit{RL}}$, changing the size of the finite sets $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$ does not modify the language, so whatever the size may be, the learner still uses the same language. \end{itemize} \subsection{RL Algorithms and Environments as Handlers} We start with the main program. As showed in the previous section, the main program is just an usual functional program that has access to the types $O_E$ and $A_E$ as well as the four main operations $\op{choice}$, $\op{reward}$, $\op{observe}$ and $\op{do}$. Thus, it corresponds to the language we denote $\lambda_{\mathit{eff}}^E$. This is the main focus of our work, to make it possible to program within this language. In order to do this we still need to handle those four operations, and for this we design several handlers. \subsubsection{The Learner} The learner is a handler with the state monad for the operations $\op{choice}_{\mathit{RL}}$ and $\op{reward}_{\mathit{RL}}$, written in $\lambda_{\mathit{eff}}^{\mathit{RL}}$. So, formally, the learner is a handler $$H_{\mathit{RL}} \equiv \key{handler} \{ \key{return} x \mapsto \lambda m. \key{return} (m,x), \op{choice}_{\mathit{RL}}(k) \mapsto C_c, \op{reward}_{\mathit{RL}} (r;k) \mapsto C_r \}$$ such that $$ k : A_{\mathit{RL}} \rightarrow S_M(T) \vdash C_c : S_M(T) \qquad r : \type{Real}, k : \type{Unit} \rightarrow S_M(T) \vdash C_r : S_M(T) $$ where $T$ is any type and $S_M(T) \equiv M \rightarrow (M \times T)$ is the type for the state monad with state $M$, that represents the \emph{memory} of the learner. With this, we obtain a handler $H_{\mathit{RL}}$ with type $T \Rightarrow S_M(T)$ for any $T$. In this handler, we can indeed encode a RL algorithm, as we did for the naive algorithm for MAB, because, informally: \begin{itemize} \item The memory $M$ can contain a value function, associating an heuristic to pairs of states and actions ($O_{\mathit{RL}} \times A_{\mathit{RL}}$). It can also be used to log information if needed, typically the previous choice, the number of times choice was called \dots \item The term for choice $C_c$ has a link with the \emph{policy} of the learner. Indeed, a policy can be seen as a function of type $M \rightarrow A_{\mathit{RL}} \times M$, where, from an internal memory of the learner, we chose an action in $A_{\mathit{RL}}$ and we can also modify the memory if needed, for example to log this choice. With this policy, it is easy to obtain a computation $C_c$ with the type described above by composing with the continuation $k$. \item The term for $C_r$ has a link with the update of the value function after a choice. Indeed, learner usually modify their value function after a choice (or a sequence of choices). This can be seen as an update function of type $\type{Real} \times M \rightarrow M$, when we modify the memory (and thus the value function) according to the reward. Here, using a log in the memory can come in handy for most reinforcement learning algorithm to remember which choice is being rewarded. It is then easy to see that, from this update function, we can obtain a computation $C_r$ with the type described above by composing with the continuation $k$. \end{itemize} However, the learner will also need additional information from the environment, typically the current observable state or the list of available actions for this state, that is why we can also use the operations of the abstract interface in the computations $C_c$ and $C_r$. \subsubsection{Hiding the Memory of the Learner} The concept of this handler for the learner, which is typically a handler with the state monad, is standard but it is not very practical. Indeed, in the type $T \Rightarrow S_M(T)$ we can see that the handled computation needs an initial memory, and the final memory is returned at the end of the computation. However, this handled computation should be done in the main program, and the user cannot provide an initial memory since it is not supposed to know the actual type of memory. Similarly, there is no reason for the user to have direct access to the memory of the learner, so this type $M$ should be hidden in the computation type. So, in practice, we want a handler for the learner of type $T \Rightarrow T$ for any $T$. Fortunately, it is possible to do this from the previous handler, and it is a standard way to make the state invisible. Suppose that the learner provides an initial memory $m_i$. Then, it can define the following handler (with the empty set of handled operations): $$H_{\mathit{hide}} \equiv \key{handler} \set{\key{return} f \mapsto \key{let} x = f~m_i ~\key{in} \pi_2(x)} $$ with type $S_M(T) \Rightarrow T$ for any $T$. So, by composing this handler with the previous one, we obtain a handler of type $T \Rightarrow T$, and the memory becomes totally hidden from the user. This construction is a way to mimic the $\key{finally}$clause of the \texttt{EFF}\ language, that we used in Section~\ref{s:OurApproach}, using the standard syntax of handler. \subsubsection{The Interface} As the previous handler uses additional algebraic operations (the one from the interface), we need to handle them. Also, the previous handler is for the operations $\op{choice}_{\mathit{RL}}$ and $\op{reward}_{\mathit{RL}}$ and we need to make the bridge between those operations and the one for the main program: $\op{choice}$ and $\op{reward}$. We do this by defining two handlers in $\lambda_{\mathit{eff}}^I$. The first handler is a simple one, mainly abstracting the set of actions. For this, we need to define a bijection $f : A_{\mathit{RL}} \rightarrow A_E$, which is easy to do as they are both finite sets with the same size. Then, the handler for abstracting actions is given by: \begin{align*} H_{\mathit{Act}} \equiv \key{handler} \{ \key{return} x &\mapsto \key{return} x, \\ \op{choice}(k) &\mapsto \op{choice}_{\mathit{RL}}(();x. k~(f~x)) \\ \op{reward}(r;k) &\mapsto \op{reward}_{\mathit{RL}}(r;x. k~x) \} \end{align*} With this handler $H_{\mathit{Act}}$, with type $T \Rightarrow T$ for any $T$, we can go from the operations from the main program to the operation for the learner. And now the only thing to do in order to successfully use the handler defined by the learner is to define the handler for abstract interface. With the interface we defined for this example, the two operations $\op{observe_{\mathit{RL}}}$ and $\op{getactions_{\mathit{RL}}}$, then the interface handler would look like: $$H_{I} \equiv \key{handler} \{ \key{return} x \mapsto \key{return} x, \op{observe}_{\mathit{RL}}(k) \mapsto C_o, \op{getactions}_{\mathit{RL}} (o;k) \mapsto C_a \}$$ with $$ k : O_{\mathit{RL}} \rightarrow T \vdash C_o : T \qquad o : O_{\mathit{RL}}, k : (A_{\mathit{RL}}~\type{List}) \rightarrow T \vdash C_a : T$$ so that the handler $H_I$ has type $T \Rightarrow T$ for any $T$. Those computations may use the $\op{observe}$ operation, and so with this handler, that can depend on the environment, we can handle the computations coming from the handler for the learner $H_{\mathit{RL}}$. Now, only two operations remain to be handled $\op{do}$ and $\op{observe}$ \subsubsection{The Environment} To handle the environment, we only need the types and functions of $\lambda_{\mathit{eff}}^E$, without $\op{reward}$ and $\op{choice}$. The handler for the environment should have the shape: $$H_{E} \equiv \key{handler} \{ \key{return} x \mapsto C_r, \op{observe}(k) \mapsto C_o, \op{do} (a;k) \mapsto C_a \}$$ such that this handler is typable with type $T \Rightarrow F(T)$ for any type $T$ where $F(T)$ a transformation of $T$. The actual computations for this handler depend strongly on the environment and so we cannot give additional information for the general case. However, in order to illustrate this handler, we show how to implement it in the case where we have a specific model of the environment. Suppose that we can model the environment by a type $E$ and two functions: $Next_E : A_E \times E \rightarrow E$ and $Observe_E : E \rightarrow O$. This may seem ad-hoc but it is in fact close to a Markov Decision Process which is a common model for the environment in RL algorithm \cite{Sutton2018:ReinforcementLearning}. Indeed, in this case the $Observe_E$ function corresponds to observing a reward and the current state of the Markov Decision Process, and the $Next_E$ function corresponds to moving in the MDP after an action in $A_E$. With those functions, we can define the following handler for the environment: \begin{align*} H_{E} \equiv \key{handler} \{ \key{return} x &\mapsto \lambda e. \key{return} (e,x), \\ \op{observe}(k) &\mapsto \lambda e. k~(Observe_E~e)~e \\ \op{do}(a;k) &\mapsto k~()~(Next_E~(a,e)) \} \end{align*} with type $T \Rightarrow S_E(T)$ for any $T$. As we saw with the learner, it is possible in this case to hide the type $E$ for the main program. This is what we did for example in the description of the MAB environment in Section~\ref{s:OurApproach}. \subsubsection{The Main Program with Handlers} And now, we can interpret all the four main operations for the main program. Thus, given a computation $C$ in $\lambda_{\mathit{eff}}^E$, we can handle all those operations with the computation: $$\key{with} H_E ~\key{handle} (\key{with} H_I ~\key{handle} (\key{with} H_{\mathit{RL}} ~\key{handle} (\key{with} H_{\mathit{Act}} ~\key{handle} C)))$$ With this composition, that we could see in the main program of Section~\ref{s:OurApproach}, we obtain a handler of type $T \Rightarrow F(T)$ if the learner hides its memory as explained before. And, with a complete model of the environment, by hiding we can then obtain a type $T \Rightarrow T$. \subsection{A Naive RL Algorithm in \texttt{EFF}} We present our approach practically with a very basic algorithm for reinforcement learning, which works by only remembering an evaluation function keeping track of \emph{the expectation} of the immediate rewards it receives for any of the actions, and chooses an action by way of a so-called $\varepsilon$-greedy policy \cite{Sutton2018:ReinforcementLearning}: with probability $(1 - \varepsilon)$, it makes the best possible choice based on the \emph{current} valuation, and with probability $\varepsilon$ it explores by choosing an action uniformly at random. To implement this algorithm, we use the language \texttt{EFF} ~\cite{Pretnar2015:EFF}, an \texttt{OCAML}-based language for effects and handlers. The syntax of \texttt{EFF}\ should be understandable to anyone with some basic knowledge on \texttt{OCAML}, effects and handlers. We use lists for the sake of simplicity, although other kinds of data structures would enable better performances. The source code as well as other examples can be found in \cite{GhyselenEFFCode}. \paragraph{Declaring The Abstract Interface.} The first step towards implementing the RL algorithm consists in declaring the sets $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$ together with the abstract interface which will allow us to recover some information on the sets $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$: \begin{lstlisting}[style = eff] type rl_act type rl_obs effect rl_observe : unit -> rl_obs effect rl_getavailableact : rl_obs -> rl_act list \end{lstlisting} Here, the first effect allows the learner to observe the environment (after the abstraction) and to get, for each observation, the list of available actions it has to choose from. As we stated before, the learner does \emph{not} have access to the interpretation of those two effects nor to the actual types, and only knows that those sets of abstract actions and observations are finite, this being enough to implement the reinforcement learning algorithm. \paragraph{Handling Choices and Rewards.} The handler makes essential use of the state monad, where the state represents the memory of the learner. For the specific RL algorithm we are targeting now, this memory consists of an element of this type: \begin{lstlisting}[style = eff] type memory = ((rl_obs*((rl_act*int*float) list)) list)*int*int \end{lstlisting} The left type of the internal memory corresponds to a \emph{value function}, for each pair of an observable and an action, we give an estimation of the immediate reward we can obtain. It is computed as the \emph{average} reward, and in order to do this average incrementally, it is common to also remember the number of times a choice has been made. Then, the internal memory also remembers the \emph{last choice made} using a pair of integers denoting indexes in the evaluation function (we usually denote $na$ the index of an action and $no$ the index of an observation). Then, we can implement the $\varepsilon$-greedy policy of the learner (we only describe the important functions and not the simple intermediate one). \begin{lstlisting}[style = eff] (* This function takes as input a probability and a list of reward estimation and returns the selected action and its index in the list *) let greedypolicy ($\epsilon$,l) = if ((randomfloat 1.) <= $\epsilon$) then (* Uniform choice in this case *) begin let na = randomint (list_length l) in (* Find the action with index na *) let a = findact l na in (na,a) end else (* Select the action with the maximal estimated reward *) argmax l ;; \end{lstlisting} And with this, and some other auxiliary functions, we can define the handler for the basic RL algorithm. The only non-standard clause for the handler is the last one, starting with $\mathtt{finally}$, in this setting with a state monad, it should be understood as the initial state for a computation. \begin{lstlisting}[style = eff] (*The first input is the probability of exploring, the second is the initial estimation*) let rl_naive $\epsilon$ v = handler (*declare a state monad, with the type described above*) | y -> (fun (_:memory) -> y) | effect Choice k -> fun (l,_,_) -> (*use the interface to get an observation*) let o = rl_observe () in (* extract the index no for o, with its list of estimations q *) let (l',no,q) = getstateestimate l o v in (* select the action a with the greedy policy *) let (na,a) = greedypolicy ($\epsilon$,q) in (*update the estimations*) let l'' = updatestate l' no (fun ll -> updatechoice ll na) in (*return action a, with the updated memory*) (continue k a) (l'',no,na) | effect (Reward r) k -> fun (l,no,na) -> (*update estimations for the previous choice (no,na) *) let l' = updatestate l no (fun q -> updatereward q na r) in (*give the new memory to the continuation*) (continue k ()) (l',no,na) (*initial memory*) | finally f -> f ([],0,0) ;; \end{lstlisting} Note that we initialize the estimations lists only when we see an element of $O_{\mathit{RL}}$ for the first time. This is standard in RL because there could be an extremely large set of states, and it may well be that not all of them are reached --- it may be better to give an initial estimation to a state only when we actually see this state (in this program, this is done by the $\mathtt{geststateestimate}$ function). We do not give the code of the update functions, which is anyway easy to write. The nice thing of this handler is that it \emph{does not depend} on the environment, it can of course interact with its environment (using $\mathtt{rl\_observe}$) but it does so in a modular way, so that this program can be used in \emph{any environment} in which we would like to experiment this (admittedly naive) algorithm. \subsection{The Multi-Armed Bandit in \texttt{EFF}} We show how to make use of the RL algorithm described in the previous section on the environment coming from MAB. The first step consists in declaring the types for $O_E$ and $A_E$. Since rewards are earnings, and our actions are nothing more than a choice of a specific machine, we can proceed as follows: \begin{lstlisting}[style = eff] type env_obs = float type env_act = int \end{lstlisting} \paragraph{Modeling the Environment} We model MAB as a program, where we take a very simple distribution of rewards for the sake of the example. As stated before, the environment correspond to the handling of $\op{observe}$ and $\op{do}$. \begin{lstlisting}[style = eff] type env_state = float (* The random reward of the machine a. In a real case, this reward should be obtained by observing the result of the slot machine *) let getreward (a:act) = (float_of_int a) +. (randomfloat 10.) ;; (*max corresponds to the number of slot machines *) let MAB_handler max = handler | y -> (fun (_:env_state) -> y) | effect (Do a) k -> fun _ -> (* When seeing a valid action a, we compute the gain for the slot machine a and store the result in the memory *) if (a > 0) && (a <= max) then (continue k ()) (getreward a) else raise "This action is not available! \n" (*An observation corresponds to showing the stored result *) | effect Observe k -> fun r -> (continue k r) r (* Initial environment, no rewards observed *) | finally f -> f 0. ;; \end{lstlisting} \paragraph{Implementing the Abstract Interface} The abstract interface is a handler that implements the types $A_{\mathit{RL}}$ and $O_{\mathit{RL}}$, and handles the algebraic operations declared by the learner: \begin{lstlisting}[style = eff] (* Abstractions Types. The type unit for observations means that the learner has no information on the environment *) type rl_obs = unit ;; type rl_act = int ;; effect rl_observe : rl_obs effect rl_getavailableact : rl_obs -> rl_act list (*Transform a standard observation into an abstract one*) let abstractobs (o : env_obs) :obs = () ;; (*The handler describes: - the abstraction of observations - the actions available to the learner *) let abs_MAB max = let l = list_enumerate 1 (max + 1) in handler | effect rl_observe k -> let o = observe () in continue k (abstractobs o) | effect (rl_getavailableact o) k -> continue k l ;; \end{lstlisting} \paragraph{The Main Program} With this, we have everything we need to handle the four main operations. In order to use the learner described above, we can just open the file in which the RL algorithm is defined and use it as a handler, with the interface described above. For example, we can write the main program: \begin{lstlisting}[style = eff] #use "MAB_Environment.eff" ;; #use "RL_Naive.eff";; (*Multi-Armed Bandit with 6 machines *) with (MAB_handler 6) handle (*Provides the interface to the learner *) with (abs_MAB 6) handle (* Call the Basic RL algorithm described previously *) with (rl_naive 0.05 10.) handle (*Start writing your progam with algebraic operations Here, we do 500 rounds *) let rec run n r = if n = 0 then r else let a = choice () in (do a); let r' = observe () in reward r'; run (n-1) (r +. r') in run 500 0. ;; \end{lstlisting} And the point is that if we want to use another learner we only have to load a different handler for the learner, and this naive learner can be used in any environment as long as the abstract interface is handled. \subsection{Algebraic Operations and Effect Typing} Type and effect systems~\cite{DBLP:conf/birthday/NielsonN99} endowed traditional type systems with annotations giving information on what effects are produced during program execution. For our purposes, we can build upon well-known effect typing systems keeping track of which operations are handled during a computation~\cite{KammarICFP2013:Handlers}. Extending the simple type system of Section~\ref{s:Generalization} in this way, we can then ensure well-typed programs to handle all their algebraic operations. We now define effect typing for our core calculus and show how to take advantage of such a typing in the context of a reinforcement learning problem. We define an effect signature as a collection of operations and annotate the type of handlers with those signatures. Formally, leave the the syntax of terms as in Figure~\ref{f:effgrammar}, but we replace the one of types as follows: \begin{align*} T &::= \type{B} \midd \type{Unit} \midd T \times T \midd T \rightarrow^E T \midd T \effarrow{E}{E} T \\ E &::= \set{\op{op}: T \rightsquigarrow T} \sqcup E \midd \emptyset \end{align*} Typing judgments for computations now are of the form $\Gamma \vdash_E C : T$, with the informal reading that that $C$ has type $T$ in a context where the only \emph{unhandled} algebraic operations $C$ can possibly perform are included in $E$. Typing judgments for values, instead, remain the same (i.e. $\Gamma \vdash V : T$), as values not being executed, they cannot perform any algebraic operation at all. The inference system for our new typing judgment is given in Figure~\ref{f:efftypeeffects}. \begin{figure} \begin{framed} \begin{center} \AXC{} \UIC{$\Gamma, x : T \vdash x : T$} \DP \qquad \AXC{$\Gamma, x : T_1 \vdash_E C : T_2$} \UIC{$\Gamma \vdash \lambda x. C : T_1 \rightarrow^E T_2$} \DP \qquad \AXC{$\Gamma \vdash V_1 : T_1$} \AXC{$\Gamma \vdash V_2 : T_2$} \BIC{$\Gamma \vdash (V_1,V_2) : T_1 \times T_2$} \DP \\ \vspace{3mm} \AXC{} \UIC{$\Gamma \vdash () : \type{Unit}$} \DP \qquad \AXC{$c : \type{B} \in \mathcal{C}$} \UIC{$\Gamma \vdash \underline{c} : \type{B}$} \DP \qquad \AXC{$f : \type{B}_1 \times \cdots \type{B}_n \rightarrow \type{B} \in \mathcal{F}$} \UIC{$\Gamma \vdash \underline{f} : \type{B}_1 \times \cdots \type{B}_n \rightarrow \type{B}$} \DP \qquad \\ \vspace{3mm} \AXC{$E_1 = \set{\op{op}_i : T^p_i \rightsquigarrow T^a_i \mid 1 \le i \le n} \sqcup E_f \qquad E_2 = E_2' \sqcup E_f$} \noLine \UIC{$(\Gamma, x : T_i^p, k : T_i^a \rightarrow^{E_2} T_c \vdash_{E_2} C_i : T_c)_{1 \le i \le n} \qquad \Gamma, x : T_v \vdash_{E_2} C_r : T_c $} \UIC{$\Gamma \vdash \key{handler} \{ \key{return} x \mapsto C_r, \op{op}_1(x;k) \mapsto C_1, \dots, \op{op}_n(x;k) \mapsto C_n \} : T_v \effarrow{E_1}{E_2} T_c $} \DP \\ \vspace{3mm} \AXC{$\Gamma \vdash V : T$} \UIC{$\Gamma \vdash_E \key{return} V : T$} \DP \qquad \AXC{$\Gamma \vdash V : T_1 \times T_2$} \UIC{$\Gamma \vdash_E \pi_i(V) : T_i$} \DP \\ \vspace{3mm} \AXC{$(\op{op} : T_p \rightsquigarrow T_a) \in E$} \AXC{$\Gamma \vdash V : T_p$} \AXC{$\Gamma, x : T_a \vdash_E C : T $} \TIC{$\Gamma \vdash_E \op{op}(V;x.C) : T$} \DP \\ \vspace{3mm} \AXC{$\Gamma \vdash_E C_1 : T_1 $} \AXC{$\Gamma, x : T_1 \vdash_E C_2 : T_2 $} \BIC{$\Gamma \vdash_E \key{let} x = C_1 ~\key{in} C_2 : T_2$} \DP \qquad \AXC{$\Gamma \vdash V_1 : T_2 \rightarrow^E T_1$} \AXC{$\Gamma \vdash V_2 : T_2$} \BIC{$\Gamma \vdash_E V_1~V_2 : T_1$} \DP \\ \vspace{3mm} \AXC{$\Gamma \vdash V : T_2 \effarrow{E_1}{E_2} T_1$} \AXC{$\Gamma \vdash_{E_1} C : T_2$} \BIC{$\Gamma \vdash_{E_2} \key{with} V ~\key{handle} C : T_1$} \DP \end{center} \end{framed} \caption{Typing Rules with Type Effects} \label{f:efftypeeffects} \end{figure} The most important rule in Figure~\ref{f:efftypeeffects} is the one for handlers (cf. the typing rule for open handlers by \citet{KammarICFP2013:Handlers}): it states that if a handler can handle a subset of the available operations (denoted by $\set{\op{op}_i : T^p_i \rightsquigarrow T^a_i \mid 1 \le i \le n}$ in Figure~\ref{f:efftypeeffects}) and introduce some new operations in their computations ($E_2'$), then the final set of free operations contains the unhandled ones in the original set ($E_f$) together with the new operations introduced by the handler. This new type system satisfies better safety properties than the previous one. In particular, it enjoys preservation (as the type system of previous section) and progress. \begin{theorem} Progress and preservation hold for the type system in Figure~\ref{f:efftypeeffects}. That is: \begin{enumerate} \item \emph{Preservation.} If $\Gamma \vdash_E C : T$ and $C \rightarrow C'$ then $\Gamma \vdash_E C' : T$. \item \emph{Progress.} Suppose that all functions for base types are total for the constants in the language. If $\vdash_E C : T$, then either there exists $C'$ such that $C \rightarrow C'$, or $C$ has the shape $\key{return} V$ for some $V$, or $C$ has the shape $\op{op}(V,x.C')$ with $\op{op} \in E$. \end{enumerate} \end{theorem} \begin{proof} We prove progress by induction on $C$. The use of typed effects is important to keep track of what are exactly the set of operations that can appear, and the commutation of $\op{op}$ with $\key{let}$and $\key{handler}$is also essential in this proof. The hypothesis on base type functions ensures that an application of a base type function can always be reduced. The case of $\key{with} H ~\key{handle} C$ is the most interesting one, by induction hypothesis and typing, there are four cases for the computation $C$, either it can be reduced to $C'$, and then we use the first rule for handlers of Figure~\ref{f:effsemantics}, either it is an operation $\op{op} \in E_f$ and we use the second rule, either it is a $\key{return} V$ and we use the third rule, or it is an operation $\op{op} \in E_1/E_f$ and we use the fourth rule. \end{proof} \begin{remark} Even if we have focused on progress and preservation, it is worth mentioning that that termination of the reduction relation can be proved using standard methods~\cite{KammarICFP2013:Handlers}. \end{remark} We now have all the ingredients needed to encode the informal policies we could build the MAB example upon. Let us define the following sets of effects: \begin{align*} E_E &= \set{\op{observe}: \type{Unit} \rightsquigarrow O_E ~;~ \op{do} : A_E \rightsquigarrow \type{Unit}} \\ E_{\mathit{RL}} &= \set{\op{choice}: \type{Unit} \rightsquigarrow A_E ~;~ \op{reward} : \type{Real} \rightsquigarrow \type{Unit}} \\ E^{\mathit{Abs}}_{\mathit{RL}} &= \set{\op{choice}_{\mathit{RL}}: \type{Unit} \rightsquigarrow A_{\mathit{RL}} ~;~ \op{reward}_{\mathit{RL}} : \type{Real} \rightsquigarrow \type{Unit}} \\ E^{\mathit{Abs}}_I &= \set{\op{observe}_{\mathit{RL}}: \type{Unit} \rightsquigarrow O_{\mathit{RL}} ~;~ \op{getactions} : O_{\mathit{RL}} \rightsquigarrow A_{\mathit{RL}}~\type{List} ~;~ \cdots} \end{align*} These are, respectively, the set of effects for the environment, the learner seen by the environment, the learner seen by the learner, and the interface used by the learner. \paragraph{The Learner} The handler $H_{\mathit{RL}}$ for the learner should have the type $$ \vdash H_{\mathit{RL}} : T \effarrow{E_{\mathit{RL}}^{\mathit{Abs}}}{E_I^{\mathit{Abs}}} S_M(T), $$ where $T$ is any type and $S_M(T) \equiv M \rightarrow M \times T$. This means that the learner handles the operations $\op{choice}_{\mathit{RL}}$ and $\op{reward}_{\mathit{RL}}$ using only the operations in the interface $E^{\mathit{Abs}}_I$. Thus, with this type, we ensure that the learner does not have a direct access to the environment, and it only sees effects for the abstract types $A_{\mathit{RL}}$ and $O_{\mathit{RL}}$ and not the concrete types $O_E$ and $A_E$. Then, with hiding, we can obtain a handler of type $T \effarrow{E_{\mathit{RL}}^{\mathit{Abs}}}{E_I^{\mathit{Abs}}} T$ as long as the learner provides an initial memory. Notice that in this hiding handler of type $T \effarrow{E_I^{\mathit{Abs}}}{E_I^{\mathit{Abs}}} T$, the initial memory can depend on the abstract interface, this being useful in those cases in which some parameters in the initial memory have to be exposed. \paragraph{The Interface} The interface is separated into two handlers: $H_{\mathit{Act}}$ and $H_I$. This first handler is only a bridge between abstract actions and concrete actions. It is not difficult to see that the former should have the type: $$ \vdash H_{\mathit{Act}} : T \effarrow{E_{\mathit{RL}}}{E_{\mathit{RL}}^{\mathit{Abs}}} T, $$ for any type $T$, thus handling the operations $\op{choice}$ and $\op{reward}$ seen from the exterior to the internal one of the learner. As for the interface, it should be a bridge between the environment and learner abstracted by the user, so it should have the type: $$ \vdash H_{I} : T \effarrow{E_I^{\mathit{Abs}} \sqcup E_E}{E_E} T,$$ where the fixed set of operations ($E_f$ in the rule) would be $E_E$. \paragraph{The Environment} As for the environment, the handler only has to handle the two operations $\op{observe}$ and $\op{do}$, without using the learner nor the interface. So, it should have the type: $$\vdash H_E : T \effarrow{E_E}{\emptyset} F(T).$$ \subsubsection{Composition of Handlers and Main Program} Now that we have types for each of the four handlers needed, we compose them. An important point of our effect typing is that it supports weakening: in the handler rule, we can always take a larger set $E_f$, so that we are licensed to use the handler in different contexts.\footnote{This is one of the main reasons why this rule is very useful to achieve polymorphism.} In our case, it means that we can give the following types to handlers: \begin{align*} \vdash H_{\mathit{RL}} &: T \effarrow{E_{\mathit{RL}}^{\mathit{Abs}} \sqcup E_E}{E_I^{\mathit{Abs}} \sqcup E_E} T \\ \vdash H_{\mathit{Act}} &: T \effarrow{E_{\mathit{RL}} \sqcup E_E}{E_{\mathit{RL}}^{\mathit{Abs}} \sqcup E_E} T \\ \vdash H_I &: T \effarrow{E_I^{\mathit{Abs}} \sqcup E_E}{E_E} T \\ \vdash H_E &: T \effarrow{E_E}{\emptyset} F(T). \end{align*} Consequently, we can compose them to obtain: $$ H_E \circ H_I \circ H_{\mathit{RL}} \circ H_{\mathit{Act}} : T \effarrow{E_{\mathit{RL}} \sqcup E_E}{\emptyset} F(T).$$ When we have a model of the environment, with hiding, we have $$ H_E \circ H_I \circ H_{\mathit{RL}} \circ H_{\mathit{Act}} : T \effarrow{E_{\mathit{RL}} \sqcup E_E}{\emptyset} T. $$ This shows that the main program can use the four main effects, as expected. Without hiding, we would have a type which is essentially the composition of the two state monads on $E$ and $M$, meaning that the program should be understood in a context with both an environment and a memory for the learner. \subsection{Polymorphism} The typing rule for handlers allows us to assign handlers arbitrary types $T$. To ensure such types not to be inspected by programs, and to ensure uniqueness of typing derivation of handlers, it is natural to extend our type system with polymorphic types. Moreover, the base types we presented for the language, $A_{\mathit{RL}}, O_{\mathit{RL}}, A_E$ and $O_E$ all depend on the actual environment, whereas we expect the handler $H_{\mathit{RL}}$ for the learner not to do so. Consequently, we may rely on polymorphism to enforce $A_{\mathit{RL}}$ and $O_{\mathit{RL}}$ not to be inspected, this way giving a unique polymorphic type to the handler $H_{\mathit{RL}}$ and thus ensuring the latter to be usable in any environment. Languages, however, can be polymorphic in may ways: especially in presence of effects. We now outline what kind of polymorphism is needed for our purposes. As a first requirement, we need to be able to declare polymorphic handlers; write their implementation once and for all; and then use them in different contexts. To do that, we believe having handlers as first-class citizen of the language, as we presented in Figure~\ref{f:effgrammar}, is necessary. Secondly, we also want to declare polymorphic effects, so to give a sense to those polymorphic handlers. We take as an inspiration the language by \citet{Biernackietal2019:AbstractingEffects}. However, since the aforementioned language does not consider handlers as first-class citizens, we cannot directly rely on that. In the rest of this section, we informally outline a possible polymorphic type assignment for our language, leaving its formal definition and analysis (such as type soundness) as future work. We consider different kinds, starting from the base kinds of types, effects, and rows, and building complex kinds using a functional arrow. Formally, kinds are generated by the following grammar: $$\kappa:= T \midd E \midd R \midd \kappa \rightarrow \kappa.$$ A row $\rho$ is a sequence of effects $\langle E_1 \mid \rho' \rangle$, with intuitively the same meaning as effect signature in our last type system, the main difference being that we can have polymorphism on row, and an effect can appear several time in a row (but possibly with different instantiation of their polymorphic types). We would like to write, as in \cite{Biernackietal2019:AbstractingEffects}, the following computation: $$\key{effect} E_{\mathit{RL}}^{\mathit{Abs}} = \forall \alpha_A :: T. \set{\op{choice}_{\mathit{RL}} : \type{Unit} \rightsquigarrow \alpha_A ; \op{reward}_{\mathit{RL}} : \type{Real} \rightsquigarrow \type{Unit}} ~\key{in} \cdots $$ declaring a new effect, called $E_{\mathit{RL}}^{\mathit{Abs}}$, waiting for a type $\alpha_A$ representing the type (of kind $T$) of actions, and then declare the types of those two algebraic operations. The kind of $E_{\mathit{RL}}^{\mathit{Abs}}$ would then be $T \rightarrow E$, so given a type of kind $T$ this indeed gives an effect of kind $E$. Similarly, the abstract interface would be declared with: $$\key{effect} E_{I}^{\mathit{Abs}} = \forall \alpha_A :: T, \alpha_O :: T. \set{\op{observe}_{\mathit{RL}} : \type{Unit} \rightsquigarrow \alpha_O ; \op{getactions}_{\mathit{RL}} : \alpha_O \rightsquigarrow \alpha_A~\type{List}; \cdots} $$ And then, in this context, the type of the handler for the learner, $H_{\mathit{RL}}$ would be, after hiding: $$ H_{\mathit{RL}} : \forall \alpha_A :: T, \alpha_O :: T, \alpha_T :: T, \rho :: R. \alpha_T \effarrow{\langle E_{\mathit{RL}}^{\mathit{Abs}}~\alpha_A \mid \rho \rangle }{\langle E_{I}^{\mathit{Abs}}~\alpha_A~\alpha_O \mid \rho \rangle} \alpha_T $$ meaning that for any type of actions $\alpha_A$, any type of observations $\alpha_O$, any type of computation $\alpha_T$ and any effect environment $\rho$, the handler for the learner has an identity type on the computation, handling the operations in $E_{\mathit{RL}}^{\mathit{Abs}}~\alpha_A$ and introducing the new operations of $E_I^{\mathit{Abs}}~\alpha_A~\alpha_O$. In practice, we would like $\alpha_A$ and $\alpha_O$ to always represent base types, and especially finite sets, so we would need some more restriction on this polymorphism. But informally, this is the shape of type we would like for the handler written by the learner, as it ensures that it can be used in any environment without modifications. Notice that in order to do this, we want handlers as first-class citizens but we do not need the full power of polymorphism since the algebraic operations themselves do not need to be polymorphic. This kind of polymorphism that we need differs slightly from the polymorphism mainly studied in the literature: usually, it allows the programmer to use different handlers for the same operation, however what we want in our case is to use a unique handler for different contexts. \subsection{Imposing an Order on Operations} Our last property of interest focuses on linearity and order of algebraic operations. For instance, we would like to ensure that when a call to $\op{choice}$ is made, it is always followed by a $\op{do}$ and a $\op{reward}$ ($\op{observe}$ can be useful to give the reward but it is not mandatory as it should have no effect on the environment). We now outline how such a goal can be achieved in presence of algebraic operations relying on suitable graded type systems \cite{Kastumata2014:ParametricEffects}. Such an approach, however, is not readily extendable to effect handlers. As far as we know, graded types have not been extended to handlers. Informally, we define a monoid on algebraic operations and associate each computation to an element of this monoid, the latter giving information on the operations executed during program evaluation. Sequential composition of computations corresponds to monoid multiplication, basic computations to the unit of the monoid, and algebraic operations to the corresponding elements of the monoid. A typing rule (for computations) then has shape $\Gamma \vdash_E C : T ; m$, where $m$ is an element of the monoid with, for example, the following rules: \begin{center} \AXC{$\Gamma \vdash V : T$} \UIC{$\Gamma \vdash_E \key{return} V : T ; 1$} \DP \qquad \AXC{$\Gamma \vdash_E C_1 : T_1 ; m_1$} \AXC{$\Gamma, x : T_1 \vdash_E C_2 : T_2 ; m_2$} \BIC{$\Gamma \vdash_E \key{let} x=C_1 ~\key{in} C_2 : T_2 : m_1 \cdot m_2 $} \DP \\ \vspace{3mm} \AXC{$(\op{op} : T_p \rightsquigarrow T_a) \in E$} \AXC{$\Gamma \vdash V : T_p$} \AXC{$\Gamma, x : T_a \vdash_E C : T ; m$} \TIC{$\Gamma \vdash_E \op{op}(V;x.C) : T ; m_{\op{op}} \cdot m$} \DP \end{center} where $1$ is the unit of the monoid, $m_1 \cdot m_2$ is monoid multiplication and $m_{\op{op}}$ is the element of the monoid corresponding to the operation $\op{op}$. In our case, the monoid would be the free monoid on the three element associated to the algebraic operations $\op{choice}, \op{do}$ and $\op{reward}$, with $\op{observe}$ confounded with the unit of the monoid, with the following equation \begin{align*} &m_\op{choice} \cdot m_\op{do} \cdot m_\op{reward} = 1 \end{align*} and then, we would like the main program to be associated to an element of this monoid with the shape $m_\op{do}^n$. With this, we can ensure that, if we forget about $\op{observe}$ since it has no effect at all, then any $\op{choice}$ is always followed by exactly one $\op{do}$ and one $\op{reward}$. Moreover, only the $\op{do}$ operation can be done outside of this loop, because essentially the user can make choices without calling the learner, and for the point of view of the learner then the user would just be a part of the transition function of the environment. However, this method, which is standard for effects, does not generalise well in presence of handlers. Indeed, we need to take into account the potentially new operations introduced by a handler, and intuitively the handler would then represent a map from the new operations to an element of the monoid. For a very simple example, consider the operation $\op{choicedoandobserve} : 1 \rightsquigarrow A_E \times O_E$ with the handler $$\key{handler} \set{\key{return} x \mapsto x ; \op{choicedoandobserve}(k) \mapsto \op{choice}(a. \op{do}(a;\_. \op{observe}(o. k~(a,o))))}$$ doing the three operations $\op{choice}$, $\op{do}$ and $\op{observe}$ in sequence. Then, this handler should be typed with the information that the new operation $\op{choicedoandobserve}$ is associated to the element $m_\op{choice} \cdot m_\op{do} \cdot m_\op{observe}$. We believe such a type system should be feasible, but we have no concrete formalization of this. So, as for polymorphism, those kind of type system would be desirable for safety but we leave the formalization to future work. \section{Related Work} The interaction between programming language theory and machine learning is an active and flourishing research area. Arguably, the current, most well-established products of such an interaction are the so-called Bayesian~\cite{tran2016edward,tran2017deep, Tolpin/Anglican/2016,DBLP:journals/jmlr/BinghamCJOPKSSH19,JSSv076i01} and differentiable~\cite{Bergstra10theano,DBLP:conf/osdi/AbadiBCCDDDGIIK16} programming languages, and their associated theories~\cite{DBLP:conf/popl/Goodman13,DBLP:journals/corr/abs-1809-10756,DBLP:journals/pacmpl/AbadiP20,DBLP:journals/toplas/PearlmutterS08,DBLP:journals/lisp/SiskindP08}. Choice-based operations are not new in programming language theory, as they first appeared in the context of computational effects (more specifically, choice operations has been first studied as nondeterministic choices~\cite{DBLP:conf/aieeire/000161}). However, their integration with reward constructs as a way to structure machine learning systems as data-driven, decision-making processes is quite recent. As an example of that, the programming language \textsf{SmartChoice}~\cite{Carbune2019:PredictedVariables} integrates choice and rewards operations with traditional programming constructs. To the best of the authors' knowledge, the first work dealing with semantic foundations for choice-based programming languages is the recent work by \citet{DBLP:conf/lics/AbadiP21}. There, a modular approach to higher-order choice-based programming languages is developed in terms of the selection monad~\cite{DBLP:conf/cie/EscardoO10a,DBLP:conf/csl/EscardoOP11, DBLP:journals/apal/EscardoO12} and its algebraic operations~\cite{PlotkinPower/FOSSACS/01, PlotkinPower2003:AlgebraicOperations,PlotkinPower/FOSSACS/02}, both at the level of operational and denotational semantics. As such, that work is the closest to ours. The results presented in this paper has been obtained starting from an investigation of possible applications of the aforementioned work by Abadi and Plotkin to modelling reinforcement learning systems. We have explained in Section~\ref{selection-monad} why, when dealing with reinforcement learning, moving from the selection to the state monad is practically beneficial. From a theoretical point of view, such a shift can be seen as obtained by looking at comodels~\cite{DBLP:journals/entcs/PowerS04} of choice operations, which directly leads to view reinforcement learning algorithms as ultimately defining stateful runners~\cite{DBLP:journals/entcs/Uustalu15,DBLP:conf/esop/AhmanB20} for such operations, and thus as generic effects \cite{PlotkinPower2003:AlgebraicOperations} for the state monad. Following this path, we have consequently relied on handlers~\cite{PlotkinPretnar/handling-algebraic-effects-2013, Bauer-Pretnar/Programming-with-algebraic-effects, Pretnar2015:EFF} to define modular implementations of such generic effects, and thus of reinforcement learning algorithms. Even if handlers and algebraic operations are well-known tools in functional programming, to the best of our knowledge the present work is the first one investigating their application to modelling reinforcement learning systems. Finally, we mention that applications of functional programming techniques in the context of machine learning similar in spirit to ones investigated in this work, as well as in the work by \citet{DBLP:conf/lics/AbadiP21}, have been proposed \cite{DBLP:conf/flops/CheungDGMR18} in terms of induction and abduction constructs, rather than in terms of choices and rewards \section{Introduction} \input{Introduction.tex} \section{Structuring Reinforcement Learning Applications Through Functional Programming} \label{s:OurApproach} \input{OurApproach.tex} \section{The Selection Monad, and Why it is Not an Answer} \label{selection-monad} \input{Selection.tex} \section{From Practice to Theory: Effects and Handlers} \label{s:Generalization} \input{Generalization.tex} \section{Type Safety} \input{Safety.tex} \section{Conclusion} \input{Conclusion.tex}
b0cd7a92c67a2a857159251f26d9cde8a30205fd
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:introduction} The ray tracing algorithm\cite{Whitted1980, Cook1984, Kajiya1986, haines2019ray} is a general term of rendering algorithms that calculate pixel colors by simulating the physical interactions of light rays and the scene, such as reflections and refractions. To render an image with high quality, ray tracing algorithms require simulating an astronomical number of rays. To be specific, a single ray scatters towards many directions when interacting with an object, and each of the scattered rays scatters towards more directions when interacting with other objects, so the total number of rays grow exponentially in the number of interactions. In many situations people have to make a trade-off between time cost and quality. For real-time ray tracing applications where the rendering duration is strictly limited, the state-of-the-art GPU can only handle sampling a small amount of rays per pixel, and the resultant noise is fixed by a subsequent denoising procedure\cite{marrs2021ray}. In this paper we focus on the ray tracing algorithm on quantum computers. Quantum computation is an emerging subject that studies how to perform computational tasks in quantum mechanical systems. By leveraging the superposition and entanglement of quantum computing, quantum computing has inherent advantages on parallel computational tasks. As a result, quantum computing shows it computational power by providing spectacular speedup over classical computing in some problems\cite{Grover1997, Shor1997}. The ray tracing algorithm can be easily parallelized, since the procedure for tracing each ray is the same. Then comes an interesting question: is the inherently parallel quantum computing able to speed up the inherently parallel ray tracing algorithm? This paper will give a positive answer as well as a fully practicable implementation. The idea of introducing quantum computing into rendering methods such as Z-buffer, ray tracing and radiosity algorithm was proposed by \cite{Lanzagorta2005}, which presents the concepts but does not give a fully practicable implementation. In particular, they proposed a quantum ray tracing solution by superposing all scene primitives. The idea of using the quantum parallelism property in computer graphics was practiced in \cite{Eric2016, Shimada2020}, which both used an amplitude amplification\cite{Abrams1999} based quantum sum estimation and applied their methods on filtering binary images. The paper \cite{Alves2019} proposed an implementation of Grover's algorithm for ray casting from an orthographic camera. \begin{figure*} \centering \subfloat[Classical path tracing.]{ \includegraphics[width=.4\linewidth]{classicalPathTracing.png} \label{fig:classical-ray-tracing} } \qquad \subfloat[Quantum ray tracing.]{ \includegraphics[width=.4\linewidth]{quantumRayTracing.png} \label{fig:quantum-ray-tracing} } \caption{Classical path tracing only traces one ray at a time, while quantum ray tracing can trace numerous rays as a superposition in one shot.} \label{fig:ray-tracing} \end{figure*} The structure of this paper is as follows. Section~\ref{sec:preliminary} briefly introduces both quantum computing and classical ray tracing. In section~\ref{sec:algorithm}, we first give a big picture for our quantum ray tracing algorithm, then dive into three details including how to perform dense sampling, how rays interact with the scene and how to extract the average color from a superposition as final output. In section~\ref{sec:performance}, we theoretically analyze the space and time complexity of quantum ray tracing, then make a comparison between quantum ray tracing and classical ray tracing, in the sense of achieving the same deviation. Finally, in section \ref{sec:discussion}, we make some conclusions and discussions. \section{Preliminary} \label{sec:preliminary} \subsection{Quantum Computing} All stories began in the 1980s when Feynman suggested that quantum mechanics might be more computationally powerful than Turing mechine\cite{Feynman1982,Feynman1986}. By substituting classical bits for quantum bits, or {\itshape qubits}, which can be not only in the states $\ket{0}$ and $\ket{1}$ but also their superposition $a\ket{0}+b\ket{1}$ where $a,b\in\mathbb{C}$ and $|a|^2+|b|^2=1$, quantum computing obtains many interesting features like entanglement, reversibility, parallelism, no-cloning and indistinguishability. In quantum computing, operations on qubits are implemented by {\itshape quantum gates}. There are two classes of gates, namely unitary gates and measurement gates. Unitary gates perform unitary transformations to the state vectors, while measurement gates perform probabilistic and destructive transformations to extract information from quantum states. A {\itshape quantum circuit} is said to be a group of quantum gates that can perform specific functions. A quantum computer can simulate a classical computer, by restricting the qubit states to $\{\ket{0},\ket{1}\}$, and using the Toffoli gate, X gate and CNOT gate to replace the AND gate, NOT gate and the copy operation in classical computers, respectively. \begin{equation*} \begin{aligned} \text{Toffoli: }& \ket{a}\ket{b}\ket{0} &\mapsto& \ket{a}\ket{b}\ket{a\text{ and }b} \\ \text{X: }& \ket{a} &\mapsto& \ket{\text{not }a} \\ \text{CNOT: }& \ket{a}\ket{0} &\mapsto& \ket{a}\ket{a} \end{aligned} \end{equation*} Furthermore, due to the reversibility of the three gates above, the quantum implementation of a classical function $j\mapsto f(j)$ should be of the following form, \begin{equation} \ket{j}\ket{0} \mapsto \ket{j}\ket{f(j)}, \end{equation} which is sometimes abbreviated as $\ket{j}\mapsto\ket{j}\ket{f(j)}$. Here $\ket{j}$ and $\ket{f(j)}$ are quantum registers that use several qubits to store various data structures like integers and real numbers. If we avoid using any measurement gate in the circuit of computing $f$, then we can make full use of the linearity and reversibility of unitary gates. It follows immediately that when a superposition state is inputted, the same circuit performs the following linear transformation, \begin{equation} \sum_jx_j\ket{j} \mapsto \sum_jx_j\ket{j}\ket{f(j)}, \label{eq:oracle-f} \end{equation} due to the linear property. We call such circuits {\itshape linear circuits}. It seems that several evaluations of the function $f$ can be obtained in one query. But once we have access to a specific $f(j_0)$, no matter by which means, the whole state must collapse to the basis state $\ket{j_0}\ket{f(j_0)}$, and the information of other evaluations is lost forever. Anyway, we have to design clever algorithms to make the best use of quantum parallelism. Some of such examples are Grover's search\cite{Grover1997}, minimum finding\cite{Durr1996}, quantum counting\cite{QuantumCounting1998}, and quantum numerical integrals\cite{Abrams1999}. \subsection{Classical Ray Tracing} To calculate the color, or the ray energy, emitted by light sources and received by the camera, the ray tracing algorithm utilizes the reversibility of light ray paths, that is, shoots rays from the camera, simulates the physical interactions between rays and scene objects, until they hit the light sources. The core mathematical problem in ray tracing is to solve the {\itshape rendering equation}\cite{Kajiya1986} for computing the light radiance from an object surface in a certain direction, \begin{equation} L_o(\mathbf{r}_o) = L_e(\mathbf{r}_o) + \int_\Omega L_i(\mathbf{r}_i)f_\text{BSDF}(\mathbf{r}_i,\mathbf{r}_o)(\mathbf{n}\cdot\mathbf{r}_i)\operatorname{d}\mathbf{r}_i, \label{eq:rendering-equation} \end{equation} where the integral domain $\Omega$ is the unit sphere, $L_o, L_i, L_e$ stands for the outgoing, incoming, self-emission radiance respectively, and $f_\text{BSDF}$ is the {\itshape bidirectional scattering distribution function} that is related to the material of the object. This spherical integral takes into account the contributions of the reflected or refracted rays in all directions. Observe that the $L_i$ term in the integrand is equal to some $L_o$ in another rendering equation, thus Eq.~\eqref{eq:rendering-equation} is infinitely recursive. A common solution is to use a Russian Roulette at each depth to decide whether to terminate, and make corresponding compensation. Another rough solution is to pre-set an upper bound $D$, and the recursion is halted when reaching depth $D$. The standard solution in classical ray tracing to solve the rendering equation is Monte Carlo sampling. One approach is the {\itshape path tracing}\cite{Kajiya1986}, in which only one randomly chosen ray is shot outwards whenever a ray hits an object, as illustrated in \figref{fig:ray-tracing}(a). For each pixel many paths are traced, and the final color written to that pixel is the average color of these paths. \section{Quantum Ray Tracing} \label{sec:algorithm} \begin{figure*} \centering \includegraphics[width=\linewidth]{big-picture.pdf} \caption{A macrostructure for our quantum ray tracing algorithm. The \textbf{Quantum Counting} frame illustrates the circuit of the well-known quantum counting algorithm. The $G$ gate performs a Grover's iteration, which is shown in the \textbf{Grover's Iteration} frame. The $O_0$ gate shifts the phase of every computational basis except $\ket{00\cdots0}$. The $O_f$ gate performs the whole path tracing algorithm, whose details are shown in the \textbf{Path Tracing} frame. } \label{fig:big-picture} \end{figure*} For a single pixel on the camera, classical ray tracing shoots many rays and calculates their average energy as the output color. The key idea of quantum ray tracing is to store all those rays in a superposition. In quantum computing, if we store the rays in the following form, \begin{equation} \sum_{id=0}^{N-1} x_{id} \ket{id} \ket{ray_{id}}, \label{eq:ray-form} \end{equation} where $N$ is the total number of superposed rays, $x_{id}\in\mathbb{C}$ are complex coefficients, and $\ket{ray_{id}}$ is a structured register that stores the origin and the direction information of the ray, then by the idea of quantum linear circuit we can trace all those rays in one shot. In classical ray tracing, if we shoot $R_k$ rays outwards at the $k$-th interaction, then a total number of $O(R)$ space and time are required, where $R=\prod_{k=1}^DR_k$ if we trace rays to depth $D$. That is why classical path tracing sets $R_k=1$ to avoid exponential explosion. But in quantum computing, according to Eq.~\ref{eq:ray-form}, only $O(\log R)$ space that stores $\ket{id}$ are required, and the subsequent procedure for tracing the superposed state of rays with a quantum linear circuit is the same as tracing a single ray. The details of how to implement ray-object interactions are discussed in Section~\ref{sec:interaction}. We can feel free to choose a large $R$ in quantum computing, that is, sample a densely distributed directions at each interaction. At each interaction we append a new quantum register to store the newly shot ray, and after tracing to depth $D$ the state becomes, \begin{equation} \begin{aligned} \sum_{id} & \ket{id} \ket{primaryRay_{id}} \ket{secondaryRay_{id}} \cdots \\ & \ket{lastRay_{id}} \ket{\cdots}, \end{aligned} \end{equation} where the coefficients are abbreviated for the convenience of writing, and $\ket{\cdots}$ stands for possible garbage registers. The details of obtaining such state are discussed in Section~\ref{sec:sampling}. Finally, each $id$ stands for a single ray path to depth $D$. During the tracing procedure we use auxiliary registers to store the accumulated energy and the energy scale at each interaction. In the end there is a register that stores the total ray energy to depth $D$, we denote the final state as, \begin{equation} \sum_{id} \ket{id} \ket{color_{id}} \ket{\cdots}. \label{eq:color-to-average} \end{equation} Having obtained the final energy of each path, the only thing left is to calculate their average, to get the final color of the pixel. Unfortunately, the energy information is entangled, and we can never read all of them from a single state. Hence, we need to use an algorithm to extract information from some repetitions of all procedures above. The quantum averaging algorithm in Section~\ref{sec:averaging} is a quantum counting\cite{QuantumCounting1998} based algorithm that construct a Boolean function to deal with the real numbers in register $color$ and use the standard quantum counting algorithm to estimate their average. Since the outcome of quantum averaging algorithm is a single real number, and the RGB model of a color contains three numbers, we should run the whole procedure for each pixel and each RGB channel to render the whole image. A macrostructure for our quantum ray tracing algorithm is shown in \figref{fig:big-picture}. \subsection{Dense sampling} \label{sec:sampling} In this part we discuss the \textbf{Generate Ray} steps in \figref{fig:big-picture}. The sampling happens at each depth of ray-object interaction, thus we need to prepare a superposition ID for each depth. We divide the register $id$ into several parts, and each of them works for only one sampling step, \begin{equation} \begin{aligned} \ket{id} = & \ket{primaryRayId} \ket{secondarRayId} \cdots \\ & \ket{finalRayId} \ket{comparatorId}, \label{eq:id-register} \end{aligned} \end{equation} where the utility of $\ket{comparatorId}$ will be discussed in Section~\ref{sec:averaging}. Given a pixel square, the primary rays are constructed by setting the origin to the world position of the camera, and calculating the direction according to the world rotation of the camera and the screen position on the camera. In classical ray tracing, the screen position of rays are uniformly randomly distributed within the corresponding pixel for anti-aliasing. Here in quantum ray tracing, we replace the random sampling with a dense superposed sampling, \begin{equation} \begin{aligned} & \sum\ket{primaryRayId}\ket{\cdots} \\ \mapsto & \sum\ket{primaryRayId}\ket{primaryRay} \ket{\cdots}. \end{aligned} \end{equation} From secondary ray on, the sampling happens when rays interact with scene objects, and the sampling domains are unit spheres, or unit hemispheres when objects are opaque. We can first sample a 2D lattice, then map it onto our desired domain, as illustrated in \figref{fig:sample-hemisphere}. The random sampling approach for calculating the numerical integral uses the following approximation, \begin{equation} \begin{aligned} & \int_{\Omega_+} L(\mathbf{r})f_\text{BSDF}(\mathbf{r},\mathbf{r}_o)\cdot (\mathbf{n}\cdot\mathbf{r})\operatorname{d}\mathbf{r} \\ \approx & \frac{1}{R_k} \sum_{j=1}^{R_k} \frac{L(\mathbf{r}_j)f_\text{BSDF}(\mathbf{r}_j,\mathbf{r}_o)\cdot (\mathbf{n}\cdot\mathbf{r}_j)}{p(\mathbf{r}_j)}, \end{aligned} \label{eq:classical-integral} \end{equation} where $R_k$ is the number of samples, $\{\mathbf{r}_j\}$ are sampled from the integral domain $\Omega_+$ with respect to the probability density function $p$. Here in dense sampling for quantum ray tracing, we use a smooth mapping $\phi:[0,1]^2\rightarrow\Omega_+$ to replace the random distribution $p$, hence Eq.~\eqref{eq:classical-integral} should be replaced by, \begin{equation} \begin{aligned} & \int_{\Omega_+} L(\mathbf{r})f_\text{BSDF}(\mathbf{r},\mathbf{r}_o)\cdot (\mathbf{n}\cdot\mathbf{r})\operatorname{d}\mathbf{r} \\ \approx & \frac{1}{R_k} \sum_{j=1}^{R_k} \frac{L(\mathbf{r}_j)f_\text{BSDF}(\mathbf{r}_j,\mathbf{r}_o)\cdot (\mathbf{n}\cdot\mathbf{r}_j)}{\det(\operatorname{D}\phi(x_j))}. \end{aligned} \label{eq:quantum-integral} \end{equation} where $\{x_j\}$ here are lattice points, $\operatorname{D}\phi$ is the differential of $\phi$, and $\det(\operatorname{D}\phi)$ is its determinant. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{sampling-hemisphere} \caption{Sample a hemisphere $\Omega_+$ in superposition from a lattice.} \label{fig:sample-hemisphere} \end{figure} \subsection{Interaction with scene} \label{sec:interaction} In this part we discuss the \textbf{Find Interaction} step in \figref{fig:big-picture}. The whole scene is inputted as a list of primitives, for example triangles. For each triangle, a ray-triangle intersection test is implemented, and the results are stored in the structured register $intersect$ that contains information including whether the interaction exist, and the distance, position, normal, texture coordinate and material ID of the interaction, in the following form, \begin{equation} \begin{aligned} \sum_{id} & \ket{id} \ket{ray} \ket{\cdots} \\ & \ket{intersect_1} \ket{interact_2} \cdots \ket{intersect_P}, \end{aligned} \end{equation} where $P$ is the number of primitives, and $intersect_k(k=1,2,\cdots,p)$ stores the intersection information of a ray and the $k$-th primitive. From those intersections, only the one that exists and has the smallest distance should be picked out. Define $nearest_k(k=1,2,\cdots,p)$ to be the nearest intersection in $\{intersect_j:1\le j\le k\}$, then we should build a chain that picks out the nearer intersection between $intersect_k$ and $nearest_{k-1}$ to decide which should be copied to $nearest_k$, where $k=2,3,\cdots,P$, to obtain the state, \begin{equation} \begin{aligned} \sum_{id} & \ket{id} \ket{ray} \ket{\cdots} \\ & \ket{intersect_1} \ket{interact_2} \cdots \ket{intersect_P} \\ & \ket{nearest_2} \cdots \ket{nearest_P}. \end{aligned} \end{equation} Finally, $nearest_P$ is the desired intersection between ray and scene. We abbreviate the current state as, \begin{equation} \sum \ket{id} \ket{ray} \ket{intersect} \ket{\cdots}. \end{equation} To compute the accumulated ray energy of each superposed path, one problem is that different rays are interacting with different materials. Since the intersection structure contains a member that stores material ID, we traverse all materials in scene, and whether a path and a material interact is controlled by whether their material IDs meet. Since the number of materials is no more than the number of primitives, the total space and time complexity of performing a whole \textbf{Find Intersection} procedure are $O(P)$. \subsection{Computing the average color} \label{sec:averaging} The idea of quantum sum estimation comes from the quantum counting algorithm\cite{QuantumCounting1998}. Given a Boolean function $f: \{0, 1, \cdots, N-1\} \rightarrow \{0, 1\}$ where it is assumed that $N=2^n(n\in\mathbb{Z}_+)$ without loss of generality, and a corresponding phase oracle, \begin{equation} O_f: \sum_{id}x_{id}\ket{id} \mapsto \sum_{id}(-1)^{f(id)}x_{id}\ket{id}, \label{eq:phase-flip} \end{equation} the quantum counting algorithm can output an estimation $\tilde{S}$ of the sum $S=\sum_{j=0}^{N-1}f(j)$, such that \begin{equation} |\tilde{S}-S| < \frac{2\pi\sqrt{S}}{T}+\frac{\pi^2}{T^2}, \end{equation} with probability at least $8/\pi^2$\cite{QuantumCounting1998}, where $T=2^t$, and $t$ is the number of qubits in the first register in the \textbf{Quantum Counting} frame in \figref{fig:big-picture}. The idea of quantum counting is to estimate the eigenvalues of the unitary transformation of a Grover's iteration\cite{Grover1997} for Boolean function $f$, namely $e^{2\pi i\theta}$ and $e^{-2\pi i\theta}$, where \begin{equation} \theta = \frac{1}{\pi}\arcsin\sqrt{\frac{S}{N}} \in \left[0,\frac{1}{2}\right]. \label{eq:phase-fraction} \end{equation} The quantum counting algorithm can output a discrete random variable $\tilde{\theta}$ with distribution, \begin{equation} P(\tilde{\theta}|\theta) = \begin{cases} \left(\frac{\sin(T\pi(\tilde{\theta}-\theta))}{T\sin(\pi(\tilde{\theta}-\theta))}\right)^2 + & \left(\frac{\sin(T\pi(\tilde{\theta}+\theta))}{T\sin(\pi(\tilde{\theta}+\theta))}\right)^2, \\ & \tilde{\theta}=\frac{1}{T},\cdots, \frac{T/2-1}{T}; \\ \left(\frac{\sin(T\pi(\tilde{\theta}-\theta))}{T\sin(\pi(\tilde{\theta}-\theta))}\right)^2, & \tilde{\theta} = 0,\frac{1}{2}; \end{cases} \end{equation} which has a sharp peak around $\tilde{\theta}=\theta$ for large $T$, as illustrated in \figref{fig:p-theta}. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{p-theta.pdf} \caption{A graph for the probability distribution $P(\tilde{\theta}|\theta)$, in which $T=1024$ and $\theta=1/3$. The red vertical line shows the value of $\theta$.} \label{fig:p-theta} \end{figure} Practically, we can repeat the phase estimation for $B$ times, to obtain a result set $\{\tilde{\theta}_k\}_{k=1}^{B}$. Since $\tilde{\theta}$ is not an unbiased estimation of $\theta$, a better way than taking an average is to use Bayesian estimation, \begin{equation} P(\theta| \{\tilde{\theta}_k\}) = \frac{P(\{\tilde{\theta}_k\}| \theta)P(\theta)}{\sum_{\theta'} P(\{\tilde{\theta}_k\}| \theta')P(\theta')}, \end{equation} to estimate $\theta$ and thus $S$. According to Eq.~\eqref{eq:phase-fraction}, the possible values of $\theta$ are discrete. Assuming $\theta$ is evenly distributed, that is, all $P(\theta)$ are equal. Then by finding the maximum of Eq.~\eqref{eq:Bayesian} we obtain the final estimation $\tilde{\theta}$ of $\theta$. \begin{equation} P(\theta| \{\tilde{\theta}_k\}) \propto P(\{\tilde{\theta}_k\}| \theta) = \prod_{k=1}^{B}P(\tilde{\theta}_k| \theta). \label{eq:Bayesian} \end{equation} Now we have the state Eq.~\eqref{eq:color-to-average}, where each $color_{id}$ is a non-negative real number, and is entangled with a unique $id$. Our goal is to estimate their average. Suppose we hope to calculate the average of a set of numbers $x\in\mathcal{X}$ bounded by the range $[0, 2^b)$. We first build a comparator set, \begin{equation} \mathcal{Y} = \left\{ 2^{b-c}y | y=0,1,\cdots,2^c-1 \right\}, \end{equation} and a comparison function, \begin{equation} f(x, y) = \begin{cases} 1, & x > y;\\ 0, & x \le y. \end{cases} \end{equation} Then the average of the summands $x\in\mathcal{X}$ can be approximated via, \begin{equation} \left| \frac{1}{|\mathcal{X}|}\sum_{x\in\mathcal{X}}x - \frac{2^{b-c}}{|\mathcal{X}|}\sum_{x\in\mathcal{X},y\in\mathcal{Y}}f(x,y) \right| < 2^{b-c-1}. \end{equation} Additionally, if $x$ is stored in a fixed-point format with total bit length $c$ and integer bit length $b$, then the approximation above is exact. Remember that one part of the $id$ register is spared for storing $comparatorId$. Suppose the $comparatorId$ register consists of $c$ qubits, then each path is entangled with a superposition \begin{equation} \sum_{comparatorId=0}^{C-1}\ket{comparatorId}, \end{equation} where $C=2^c$. Then we use the quantity, \begin{equation} 2^{b-n}\sum_{id}f(color_{id},comparator_{id}), \end{equation} to approximate the average of colors, where $n$ is the size of $id$ register. Here $f$ is a Boolean function, hence the sum can be approximated by the standard quantum counting algorithm. We apply phases shifts to the $id$s that satisfies $color_{id} > comparator_{id}$, that is, perform the following transformation, \begin{equation} \begin{aligned} & \sum_{id} \ket{id} \ket{color_{id}} \ket{comparator_{id}} \ket{\cdots} \\ \mapsto & \sum_{id} (-1)^{f(color_{id}, comparator_{id})} \ket{id} \\ & \ket{color_{id}} \ket{comparator_{id}} \ket{\cdots}. \end{aligned} \end{equation} Finally, an uncomputing procedure, which inverses all circuit above except the final phase shifting, is performed to obtain the state, \begin{equation} \sum_{id} \ket{id} \mapsto \sum_{id}(-1)^{f(color_{id}, comparator_{id})} \ket{id}, \end{equation} which completes the construction of $O_f$ in \figref{fig:big-picture}. \section{Performance estimation} \label{sec:performance} In this section we estimate the time and space complexity, and make a comparison between quantum ray tracing and classical path tracing. First, we discuss the complexity of quantum ray tracing with respect to parameters like scene complexity $P$, maximum depth $D$, number of scattered rays at each intersection $R$, the comparator precision $C$, the precision in quantum counting $T$. From Eq.~\eqref{eq:id-register} we know the size of $id$ register is $\log R+\log C$. In the implementation of $O_f$ in \figref{fig:big-picture}, the space and time complexity of a single $FindIntersection$ procedure is $O(P)$, so the space and time complexity of the whole $O_f$ is $O(DP+\log R+\log C)$. Moreover, there are $\log T$ more qubits required in the quantum counting procedure, thus the overall space complexity is $O(DP+\log R+\log C+\log T)$. As for the time complexity, since the $G$ in \figref{fig:big-picture} are repeated for $\sum_{j=0}^{t-1}2^j=T-1$ times, and the $QFT^\dagger$ procedure takes $O((\log T)^2)$ time, the overall time complexity is $O(T(DP+\log R+\log C))$. To compare with classical ray tracing, we should formulate a connection between those parameters above and the precision of results. If we view the calculation of the color of a single pixel as an integral, more precisely a $2D$-dimensional integral, then our quantum ray tracing algorithm densely samples $R$ points and uses their average to estimate the integral. The corresponding truncation error is $ E_R=O(R^{-1/2D}) $, so we choose $ R=\Omega(E_R^{-2D}) $. Plus, the quantum counting procedure brings an additional probabilistic error. From the book\cite{qcqi} we know that if we hope to get a counting estimation with accuracy $E_T$ with success probability at least $1-\epsilon$, then we should choose $ T = \Omega(1/(E_T\cdot\epsilon)) $. The truncation error brought by the comparator interval is $E_C=O(1/C)$, thus we choose $ C = \Omega(1 / E_C) $. Therefore, the space complexity becomes, \begin{equation} O\left(DP - 2D\log E_R - \log E_C - \frac{1}{E_T\cdot\epsilon}\right), \end{equation} and the time complexity becomes, \begin{equation} O\left(\frac{DP - 2D\log E_R - \log E_C}{E_T\cdot\epsilon}\right). \end{equation} We can see that the major error in $E=E_R+E_T+E_C$ comes from $E_T$, since $E_T^{-1}$ has linear impacts on space and time complexity, while others have logarithm impacts. For simplicity of analysis we write the space complexity as $ O(DP-1/(E\cdot\epsilon)) $, and the time complexity as $ O(DP/(E\cdot\epsilon)) $. In comparison, the core of path tracing is the Monte Carlo integration. So if we hope to get an estimation within accuracy $E$ with success probability at least $1-\epsilon$, then the number of rays required is $ R = \Omega(1/(E^2\cdot\epsilon)) $. Moreover, the depth of a classical ray path could be dynamic, and modern classical ray tracing algorithm uses various acceleration approaches in the intersection test step to avoid traversing all primitives, like BSP tree\cite{Fuchs1980}, KD-tree\cite{Bentley1975, hapala2011kd} and BVH\cite{Clark1976}. Assume that the average depth is $D$, and the average number of ray-primitive intersection in searching the nearest intersection of a ray and the whole scene is $O(P)$, then the time complexity is $ O(RDP) = O(DP/(E^2\cdot\epsilon)) $. So the quantum ray tracing achieves a quadratic speedup in the sense of being controlled by the same error order. \section{Conclusion and Discussion} \label{sec:discussion} In this paper, we propose a quantum ray tracing algorithm, by first constructing a linear circuit for calculating ray colors, then applying quantum averaging algorithm to extract their mean value. Finally, we theoretically compare the performances of quantum ray tracing and classical path tracing, and do some simulated experiments to roughly prove our idea. Unfortunately, it is impossible at present to fully simulate the quantum ray tracing algorithm on classical computers, because it requires exponentially more classical computational resources to simulate quantum computers. Moreover, the real quantum computers at present cannot provide enough memory to run the algorithm. We are looking forward to testing our algorithm in a future quantum computer some day. There are also potential improvements in our work. In this paper we assume that the time cost for different algorithms to find the intersection of a ray and all scene objects are the same, and compare the time cost of them by counting the number of rays. Indeed, we overestimate the time cost of modern ray tracing algorithm, since it involves many vital acceleration approaches. In addition, our quantum ray tracing algorithm uses a fixed-depth ray tree, which may cause visual artifacts and must be compensated. In classical ray tracing, the problem can be solved by introducing a Russian roulette in the recursion such that there is a probabilistic halting test at each depth. Such dynamic ray-tree can make the Monte Carlo estimation unbiased. But the same solution is hard to be implemented in our quantum ray tracing. In the end, since computer graphics is an application field that requires huge computational power, we hope this paper can be an inspiration of quantum graphics, which studies the quantum solution for more computer graphics problems.
7f2359d5c23f28a12e25e7810a3f8eae9efae396
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} In recent years, text-to-speech~(TTS) models~\cite{shen2018natural,ren2020fastspeech,jeong2021diff,kim2020glow,kim2021conditional} have achieved dramatic improvement in various perspectives including naturalness, intelligibility, generation speed and controllability. However, one of the unresolved problems of TTS is that training these neural TTS models requires large amounts of text labeled speech corpora for high-quality speech generation. For example, LJSpeech~\cite{ito2017lj}, a public single speaker corpus for TTS, consists of more than 20 hours of delicately recorded speech with transcriptions. The difficulty and cost of collecting the labeled dataset can limit the application in various fields. In the zero-shot multi-speaker TTS~(ZS-TTS)~\cite{arik2018neural, cooper2020zero, min2021meta, casanova2021sc}, which synthesize voices of new speakers with only a few seconds of reference speech, it becomes more difficult to collect labeled dataset. The dataset should be composed of as many speakers as possible for better speaker generalization.\\ Meanwhile, transfer learning has been widely used in various fields, especially when the labeled dataset is insufficient. In transfer learning, a neural network model is firstly pre-trained for indirectly related objectives, and then the pre-trained model is used for parameter initialization of fine-tuning or feature extraction. For example, in computer vision~(CV), various image classification models~\cite{simonyan2014very, he2016deep, tan2019efficientnet, dosovitskiy2020image} trained on ImageNet~\cite{deng2009imagenet} are usually fine-tuned to classify the new classes with little examples. In natural language process~(NLP), self-supervised pre-training methods~\cite{devlin2018bert, liu2019roberta, yang2019xlnet} make it possible to exploit a large-scale unlabeled dataset, and significantly improve the generalization performance of downstream tasks such as machine translation and sentence classification. Following these works, several studies have attempted to apply transfer learning for speech data~\cite{oord2018representation, baevski2020wav2vec, hsu2021hubert}. For instance, wav2vec~2.0~\cite{baevski2020wav2vec} is used for low-resource speech recognition, even when there is no labeled dataset~\cite{baevski2021unsupervised}. In addition, several models utilize the self-supervised representations for speech analysis, disentanglement and voice conversion~\cite{polyak2021speech,choi2021neural,kreuk2021textless}.\\ Inspired by these works, we propose a novel transfer learning framework for TTS which employs large amounts of unlabeled speech for pre-training. The proposed method operates on VITS~\cite{kim2021conditional} architecture and leverages the wav2vec~2.0 representation to extract pseudo phoneme sequences, which are used for pre-training as a substitute of phoneme sequences. We also carefully designed the fine-tuning procedure in consideration of the role of each component and the training mechanism of normalizing flow.\\ The contributions of our work are as follows: \begin{itemize} \item To the best of our knowledge, it is the first approach that utilizes the unlabeled dataset for TTS based on the transfer learning framework. \item For the single speaker TTS, we verify that the proposed pre-training significantly improved the generated speech quality, especially in the lack of labeled dataset. Only 10 minutes of labeled dataset is required for synthesizing high fidelity speech. \item We extend the proposed framework to ZS-TTS. Pre-training on the large corpus, which consists of a large number of speakers, improves the speaker generalization on unseen speakers and even allows to generate the reference voices with only 30 minutes of a single speaker TTS dataset. \end{itemize} \begin{figure*} \centering \begin{subfigure}{0.67\columnwidth} \includegraphics[width=\columnwidth]{figure1.pdf}% \caption{Pre-training procedure}% \label{subfiga}% \end{subfigure}\hspace{0.2cm} \begin{subfigure}{0.67\columnwidth} \includegraphics[width=\columnwidth]{figure2.pdf}% \caption{Fine-tuning procedure}% \label{subfigb}% \end{subfigure}\hspace{0.2cm} \begin{subfigure}{0.67\columnwidth} \includegraphics[width=\columnwidth]{figure3.pdf}% \caption{Inference procedure}% \label{subfigc}% \end{subfigure} \caption{The entire framework of the proposed method. The discriminator part of the model is omitted for simplicity.} \label{figure1} \end{figure*} \section{Proposed Method} In this section, we describe the proposed transfer learning framework for TTS. As a base architecture, we use VITS~\cite{kim2021conditional} with several modifications. We first pre-train the VITS with a large untranscribed speech corpus and fine-tune the model with a small amount of text-labeled dataset. A new phonetic token named pseudo phoneme is used for pre-training as a substitute for phoneme. We explain pseudo phoneme in Section~\ref{pseudo phoneme}, and describe the detailed method in Section~\ref{transfer}. At last, we discuss the operation of the proposed framework in Section~\ref{discussion}. The overall proposed framework is depicted in Figure.~\ref{figure1}. \subsection{Pseudo Phoneme}\label{pseudo phoneme} Pseudo phoneme is a proposed token that contains phonetic information, and it is used as a substitute for a phoneme in pre-training. The pseudo phoneme should have similar characteristics with phoneme for effective pre-training and has to be acquired by speech-only corpus for our precondition of not using supervision. To satisfy these requirements, we leveraged the hidden representation of pre-trained wav2vec2.0 ~\cite{baevski2020wav2vec} which is trained in a self-supervised manner. According to ~\cite{baevski2021unsupervised}, k-means clustering on hidden representations of wav2vec2.0 operates well for assigning a phonetic token to each speech frame. The pseudo phoneme is extracted as follows. At first, we perform k-means clustering to identify $K$ clusters on the hidden representations of block 15 for the entire unlabeled speech corpus. We denote the hidden representation of block 15 as $h_{1},...,h_{T}$. Then, the cluster index $i_t \in \{1,...,K\}$ is obtained from each $h_t$, where we set $K=128$ for this work. As shown in Figure.\ref{subfiga}, the same consecutive indices are merged to reflect the characteristics of a real phoneme. We refer to these merged indices $i'_1,...,i'_{T'}$ as pseudo phoneme and use it for pre-training. In the above notation, $T$ and $T'$ denote lengths of speech frames and merged frames, respectively. \subsection{Transfer Learning Framework for TTS}\label{transfer} The proposed framework builds upon VITS architecture which has a conditional variational autoencoder (CVAE) structure. VITS consists of a posterior encoder, prior encoder, decoder and duration predictor. The posterior encoder extracts the posterior distribution $q_{\phi}(z|x_{lin})$ of the latent variable $z$ given the linear spectrogram $x_{lin}$, and the decoder generates output audio from the sampled $z$. The prior encoder consists of a normalizing flow and text encoder, and match the conditional prior distribution $p_{\theta}(z|c_{text}, A_{text})$ of $z$, given text $c_{text}$ and the alignment $A_{text}$. The alignment $A_{text}$ is calculated by monotonic alignment search~(MAS) algorithm~\cite{kim2020glow}, and the duration predictor learns the duration of each phoneme using $A_{text}$. Additionally, adversarial training helps to generate high fidelity sound. In the case of zero-shot multi-speaker TTS, we add a reference encoder with the same architecture of ~\cite{kim2021expressive} to extract speaker embedding. The speaker embedding is conditioned on the affine coupling layers of normalizing flow in the same way as ~\cite{kim2021conditional}, and it makes text-speaker dependent prior distribution of $z$.\\ \textbf{Pre-training} For pre-training, we exploit the vanilla VITS training method except for two differences. At first, the pseudo phoneme and pseudo text encoder are used instead of phoneme and text encoder, respectively. The pseudo text encoder consists of 2 layers of 1D convolutions with a ReLU activation. Accordingly, the training objective is modified to maximize the conditional likelihood of speech given pseudo phoneme so that Kullback-Leibler divergence~(KLD) loss for prior matching is changed from Eq.~\ref{eq: kld1} to Eq.~\ref{eq: kld2}. \begin{equation} \label{eq: kld1} L_{kl} = \log q_{\phi}(z|x_{lin}) - \log p_{\theta}(z|c_{text}, A_{text}) \end{equation} \begin{equation} \label{eq: kld2} L_{kl'} = \log q_{\phi}(z|x_{lin}) - \log p_{\psi}(z|c_{i'}, A_{i'}) \end{equation} In Eq.~\ref{eq: kld2}, ${\psi}$ represents parameters of the modified prior encoder: pseudo text encoder and normalizing flow, and $A_{i'}$ denotes the alignment between speech and pseudo phoneme. For ZS-TTS, the reference encoder is jointly trained with the other components.\\ \textbf{Fine-tuning} The goal of fine-tuning is to adapt the pre-trained model to phoneme sequences. During fine-tuning, the pseudo phoneme and pseudo text encoder are replaced by phoneme and text encoder, and the KLD loss is also returned to Eq.~\ref{eq: kld1}. We carefully divide the model into three parts for efficient training: frozen, fine-tunned and scratch. Firstly, the decoder and posterior encoder are frozen during fine-tuning. As the role of the decoder and posterior encoder is to reconstruct high-quality raw audio, we assumed that these modules are trained enough with a large corpus and does not have to be fine-tuned with a small dataset. Freezing decoder induces several benefits. As we do not have to feed-forward to the frozen decoder, we can save lots of memory consumption and calculations for generating the high-resolution audio. In addition, there is no speech output during fine-tuning, so we can skip the adversarial training of VITS that makes the training process more complex. In the case of ZS-TTS, the reference encoder is also frozen during fine-tuning. We assume that fine-tuning reference encoders with small speakers can decrease the generalization performance for unseen speakers. Meanwhile, normalizing flow is fine-tuned to adjust the pseudo phoneme dependent prior to the phoneme dependent prior. It can mitigate the mismatch between the phoneme and pseudo phoneme. Lastly, the text encoder and duration predictor is trained from scratch. For better generalization, we do not condition speaker embedding to duration predictor. We briefly state that the only fine-tuned part is the normalizing flow, and only KLD loss and duration prediction loss are used for fine-tuning. \subsection{Discussion on Framework Design} \label{discussion} There is a notable difference between the existing transfer learning methods and the proposed framework. In transfer learning, a domain $\mathcal{D}$ is defined as $\mathcal{D}=\{\mathcal{X}, P(X)\}$, where $\mathcal{X}$ is a feature space and $P(X)$ is probability distribution of $X=\{x_{1},...,x_{n}\}\in {\mathcal{X}}$. Given a domain $\mathcal{D}$, a task is defined as $\mathcal{T}=\{\mathcal{Y}, f(x)\}$, where $\mathcal{Y}$ is a label space, and $f:\mathcal{X}\rightarrow\mathcal{Y}$ is an objective predictive function. The knowledge of source domain~$\mathcal{D}_S$ and source task~$\mathcal{T}_S$ can help training the target function~$f_T(x)$ of target task~$\mathcal{T}_T$ in target domain~$\mathcal{D}_T$. However, in our framework, the source domain: pseudo phoneme indices and target domain: phoneme indices don't share any common feature spaces, meaning $\mathcal{X}_{S}\cap\mathcal{X}_{T}=\emptyset$. Instead, the $\mathcal{Y}_S$ and $\mathcal{Y}_T$ are highly related, since they are both speech. For this reason, feed-forward TTS models such as~\cite{ren2019fastspeech, ren2020fastspeech, lancucki2021fastpitch, vainer2020speedyspeech} are not suitable for the proposed method. When the domain changes, the text encoder should be randomly initialized because of feature space mismatch, and the decoder takes unlearned features from the text encoder. This makes it difficult to utilize the knowledge of the decoder acquired from pre-training and causes catastrophic forgetting~\cite{french1999catastrophic} during fine-tuning. To avoid this issue, we exploited the invertibility of normalizing flow. Normalizing flow has opposite directions for the training and inference procedure. In training procedure, the output of posterior encoder $z$ is converted to the latent variable of normalizing flow, $z_p$ $\sim\mathcal{N}(\mu_\theta(c_{text}, A_{text}), \sigma_\theta(c_{text}, A_{text}))$, where $\mu_\theta$ and $\sigma_\theta$ are calculated from text encoder. This property converts the domain shift problem to a target shift problem. Specifically, maximizing $\log p_{\theta}(z_p;\mu_\theta, \sigma_\theta)$ for the objective of Eq.~\ref{eq: kld1}\footnote{In Eq.\ref{eq: kld1}, $ p_{\theta}(z|c_{text}, A_{text})=\mathcal{N}(z_p;\mu_\theta, \sigma_\theta )|\mathrm{det}\frac{\partial z_p}{\partial z}|$.}, resembles minimizing weighted mean-squared-error~(MSE) between $z_p$ and $\mu_\theta(c_{text}, A_{text})$. This can be considered as target shift problem from $\mu_\psi(c_{i'}, A_{i'})$. As pseudo phoneme has rich phonetic information, the text encoder can quickly learn the well-defined latent space of $z_p$, and normalizing flow adapts for the gap between text and pseudo phoneme. \section{Experiments} In this section, we verify the effectiveness of the proposed method in single-speaker TTS and zero-shot multi-speaker TTS. The detailed experimental setup and results of each case are described in Section~\ref{exp_single} and \ref{exp_multi}, respectively. Our synthesized audio samples are publicly available at https://jmhxxi.github.io/TransferTTS-demo/. \subsection{Single Speaker TTS}\label{exp_single} For single speaker TTS, we firstly pre-trained the single speaker VITS without transcription and fine-tuned on different sizes of the labeled dataset. This experiment demonstrates the effectiveness of the proposed method and its relation to the amount of the labeled dataset.\\ \textbf{Dataset}: We used LJSpeech~\cite{ito2017lj} dataset for single speaker TTS. The LJSpeech dataset consists of 13,100 short sentences, and the total length is about 24 hours with a sample rate of 22.05kHz. The dataset was randomly split into subsets of training set~(12500~sentences) and evaluation set~(500~sentences). All of the speech in the training set~(23~hours unlabeled) was used for pre-training, and different amounts of speech-text pairs in the training set were used for fine-tuning: LJ-10min~(10~minutes labeled), LJ-1h~(1~hour labeled), and LJ-10h~(10~hours labeled).\\ \textbf{Implementation Details}: We exploited the basic configuration of ~\cite{kim2021conditional} for the proposed model unless otherwise explained. We pre-trained the model for 500k iterations and fine-tuned it only for 30k iterations to generate high-quality speech. Both processes were trained with mini-batch size 64. For comparison, we used VITS-baseline, Glow-TTS~\cite{kim2020glow}, and FastSpeech2~\cite{ren2020fastspeech}. These baselines were trained on the fine-tuning subsets without pre-training. HiFi-GAN~\cite{kong2020hifi}, trained on the entire LJSpeech, was used as a vocoder for Glow-TTS and FastSpeech2.\\ \textbf{Evaluation Metrics}: For the subjective evaluation of audio fidelity, we conducted a mean opinion score~(MOS) test. 15 raters listened to the randomly selected samples and gave 5 scaled scores from 1 to 5 based on their naturalness. In addition, we estimated the character error rate~(CER) to evaluate the intelligibility of generated speech. We used a pre-trained speech recognition model from speechbrain toolkit~\cite{ravanelli2021speechbrain} for transcription.\\ \textbf{Experimental Results}: The results of single-speaker TTS are presented in Table~\ref{tab:single}. As shown in Table~\ref{tab:single}, the proposed method shows the best performance for both CER and MOS in all cases, and with the fewer labeled dataset, the larger the performance gap. This indicates that our proposed method using speech-only corpus significantly improve the performance, especially in the lack of the labeled dataset. \begin{table}[th] \setlength{\tabcolsep}{10pt} \setlength{\arrayrulewidth}{0.2mm} \caption{Comparison of CER and MOS with 95\% confidence intervals for single speaker TTS.} \label{tab:single} \centering \begin{tabular}{l r r} \toprule \textbf{Method} & \multicolumn{1}{l}{\textbf{CER}}& \multicolumn{1}{l}{\textbf{\quad MOS}} \\ \midrule Ground Truth & 1.6 & 4.77$\pm$0.05 \\ \midrule \textbf{LJSpeech 10min}\\ GlowTTS & 31.6 & 1.82$\pm$0.11 \\ FastSpeech2 & 15.3 & 1.89$\pm$0.11 \\ VITS-baseline & 8.0 & 2.20$\pm$0.10 \\ Proposed & \textbf{3.5} & \textbf{4.42$\pm$0.08} \\ \midrule \textbf{LJSpeech 1hour}\\ GlowTTS & 8.2 & 2.83$\pm$0.12 \\ FastSpeech2 & 3.1 & 3.35$\pm$0.10 \\ VITS-baseline & 2.4 & 3.87$\pm$0.11 \\ Proposed & \textbf{2.3} & \textbf{4.58$\pm$0.07} \\ \midrule \textbf{LJSpeech 10hour}\\ GlowTTS & 2.1 & 4.37$\pm$0.09 \\ FastSpeech2 & 2.6 & 3.90$\pm$0.09 \\ VITS-baseline & \textbf{1.9} & 4.60$\pm$0.07 \\ Proposed & \textbf{1.9} & \textbf{4.66$\pm$0.06} \\ \bottomrule \end{tabular} \end{table} \subsection{Zero-Shot Multi-Speaker TTS}\label{exp_multi} Similar to the single speaker TTS, we pre-trained the zero-shot multi-speaker VITS model and fine-tuned it on different sizes of dataset. This experiment is conducted to verify that the proposed method improves the speaker generalization performance of ZS-TTS.\\ \textbf{Dataset:} For pre-training, we used train-clean-100 and train-clean-360 subsets of LibriTTS~\cite{zen2019libritts}. These subsets are about 245 hours in total, including 1151 speakers. In the case of fine-tuning, we used LJSpeech corpus and VCTK corpus~\cite{yamagishi2019cstr}. We made subsets of these corpus based on the total hours and number of speakers: LJ-30min~(30 minutes, 1 speaker), VCTK-1h~(1 hour, 4 speakers), VCTK-5h~(5 hours, 20 speakers) and VCTK-20h~(20 hours, 80 speakers). These subsets were used for fine-tuning. The evaluation set is composed of 28 speakers of VCTK not included in the fine-tuning sets so that all of the speakers in the evaluation set are unseen during training. The evaluation set has a total of 560 sentences and 20 sentences per speaker. All of the datasets were down-sampled to 22.05kHz for this experiment.\\ \textbf{Implementation Details:} For ZS-TTS, the same configuration of the model was set with that of single speaker TTS except for the reference encoder. The proposed model was pre-trained for 500k iterations as in Section~\ref{exp_multi}, then fine-tuned for 10k iterations on LJ-30min and 100k iterations on the other subsets. For comparison, we set the baselines with Meta-StyleSpeech~\cite{min2021meta}, SC-GlowTTS\footnote{We used a pre-trained speaker verification model~\cite{heo2020clova} for the reference encoder of SC-GlowTTS}~\cite{casanova2021sc}, and VITS-baseline. The VITS-baseline has the same architecture as the fine-tuned model but without pre-training, and these baselines were trained on the fine-tuning parts except LJ-30min. A pre-trained universal HiFi-GAN was used as a vocoder for Meta-StyleSpeech and SC-GlowTTS.\\% These baselines are trained on the fine-tuning parts except LJ-30min.\\ \textbf{Evaluation Metrics:} For speech quality and intelligibility, we used CER and MOS in the same way as Section~\ref{exp_single}. In addition, we evaluated the speaker similarity between reference speech and synthesized speech by similarity mean opinion score~(SMOS) and speaker embedding cosine similarity~(SECS). For SMOS, 15 raters evaluated whether generated speech reflects the speaker identity of reference speech well in the 5 scaled scores from 1 to 5. The SECS is the cosine distance of speaker embedding between generated speech and reference speech. To extract speaker embedding, we used a pre-trained speaker verification model~\cite{desplanques2020ecapa} from speechbrain toolkit. The SECS ranges from -1 to 1, and the higher score indicates the higher similarity.\\ \textbf{Experimental Results:} The results of ZS-TTS are presented in Table~\ref{tab:multi}. As shown in Table~\ref{tab:multi}, the overall performance gap between baselines and the proposed model increases as the datasets get smaller, and the performance of the proposed model is relatively less affected by the amount of fine-tuning dataset. Specifically, the proposed method achieves lower CER in all of the cases. Even though the MOS of the proposed model is lower than VITS-baseline in VCTK-5h and VCTK-20h, we expect that this gap can be mitigated by carefully matching the domain between pre-training and fine-tuning dataset. In the case of speaker similarity: SECS and SMOS, the proposed model significantly outperforms the baselines as well as VITS-baseline with any data sizes except for SC-GlowTTS of VCTK-20h. Since only SC-GlowTTS uses a pre-trained speaker verification model as a reference encoder, SC-GlowTTS might get higher SECS calculated by speaker verification model, while perceptual speaker similarity has a different tendency. One notable point is the results on LJ-30min. Although the proposed model is fine-tuned on a small single speaker dataset, it can generate voices of unseen speakers even with comparable performance. By this experiment, we show that the speaker similarity of ZS-TTS is heavily affected by the size of multi-speaker TTS corpus, and using large-scale unlabeled speech corpus can improve the speaker generalization performance, especially when the labeled dataset is limited.\\ \begin{table}[th] \setlength{\tabcolsep}{2pt} \setlength{\arrayrulewidth}{0.2mm} \caption{Comparison of results for zero-shot multi-speaker TTS. MOS and SMOS is described with 95\% confidence intervals.} \label{tab:multi} \centering \begin{tabular}{l r r r r} \toprule \textbf{Method} & \multicolumn{1}{l}{\textbf{CER}}& \multicolumn{1}{l}{\textbf{SECS}}& \multicolumn{1}{l}{\textbf{\quad MOS}}& \multicolumn{1}{l}{\textbf{\; SMOS}} \\ \midrule Ground Truth & 4.1 & 0.632 & 4.72$\pm$0.06 & 4.65$\pm$0.07 \\ \midrule \textbf{LJ 30min, 1speaker}\\ Proposed & 6.1 & 0.212 &3.99$\pm$0.10&3.47$\pm$0.09 \\ \midrule \textbf{VCTK 1h, 4speakers}\\ SC-GlowTTS & 29.5 & 0.151 &2.66$\pm$0.11&2.75$\pm$0.08 \\ Meta-StyleSpeech & 18.1 & 0.107 &2.12$\pm$0.11&1.98$\pm$0.09 \\ VITS-baseline (+ ref.) & 18.9 & 0.107 &3.36$\pm$0.11&2.84$\pm$0.08 \\ Proposed & \textbf{8.0} & \textbf{0.248} &\textbf{4.10$\pm$0.10}&\textbf{3.85$\pm$0.09} \\ \midrule \textbf{VCTK 5h, 20speakers}\\ SC-GlowTTS & 14.0 & 0.248 &3.34$\pm$0.11&3.36$\pm$0.08 \\ Meta-StyleSpeech & 16.0 & 0.246 &3.52$\pm$0.12&3.69$\pm$0.09 \\ VITS-baseline (+ ref.) & 8.7 & 0.179 &\textbf{4.40$\pm$0.08}&3.60$\pm$0.09 \\ Proposed & \textbf{8.5} & \textbf{0.298} &4.21$\pm$0.10&\textbf{3.92$\pm$0.09} \\ \midrule \textbf{VCTK 20h, 80speakers}\\ SC-GlowTTS & 6.2 & \textbf{0.327} &3.94$\pm$0.09&3.79$\pm$0.09 \\ Meta-StyleSpeech & 14.4 & 0.302 &3.42$\pm$0.11&3.85$\pm$0.08 \\ VITS-baseline (+ ref.) & \textbf{5.7} & 0.267 &\textbf{4.44$\pm$0.08}&4.00$\pm$0.09 \\ Proposed & \textbf{5.7} & 0.325 &4.32$\pm$0.09&\textbf{4.15$\pm$0.08} \\ \bottomrule \end{tabular} \end{table} \section{Conclusions} In this work, we introduced a transfer learning framework for TTS that uses a large amount of unlabeled speech dataset for pre-training. This framework is based on VITS architecture and the pseudo phoneme extracted from wav2vec2.0 representation. Due to the similar nature of phoneme and pseudo phoneme, we can pre-train the TTS model on a speech-only corpus, which improves the overall performance, especially in the lack of labeled speech. Our experimental results show that the proposed method outperforms other baselines over all of the fine-tuning subsets in single-speaker TTS and makes higher speaker similarity for zero-shot multi-speaker TTS. This performance improvement was greater with the smaller labeled dataset. With these advantages, we expect that the proposed method becomes a good starting point for low-resource TTS. \section{Acknowledgements} This work is/was supported by Samsung Research, Samsung Electronics Co.,Ltd. \bibliographystyle{IEEEtran}
3d05662e97049c05e4450dda233f177eed523430
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Ionic fluids (plasma, electrolyte solutions, molten salts, and room temperature ionic liquids) have recently attracted a lot of researchers' and chemical engineers' attention. This was mostly caused by the use of ionic fluids in various applications, including lipid and ion-exchange membranes, biomacromolecules, colloids, batteries, fuel cells, supercapacitors, {\it etc}. In all these examples, ionic fluids, which either interact with the charged surface of the membrane, macromolecule, colloid, or electrode surface or are confined in charged nanopores, are strongly inhomogeneous. Due to the inhomogeneity of the ionic fluid, the local electrical neutrality is violated, so that its description requires numerical solution of one or another self-consistent field equation for the electrostatic potential with appropriate boundary conditions: the classical Poisson-Boltzmann (PB) equation or its generalizations. The latter are known in the literature as modified PB equations. The modified PB equations obtained up to now take into account the individual properties of ionic species and the chemical specifics of the surface interacting with them. In this case it is necessary to especially emphasize the consideration of the non-zero size of ions (steric interactions)~\cite{kralj1996simple,borukhov1997steric,maggs2016general,kornyshev2007double}, their specific and structural interactions~\cite{goodwin2017mean,blossey2017structural}, polarizability/quadrupolarizability and permanent dipole moment of ionic species and solvent (co-solvent) molecules~\cite{frydel2011polarizable,budkov2020two,budkov2021theory,budkov2015modified,budkov2016theory,budkov2018theory,coalson1996statistical,abrashkin2007dipolar,iglivc2010excluded,buyukdagli2013microscopic,slavchov2014quadrupole}, surface charge regulaton~\cite{podgornik2018general}, specific ion-electrode interactions~\cite{budkov2018theory,uematsu2018effects} and electrostatic correlations~\cite{buyukdagli2020schwinger,de2020continuum,bazant2011double}. However, despite the variety of the modified PB equations, to the best of our knowledge, there is still no first-principles approaches allowing us to derive them from the unified standpoint and, simultaneously, take into account the aforementioned effects. Moreover, for applications, where it is required to calculate the macroscopic forces acting on conductive or dielectric bodies immersed in the ionic fluid (such as electrodes, colloid particles, membranes, micelles, dust particles, {\it etc}.), it is necessary to have a stress tensor consistent with the modified PB equation. In this paper, we will present such a field-theoretical approach based on the thermodynamic perturbation theory allowing us to derive the grand thermodynamic potential of an inhomogeneous ionic fluid as a functional of the electrostatic potential for an arbitrary reference system, modified PB equation (as the Euler-Lagrange equation for this functional), and a stress tensor (with use of Noether's theorem). We will apply this approach to derivation of the modified PB equations and stress tensors for three types of models that can be employed in the applications: (1) unpolarizable ionic fluid models, (2) polarizable ionic fluid models, and (3) polarizable models of the ion-dipole mixture (solvent in salt models). \section{Mean-field theory of ionic fluids} \subsection{Model I. Nonpolarizable ionic fluid mean-field models} Let us consider an ionic fluid -- a set of two types of ions with electric charges $q_{\pm}$ confined in a volume $V$ at a temperature $T$ contacting with an infinite reservoir with ions (bulk). We assume that the ions are immersed in a dielectric background of constant permittivity, $\varepsilon_b$. The ions interact with each other, in addition to the Coulomb interactions, via the short-range repulsive potentials $U_{\alpha\gamma}(\bold{r})$, where indexes $\alpha,\gamma=\pm$ enumerate the ions types. Thus, the grand partition function can be written as follows \begin{equation} \label{GPF} \Xi=\sum\limits_{n_{+}=0}^{\infty}\sum\limits_{n_{-}=0}^{\infty}\frac{z_{+}^{n_{+}}z_{-}^{n_{-}}}{n_{+}!n_{-}!}Q_{n_{+}n_{-}}, \end{equation} with the fugacities $z_{\pm}=\Lambda_{\pm}^{-3}e^{\beta\mu_{\pm}}\theta_{\pm}$ (expressed via the chemical potentials, $\mu_{\pm}$, the de Broglie thermal wavelengths, $\Lambda_\pm$, and internal partition functions, $\theta_{\pm}$, of the ions) of the ionic species and configuration integrals \begin{equation} Q_{n_{+}n_{-}}=\int d\Gamma_{n_+ n_-}\exp\left[-\beta U_{n_+ n_-}\right], \end{equation} where $\beta=(k_{B}T)^{-1}$ ($k_{B}$ is the Boltzmann constant, $T$ is the temperature) and \begin{equation} \int d\Gamma_{n_+ n_-}(\cdot)=\int..\int\prod\limits_{j=1}^{n_{+}}{d\bold{r}_{j}^{(+)}}\prod\limits_{k=1}^{n_{-}}{d\bold{r}_{k}^{(-)}}(\cdot). \end{equation} The total potential energy, $U_{n_+ n_-}$, of the interionic interactions can be written as a sum of several basic terms: \begin{equation} \label{hamilt} U_{n_+ n_-}=U_{n_{+}n_{-}}^{(el)}+U_{n_+ n_-}^{(ev)}+U_{n_+ n_-}^{(ext)}-U_{self}. \end{equation} The first term in eq. (\ref{hamilt}) describes the total potential energy of electrostatic interactions \begin{equation} U_{n_+ n_-}^{(el)}=\frac{1}{2}\int d\bold{r}\int d\bold{r}^{\prime}\hat{\rho}(\bold{r})G(\bold{r}-\bold{r}^{\prime})\hat{\rho}(\bold{r}^{\prime})=\frac{1}{2}\left(\hat{\rho}G\hat{\rho}\right), \end{equation} where $G(\bold{r}-\bold{r}^{\prime})=1/4\pi \varepsilon_{b}|\bold{r}-\bold{r}^{\prime}|$ is the Green function of the Poisson equation; \begin{equation} \hat{\rho}(\bold{r})=\hat{\rho}_{i}(\bold{r})+{\rho}_{ext}(\bold{r}), \end{equation} is the local charge density containing microscopic charge density of the ions \begin{equation} \hat{\rho}_{i}(\bold{r})=\sum\limits_{\alpha=\pm}q_{\alpha}\hat{c}_{\alpha}(\bold{r}) \end{equation} with the microscopic ionic concentrations \begin{equation} \hat{c}_{\alpha}(\bold{r})=\sum_{j=1}^{n_{\alpha}}\delta\left(\bold{r}-\bold{r}_{j}^{(\alpha)}\right) \end{equation} and the local charge density ${\rho}_{ext}(\bold{r})$ of the external charges. The second term in eq. (\ref{hamilt}) describes the total potential energy of the excluded volume interactions, i.e. \begin{equation} U_{n_+ n_-}^{(ev)}=\frac{1}{2}\sum\limits_{\alpha\gamma}^{}\left(\hat{c}_{\alpha}U_{\alpha\gamma}\hat{c}_{\gamma}\right)=\frac{1}{2}\int d\bold{r}\int d\bold{r}^{\prime}\sum\limits_{\alpha\gamma}^{}\hat{c}_{\alpha}(\bold{r})U_{\alpha\gamma}(\bold{r}-\bold{r}^{\prime})\hat{c}_{\gamma}(\bold{r}^{\prime}). \end{equation} The third term describes the interactions of ions with external fields with potential energies, $u_{\pm}(\bold{r})$: \begin{equation} U_{n_+ n_-}^{(ext)}=\sum\limits_{\alpha}\int d\bold{r}\hat{c}_{\alpha}(\bold{r})u_{\alpha}(\bold{r})=\sum\limits_{\alpha}(\hat{c}_{\alpha}u_{\alpha}). \end{equation} The last term in eq. (\ref{hamilt}) is the self-energy of the ions determined by the following equation $U_{self}=\left({n_{+}q_{+}^2}+{n_{-}q_{-}^2}\right)G(0)/2+({n_{+}U_{++}(0)}+{n_{-}U_{--}(0)})/2$. Futher, using the standard Hubbard-Stratonovich transformations \begin{equation} \label{HS1} e^{-\frac{\beta}{2}(\hat{\rho}G\hat{\rho})}=\int\frac{\mathcal{D}\varphi}{C}e^{-\frac{\beta}{2}(\varphi G^{-1}\varphi)+i\beta (\hat{\rho}\varphi)}, \end{equation} \begin{equation} \label{HS2} e^{-\frac{\beta}{2}\sum\limits_{\alpha\gamma}(\hat{c}_{\alpha}U_{\alpha\gamma}\hat{c}_{\gamma})}=\int \frac{\mathcal{D}\Phi}{\mathcal{N}_{U}}e^{-\frac{\beta}{2}\sum\limits_{\alpha\gamma}(\Phi_{\alpha}U^{-1}_{\alpha\gamma}\Phi_{\gamma})+i\beta \sum\limits_{\alpha}(\hat{c}_{\alpha}\Phi_{\alpha})}, \end{equation} after some algebra, we obtain the following functional integral representation of the grand partition function \begin{equation} \Xi=\int \frac{\mathcal{D}\varphi}{C}e^{-\frac{\beta}{2}\left(\varphi G^{-1}\varphi\right)+i\beta(\rho_{ext}\varphi)}\Xi_{R}[\varphi], \end{equation} where $C=\int\mathcal{D}\varphi e^{-\frac{\beta}{2}\left(\varphi G^{-1}\varphi\right)}$ and $\mathcal{N}_{U}=\int{\mathcal{D}\Phi}e^{-\frac{\beta}{2}\sum\limits_{\alpha\gamma}(\Phi_{\alpha}U^{-1}_{\alpha\gamma}\Phi_{\gamma})}$ are the normalization constants of the Gaussian measures. The inverse electrostatic Green function has the following form \begin{equation} G^{-1}(\bold{r}-\bold{r}^{\prime})=-\varepsilon_{b}\nabla^2\delta(\bold{r}-\bold{r}^{\prime}). \end{equation} The grand partition function, $\Xi_{R}$, of the reference fluid with pure repulsive interactions between the particles can be written as the following functional integral \begin{equation} \Xi_{R}=\int \frac{\mathcal{D}\Phi}{\mathcal{N}_{U}}\exp\left[-\frac{\beta}{2}\sum\limits_{\alpha\gamma}(\Phi_{\alpha}U^{-1}_{\alpha\gamma}\Phi_{\gamma})+\sum\limits_{\alpha}\bar{z}_{\alpha}\int d\bold{r}e^{i\beta(q_{\alpha}\varphi+\Phi_{\alpha}+iu_{\alpha})}\right], \end{equation} where $\bar{z}_{\pm}=e^{\frac{\beta{U}_{\pm\pm}(0)}{2}+\frac{\beta q_{\pm}^2 G(0)}{2}}z_{\pm}\theta_{\pm}$ are the renormalized fugacities. The inverse operator, $U^{-1}$, is determined by the integral relation \begin{equation} \int d\bold{r}^{\prime\prime}\sum\limits_{\lambda} U_{\alpha\lambda}^{-1}(\bold{r}-\bold{r}^{\prime\prime})U_{\lambda\gamma}(\bold{r}^{\prime\prime}-\bold{r}^{\prime})=\delta_{\alpha\gamma}\delta(\bold{r}-\bold{r}^{\prime}). \end{equation} Also, using the cumulant expansion, we obtain \begin{equation} \Xi_{R}=\exp\left[\sum\limits_{n=1}^{\infty}\frac{\left<W^{n}[\Phi;\chi]\right>_{c}}{n!}\right], \end{equation} where we have introduced the functional \begin{equation} \label{W} W[\Phi;\chi]=\sum\limits_{\alpha}\bar{z}_{\alpha}\int d\bold{r} e^{i\beta \Phi_{\alpha}+i\beta\chi_{\alpha}} \end{equation} with the auxiliary variables $\chi_{\alpha}=q_{\alpha}\varphi+iu_{\alpha}$; and the symbol $\left<(\cdot)\right>_{c}$ denotes the cumulant average \cite{kubo1962generalized}, so that the following relations take place \begin{equation} \left<W[\Phi;\chi]\right>_{c}=\left<W[\Phi;\chi]\right>, \end{equation} \begin{equation} \left<W^{2}[\Phi;\chi]\right>_{c}=\left<W^{2}[\Phi;\chi]\right>-\left<W[\Phi;\chi]\right>^2, \end{equation} \begin{equation} \left<W^{3}[\Phi;\chi]\right>_{c}=\left<W^{3}[\Phi;\chi]\right>-3\left<W^{2}[\Phi;\chi]\right>\left<W[\Phi;\chi]\right>+2\left<W[\Phi;\chi]\right>^3,... \end{equation} where we have introduced the notation for averaging over the Gaussian measure, i.e. \begin{equation} \left<(\cdot)\right>= \int \frac{\mathcal{D}\Phi}{\mathcal{N}_{U}}\exp\left[-\frac{\beta}{2}\sum\limits_{\alpha\gamma}(\Phi_{\alpha}U^{-1}_{\alpha\gamma}\Phi_{\gamma})\right](\cdot). \end{equation} Therefore, using the binomial formula, we obtain \begin{equation} \nonumber \sum\limits_{n=1}^{\infty}\frac{\left<W^{n}[\Phi;\chi]\right>_{c}}{n!}=\sum\limits_{n=1}^{\infty}\sum\limits_{k=0}^{n}\frac{\bar{z}_{+}^{k}\bar{z}_{-}^{n-k}}{k!(n-k)!}\int d\bold{r}_{1}^{(+)}...\int d\bold{r}_{k}^{(+)}\int d\bold{r}_{1}^{(-)}...\int d\bold{r}_{n-k}^{(-)} \end{equation} \begin{equation} \times \left<e^{i\beta \sum\limits_{s=1}^{k}\Phi_{+}\left(\bold{r}_{s}^{(+)}\right)+i\beta \sum\limits_{l=1}^{n-k}\Phi_{-}\left(\bold{r}_{s}^{(-)}\right)}\right>_{c} e^{i\beta \sum\limits_{s=1}^{k}\chi_{+}\left(\bold{r}_{s}^{(+)}\right)+i\beta \sum\limits_{l=1}^{n-k}\chi_{-}\left(\bold{r}_{l}^{(-)}\right)}. \end{equation} Then, after the calculations of the Gaussian functional integrals \cite{zinn2002quantum}, we get \begin{equation} \left<e^{i\beta \sum\limits_{s=1}^{k}\Phi_{+}(\bold{r}_{s}^{(+)})+i\beta \sum\limits_{l=1}^{n-k}\Phi_{-}(\bold{r}_{s}^{(-)})}\right>_{c}=e^{\frac{\beta k U_{++}(0)}{2}+\frac{\beta(n-k)U_{--}(0)}{2}}B^{nk}_{R}\left(\bold{r}_{1}^{(+)},...,\bold{r}_{k}^{(+)};\bold{r}_{1}^{(-)},...,\bold{r}_{n-k}^{(-)}\right), \end{equation} where we have introduced the cluster functions: \begin{equation} B_{R}^{11}\left(\bold{r}^{(+)}\right)=B_{R}^{10}\left(\bold{r}^{(-)}\right)=1, \end{equation} \begin{equation} \nonumber B_{R}^{22}\left(\bold{r}_{1}^{(+)},\bold{r}_{2}^{(+)}\right)=e^{-\beta U_{++}\left(\bold{r}_{1}^{(+)}-\bold{r}_{2}^{(+)}\right)}-1,~B_{R}^{21}\left(\bold{r}_{1}^{(+)};\bold{r}_{1}^{(-)}\right)=e^{-\beta U_{+-}\left(\bold{r}_{1}^{(+)}-\bold{r}_{1}^{(-)}\right)}-1, \end{equation} \begin{equation} B_{R}^{20}\left(\bold{r}_{1}^{(-)},\bold{r}_{2}^{(-)}\right)=e^{-\beta U_{--}\left(\bold{r}_{1}^{(-)}-\bold{r}_{2}^{(-)}\right)}-1, \end{equation} \begin{equation} \nonumber B_{R}^{33}\left(\bold{r}_{1}^{(+)},\bold{r}_{2}^{(+)},\bold{r}_{3}^{(+)}\right)=e^{-\beta \left(U_{++}\left(\bold{r}_{1}^{(+)}-\bold{r}_{2}^{(+)}\right)+U_{++}\left(\bold{r}_{1}^{(+)}-\bold{r}_{3}^{(+)}\right)+U_{++}\left(\bold{r}_{2}^{(+)}-\bold{r}_{3}^{(+)}\right)\right)} \end{equation} \begin{equation} \nonumber -e^{-\beta U_{++}\left(\bold{r}_{1}^{(+)}-\bold{r}_{2}^{(+)}\right)}-e^{-\beta U_{++}\left(\bold{r}_{1}^{(+)}-\bold{r}_{3}^{(+)}\right)}-e^{-\beta U_{++}\left(\bold{r}_{2}^{(+)}-\bold{r}_{3}^{(+)}\right)}+2, \end{equation} \begin{equation} \nonumber B_{R}^{32}\left(\bold{r}_{1}^{(+)},\bold{r}_{2}^{(+)};\bold{r}_{1}^{(-)}\right)=e^{-\beta \left(U_{++}\left(\bold{r}_{1}^{(+)}-\bold{r}_{2}^{(+)}\right)+U_{+-}\left(\bold{r}_{1}^{(+)}-\bold{r}_{1}^{(-)}\right)+U_{+-}\left(\bold{r}_{2}^{(+)}-\bold{r}_{1}^{(-)}\right)\right)} \end{equation} \begin{equation} \nonumber -e^{-\beta U_{++}\left(\bold{r}_{1}^{(+)}-\bold{r}_{2}^{(+)}\right)}-e^{-\beta U_{+-}\left(\bold{r}_{1}^{(+)}-\bold{r}_{1}^{(-)}\right)}-e^{-\beta U_{+-}\left(\bold{r}_{2}^{(+)}-\bold{r}_{1}^{(-)}\right)}+2, \end{equation} \begin{equation} \nonumber B_{R}^{31}\left(\bold{r}_{1}^{(+)};\bold{r}_{1}^{(-)},\bold{r}_{2}^{(-)}\right)=e^{-\beta \left(U_{+-}\left(\bold{r}_{1}^{(+)}-\bold{r}_{1}^{(-)}\right)+U_{+-}\left(\bold{r}_{1}^{(+)}-\bold{r}_{2}^{(-)}\right)+U_{--}\left(\bold{r}_{1}^{(-)}-\bold{r}_{2}^{(-)}\right)\right)} \end{equation} \begin{equation} \nonumber -e^{-\beta U_{+-}\left(\bold{r}_{1}^{(+)}-\bold{r}_{1}^{(-)}\right)}-e^{-\beta U_{+-}\left(\bold{r}_{1}^{(+)}-\bold{r}_{2}^{(-)}\right)}-e^{-\beta U_{--}\left(\bold{r}_{1}^{(-)}-\bold{r}_{2}^{(-)}\right)}+2, \end{equation} \begin{equation} \nonumber B_{R}^{30}\left(\bold{r}_{1}^{(-)},\bold{r}_{2}^{(-)},\bold{r}_{3}^{(-)}\right)=e^{-\beta \left(U_{--}\left(\bold{r}_{1}^{(-)}-\bold{r}_{2}^{(-)}\right)+U_{--}\left(\bold{r}_{2}^{(-)}-\bold{r}_{3}^{(-)}\right)+U_{--}\left(\bold{r}_{1}^{(-)}-\bold{r}_{3}^{(-)}\right)\right)} \end{equation} \begin{equation} -e^{-\beta U_{--}\left(\bold{r}_{1}^{(-)}-\bold{r}_{2}^{(-)}\right)}-e^{-\beta U_{--}\left(\bold{r}_{2}^{(-)}-\bold{r}_{3}^{(-)}\right)}-e^{-\beta U_{--}\left(\bold{r}_{1}^{(-)}-\bold{r}_{3}^{(-)}\right)}+2,... \end{equation} where index $k$ denotes the number of positively charged ions among the group of $n$ ions. At sufficiently small radii of the steric interactions, the cluster functions, $B^{nk}_{R}$, significantly deviate from zero, only when the positions of the particles are very close to each other. This allows us to adopt the following approximation for cumulant expansion \begin{equation} \nonumber \sum\limits_{n=1}^{\infty}\frac{\left<W^{n}[\Phi;\chi]\right>_{c}}{n!}=\sum\limits_{n=1}^{\infty}\sum\limits_{k=0}^{n}\frac{\tilde{z}_{+}^{k}\tilde{z}_{-}^{n-k}}{k!(n-k)!}\int d\bold{r}_{1}^{(+)}..\int d\bold{r}_{k}^{(+)}\int d\bold{r}_{1}^{(-)}..\int d\bold{r}_{n-k}^{(-)} \end{equation} \begin{equation} \nonumber \times B^{nk}_{R}\left(\bold{r}_{1}^{(+)},...,\bold{r}_{k}^{(+)};\bold{r}_{1}^{(-)},...,\bold{r}_{n-k}^{(-)}\right)e^{i\beta \sum\limits_{s=1}^{k}\chi_{+}\left(\bold{r}_{s}^{(+)}\right)+i\beta \sum\limits_{l=1}^{n-k}\chi_{-}\left(\bold{r}_{l}^{(-)}\right)} \end{equation} \begin{equation} \nonumber \approx \int d\bold{r}\sum\limits_{n=1}^{\infty}\sum\limits_{k=0}^{n}\frac{\tilde{z}_{+}^{k}\tilde{z}_{-}^{n-k}}{k!(n-k)!}e^{i\beta k\chi_{+}\left(\bold{r}\right)+i\beta(n-k) \chi_{-}\left(\bold{r}\right)} \end{equation} \begin{equation} \nonumber \times \int d\bold{r}_{2}^{(+)}..\int d\bold{r}_{k}^{(+)}\int d\bold{r}_{1}^{(-)}..\int d\bold{r}_{n-k}^{(-)} B^{nk}_{R}\left(\bold{r}_{1}^{(+)},...,\bold{r}_{k}^{(+)};\bold{r}_{1}^{(-)},...,\bold{r}_{n-k}^{(-)}\right) \end{equation} \begin{equation} \nonumber =\int d\bold{r}\sum\limits_{n=1}^{\infty}\sum\limits_{k=0}^{n}b_{nk}{\tilde{z}_{+}^{k}\tilde{z}_{-}^{n-k}} e^{i\beta k\chi_{+}\left(\bold{r}\right)+i\beta(n-k) \chi_{-}\left(\bold{r}\right)}, \end{equation} where $\tilde{z}_{\pm}=z_{\pm} e^{\beta q_{\pm}^2G(0)/2}\theta_{\pm}$ and \begin{equation} b_{nk}=\frac{1}{k!(n-k)!}\int d\bold{r}_{2}^{(+)}...\int d\bold{r}_{k}^{(+)}\int d\bold{r}_{1}^{(-)}...\int d\bold{r}_{n-k}^{(-)} B^{nk}_{R}\left(\bold{r}_{1}^{(+)},...,\bold{r}_{k}^{(+)};\bold{r}_{1}^{(-)},...,\bold{r}_{n-k}^{(-)}\right) \end{equation} are the cluster integrals for a two-component fluid \cite{hill1986introduction}. In other words, the cluster functions in this 'local' approximation can be approximated as \begin{equation} B^{nk}_{R}\left(\bold{r}_{1}^{(+)},...,\bold{r}_{k}^{(+)};\bold{r}_{1}^{(-)},...,\bold{r}_{n-k}^{(-)}\right)=k!(n-k)!b_{nk}\prod\limits_{j=2}^{k}\delta\left(\bold{r}_{j}^{(+)}-\bold{r}_{1}^{(+)}\right)\prod\limits_{l=1}^{n-k}\delta\left(\bold{r}_{l}^{(-)}-\bold{r}_{1}^{(+)}\right). \end{equation} Therefore, in the local approximation, the cumulant expansion is simply a cluster expansion \cite{hill1986introduction} of the bulk pressure as a function of shifted chemical potentials, $\bar{\mu}_{\pm}=\mu_{\pm}+i\chi_{\pm}+{q_{\pm}^2G(0)}/{2}+k_{B}T\ln\theta_{\pm}$, i.e. \begin{equation} \sum\limits_{n=1}^{\infty}\frac{\left<W^{n}[\Phi;\chi]\right>_{c}}{n!}\approx \beta\int d\bold{r}{P(T,\bar{\mu}_{+},\bar{\mu}_{-})}. \end{equation} Redefining the chemical potentials of the species $\bar{\mu}_{\pm}\rightarrow \bar{\mu}_{\pm}-{q_{\pm}^2G(0)}/{2}-k_{B}T\ln\theta_{\pm}$, we obtain the following local approximation for the grand partition function of the reference fluid \begin{equation} \label{loc_app} \Xi_{R}=\exp\left[\beta\int d\bold{r} P(T,\bar{\mu}_{+},\bar{\mu}_{-})\right], \end{equation} where $P\left(T,\bar{\mu}_{+},\bar{\mu}_{-}\right)$ is the reference fluid pressure as a function of the intrinsic chemical potentials $\bar{\mu}_{\pm}=\mu_{\pm}+iq_{\pm}\varphi-u_{\pm}$ of species and temperature. We would like to note that this approximation is in accordance with the thermodynamic relation $\Omega=-PV$ for the bulk systems. Therefore, the grand partition function of the ionic fluid takes the form \begin{equation} \Xi=\int \frac{\mathcal{D}\varphi}{C}\exp\left[-\beta \Omega_{ef}[\varphi]\right], \end{equation} where we have introduced the following grand thermodynamic potential \begin{equation} \label{omega} \Omega_{ef}[\varphi]=\frac{1}{2}\left(\varphi G^{-1}\varphi\right)-i(\rho_{ext}\varphi)-\int d\bold{r}P\left(T,\bar{\mu}_{+},\bar{\mu}_{-}\right), \end{equation} as a functional of the fluctuating electrostatic potential, $\varphi$. We would like to note that the functional (\ref{omega}) can be considered as the Landau-Ginzburg-Wilson effective Hamiltonian for the ionic fluid ($\varphi(\bold{r})$ is an order parameter) similar to those obtained within the similar approaches for simple fluids \cite{ivanchenko1984ginzburg,brilliantov1998effective,brilliantov2020molecular}. Then, using the mean-field approximation, i.e. the functional derivative of the GTP to zero \begin{equation} \frac{\delta \Omega_{ef}}{\delta \varphi(\bold{r})}=0 \end{equation} and introducing the self-consistent field potential (saddle-point) $\varphi^{(MF)}=i\psi$, we arrive at the following self-consistent field equation \begin{equation} \label{Poisson} \Delta\psi(\bold{r})=-\frac{1}{\varepsilon_{b}}\left(\rho_{ext}(\bold{r})+q_{+}\bar{c}_{+}(\bold{r})+q_{-}\bar{c}_{-}(\bold{r})\right) \end{equation} where the local concentrations, $\bar{c}_{\pm}(\bold{r})$, are determined by the following thermodynamic relations \begin{equation} \bar{c}_{\gamma}(\bold{r})=\frac{\delta\Omega_{ef}}{\delta{u}_{\gamma}(\bold{r})}=\frac{\partial{P\left(T,\bar{\mu}_{+}(\bold{r}),\bar{\mu}_{-}(\bold{r})\right)}}{\partial{\bar{\mu}_{\gamma}}}=c_{\gamma}\left(T,\bar{\mu}_{+}(\bold{r}),\bar{\mu}_{-}(\bold{r})\right), \end{equation} where $c_{\gamma}\left(T,\bar{\mu}_{+}(\bold{r}),\bar{\mu}_{-}(\bold{r})\right)$ are the concentrations of the reference fluid species. Thus, within the mean-field approximation, the ionic concentrations are determined as the molecular concentrations of the reference fluid and depend on the position, $\bold{r}$, via the intrinsic chemical potentials $\bar{\mu}_{\pm}(\bold{r})=\mu_{\pm}-q_{\pm}\psi(\bold{r})-u_{\pm}(\bold{r})$. Solving eq. (\ref{Poisson}) with the appropriate boundary conditions, we can calculate the GTP in the mean-field approximation as \begin{equation} \label{Omega33} \Omega=\Omega_{ef}[\varphi^{(MF)}]=\int d\bold{r}\left(-\frac{\varepsilon_{b}(\nabla{\psi})^2}{2}+\rho_{ext}\psi-P(T,\bar{\mu}_{+},\bar{\mu}_{-})\right). \end{equation} However, when the ionic fluid adjoins with conductors possessing fixed electric potentials or surface charges and there are no fixed volume charges, we can use the following functional \begin{equation} \Omega[\psi]=\int d\bold{r}\left(-\frac{\varepsilon_{b}(\nabla{\psi})^2}{2}-P(T,\bar{\mu}_{+},\bar{\mu}_{-})\right), \end{equation} related to the following self-consistent field equation \begin{equation} \label{Poisson_eq_3} \Delta\psi(\bold{r})=-\frac{1}{\varepsilon_{b}}\left(q_{+}\bar{c}_{+}(\bold{r})+q_{-}\bar{c}_{-}(\bold{r})\right). \end{equation} Note that equation (\ref{Poisson}) can be obtained directly by varying functional (\ref{Omega33}) with respect to the potential, $\psi$. In other words, functional (\ref{Omega33}) reaches the extreme value at solutions to eq. (\ref{Poisson}). This idea was used in papers \cite{budkov2018theory,budkov2016theory,maggs2016general,budkov2020two,blossey2017structural} to obtain the self-consistent field equations by varying the GTP rewritten as a functional of electrostatic potential \cite{budkov2016theory,maggs2016general} and potentials of specific interactions \cite{budkov2018theory,blossey2017structural} by using the local Legendre transformation. In this paper, we justify this heuristic approach, starting from the grand partition function of ionic fluid. In order to apply this theory to inhomogeneous electrolyte solutions or room temperature ionic liquids, it is necessary to specify the dependence of osmotic pressure on chemical potentials, $P(T,\bar{\mu}_{+},\bar{\mu}_{-})$. For the case of an ideal gas reference system, for which \begin{equation} P(T,\bar{\mu}_{+},\bar{\mu}_{-})=\frac{k_{B}T}{\Lambda_{+}^3}e^{\beta\bar{\mu}_{+}}+\frac{k_{B}T}{\Lambda_{-}^3}e^{\beta\bar{\mu}_{-}}, \end{equation} where $\Lambda_{\pm}$ are the thermal de Broglie wavelengths, we obtain the classical Poisson-Boltzmann equation \begin{equation} \label{Poisson-Boltzmann} \Delta\psi(\bold{r})=-\frac{1}{\varepsilon_{b}}\left(q_{+}c_{+,b}e^{-\beta q_{+}\psi(\bold{r})}+q_{-}c_{-,b}e^{-\beta q_{-}\psi(\bold{r})}\right), \end{equation} where we used the relations for bulk chemical potentials $\mu_{\pm}=k_{B}T\ln\left(\Lambda_{\pm}^3c_{\pm,b}\right)$, with $c_{\pm,b}$ being the ionic concentrations in the bulk (where $\psi=0$). Another widely used reference fluid system is a symmetric lattice gas, for which such dependence has the form \cite{hill1986introduction,maggs2016general} \begin{equation} P(T,\bar{\mu}_{+},\bar{\mu}_{-})=\frac{k_{B}T}{v}\ln\left(1+e^{\beta\bar{\mu}_{+}}+e^{\beta\bar{\mu}_{-}}\right), \end{equation} where $v$ is the lattice cell volume. In this case, when $q_{\pm}=\pm q$ and $\mu_{\pm}=k_{B}T\ln{cv/(1-2cv)}$ the self-consistent field equation transforms into the so-called Poisson-Fermi equation~\cite{kornyshev2007double,bazant2009towards,borukhov1997steric} \begin{equation} \Delta\psi(\bold{r})=\frac{2c q}{\varepsilon_{b}}\frac{\sinh{\beta q\psi(\bold{r})}}{1+2cv\left(\cosh\beta q\psi(\bold{r})-1\right)}, \end{equation} where $c$ is the bulk ionic concentration. In order to take into account the ionic size asymmetry, we can use the asymmetric lattice gas model as the reference system, which was systematically considered in paper~\cite{maggs2016general} in the context of the electric double layer theory. To take into account the ionic size asymmetry, we can also use the hard sphere mixture, for which the local pressure and chemical potentials can be obtained from the following excess free energy density within the Percus-Yevick approximation: \begin{equation} \label{PY} \beta f_{ex} = -n_0 \ln(1-n_3) + \frac{n_1 n_2}{1 - n_3} + \frac{n_2^3}{24\pi(1-n_3)^2} \end{equation} or using the Carnahan-Starling approximation~\cite{roth2010fundamental,maggs2016general}. The auxiliary variables are: $n_0 = \bar{c}_{+} + \bar{c}_{-}$, $n_1 = 1/2 ~ d_+ \bar{c}_{+} + 1/2 ~ d_- \bar{c}_{-}$, $n_2 = \pi~d_+^2 \bar{c}_{+} +\pi ~ d_-^2 \bar{c}_{-}$, $n_3 = \pi/6 ~ d_+^3 \bar{c}_{+} + \pi/6 ~ d_-^3 \bar{c}_{-}$. The pressure and chemical potentials of species ($\alpha = \pm$) can be derived via standard thermodynamic relations~\cite{roth2002fundamental}: \begin{equation} \label{press} \beta P = n_0 \frac{1 + n_3 + n_3^2}{(1-n_3)^3} + \frac{1/12\pi~n_2^3 + n_1 n_2 (1 - n_3) -3 n_0 n_3}{(1-n_3)^3}, \end{equation} \begin{equation} \label{mu} \beta\bar{\mu}_{\alpha} =\ln\frac{\bar{c}_{\alpha}\Lambda_{\alpha}^3}{1-n_3}+\frac{n_2 d_{\alpha}}{2(1-n_3)}+\pi d_{\alpha}^2\left(\frac{n_1}{1-n_3} + \frac{n_2^2}{8\pi (1-n_3)^2}\right)+\frac{\beta \pi d_{\alpha}^3P}{6}, \end{equation} where $d_{\alpha}$ are the ionic effective diameters. \subsection{Model II. Polarizable ionic fluid mean-field models} Now let us consider an ionic fluid, whose ions carry charges $q_{\pm}+e_{\pm}$ at the center and additional 'peripheral' charges $-e_{\pm}$ at a fluctuating distance from it, so that the total charges of the ions are $q_{\pm}$. The fluctuating distance, $\bold{\xi}$, is described by the distribution functions $g_{\pm}(\bold{\xi})$. This model can be used to describe room temperature ionic liquids and molten salts with polarizable/polar ions. A similar 'nonlocal' description of the bound charge of ions and molecules was also presented in papers~\cite{buyukdagli2013microscopic,budkov2019statistical,budkov2020statistical,budkov2018nonlocal}. The configuration integrals in the grand partition function (\ref{GPF}) take the form \begin{equation} Q_{n_+ n_-}=\int d\Gamma_{n_+ n_-}\exp\left[-\beta U_{n_+ n_-}\right], \end{equation} where \begin{equation} \int d\Gamma_{n_+ n_-}(\cdot)=\int..\int\prod\limits_{j=1}^{n_{+}}{d\bold{r}_{j}^{(+)}}d\bold{\xi}^{(+)}_{j}g_{+}\left(\bold{\xi}^{(+)}_{j}\right)\prod\limits_{k=1}^{n_{-}}{d\bold{r}_{k}^{(-)}}d\bold{\xi}^{(-)}_{k}g_{-}\left(\bold{\xi}^{(-)}_{k}\right)(\cdot). \end{equation} The total potential energy is determined by the same expression (\ref{hamilt}) with the electrostatic energy expressed via the following local charge density \begin{equation} \hat{\rho}(\bold{r})=\hat{\rho}_{i}(\bold{r})+{\rho}_{ext}(\bold{r}), \end{equation} where \begin{equation} \label{rho_i} \hat{\rho}_{i}(\bold{r})=\sum\limits_{\alpha}q_{\alpha}\hat{c}_{\alpha}(\bold{r})+\sum\limits_{\alpha=\pm}\sum\limits_{j_{\alpha}=1}^{n_{\alpha}}e_{\alpha}\left(\delta\left(\bold{r}-\bold{r}^{(\alpha)}_{j_{\alpha}}\right)-\delta\left(\bold{r}-\bold{r}^{(\alpha)}_{j_{\alpha}}-\bold{\xi}_{j_{\alpha}}^{(\alpha)}\right)\right) \end{equation} is the microscopic charge density of the ions taking into account their polarizability (the second term). Performing the same transformations as in Subsection A, we arrive at \begin{equation} \Xi=\int \frac{\mathcal{D}\varphi}{C}e^{-\frac{\beta}{2}\left(\varphi G^{-1}\varphi\right)+i\beta(\rho_{ext}\varphi)}\Xi_{R}, \end{equation} where we have introduced the reference grand partition function \begin{equation} \Xi_{R}=\int \frac{\mathcal{D}\Phi}{\mathcal{N}_{U}}\exp\left[-\frac{\beta}{2}\sum\limits_{\alpha\gamma}(\Phi_{\alpha}U^{-1}_{\alpha\gamma}\Phi_{\gamma})+W[\Phi;\chi]\right] \end{equation} with the functional $W[\Phi;\chi]$ determined by eq. (\ref{W}) with \begin{equation} \chi_{\alpha}(\bold{r})=q_{\alpha}\varphi(\bold{r})+iu_{\alpha}(\bold{r})+k_{B}T\ln\left[\int d\bold{\xi}g_{\alpha}(\bold{\xi})e^{i\beta e_{\alpha}\left(\varphi(\bold{r})-\varphi(\bold{r}+\bold{\xi})\right)}\right]. \end{equation} Then, performing the same calculations based on the cumulant expansion and adopting the same approximations as in Subsection A, we obtain the GTP in the absence of external volume electric charges \begin{equation} \label{Omega4} \Omega[\psi]=\int d\bold{r}\left(-\frac{\varepsilon_{b}(\nabla{\psi})^2}{2}-P(T,\bar{\mu}_{+},\bar{\mu}_{-})\right), \end{equation} where \begin{equation} \bar{\mu}_{\alpha}(\bold{r})=\mu_{\alpha}-q_{\alpha}\psi(\bold{r})+k_{B}T\ln\left[\int d\bold{\xi}g_{\alpha}(\bold{\xi})e^{-\beta e_{\alpha}\left(\psi(\bold{r})-\psi(\bold{r}+\bold{\xi})\right)}\right]. \end{equation} Now we would like to specify the probability distribution functions $g_{\alpha}(\bold{\xi})$. We consider the Gaussian distributions \begin{equation} \label{PDE} g_{\alpha}(\bold{\xi})=(2\pi\sigma_{\alpha}^2)^{-3/2}\int\frac{d\bold{n}_{\alpha}}{4\pi}\exp\left[-\frac{(\bold{\xi}-\bold{s}_{\alpha})^2}{2\sigma_{\alpha}^2}\right], \end{equation} averaged over orientations of unit vectors $\bold{n}_{\alpha}=\bold{s}_{\alpha}/|\bold{s}_{\alpha}|$, where $\bold{s}_{\alpha}$ is the vector of the average distance between charges $\pm e_{\alpha}$. In this case, we obtain \begin{equation} \nonumber \int d\bold{\xi}g_{\alpha}(\bold{\xi})e^{-\beta e_{\alpha}\left(\psi(\bold{r})-\psi(\bold{r}+\bold{\xi})\right)}=\int\frac{d\bold{n}_{\alpha}}{4\pi}\int\frac{d\bold{\xi}}{(2\pi\sigma_{\alpha}^2)^{3/2}}e^{-\frac{(\bold{\xi}-\bold{s}_{\alpha})^2}{2\sigma_{\alpha}^2}}e^{-\beta e_{\alpha}\left(\psi(\bold{r})-\psi(\bold{r}+\bold{\xi})\right)} \end{equation} \begin{equation} \approx \int\frac{d\bold{n}_{\alpha}}{4\pi}\int\frac{d\bold{\xi}}{(2\pi\sigma_{\alpha}^2)^{3/2}}e^{-\frac{(\bold{\xi}-\bold{s}_{\alpha})^2}{2\sigma_{\alpha}^2}}e^{-\beta e_{\alpha}\bold{\xi}\nabla\psi(\bold{r})}= \frac{\sinh(\beta p_{\alpha}|\nabla \psi(\bold{r})|)}{\beta p_{\alpha}|\nabla \psi(\bold{r})|}e^{\frac{\gamma_{\alpha}(\nabla\psi(\bold{r}))^2}{2k_{B}T}}, \end{equation} where we have used the approximation $\psi(\bold{r}+\bold{\xi})\approx \psi(\bold{r})+\bold{\xi}\nabla\psi(\bold{r})$ and introduced the permanent dipole moments, $p_{\alpha}=e_{\alpha}|\bold{s}_{\alpha}|$, and static polarizabilities, $\gamma_{\alpha}=\beta\sigma_{\alpha}^2e_{\alpha}^2$, of the ions. Therefore, we obtain the following expressions for the intrinsic chemical potentials of the species \begin{equation} \label{chem_pot} \bar{\mu}_{\alpha}(\bold{r})=\mu_{\alpha}-q_{\alpha}\psi(\bold{r})+\frac{\gamma_{\alpha}(\nabla\psi(\bold{r}))^2}{2}+k_{B}T\ln\left[\frac{\sinh(\beta p_{\alpha}|\nabla \psi(\bold{r})|)}{\beta p_{\alpha}|\nabla \psi(\bold{r})|}\right]. \end{equation} Variation of the functional (\ref{Omega4}) with respect to the electrostatic potential, $\psi(\bold{r})$, with an account for eq. (\ref{chem_pot}) leads to the following self-consistent field equation \begin{equation} \label{scf_eq2} -\nabla\cdot(\epsilon(\bold{r})\nabla\psi(\bold{r}))=q_{+}\bar{c}_{+}(\bold{r})+q_{-}\bar{c}_{-}(\bold{r}), \end{equation} where \begin{equation} \label{eps} \epsilon(\bold{r})=\varepsilon_{b} + \sum\limits_{\alpha=\pm}\left(\gamma_{\alpha}+\frac{p_{\alpha}^2}{k_{B}T}\frac{L(\beta p_{\alpha}\mathcal{E}(\bold{r}))}{\beta p_{\alpha}\mathcal{E}(\bold{r})}\right)\bar{c}_{\alpha}(\bold{r}) \end{equation} is the effective permittivity of the medium, $\mathcal{E}(\bold{r})=|\nabla \psi(\bold{r})|$ is the electric field absolute value, $L(x)=\coth x-1/x$ is the Langevin function. We would like to mention that eqs. (\ref{scf_eq2}-\ref{eps}), in case of the symmetric lattice gas model, were used in ref. \cite{budkov2021theory} to model the ionic liquids with a polarizable/polar cation on a charged electrode. A similar theory was also used to model two-component electrolyte solution with strongly polar cations on charged electrode \cite{budkov2020two}. \subsection{Model III. Mean-field ion-dipole mixture models (solvent in salt models)} Now let us consider the case of an ionic fluid with an admixture of electrically neutral but polarizable molecules. This model can be used to describe room temperature ionic fluids and molten salts with an additive of polar solvents (solvent in salt) or electrolyte solutions with an admixture of highly polar molecules, such as amino acids. As above, we assume that the ions carry charges $q_{\pm}+e_{\pm}$ at the center and additional charges $-e_{\pm}$ at a fluctuating distance from it. The neutral molecules also have charge $e_{0}$ at the center and charge $-e_{0}$ placed at a fluctuating distance from the center. The probability distribution functions $g_{\alpha}(\bold{\xi})$ ($\alpha=\pm,0$) are the same averaged Gaussian functions (\ref{PDE}). The grand partition function, thus, can be written as follows \begin{equation} \label{GPF} \Xi=\sum\limits_{n_{+}=0}^{\infty}\sum\limits_{n_{-}=0}^{\infty}\sum\limits_{n_{0}=0}^{\infty}\frac{z_{+}^{n_{+}}z_{-}^{n_{-}}z_0^{n_0}}{n_{+}!n_{-}!n_{0}!}Q_{n_{+}n_{-}n_0} \end{equation} with the fugacities, $z_{\alpha}=\Lambda_{\alpha}^{-3}e^{\beta\mu_{\alpha}}\theta_{\alpha}$, ($\alpha=\pm,0$) of the ionic species and the configuration integrals \begin{equation} Q_{n_{+}n_{-}n_0}=\int d\Gamma_{n_{+}n_{-}n_0} \exp\left[-\beta U_{n_{+}n_{-}n_0}\right], \end{equation} \begin{multline} \int d\Gamma_{n_{+}n_{-}n_0}(\cdot)=\int..\int\prod\limits_{j=1}^{n_{+}}{d\bold{r}_{j}^{(+)}}d\bold{\xi}^{(+)}_{j}g_{+}\left(\bold{\xi}^{(+)}_{j}\right)\\\times\prod\limits_{k=1}^{n_{-}}{d\bold{r}_{k}^{(-)}}d\bold{\xi}^{(-)}_{k}g_{-}\left(\bold{\xi}^{(-)}_{k}\right)\prod\limits_{l=1}^{n_{0}}{d\bold{r}_{l}^{(0)}}d\bold{\xi}^{(0)}_{l}g_{0}\left(\bold{\xi}^{(0)}_{l}\right)(\cdot), \end{multline} where the total potential energy is determined by the same eq. (\ref{hamilt}). The total local charge density, in this case, can be written in the form \begin{equation} \hat{\rho}(\bold{r})=\hat{\rho}_{i}(\bold{r})+\hat{\rho}_{d}(\bold{r})+{\rho}_{ext}(\bold{r}), \end{equation} where $\hat{\rho}_{i}(\bold{r})$ is already defined above by eq. (\ref{rho_i}) and \begin{equation} \hat{\rho}_{d}(\bold{r})=\sum\limits_{j=1}^{N_{0}}e_{0}\left(\delta\left(\bold{r}-\bold{r}^{(0)}_j\right)-\delta\left(\bold{r}-\bold{r}^{(0)}_{j}-\bold{\xi}_{j}^{(0)}\right)\right) \end{equation} is the microscopic density of the bound charge of the molecules. Then, performing the same transformations as in Subsection A, we obtain \begin{equation} \Xi=\int \frac{\mathcal{D}\varphi}{C}e^{-\frac{\beta}{2}\left(\varphi G^{-1}\varphi\right)+i\beta(\rho_{ext}\varphi)}\Xi_{R}[\varphi], \end{equation} where we have introduced the reference grand partition function \begin{equation} \Xi_{R}=\int \frac{\mathcal{D}\Phi}{\mathcal{N}_{U}}\exp\left[-\frac{\beta}{2}\sum\limits_{\alpha\gamma}(\Phi_{\alpha}U^{-1}_{\alpha\gamma}\Phi_{\gamma})+W[\Phi;\chi]\right] \end{equation} with the functional \begin{equation} \label{W2} W[\Phi;\chi]=\sum\limits_{\alpha=\pm,0}\bar{z}_{\alpha}\int d\bold{r} e^{i\beta \Phi_{\alpha}+i\beta\chi_{\alpha}}, \end{equation} where \begin{equation} \chi_{\alpha}(\bold{r})=q_{\alpha}\varphi(\bold{r})+iu_{\alpha}(\bold{r})+k_{B}T\ln\left[\int d\bold{\xi}g_{\alpha}(\bold{\xi})e^{i\beta e_{\alpha}\left(\varphi(\bold{r})-\varphi(\bold{r}+\bold{\xi})\right)}\right],~\alpha=\pm \end{equation} \begin{equation} \chi_{0}(\bold{r})=iu_{0}(\bold{r})+k_{B}T\ln\left[\int d\bold{\xi}g_{0}(\bold{\xi})e^{i\beta e_{0}\left(\varphi(\bold{r})-\varphi(\bold{r}+\bold{\xi})\right)}\right]. \end{equation} After the same approximation, as in Subsection B, in the absence of external volume charge, we arrive at the following GTP \begin{equation} \label{Omega5} \Omega[\psi]=\int d\bold{r}\left(-\frac{\varepsilon_{b}(\nabla{\psi})^2}{2}-P(T,\bar{\mu}_{+},\bar{\mu}_{-},\bar{\mu}_{0})\right) \end{equation} and self-consistent field equation \begin{equation} -\nabla\cdot(\epsilon(\bold{r})\nabla\psi(\bold{r}))=q_{+}\bar{c}_{+}(\bold{r})+q_{-}\bar{c}_{-}(\bold{r}), \end{equation} where \begin{equation} \epsilon(\bold{r})=\varepsilon_{b} + \sum\limits_{\alpha=\pm,0}\left(\gamma_{\alpha}+\frac{p_{\alpha}^2}{k_{B}T}\frac{L(\beta p_{\alpha}\mathcal{E}(\bold{r}))}{\beta p_{\alpha}\mathcal{E}(\bold{r})}\right)\bar{c}_{\alpha}(\bold{r}) \end{equation} is the effective permittivity taking into account polarizability of the ions and molecules and \begin{equation} \label{chem_pot2} \bar{\mu}_{\alpha}(\bold{r})=\mu_{\alpha}-q_{\alpha}\psi(\bold{r})+\frac{\gamma_{\alpha}(\nabla\psi(\bold{r}))^2}{2}+k_{B}T\ln\left[\frac{\sinh(\beta p_{\alpha}|\nabla \psi(\bold{r})|)}{\beta p_{\alpha}|\nabla \psi(\bold{r})|}\right],~\alpha=\pm, \end{equation} \begin{equation} \label{chem_pot3} \bar{\mu}_{0}(\bold{r})=\mu_{0}+\frac{\gamma_{0}(\nabla\psi(\bold{r}))^2}{2}+k_{B}T\ln\left[\frac{\sinh(\beta p_{0}|\nabla \psi(\bold{r})|)}{\beta p_{0}|\nabla \psi(\bold{r})|}\right] \end{equation} are the intrinsic chemical potentials, where $p_0=e_0|\bold{s}_0|$ and $\gamma_0=\beta\sigma_0^2e_0^2$ are the permanent dipole moment and static polarizability of the molecules, respectively. The local concentrations of the species are \begin{equation} \bar{c}_{\alpha}(\bold{r})=\frac{\partial{P}}{\partial{\bar{\mu}_{\alpha}(\bold{r})}}=c_{\alpha}\left(T,\bar{\mu}_{+}(\bold{r}),\bar{\mu}_{-}(\bold{r}),\bar{\mu}_{0}(\bold{r})\right),~\alpha=\pm,0. \end{equation} We would like to note that in case when $\gamma_{\pm}=\gamma_{0}=p_{\pm}=0$ and $p_{0}=p\neq 0$ and \begin{equation} P(T,\bar{\mu}_{+},\bar{\mu}_{-},\bar{\mu}_{0})=\frac{k_{B}T}{\Lambda_{+}^3}e^{\beta\bar{\mu}_{+}}+\frac{k_{B}T}{\Lambda_{-}^3}e^{\beta\bar{\mu}_{-}}+\frac{k_{B}T}{\Lambda_{0}^3}e^{\beta\bar{\mu}_{0}}, \end{equation} we obtain the well-known Poisson-Boltzmann-Langevin (PBL) equation \cite{abrashkin2007dipolar,coalson1996statistical} \begin{equation} \label{PBL_eq} -\nabla\cdot(\epsilon(\bold{r})\nabla\psi(\bold{r}))=q_{+}c_{+,b}e^{-\beta q_{+}\psi(\bold{r})}+q_{-}c_{-,b}e^{-\beta q_{-}\psi(\bold{r})}, \end{equation} where \begin{equation} \epsilon(\bold{r})=\varepsilon_{b} + \frac{c_{0,b} p^2}{k_{B}T} \mathcal{G}(\beta p\mathcal{E}(\bold{r})), \end{equation} $\mathcal{G}(x)=\sinh x L(x)/x^2$, $c_{0,b}$ is the bulk concentration of the molecules. Note that we took into consideration the relations for bulk chemical potentials $\mu_{\pm}=k_{B}T\ln(c_{\pm,b}\Lambda_{\pm}^3)$, $\mu_{0}=k_{B}T\ln(c_{0,b}\Lambda_{0}^3)$. To take into account the excluded volume of the ions and molecules, we can use a three-component hard-sphere system as the reference system in the Percus-Yevick approximation determined by eqs. (\ref{PY}-\ref{mu}), where $n_0 = \bar{c}_{+} + \bar{c}_{-} + \bar{c}_{0}$, $n_1 = 1/2 ~ d_+ \bar{c}_{+} + 1/2 ~ d_- \bar{c}_{-}+1/2 ~ d_0 \bar{c}_{0}$, $n_2 = \pi~d_+^2 \bar{c}_{+} +\pi ~ d_-^2 \bar{c}_{-}+\pi ~ d_0^2 \bar{c}_{0}$, $n_3 = \pi/6 ~ d_+^3 \bar{c}_{+} + \pi/6 ~ d_-^3 \bar{c}_{-}+\pi/6 ~ d_0^3 \bar{c}_{0}$ ($d_0$ is the effective diameter of molecules). \section{Stress tensor and macroscopic forces in ionic fluids} As it has been shown above, the GTP of an ionic fluid for all considered models in the mean-field approximation can be written as follows \begin{equation} \label{omega2} \Omega=\int d\bold{r}\omega(\psi,\nabla\psi), \end{equation} where we have introduced the GTP density \begin{equation} \omega=-\frac{\varepsilon_{b}(\nabla{\psi})^2}{2}-P. \end{equation} We assume that the dependence of the GTP density on coordinates stems only from the electrostatic potential $\psi(\bold{r})$, so that for simplicity we consider the case $u_{\pm}(\bold{r})=0$. The case $u_{\pm}(\bold{r})\neq 0$ will be considered below. Variation of the GTP leads to self-consistent field equation (\ref{Poisson_eq_3}), which can be written as follows \begin{equation} \label{scf_eq} \frac{\partial}{\partial x_{i}}\left(\frac{\partial\omega}{\partial\psi_{,i}}\right)-\frac{\partial\omega}{\partial\psi}=0, \end{equation} where $x_{i}$ are the Cartesian coordinates and $\psi_{,i}=\partial{\psi}/\partial{x}_{i}$. Note that we use the Einstein rule, implying the summation over repeated indices. Then, with using eq. (\ref{scf_eq}), we get \begin{equation} \frac{\partial\omega}{\partial x_{i}}=\frac{\partial}{\partial x_{k}}\left(\frac{\partial\omega}{\partial\psi_{,k}}\right)\psi_{,i}+\left(\frac{\partial\omega}{\partial\psi_{,k}}\right)\frac{\partial \psi_{,k}}{\partial x_{i}}=\frac{\partial}{\partial x_{k}}\left(\psi_{,i}\frac{\partial{\omega}}{\partial{\psi_{,k}}}\right) \end{equation} or \begin{equation} \label{equil_cond} \frac{\partial \sigma_{ik}}{\partial{x_{k}}}=0, \end{equation} where \begin{equation} \label{sigma} \sigma_{ik}=\delta_{ik}\omega-\psi_{,i}\frac{\partial{\omega}}{\partial{\psi_{,k}}}. \end{equation} Eq. (\ref{equil_cond}) determines the local mechanical equilibrium condition for the ionic fluid with stress tensor, $\sigma_{ik}$. For model I, eq.(\ref{sigma}) yields \begin{equation} \label{stress1} \sigma_{ik}=\varepsilon_{b}\left(\mathcal{E}_{i}\mathcal{E}_{k}-\frac{1}{2}\mathcal{E}^2\delta_{ik}\right)-\delta_{ik}P_{0}, \end{equation} where the first term is the standard Maxwell stress tensor \cite{landau2013electrodynamics} in continuous dielectric media with the electrostatic field components $\mathcal{E}_{i}=-\psi_{,i}$, whereas the second term is the stress tensor of an ionic fluid with the local osmotic pressure $P_{0}(\bold{r})=P(T,\bar{\mu}_{+}(\bold{r}),\bar{\mu}_{-}(\bold{r}))$, $\delta_{ik}$ is the unit tensor (Kronecker symbol). For model II, based on the GTP (\ref{Omega4}) and intrinsic chemical potentials (\ref{chem_pot}), we obtain the stress tensor with an account for the polarizabilities and permanent dipole moments of the ions. Using eq. (\ref{sigma}), we obtain the expression for the stress tensor \begin{equation} \label{stress2} \sigma_{ik}=\epsilon \mathcal{E}_{i}\mathcal{E}_{k}-\delta_{ik}\left(P_{0}+\frac{\varepsilon_{b}\mathcal{E}^2}{2}\right). \end{equation} Note that in the case of unpolarizable ions ($p_{\pm}=\gamma_{\pm}=0$, $\epsilon=\varepsilon_b$), eq. (\ref{stress2}) transforms into eq. (\ref{stress1}). For model III, using eq. (\ref{sigma}) and taking into account eqs. (\ref{Omega5}), (\ref{chem_pot2}), and (\ref{chem_pot3}), we arrive at the same expression (\ref{stress2}) for the stress tensor with $P_{0}(\bold{r})=P(T,\bar{\mu}_{+}(\bold{r}),\bar{\mu}_{-}(\bold{r}),\bar{\mu}_{0}(\bold{r}))$. We would like to note that the same approach was used in \cite{landau2013classical} to express the energy-momentum tensor of an arbitrary physical system through its Lagrangian (Noether's theorem~\cite{bogolyubov1973introduction}). Note that even if we cannot obtain the GTP density from the first principles, we still can utilise eq. (\ref{sigma}) to formulate the stress tensor. However, it would require {\it ad hoc} assumptions regarding the GTP functional dependence on the electrostatic potential and field. Now let us consider the case when ions are under the influence of external potential forces with total potential energies $u_{\pm}(\bold{r})$. For example, these can be van der Waals or specific interactions between the ions and the charged surfaces (electrodes or membranes, for instance). In this case, the GTP density depends explicitly on the coordinates via the aforementioned potential energies. Analogous calculations result in the following equation \begin{equation} \label{equil_cond_2} \frac{\partial \sigma_{ik}}{\partial{x_{k}}}-\sum\limits_{\alpha}\bar{c}_{\alpha}\frac{\partial u_{\alpha}}{\partial x_{i}}=0, \end{equation} which determines the mechanical equilibrium condition of the ionic fluid in the presence of external volume forces. Knowledge of the stress tensor allows us to calculate the macroscopic force acting on a conductive (electrode) or dielectric (a membrane or a colloid particle) body immersed in an ionic fluid. It can be calculated as the following integral over the surface of an immersed body \begin{equation} \label{force} F_{i}= \oint\limits_{S} \sigma_{ik}n_{k} dS, \end{equation} where $n_k$ are the components of the external normal and $dS$ is the elementary area. Note that in the absence of volume nonelectrostatic forces ($u_{\pm}(\bold{r})=0$), the integration in eq. (\ref{force}) can be performed over any closed surface around a macroscopic body because the ionic fluid is in mechanical equilibrium~\cite{landau2013electrodynamics}. In the presence of nonelectrostatic volume forces, as it follows from the mechanical equilibrium, the macroscopic force can be calculated as follows \begin{equation} \label{force2} F_{i}=\oint\limits_{S} \sigma_{ik}n_{k} dS +\int\limits_{V} f_{i}dV, \end{equation} where the first integral is taken over an arbitrary closed surface $S$ around the macroscopic body, whereas the second integral -- over the volume between surface $S$ and the surface of the macroscopic body; $f_{i}=-\sum_{\alpha}\bar{c}_{\alpha}{\partial u_{\alpha}}/{\partial x_{i}}$ are the components of the total nonelectrostatic volume density force. In order to calculate the macroscopic force by eq. (\ref{force}) or (\ref{force2}), it is necessary to solve self-consistent field equation (\ref{Poisson}) with appropriate boundary conditions \footnote{The boundary conditions are determined by the nature of immersed body. The boundary conditions for dielectric or conductive body are standard~\cite{landau2013electrodynamics}. The boundary conditions for surfaces with regulated charge are proposed were~\cite{podgornik2018general}.} to obtain the local osmotic pressure, $P_{0}(\bold{r})$, and local ionic concentrations, $\bar{c}_{\alpha}(\bold{r})$, of the ions and the electrostatic field on the body surface and around it. We would like to note that similar theories based on {\it ad hoc} assumptions were applied in \cite{neu1999wall,trizac1999long,filippov2006electrostatic} to describe the electrostatic interactions between charged particles in ionic fluid within the ideal gas and symmetric lattice gas models. We applied our theory to describe the electrosorption-iduced deformation of electrified porous carbon with nonconvex pores in electrolyte solutions~\cite{kolesnikov2022}. Now it is instructive to discuss how the general mean-field approximation of disjoining pressure for an ionic liquid in a slit nanopore can be derived. Placing the origin of $z$ axis on one charged wall and another one at $z=H$, we can calculate the disjoining pressure~\cite{derjaguin1987derjaguin} as follows \begin{equation} \Pi=-\frac{\partial\Omega}{\partial H}-P_b, \end{equation} where $P_{b}=P(T,\mu_+,\mu_-,\mu_0)$ is the ionic fluid pressure in the bulk. Then, we have \begin{equation} \nonumber \frac{\partial\Omega}{\partial H}=\int\limits_{0}^{H} dz\frac{\delta\Omega}{\delta\psi(z)}\frac{\partial\psi(z)}{\partial H}+\omega-\psi^{\prime}\frac{\partial\omega}{\partial\psi^{\prime}}\bigg|_{z=H}- \int\limits_{0}^{H}dz\sum\limits_{\alpha}\frac{\partial P}{\partial u_{\alpha}}\frac{\partial u_{\alpha}}{\partial H} \end{equation} \begin{equation} = \int\limits_{0}^{H}dz\sum\limits_{\alpha}\bar{c}_{\alpha}(z)\frac{\partial u_{\alpha}(z)}{\partial H}+\sigma_{zz}(H), \end{equation} where we took into account that ${\partial P}/{\partial u_{\alpha}}=-{\partial P}/{\partial \bar{\mu}_{\alpha}}=-\bar{c}_{\alpha}$. Therefore, we eventually obtain the general expression for disjoining pressure \begin{equation} \Pi=-\sum\limits_{\alpha}\int\limits_{0}^{H}dz\bar{c}_{\alpha}(z)\frac{\partial u_{\alpha}(z)}{\partial H}-\sigma_{zz}(H)-P_b, \end{equation} where $\sigma_{zz}(H)=\omega-\psi^{\prime}{\partial\omega}/{\partial\psi^{\prime}}|_{z=H}={\varepsilon_b\mathcal{E}^2(H)}/{2}-P_0(H)$ is the normal stress at $z=H$. Now let us assume that external potentials are created by identical walls, i.e. \begin{equation} \label{u} u_{\alpha}(z)=\phi_{\alpha}(z)+\phi_{\alpha}(H-z), \end{equation} where $\phi_{\alpha}$ is the single wall potential, and taking into account that $\bar{c}_{\alpha}(z)=\bar{c}_{\alpha}(H-z)$, we arrive at \begin{equation} \label{Pi} \Pi=-\sum\limits_{\alpha}\int\limits_{0}^{H}dz\bar{c}_{\alpha}(z)\phi_{\alpha}^{\prime}(z)-\sigma_{zz}(H)-P_b. \end{equation} Eq. (\ref{Pi}) can be rewritten in a form that is more suitable for applications. Using the mechanical equilibrium equation \begin{equation} \frac{d\sigma_{zz}}{dz}-\sum\limits_{\alpha}\bar{c}_{\alpha}(z)u_{\alpha}^{\prime}(z)=0, \end{equation} after the integration from $z=H/2$ to $z=H$ we obtain \begin{equation} \label{sigmazz} \sigma_{zz}(H)=\sigma_{zz}\left(\frac{H}{2}\right)+\sum\limits_{\alpha}\int\limits_{H/2}^{H}dz\bar{c}_{\alpha}(z)\phi_{\alpha}^{\prime}(z)-\sum\limits_{\alpha}\int\limits_{0}^{H/2}dz\bar{c}_{\alpha}(z)\phi_{\alpha}^{\prime}(z), \end{equation} where we have taken into account eq. (\ref{u}) and condition $\bar{c}_{\alpha}(z)=\bar{c}_{\alpha}(H-z)$. Substituting expression (\ref{sigmazz}) for $\sigma_{zz}(H)$ in eq.(\ref{Pi}), after some algebra, we obtain \begin{equation} \label{Pi2} \Pi=P_{m}-P_{b}-2\sum\limits_{\alpha}\int\limits_{H/2}^{H}dz\bar{c}_{\alpha}(z)\phi_{\alpha}^{\prime}(z), \end{equation} where $P_{m}=P_{0}\left({H}/{2}\right)$ is the pressure in the middle of a pore and we take into account that $\mathcal{E}(H/2)=0$. Note that a similar expression for disjoining pressure for simple (nonionic) fluids was obtained by Henderson in Ref.\cite{henderson1986compressibility} within a different approach. For negligible volume forces ($\phi_{\alpha}(z)=0$), we obtain the Langmuir equation~\cite{derjaguin1987derjaguin}, $\Pi=P_m - P_b$, for disjoining pressure. Eq. (\ref{Pi2}) is a generalization of the classical DLVO expression for disjoining pressure for the case of an arbitrary reference fluid model in the presence of external volume forces. \section{Concluding remarks} In conclusion, we proposed a field-theoretical approach based on the thermodynamic perturbation theory allowing us to derive the grand thermodynamic potential of the inhomogeneous ionic fluid as a functional of electrostatic potential for an arbitrary reference system. We obtained the modified Poisson-Boltzmann equation as the Euler-Lagrange equation for the grand thermodynamic potential. Using Noether's theorem, we derived a general mean-field expression for the stress tensor consistent with the respective modified Poisson-Boltzmann equation. We derived a general mean-field expression for the disjoining pressure of an ionic fluid in a slit pore. We applied the developed formalism to describe three ionic liquid models of practical importance: nonpolarizable models (including the Poisson-Boltzmann and Poisson-Fermi equations), polarizable models (the ions have nonzero permanent dipole moment or static polarizability), and ion-dipole mixtures (mixture of polar/polarizable ions and polar/polarizable molecules). For all these models, we derived modified Poisson-Boltzmann equations and respective stress tensors, which can be used in different applications, where it is necessary to estimate the electrostatic potential and ionic concentrations around dielectric or conductive bodies (electrodes, colloids, membranes, dust particles, {\it etc}.) immersed in an ionic fluid, as well as the macroscopic forces acting on them. \section*{Acknowledgments} The development of the self-consistent field theories presented in section 2 is supported by the Russian Science Foundation (No. 21-11-00031). Theory presented in section 3 is supported by grant of the President of the Russian Federation (project No. MD-341.2021.1.3).
9ee513a261e52003508442983c0db0f6e9adb660
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section*{Introduction} The explosion of available biological sequence data has led to multiple computational approaches aiming to infer three-dimensional structure, biological function, fitness, and evolutionary history of proteins from sequence data~\cite{deJuan13,Cocco18}. Recently, self-supervised deep learning models based on natural language processing methods, especially attention~\cite{Bahdanau14} and transformers~\cite{Vaswani17}, have been trained on large ensembles of protein sequences by means of the masked language modeling objective of filling in masked amino acids in a sequence, given the surrounding ones \cite{ElnaggarPreprint,Rives21,rao2021transformer,Choromanski20,Madani20,Madani21}. These models, which capture long-range dependencies, learn rich representations of protein sequences, and can be employed for multiple tasks. In particular, they can predict structural contacts from single sequences in an unsupervised way~\cite{rao2021transformer}, presumably by transferring knowledge from their large training set~\cite{Bhattacharya22}. Neural network architectures based on attention are also employed in the Evoformer blocks in AlphaFold~\cite{Jumper21}, as well as in RoseTTAFold~\cite{Baek21} and RGN2~\cite{Chowdhury21}, and they contributed to the recent breakthrough in the supervised prediction of protein structure. Protein sequences can be classified in families of homologous proteins, that descend from an ancestral protein and share a similar structure and function. Analyzing multiple sequence alignments (MSAs) of homologous proteins thus provides substantial information about functional and structural constraints~\cite{deJuan13}. The statistics of MSA columns, representing amino-acid sites, allow to identify functional residues that are conserved during evolution, and correlations of amino-acid usage between columns contain key information about functional sectors and structural contacts~\cite{Casari95,Socolich05,Dunn08,Halabi09}. Indeed, through the course of evolution, contacting amino acids need to maintain their physico-chemical complementarity, which leads to correlated amino-acid usages at these sites: this is known as coevolution. Potts models, also known as Direct Coupling Analysis (DCA), are pairwise maximum entropy models trained to match the empirical one- and two-body frequencies of amino acids observed in the columns of an MSA of homologous proteins~\cite{Lapedes99,Weigt09,Marks11,Morcos11,Sulkowska12,Ekeberg13,Ekeberg14,Figliuzzi18,Cocco18}. They capture the coevolution of contacting amino acids, and they provided state-of-the-art unsupervised predictions of structural contacts before the advent of protein language models. Note that coevolutionary signal also aids supervised contact prediction~\cite{Abriata18}. While most protein language neural networks take individual amino-acid sequences as inputs, some others have been trained to perform inference from MSAs of evolutionarily related sequences. This second class of networks includes MSA Transformer~\cite{rao2021msa} and the Evoformer blocks in AlphaFold~\cite{Jumper21}, both of which interleave row (i.e.\ per-sequence) attention with column (i.e.\ per-site) attention. Such an architecture is conceptually extremely attractive because it can incorporate coevolution in the framework of deep learning models using attention. In the case of MSA Transformer, simple combinations of the model's row attention heads have led to state-of-the-art unsupervised structural contact predictions, outperforming both language models trained on individual sequences and Potts models~\cite{rao2021msa}. Beyond structure prediction, MSA Transformer is also able to predict mutational effects~\cite{meier2021language,hie2022evolutionary} and to capture fitness landscapes~\cite{HawkinsPreprint}. In addition to coevolutionary signal caused by structural and functional constraints, MSAs feature correlations that directly stem from the common ancestry of homologous proteins, i.e.\ from phylogeny. Does MSA Transformer learn to identify phylogenetic relationships between sequences, which are a key aspect of the MSA data structure? Here, we show that simple, and universal, combinations of MSA Transformer's column attention heads, computed on a given MSA, strongly correlate with the Hamming distances between sequences in that MSA. This demonstrates that MSA Transformer encodes detailed phylogenetic relationships. Is MSA Transformer able to separate coevolutionary signals encoding functional and structural constraints from phylogenetic correlations arising from historical contingency? To address this question, we generate controlled synthetic MSAs from Potts models trained on natural MSAs, either without or with phylogeny. For this, we perform Metropolis Monte Carlo sampling under the Potts Hamiltonians, either at equilibrium or along phylogenetic trees inferred from the natural MSAs. Using the top Potts model couplings as proxies for structural contacts, we demonstrate that unsupervised contact prediction via MSA Transformer is substantially more resilient to phylogenetic noise than contact prediction using inferred Potts models. \section*{Results} \subsection*{Column attention heads capture Hamming distances in separate MSAs} \label{subsec:results_separate_hamming} We first considered separately each of 15 different Pfam seed MSAs (see \qnameref{subsec:datasets} and \cref{tab:MSA}), corresponding to distinct protein families, and asked whether MSA Transformer has learned to encode phylogenetic relationships between sequences in its attention layers. To test this, we split each MSA randomly into a training and a test set, and train a logistic model [\cref{eq:logistic_model_defn,eq:logistic_model_loss}] based on the column-wise means of MSA Transformer's column attention heads on all pairwise Hamming distances in the training set -- see \cref{fig:msa_transformer_and_hamming_regr_schematics} for a schematic, and \qnameref{subsec:methods_supervised_hamming} for details. \cref{fig:mean_cols_regr_results} shows the results of fitting these specialized logistic models. \begin{figure}[htbp] \centering \includegraphics{MSA_Transformer_regression_schematic_v3} \caption{\textbf{MSA Transformer: column attentions and Hamming distances.} \textbf{(a)} MSA Transformer is trained using the masked language modeling objective of filling in randomly masked residue positions in MSAs. For each residue position in an input MSA, it assigns attention scores to all residue positions in the same row (sequence) and column (site) in the MSA. These computations are performed by 12 independent row/column attention heads in each of 12 successive layers of the network. \textbf{(b)} Our approach for Hamming distance matrix prediction from the column attentions computed by the trained MSA Transformer model, using a natural MSA as input. For each $i = 1, \ldots, M$, $j = 0, \ldots, L$ and $l = 1, \ldots, 12$, the embedding vector $x_{ij}^{(l)}$ is the $i$-th row of the matrix $X_{j}^{(l)}$ defined in the main text, and the column attentions are computed according to \cref{eq:query_key_values,eq:col_attn}.} \label{fig:msa_transformer_and_hamming_regr_schematics} \end{figure} For all alignments considered, large regression coefficients concentrate in early layers in the network, and single out some specific heads consistently across different MSAs -- see \cref{subfig:mean_cols_regr_plots}, first and second columns, for results on four example MSAs. These logistic models reproduce the Hamming distances in the training set very well, and successfully predict those in the test set -- see \cref{subfig:mean_cols_regr_plots}, third and fourth columns, for results on four example MSAs. Note that the block structures visible in the Hamming distance matrices, and well reproduced by our models, come from the phylogenetic ordering of sequences in our seed MSAs, see \qnameref{subsec:datasets}. Quantitatively, in all the MSAs studied, the coefficients of determination ($R^2$) computed on the test sets are above $0.84$ in all our MSAs -- see \cref{subfig:mean_cols_regr_table}. A striking result from our analysis is that the regression coefficients appear to be similar across MSAs -- see \cref{subfig:mean_cols_regr_plots}, first column. To quantify this, we computed the Pearson correlations between the regression coefficients learnt on the larger seed MSAs. \cref{fig:mean_cols_regr_coeffs_pearson_corr} demonstrates that regression coefficients are indeed highly correlated across these MSAs. \begin{figure}[htbp] \centering \begin{subfigure}[h]{0.73\textwidth} \centering \includegraphics[width=\textwidth]{mean_cols_regr_results_shifted_idx} \caption{\label{subfig:mean_cols_regr_plots}} \end{subfigure} \hfill \begin{subfigure}[h]{0.25\textwidth} \centering \begin{tabular}{ll} \toprule \multicolumn{1}{c}{Family} & \multicolumn{1}{c}{$R^2$} \\ \midrule PF00004 & 0.97 \\ PF00005 & 0.99 \\ PF00041 & 0.98 \\ PF00072 & 0.99 \\ PF00076 & 0.98 \\ PF00096 & 0.94 \\ PF00153 & 0.95 \\ PF00271 & 0.94 \\ PF00397 & 0.84 \\ PF00512 & 0.94 \\ PF00595 & 0.98 \\ PF01535 & 0.86 \\ PF02518 & 0.92 \\ PF07679 & 0.99 \\ PF13354 & 0.99 \\ \bottomrule \end{tabular} \caption{\label{subfig:mean_cols_regr_table}} \end{subfigure} \caption{\textbf{Fitting logistic models to predict Hamming distances separately in each MSA.} The column-wise means of MSA Transformer's column attention heads are used to predict normalised Hamming distances as probabilities in a logistic model. Each MSA is randomly split into a training set comprising $70\%$ of its sequences and a test set composed of the remaining sequences. For each MSA, a logistic model is trained on all pairwise distances in the training set. \subref{subfig:mean_cols_regr_plots} Regression coefficients are shown for each layer and attention head (first column), as well as their absolute values averaged over heads for each layer (second column). For four example MSAs, ground truth Hamming distances are shown in the upper triangle (blue) and predicted Hamming distances in the lower triangle and diagonal (green), for the training and test sets (third and fourth columns). Darker shades correspond to larger Hamming distances. \subref{subfig:mean_cols_regr_table} $R^2$ coefficients of determination for the predictions by each fitted model on its respective test set.} \label{fig:mean_cols_regr_results} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.3\textwidth]{mean_cols_regr_coeffs_pearson_corr} \caption{\textbf{Pearson correlations between regression coefficients in larger MSAs.} Sufficiently deep ($\geq 100$ sequences) and long ($\geq 30$ residues) MSAs are considered (mean/min/max Pearson correlations: $0.80$/$0.69$/$0.87$).} \label{fig:mean_cols_regr_coeffs_pearson_corr} \end{figure} \clearpage \subsection*{MSA Transformer learns a universal representation of Hamming distances} \label{subsec:results_common_hamming} Given the substantial similarities between our models trained separately on different MSAs, we next asked whether a common model across MSAs could capture Hamming distances within generic MSAs. To address this question, we trained a single logistic model, based on the column-wise means of MSA Transformer’s column attention heads, on all pairwise distances within each of the first 12 of our seed MSAs. We assessed its ability to predict Hamming distances in the remaining 3 seed MSAs, which thus correspond to entirely different Pfam families from those in the training set. \cref{fig:mean_cols_regr_results_many_msas} shows the coefficients of this regression (first and second panels), as well as comparisons between predictions and ground truth values for the Hamming distances within the three test MSAs (last three panels). We observe that large regression coefficients again concentrate in the early layers of the model, but somewhat less than in individual models. Furthermore, the common model captures well the main features of the Hamming distance matrices in test MSAs. \begin{figure}[htbp] \centering \includegraphics[width=\textwidth]{mean_cols_regr_results_many_msas_shifted_idx_v2} \caption{\textbf{Fitting a single logistic model to predict Hamming distances.} Our collection of $15$ MSAs is split into a training set comprising $12$ of them and a test set composed of the remaining $3$. A logistic regression is trained on all pairwise distances within each MSA in the training set. Regression coefficients (first panel) and their absolute values averaged over heads for each layer (second panel) are shown as in \cref{fig:mean_cols_regr_results}. For the three test MSAs, ground truth Hamming distances are shown in the upper triangle (blue) and predicted Hamming distances in the lower triangle and diagonal (green), also as in \cref{fig:mean_cols_regr_results} (last three panels). We further report the $R^2$ coefficients of determination for the regressions on these test MSAs -- see also \cref{tab:mean_cols_regr_results_many_msas_fit_quality}.} \label{fig:mean_cols_regr_results_many_msas} \end{figure} In \cref{tab:mean_cols_regr_results_many_msas_fit_quality}, we quantify the quality of fit for this model on all our MSAs. In all cases, we find very high Pearson correlation between the predicted distances and the ground truth Hamming distances. Furthermore, the median value of the $R^2$ coefficient of determination is 0.6, confirming the good quality of fit. In the three shortest and the two shallowest MSAs, the model performs below this median, while all MSAs for which $R^2$ is above median satisfy $M \geq 52$ and $L \geq 67$. We also compute, for each MSA, the slope of the linear fit when regressing the ground truth Hamming distances on the distances predicted by the model. MSA depth is highly correlated with the value of this slope (Pearson $r \approx 0.95$). This bias may be explained by the under-representation in the training set of Hamming distances and attention values from shallower MSAs, as their number is quadratic in MSA depth. Ref.~\cite{rao2021msa} showed that some column attention matrices, summed along one of their dimensions, correlate with phylogenetic sequence weights (see \qnameref{subsec:methods_supervised_hamming}). This indicates that the model is, in part, attending to maximally diverse sequences. Our study demonstrates that MSA Transformer actually learns pairwise phylogenetic relationships between sequences, beyond these aggregate phylogenetic sequence weights. It also suggests an additional mechanism by which the model may be attending to these relationships, focusing on similarity instead of diversity. Indeed, while our regression coefficients with positive sign in \cref{fig:mean_cols_regr_results_many_msas} are associated with (average) attentions that are positively correlated with the Hamming distances, we also find several coefficients with large negative values. They indicate the existence of important negative correlations: in those heads, the model is actually attending to pairs of similar sequences. Besides, comparing our \cref{subfig:mean_cols_regr_plots,fig:mean_cols_regr_results_many_msas} with Fig.~5 in Ref.~\cite{rao2021msa} shows that different attention heads are important in our study versus in the analysis of Ref.~\cite[Sec.\ 5.1]{rao2021msa}. Specifically, here we find that the fifth attention head in the first layer in the network is associated with the largest positive regression coefficient, while the sixth one was most important there. Moreover, still focusing on the first layer of the network, the other most prominent heads here were not significant there. MSA Transformer's ability to focus on similarity may also explain why its performance at predicting mutational effects can decrease significantly when using MSAs which include a duplicate of the query sequence~\cite[Supplementary Fig.~9 and Table~10]{meier2021language}: in these cases, the model predicts masked tokens with very high confidence using information from the duplicate sequence. How much does the ability of MSA Transformer to capture phylogenetic relationships arise from its training? To address this question, we trained a common logistic model as above to predict Hamming distances, but using column attention values computed from a randomly re-initialized version of the MSA Transformer network. We used the same protocol as in MSA Transformer's original pre-training to randomly initialize the entries of the network's row- and column-attention weight matrices $W_\mathrm{\mathrm{Q}}^{(l, h)}$, $W_\mathrm{\mathrm{K}}^{(l, h)}$ and $W_\mathrm{\mathrm{V}}^{(l, h)}$ (see \qnameref{subsec:MSA-Tr_attn}), as well as the entries of the matrix used to embed input tokens, the weights in the feed-forward layers, and the positional encodings. Specifically, we sampled these entries (with the exception of bias terms and of the embedding vector for the padding token, which were set to zero) from a Gaussian distribution with mean $0$ and standard deviation $0.02$. The results obtained in this case for our regression task are reported in \cref{tab:mean_cols_regr_results_many_msas_random_init_fit_quality}. They demonstrate that, although random initialization can yield better performance than random guessing (which may partly be explained by Gordon's Theorem \cite{gordon1988milman}), the trained MSA Transformer gives vastly superior results. This confirms that the masked language modeling pre-training has driven it towards precisely encoding distances between sequences. For each layer and attention head in the network, MSA Transformer computes one matrix of column attention values per site -- see \cref{eq:A^lh}. This is in contrast with row attention, which is tied (see \qnameref{subsec:MSA-Tr_attn}). Our results are more surprising that they would be if the model's column attentions were also tied. Indeed, during pre-training, by tuning its row-attention weight matrices to achieve optimal tied attention, MSA Transformer discovers covariance between MSA sites in early layers, and covariance between MSA sequences is related to Hamming distance. Finally, to explore the contribution of each column to performance in our regression task, we employed our common logistic model (trained on the means of column attention matrices) to predict Hamming distances using column attentions from individual sites. We find that the most highly conserved sites (corresponding to columns with low entropy) lead to predictions whose errors have among the smallest standard deviations -- see \cref{tab:low_entropy_table}. Note that we focused on standard deviations to mitigate the biases of the common logistic model (see above). This indicates that highly conserved sites lead to more stable predictions. \subsection*{MSA Transformer efficiently disentangles correlations from contacts and phylogeny} MSA Transformer is known to capture three-dimensional contacts through its (tied) row attention heads~\cite{rao2021msa}, and we have shown that it also captures Hamming distances, and thus phylogeny, through its column attention heads. Correlations observed between the columns of an MSA can arise both from coevolution due to functional constraints and from phylogeny (see \cref{fig:coevolution_potts_phylogeny}). How efficiently does MSA transformer disentangle correlations from contacts and phylogeny? We address this question in the concrete case of structure prediction. Because correlations from contacts and phylogeny are always both present in natural data, we constructed controlled synthetic data by sampling from Potts models (\cref{fig:coevolution_potts_phylogeny}(b)), either independently at equilibrium, or along a phylogenetic tree inferred from the natural MSA using FastTree \cite{Price10}. The Potts models we used were trained on each of 15 full natural MSAs (see \qnameref{subsec:datasets} and \cref{tab:MSA}) using the generative method bmDCA~\cite{Figliuzzi18,Russ20} -- see \qnameref{subsec:methods_phylogeny}. This setup allows us to compare data where all correlations come from couplings (pure Potts model) to data that comprises phylogenetic correlations on top of these couplings. For simplicity, let us call ``contacts'' the top scoring pairs of amino-acid sites according to the bmDCA models used to generate our MSAs, and refer to the task of inferring these top scoring pairs as ``contact prediction''. \begin{figure}[htbp] \centering \includegraphics{coevolution_potts_phylogeny_schematic_v2} \caption{\textbf{Correlations from coevolution and from phylogeny in MSAs.} \textbf{(a)} Natural selection on structure and function leads to correlations between residue positions in MSAs (coevolution). \textbf{(b)} Potts models, also known as DCA, aim to capture these correlations in their pairwise couplings. \textbf{(c)} Historical contingency can lead to correlations even in the absence of structural or functional constraints. } \label{fig:coevolution_potts_phylogeny} \end{figure} Contact maps inferred by plmDCA~\cite{Ekeberg13,Ekeberg14} and by MSA Transformer for our synthetic datasets are shown in \cref{fig:contact_prediction_phylo}. For datasets generated with phylogeny, more false positives, scattered across the whole contact maps, appear in the inference by plmDCA than in that by MSA Transformer. This is shown quantitatively in \cref{tab:AUC}, which reports the area under the receiver operating characteristic curve (ROC-AUC) for contact prediction for two different cutoffs on the number of contacts. We also quantify the degradation in performance caused by phylogeny by computing the relative drop $\Delta$ in ROC-AUC due to the injection of phylogeny in our generative process, for each Pfam family and for both plmDCA and MSA Transformer. On average, $\Delta$ is twice or three times (depending on the cutoff) higher for plmDCA than for MSA Transformer. We checked that these outcomes are robust to changes in the strategy used to compute plmDCA scores. In particular, the average $\Delta$ for plmDCA becomes even larger when we average scores coming from independent models fitted on the $10$ subsampled MSAs used for MSA Transformer -- thus using the exact same method as for predicting contacts with MSA Transformer (see \qnameref{par:methods_generation_phylogeny}). The conclusion is the same if $10$ (or $6$, for Pfam family PF13354) twice-deeper subsampled MSAs are employed. \begin{table}[htb] \centering \begin{tabular}{@{}llllclllclllclll@{}} \toprule & \multicolumn{7}{c}{ROC-AUC for $N$ contacts} &\vphantom{}& \multicolumn{7}{c}{ROC-AUC for $2L$ contacts} \\ \cmidrule{2-8} \cmidrule{10-16} & \multicolumn{3}{c}{plmDCA} &\vphantom{}& \multicolumn{3}{c}{MSA Trans.} && \multicolumn{3}{c}{plmDCA} &\vphantom{}& \multicolumn{3}{c}{MSA Trans.} \\ \cmidrule{2-4} \cmidrule{6-8} \cmidrule{10-12} \cmidrule{14-16} \multicolumn{1}{c}{Pfam ID} & \multicolumn{1}{c}{Eq.} & \multicolumn{1}{c}{Tree} & \multicolumn{1}{c}{$\Delta$} && \multicolumn{1}{c}{Eq.} & \multicolumn{1}{c}{Tree} & \multicolumn{1}{c}{$\Delta$} && \multicolumn{1}{c}{Eq.} & \multicolumn{1}{c}{Tree} & \multicolumn{1}{c}{$\Delta$} && \multicolumn{1}{c}{Eq.} & \multicolumn{1}{c}{Tree} & \multicolumn{1}{c}{$\Delta$} \\ \midrule PF00004 & 0.87 & 0.58 & 0.33 && 0.70 & 0.67 & 0.04 && 0.93 & 0.61 & 0.34 && 0.80 & 0.71 & 0.11 \\ PF00005 & 0.93 & 0.67 & 0.28 && 0.79 & 0.76 & 0.03 && 0.96 & 0.74 & 0.23 && 0.81 & 0.82 & $-0.01$ \\ PF00041 & 0.86 & 0.64 & 0.25 && 0.69 & 0.62 & 0.10 && 0.94 & 0.73 & 0.22 && 0.87 & 0.79 & 0.09 \\ PF00072 & 0.94 & 0.73 & 0.23 && 0.86 & 0.77 & 0.10 && 0.99 & 0.85 & 0.14 && 0.94 & 0.87 & 0.08 \\ PF00076 & 0.92 & 0.69 & 0.25 && 0.81 & 0.76 & 0.05 && 0.97 & 0.72 & 0.25 && 0.88 & 0.83 & 0.05 \\ PF00096 & 0.88 & 0.54 & 0.39 && 0.68 & 0.54 & 0.21 && 0.92 & 0.54 & 0.41 && 0.78 & 0.54 & 0.30 \\ PF00153 & 0.95 & 0.71 & 0.26 && 0.83 & 0.63 & 0.24 && 0.98 & 0.77 & 0.21 && 0.90 & 0.65 & 0.28 \\ PF00271 & 0.91 & 0.62 & 0.32 && 0.78 & 0.72 & 0.07 && 0.95 & 0.67 & 0.29 && 0.85 & 0.77 & 0.10 \\ PF00397 & 0.85 & 0.58 & 0.33 && 0.69 & 0.58 & 0.15 && 0.93 & 0.61 & 0.34 && 0.76 & 0.59 & 0.22 \\ PF00512 & 0.94 & 0.74 & 0.21 && 0.84 & 0.77 & 0.08 && 0.97 & 0.78 & 0.20 && 0.88 & 0.81 & 0.08 \\ PF00595 & 0.91 & 0.61 & 0.33 && 0.72 & 0.62 & 0.14 && 0.96 & 0.64 & 0.33 && 0.83 & 0.68 & 0.18 \\ PF01535 & 0.85 & 0.66 & 0.23 && 0.66 & 0.63 & 0.05 && 0.88 & 0.72 & 0.18 && 0.73 & 0.72 & 0.01 \\ PF02518 & 0.93 & 0.69 & 0.27 && 0.82 & 0.75 & 0.09 && 0.98 & 0.78 & 0.20 && 0.90 & 0.79 & 0.12 \\ PF07679 & 0.85 & 0.63 & 0.26 && 0.68 & 0.64 & 0.05 && 0.95 & 0.77 & 0.19 && 0.85 & 0.80 & 0.05 \\ PF13354 & 0.68 & 0.56 & 0.18 && 0.76 & 0.65 & 0.14 && 0.82 & 0.65 & 0.21 && 0.91 & 0.74 & 0.19 \\ \cmidrule{1-16} Average & 0.88 & 0.64 & 0.27 && 0.75 & 0.68 & 0.10 && 0.94 & 0.71 & 0.25 && 0.85 & 0.74 & 0.12 \\ \bottomrule \end{tabular} \caption{\textbf{Impact of phylogeny on contact prediction by plmDCA and MSA Transformer.} We consider synthetic MSAs generated by sampling Potts models either at equilibrium (Eq.) or along inferred phylogenies (Tree). We report the ROC-AUCs for contact prediction, computed by comparing couplings inferred from our synthetic MSAs using plmDCA and MSA Transformer, with ground-truth proxy contacts consisting of either the $N$ or the $2L$ pairs with top coupling scores according to the Potts models that generated the data (see \qnameref{subsec:methods_phylogeny}). Here, $N$ denotes the number of pairs of residues that have an all-atom minimal distance smaller than $\SI{8}{\angstrom}$ in the experimental structure in \cref{tab:MSA}, excluding pairs at positions $i, j$ with $| i - j | \leq 4$ (in all cases, $N>2L$). To assess the impact of phylogenetic noise, we compute $\Delta := (A_{\mathrm{eq}} - A_{\mathrm{tree}}) / A_{\mathrm{eq}}$, where $A_{\mathrm{eq}}$ is the ROC-AUC obtained from the equilibrium MSA and $A_{\mathrm{tree}}$ is the ROC-AUC obtained from the MSA with phylogeny. \label{tab:AUC}} \end{table} These results demonstrate that contact inference by MSA Transformer is less deteriorated by phylogenetic correlations than contact inference by DCA. This resilience might explain the remarkable result that structural contacts are predicted more accurately by MSA Transformer than by Potts models even when MSA Transformer's pre-training dataset minimizes diversity \cite[Sec.\ 5.1]{rao2021msa}. \cref{tab:AUC} also shows that plmDCA performs better than MSA Transformer on the synthetic MSAs generated without phylogeny. Because these sequences are sampled independently and at equilibrium from Potts models inferred from the natural MSAs, they are by definition well-described by Potts models. However, these sequences incorporate the imperfections of the inferred Potts models (see the inferred contact maps versus the experimental ones in \cref{fig:contact_prediction_plmDCA}), in addition to lacking the phylogenetic relationships that exist in natural MSAs. These differences with the natural MSAs that were used to train MSA Transformer might explain why it performs less well than plmDCA on these synthetic MSAs, while the opposite holds for natural MSAs (see Ref.~\cite{rao2021msa} and \cref{fig:contact_prediction_plmDCA,fig:contact_prediction_MSA_Transformer}). Note that directly comparing the performance of inference between natural and synthetic data is difficult because the ground-truth contacts are not the same and because synthetic data relies on inferred Potts models and inferred phylogenetic trees with their imperfections. However, this does not impair our comparisons of the synthetic datasets generated without and with phylogeny, or of plmDCA and MSA Transformer on the same datasets. Furthermore, an interesting feature that can be observed in \cref{fig:contact_prediction_phylo}, and is quantified in \cref{tab:ppv_and_md_experimental}, is that MSA Transformer tends to recover the experimental contact maps from our synthetic data generated by bmDCA. Specifically, some secondary structure features that were partially lost in the bmDCA inference and generation process (see the experimental contact maps in \cref{fig:contact_prediction_plmDCA}) become better defined again upon contact inference by MSA Transformer. This could be because MSA Transformer has learnt the structure of contact maps, including the spatial compactness and shapes of secondary structures. \section*{Discussion} MSA Transformer is known to capture structural contacts through its (tied) row attention heads~\cite{rao2021msa}. Here, we showed that it also captures Hamming distances, and thus phylogenetic information, through its column attention heads. This separation of the two signals in the representation of MSAs built by MSA Transformer comes directly from its architecture with interleaved row and column attention heads. It makes sense, given that some correlations between columns (i.e.\ amino-acid sites) of an MSA are associated to contacts between sites, while similarities between rows (i.e.\ sequences) arise from relatedness between sequences~\cite{Casari95}. Specifically, we found that simple combinations of column attention heads, tuned to individual MSAs, can predict pairwise Hamming distances between held-out sequences with very high accuracy. The larger coefficients in these combinations are found in early layers in the network. More generally, this study demonstrated that the regressions trained on different MSAs had major similarities. This motivated us to train a single model across a heterogeneous collection of MSAs, and this general model was still found to accurately predict pairwise distances in test MSAs from entirely distinct Pfam families. This result hints at a universal representation of phylogenetic relationships in MSA Transformer. Furthermore, our results suggest that the network has learned to quantify phylogenetic relatedness by attending not only to dissimilarity \cite{rao2021msa}, but also to similarity relationships. Next, to test the ability of MSA Transformer to disentangle phylogenetic correlations from functional and structural ones, we focused on unsupervised contact prediction tasks. Using controlled synthetic data, we showed that unsupervised contact prediction is more robust to phylogeny when performed by MSA Transformer than by inferred Potts models. Language models often capture important properties of the training data in their internal representations~\cite{Rogers20}. For instance, those trained on single protein sequences learn structure and binding sites~\cite{vig2021bertology}, and those trained on chemical reactions learn how atoms rearrange~\cite{Schwaller21}. Our finding that detailed phylogenetic relationships between sequences are learnt by MSA Transformer, in addition to structural contacts, and in an orthogonal way, demonstrates how precisely this model represents the MSA data structure. We note that, without language models, analyzing the correlations in MSAs can reveal evolutionary relatedness and sub-families~\cite{Casari95}, as well as collective modes of correlation, some of which are phylogenetic and some functional~\cite{Halabi09}. Furthermore, Potts models capture the clustered organization of protein families in sequence space~\cite{Figliuzzi18}, and the latent space of variational autoencoder models trained on sequences~\cite{Riesselman18,Ding19,McGee21} qualitatively captures phylogeny~\cite{Ding19}. Here, we demonstrated the stronger result that detailed pairwise phylogenetic relationships between sequences are quantitatively learnt by MSA Transformer. Separating coevolutionary signals encoding functional and structural constraints from phylogenetic correlations arising from historical contingency constitutes a key problem in analyzing the sequence-to-function mapping in proteins~\cite{Casari95,Halabi09}. Phylogenetic correlations are known to obscure the identification of structural contacts by traditional coevolution methods, in particular by inferred Potts models~\cite{Weigt09,Marks11,Qin18,Vorberg18,RodriguezHorta19,RodriguezHorta21}, motivating various corrections~\cite{Lichtarge96,Dunn08,Ekeberg13,Marks11,Morcos11,Hockenberry19,Malinverni20,Colavin22}. From a theoretical point of view, disentangling these two types of signals is a fundamentally hard problem~\cite{WeinsteinPreprint}. In this context, the fact that protein language models such as MSA Transformer learn both signals in orthogonal representations, and separate them better than Potts model, is remarkable. Here, we have focused on Hamming distances as a simple measure of phylogenetic relatedness between sequences. It would be very interesting to extend our study to other, more detailed, measures of phylogeny. One may ask whether they are encoded in deeper layers in the network than those most involved in our study. Besides, we have mainly considered attentions averaged over columns, but exploring in more detail the role of individual columns would be valuable, especially given the impact we found for column entropies. More generally, our results suggest that the performance of protein language models trained on MSAs could be assessed by evaluating not only how well they capture structural contacts, but also how well they capture phylogenetic relationships. In addition, the ability of protein language models to learn phylogeny could make them particularly well-suited at generating synthetic MSAs capturing the data distribution of natural ones~\cite{SgarbossaPreprint}. It also raises the question of their possible usefulness to infer phylogenies and evolutionary histories. \section*{Methods} \subsection*{Datasets} \label{subsec:datasets} The Pfam database \cite{mistry2021pfam} contains a large collection of related protein regions (families), typically associated to functional units called domains that can be found in multiple protein contexts. For each of its families, Pfam provides an expert-curated seed alignment that contains a representative set of sequences. In addition, Pfam provides deeper ``full'' alignments, that are automatically built by searching against a large sequence database using a profile hidden Markov model (HMM) built from the seed alignments. For this work, we considered $15$ Pfam families, and for each we constructed (or retrieved, see below) one MSA from its seed alignment -- henceforth referred to as the ``seed MSA'' -- and one from its full alignment -- henceforth referred to as the full MSA. The seed MSAs were created by first aligning Pfam seed alignments (Pfam version 35.0, Nov.\ 2021) to their HMMs using the \texttt{hmmalign} command from the HMMER suite (\url{http://hmmer.org}, version 3.3.2), and then removing columns containing only insertions or gaps. We retained the original Pfam tree ordering, with sequences ordered according to phylogeny inferred by FastTree \cite{Price10}. In the case of family PF02518, out of the initial 658 sequences, we kept only the first 500 in order to limit the memory requirements of our computational experiments to less than $64\,$GB. Of the full MSAs, six (PF00153, PF00397, PF00512, PF01535, PF13354) were created from Pfam full alignments (Pfam version 34.0, Mar.\ 2021), removing columns containing only insertions or gaps, and finally removing sequences where $10 \%$ or more characters were gaps. The remaining nine full MSAs were retrieved from the online repository \url{https://github.com/matteofigliuzzi/bmDCA} (publication date: Dec.\ 2017) and were previously considered in Ref.~\cite{Figliuzzi18}. These alignments were constructed from full Pfam alignments from an earlier release of Pfam. An MSA is a matrix $\mathcal{M}$ with $L$ columns, representing the different amino-acid sites, and $M$ rows. Each row $i$, denoted by $\bm{x}^{(i)}$, represents one sequence of the alignment. We will refer to $L$ as the MSA length, and to $M$ as its depth. For all but one (PF13354) of our full MSAs, $M > 36000$. Despite their depth, however, our full MSAs include some highly similar sequences due to phylogenetic relatedness, a usual feature of large alignments of homologous proteins. We computed the effective depth~\cite{Weigt09} of each MSA $\mathcal{M}$ as \begin{equation}\label{eq:Meff} M^{(\delta)}_\mathrm{eff} := \sum_{i=1}^M w_i, \quad \text{with} \quad w_i := |\{ i' : d_\mathrm{H}(\bm{x}^{(i)}, \bm{x}^{(i')}) < \delta \}|^{-1}, \end{equation} where $d_\mathrm{H}(\bm{x}, \bm{y})$ is the (normalized) Hamming distance between two sequences $\bm{x}$ and $\bm{y}$, i.e.\ the fraction of sites where the amino acids differ, and we set $\delta = 0.2$. While $M^{(0.2)}_\mathrm{eff} / M$ can be as low as $0.06$ for our full MSAs, this ratio is close to 1 for all seed MSAs: it is almost $0.83$ for PF00004, and larger than $0.97$ for all other families. Finally, for each Pfam domain considered, we retrieved one experimental three-dimensional protein structure, corresponding to a sequence present in the full MSA, from the PDB (\url{https://www.rcsb.org}). All these structures were obtained by X-ray crystallography and have R-free values between 0.13 and 0.29. Information about our MSAs is summarized in \cref{tab:MSA}. All these families have been previously considered in the literature and shown to contain coevolutionary signal detectable by DCA methods~\cite{Figliuzzi18}, making our experiments on contact prediction readily comparable with previous results. While the precise choice of Pfam families is likely immaterial for our investigation of the column attention heads computed by MSA Transformer, our domains' short lengths are convenient in view of MSA Transformer's large memory footprint -- which is $O(L M^2) + O(L^2)$. \subsection*{MSA Transformer and column attention} \label{subsec:MSA-Tr_attn} We used the pre-trained MSA Transformer model introduced in Ref.~\cite{rao2021msa}, retrieved from the Python Package Index as \texttt{fair-esm 0.4.0}. We briefly recall that this model was trained, with a variant of the masked language modeling (MLM) objective \cite{devlin2019bert}, on 26 million MSAs constructed from UniRef50 clusters (March 2018 release), and contains 100 million trained parameters. The input to the model is an MSA with $L$ columns and $M$ rows. First, the model pre-pends a special beginning-of-sentence token to each row in the input MSA (this is common in language models inspired by the BERT architecture \cite{devlin2019bert}). Then, each residue (or token) is embedded independently, via a learned mapping from the set of possible amino-acid/gap symbols into $\mathbb{R}^d$ ($d = 768$). To these obtained embeddings, the model adds two kinds of learned \cite{Rives21} scalar positional encodings \cite{gehring2017convolutional}, designed to allow the model to distinguish between (a) different aligned positions (columns), and (b) between different sequence positions (rows). (Note that removing the latter kind was shown in Ref.~\cite{rao2021msa} to have only limited impact.) The resulting collection of $M \times (L + 1)$ $d$-dimensional vectors, viewed as an $M \times (L + 1) \times d$ array, is then processed by a neural architecture consisting of $12$ layers. Each layer is a variant of the axial attention \cite{ho2019axial} architecture, consisting of a multi-headed (12 heads) tied row attention block, followed by a multi-headed (12 heads) column attention block, and finally by a feed-forward network. (Note that both attention blocks, and the feed-forward network, are in fact preceded by layer normalization \cite{ba2016layer}.) The roles of row and column attention in the context of the MLM training objective are illustrated in \cref{fig:msa_transformer_and_hamming_regr_schematics}(a). Tied row attention incorporates the expectation that 3D structure should be conserved amongst sequences in an MSA; we refer the reader to \cite{rao2021msa} for technical details. Column attention works as follows: let $X^{(l)}_{j}$ be the $M \times d$ matrix corresponding to column $j$ in the $M \times (L + 1) \times d$ array output by the row attention block in layer $l$ with $l = 1, \ldots, 12$. At each layer $l$ and each head $h = 1, \ldots, 12$, the model learns three $d \times d$ matrices $W^{(l, h)}_{\mathrm{Q}}$, $W^{(l, h)}_{\mathrm{K}}$ and $W^{(l, h)}_{\mathrm{V}}$ (note that these matrices, \textit{mutatis mutandis}, could be of dimension $d \times d'$ with $d' \neq d$), used to obtain three $M \times d$ matrices \begin{equation}\label{eq:query_key_values} Q^{(l, h)}_{j} = X^{(l)}_j W^{(l, h)}_{\mathrm{Q}}, \quad K^{(l, h)}_{j} = X^{(l)}_j W^{(l, h)}_{\mathrm{K}} , \quad V^{(l, h)}_{j} = X^{(l)}_{j} W^{(l, h)}_{\mathrm{V}}, \end{equation} whose rows are referred to as ``query'', ``key'', and ``value'' vectors respectively. The column attention from MSA column $j \in \{0, \ldots, L\}$ (where $j=0$ corresponds to the beginning-of-sentence token), at layer $l$, and from head $h$, is then the $M \times M$ matrix \begin{equation}\label{eq:col_attn} A^{(l, h)}_{j} := \mathrm{softmax}_{\mathrm{row}}\left(\frac{Q^{(l, h)}_{j} {K^{(l, h)}_{j}}^\mathrm{T}}{\sqrt{d}} \right), \end{equation} where we denote by $\mathrm{softmax}_{\mathrm{row}}$ the application of $\mathrm{softmax}(\xi_1, \ldots \xi_d) = (e^{\xi_{1}}, \ldots, e^{\xi_{d}}) / \sum_{k=1}^d e^{\xi_{k}}$ to each row of a matrix independently, and by $(\cdot)^\mathrm{T}$ matrix transposition. As in the standard Transformer architecture \cite{Vaswani17}, these attention matrices are then used to compute $M \times d$ matrices $Z^{(l, h)}_{j} = A^{(l, h)}_{j} V^{(l,h)}_{j}$, one for each MSA column $j$ and head $h$. Projecting the concatenation $Z^{(l, 1)}_{j} \mid \cdots \mid Z^{(l, 12)}_{j}$, a single $M \times d$ matrix $Z^{(l)}_{j}$ is finally obtained at layer $l$. The collection $(Z^{(l)}_j)_{j=1, \ldots, L}$, thought of as an $M \times (L + 1) \times d$ array, is then passed along to the feed-forward layer. \subsection*{Supervised prediction of Hamming distances} \label{subsec:methods_supervised_hamming} Row $i$ of the column attention matrices $A^{(l, h)}_{j}$ in \cref{eq:col_attn} consists of $M$ positive weights summing to one -- one weight per row index $i'$ in the original MSA. According to the usual interpretation of the attention mechanism \cite{Bahdanau14, Vaswani17}, the role of these weights may be described as follows: When constructing a new internal representation (at layer $l$) for the row-$i$, column-$j$ residue position, the network distributes its focus, according to these weights, among the $M$ available representation vectors associated with each MSA row-$i'$, column-$j$ residue position (including $i' = i$). Since row attention precedes column attention in the MSA Transformer architecture, we remark that, even at the first layer, the row-$i'$, column-$j$ representation vectors that are processed by that layer's column attention block can encode information about the entire row $i'$ in the MSA. In~\cite[Sec.\ 5.1]{rao2021msa}, it was shown that, for some layers $l$ and heads $h$, averaging the $M \times M$ column attention matrices $A^{(l, h)}_{j}$ in \cref{eq:col_attn} from all MSA columns $j$, and then averaging the result along the first dimension, yields $M$-dimensional vectors whose entries correlate reasonably well with the phylogenetic sequence weights $w_i$ defined in \cref{eq:Meff}. Larger weights are, by definition, associated with less redundant sequences, and MSA diversity is known to be important for coevolution-based methods -- particularly in structure prediction tasks. Thus, these correlations can be interpreted as suggesting that the model is, in part, explicitly attending to a maximally diverse set of sequences. Beyond this, we hypothesize that MSA Transformer may have learned to quantify and exploit phylogenetic correlations in order to optimize its performance in the MLM training objective of filling in randomly masked residue positions. To investigate this, we set up regression tasks in which, to predict the Hamming distance $y$ between the $i$-th and the $i'$-th sequence in an MSA $\mathcal{M}$ of length $L$, we used the entries $a^{(l, h)}_{i, i'}$ at position $(i, i')$ (henceforth $a^{(l, h)}$ for brevity) from the $144$ matrices \begin{equation} \label{eq:A^lh} \bm{A}^{(l, h)} := \frac{1}{2(L + 1)}\sum_{j = 0}^L \left(A^{(l, h)}_{j} + {A^{(l, h)}_{j}}^{\mathrm{T}} \right), \quad \text{with} \quad 1 \leq l \leq 12 \text{ and } 1 \leq h \leq 12. \end{equation} These matrices are obtained by averaging, across all columns $j = 0, \ldots, L$, the symmetrised column attention maps $A^{(l, h)}_{j}$ computed by MSA Transformer, when taking $\mathcal{M}$ as input. We highlight that column $j = 0$, corresponding to the beginning-of-sentence token, is included in the average defining $\bm{A}^{(l, h)}$. We fit fractional logit models via quasi-maximum likelihood estimation \cite{papke1996econometric} using the \texttt{statsmodels} package (version 0.13.2) \cite{seabold2010statsmodels}. Namely, we model the relationship between the Hamming distance $y$ and the aforementioned symmetrised, and averaged, attention values $\bm{a} = (a^{(1,1)}, \ldots, a^{(12,12)})$, as \begin{equation} \label{eq:logistic_model_defn} \mathbb{E}[y \, | \, \bm{a}] = G_{\beta_0, \, \bm{\beta}}(\bm{a}), \quad \text{with} \quad G_{\beta_0, \, \bm{\beta}}(\bm{a}) := \sigma\left( \beta_0 + \bm{a} \bm{\beta}^{\mathrm{T}} \right), \end{equation} where $\mathbb{E}[ \, \cdot \, | \, \cdot \, ]$ denotes conditional expectation, $\sigma(x) = (1 + e^{-x})^{-1}$ is the standard logistic function, and the coefficients $\beta_0$ and $\bm{\beta} = (\beta_1, \ldots, \beta_{144})$ are determined by maximising the sum of Bernoulli log-likelihoods \begin{equation} \label{eq:logistic_model_loss} \ell(\beta_0, \bm{\beta} \, | \, \bm{a}, y) = y \log[G_{\beta_0, \, \bm{\beta}}(\bm{a})] + (1 - y) \log[1 - G_{\beta_0, \, \bm{\beta}}(\bm{a})], \end{equation} evaluated over a training set of observations of $y$ and $\bm{a}$. Note that this setup is similar to logistic regression, but allows for the dependent variable to take real values between $0$ and $1$ (it can be equivalently described as a generalized linear model with binomial family and logit link). For simplicity, we refer to these fractional logit models simply as ``logistic models''. Our general approach to predict Hamming distances is illustrated in \cref{fig:msa_transformer_and_hamming_regr_schematics}(b). Using data from our seed MSAs (cf.\ \cref{tab:MSA}), we performed two types of regression tasks. In the first one, we randomly partitioned the set of row indices in each separate MSA $\mathcal{M}$ into two subsets $I_{\mathcal{M}, \, \mathrm{train}}$ and $I_{\mathcal{M}, \, \mathrm{test}}$, with $I_{\mathcal{M}, \, \mathrm{train}}$ containing $70\%$ of the indices. We then trained and evaluated one model for each $\mathcal{M}$, using as training data the Hamming distances, and column attentions, coming from (unordered) pairs of indices in $I_{\mathcal{M}, \, \mathrm{train}}$, and as test data the Hamming distances, and column attentions, coming from pairs of indices in $I_{\mathcal{M}, \, \mathrm{test}}$. The second type of regression task was a single model fit over a training dataset consisting of all pairwise Hamming distances, and column attentions, from the first 12 of our 15 MSAs. We then evaluated this second model over a test set constructed in an analogous way from the remaining 3 MSAs. \subsection*{Synthetic MSA generation via Potts model sampling along inferred phylogenies} \label{subsec:methods_phylogeny} To assess the performance of MSA Transformer at disentangling signals encoding functional and structural (i.e.\ fitness) constraints from phylogenetic correlations arising from historical contingency, we generated and studied controlled synthetic data. Indeed, disentangling fitness landscapes from phylogenetic history in natural data poses a fundamental challenge \cite{WeinsteinPreprint} -- see \cref{fig:coevolution_potts_phylogeny} for a schematic illustration. This makes it very difficult to assess the performance of a method at this task directly on natural data, because gold standards where the two signals are well-separated are lacking. We resolved this conundrum by generating synthetic MSAs according to well-defined dynamics such that the presence of phylogeny can be controlled. First, we inferred unrooted phylogenetic trees from our full MSAs (see \qnameref{subsec:datasets}), using FastTree version 2.1 \cite{Price10} with its default settings. Our use of FastTree is motivated by the depth of the full MSAs, which makes it computationally prohibitive to employ more precise inference methods. Deep MSAs are needed for the analysis described below, since it relies on accurately fitting Potts models. Then, we fitted Potts models on each of these MSAs using bmDCA \cite{Figliuzzi18} (\url{https://github.com/ranganathanlab/bmDCA}, version 0.8.12) with its default hyperparameters. These include, in particular, regularization strengths for the Potts model fields and couplings, both set at $\lambda = 10^{-2}$. With the exception of family PF13354, we trained all models for $2000$ iterations and stored the fields and couplings at the last iteration; in the case of PF13354, we terminated training after $1480$ iterations. In all cases, we verified that, during training, the model's loss had converged. The choice of bmDCA is motivated by the fact that, as has been shown in Refs.~\cite{Figliuzzi18, Russ20}, model fitting on natural MSAs using Boltzmann machine learning yields Potts models with good generative power. This sets it apart from other DCA inference methods, especially pseudo-likelihood DCA (plmDCA)~\cite{Ekeberg13, Ekeberg14}, which is the DCA standard for contact prediction, but cannot faithfully reproduce empirical one- and two-body marginals, making it a poor choice of a generative model~\cite{Figliuzzi18}. Using the phylogenetic trees and Potts models inferred from each full MSA, we generated synthetic MSAs without or with phylogeny, as we now explain. In the remainder of this subsection, let $\mathcal{M}$ denote an arbitrary MSA from our set of full MSAs, $L$ its length, and $M$ its depth. Consider a sequence of $L$ amino-acid sites. We denote by $x_i \in \{1, \dots, q\}$ the state of site $i \in \{1, \dots, L\}$, where $q=21$ is the number of possible states, namely the 20 natural amino acids and the alignment gap. A general Potts model Hamiltonian applied to a sequence $\bm{x} = (x_1, \ldots, x_{L})$ reads \begin{equation} H(\bm{x}) = -\sum_{i=1}^{L}h_{i}(x_i) - \sum_{j=1}^{L}\sum_{i=1}^{j-1}e_{ij}(x_i, x_j)\,, \label{eq:maxent} \end{equation} where the fields $h_i(x_i)$ and couplings $e_{ij}(x_i,x_j)$ are parameters that can be inferred from data by DCA methods~\cite{Weigt09,Cocco18}. In our case, they are inferred from $\mathcal{M}$ by bmDCA~\cite{Figliuzzi18, Russ20}. The Potts model probability distribution is then given by the Boltzmann distribution associated to the Hamiltonian $H$ in \cref{eq:maxent}: \begin{equation} P(\bm{x})=\frac{e^{-H(\bm{x})}}{Z}\,, \end{equation} where $Z$ is a constant ensuring normalization. In this context, we implement a Metropolis--Hastings algorithm for Markov Chain Monte Carlo (MCMC) sampling from $P$, where an iteration step consists of a proposed move (mutation) in which a site $i$ is chosen uniformly at random, and its state $x_i$ may be changed into another state chosen uniformly at random. Each of these attempted mutations is accepted or rejected according to the Metropolis criterion, i.e.\ with probability \begin{equation} p = \min \left[ 1, \exp \left(-\Delta H \right)\right], \label{eq:MetroCrit} \end{equation} where $\Delta H$ is the difference in the value of $H$ after and before the mutation. \paragraph{Generating independent equilibrium sequences under a Potts model.} To generate a synthetic MSAs without phylogeny from each $\mathcal{M}$, we performed equilibrium MCMC sampling from the Potts model with Hamiltonian $H$ in \cref{eq:maxent}, using the Metropolis--Hastings algorithm. Namely, we started from a set of $M$ randomly and independently initialized sequences, and proposed a total number $N$ of mutations on each sequence. Suitable values for $N$ are estimated by bmDCA during its training, to ensure that Metropolis--Hastings sampling reaches thermal equilibrium after $N$ steps when starting from a randomly initialized sequence~\cite{Figliuzzi18}. We thus used the value of $N$ estimated by bmDCA at the end of training. This yielded a synthetic MSA of the same depth $M$ as the original full MSA $\mathcal{M}$, composed of independent equilibrium sequences. \paragraph{Generating sequences along an inferred phylogeny under a Potts model.}\label{par:methods_generation_phylogeny} We also generated synthetic data using MCMC sampling along our inferred phylogenetic trees~\cite{Vorberg18}, using an open-source implementation available at \url{https://github.com/Bitbol-Lab/Phylogeny-Partners} (version 2.0). We started from an equilibrium ancestor sequence sampled as explained above, and placed it at the root (note that, while FastTree roots its trees arbitrarily, root placement does not matter; see below). Then, this sequence was evolved by successive duplication (at each branching of the tree) and mutation events (along each branch). Mutations were again modeled using for acceptance the Metropolis criterion in \cref{eq:MetroCrit} with the Hamiltonian in \cref{eq:maxent}. As the length $b$ of a branch gives the estimated number of substitutions that occurred per site along it~\cite{Price10}, we generate data by making a number of accepted mutations on this branch equal to the integer closest to $b L$. Since we traversed the entire inferred tree in this manner, the resulting sequences at the leaves of the tree yield a synthetic MSA of the same depth as the original full MSA $\mathcal{M}$. Finally, we verified that the Hamming distances between sequences in these synthetic MSAs were reasonably correlated with those between corresponding sequences in the natural MSAs -- see \cref{fig:Hamming_synthetic_MSAs}. Because we start from an ancestral equilibrium sequence, and then employ the Metropolis criterion, all sequences in the phylogeny are equilibrium sequences. Thus, some of the correlations between the sequences at the leaves of the tree can be ascribed to the couplings in the Potts model, as in the case of independent equilibrium sequences described above. However, their relatedness adds extra correlations, arising from the historical contingency in their phylogeny. Note that separating these ingredients is extremely tricky in natural data~\cite{WeinsteinPreprint}, which motivates our study of synthetic data. Our procedure for generating MSAs along a phylogeny is independent of the placement of the tree's root. Indeed, informally, a tree's root placement determines the direction of evolution; hence, root placement should not matter when evolution is a time-reversible process. That evolution via our mutations and duplications is a time-reversible process is a consequence of the fact that we begin with equilibrium sequences at the (arbitrarily chosen) root. More formally, for an irreducible Markov chain with transition matrix $\mathcal{P}$ and state space $\Omega$, and for any $n \geq 1$, let $\mathrm{Markov}_n(\pi, \mathcal{P})$ denote the probability space of chains $(X_k)_{0 \leq k \leq n}$ with initial distribution $\pi$ on $\Omega$. If $\pi$ is the chain's stationary distribution and $\pi$ satisfies detailed balance, then, for any number of steps $n \geq 1$, any chain $(X_k)_{0 \leq k \leq n} \in \mathrm{Markov}_n(\pi, \mathcal{P})$ is reversible in the sense that $(X_{n - k})_{0 \leq k \leq n} \in \mathrm{Markov}_n(\pi, \mathcal{P})$. In our case, since the Metropolis--Hastings algorithm constructs an irreducible Markov chain whose stationary distribution satisfies detailed balance, and since duplication events are also time-reversible constraints imposed at each branching node, all ensemble observables are independent of root placement as long as the root sequences are sampled from the stationary distribution. \paragraph{Assessing performance degradation due to phylogeny in coupling inference.}\label{par:performance_degradation} DCA methods and MSA Transformer both offer ways to perform unsupervised inference of structural contacts from MSAs of natural proteins. In the case of DCA, the established methodology~\cite{Ekeberg13,Ekeberg14,Figliuzzi18} is to (1) learn fields and couplings [see \cref{eq:maxent}] by fitting the Potts model, (2) change the gauge to the zero-sum gauge, (3) compute the Frobenius norms, for all pairs of sites $(i,j)$, of the coupling matrices $\left( e_{ij}(x, y) \right)_{x, y}$, and finally (4) apply the average product correction (APC)~\cite{Dunn08}, yielding a coupling score $E_{ij}$. Top scoring pairs of sites are then predicted as being contacts. In the case of MSA Transformer~\cite{rao2021msa}, a single logistic regression (shared across all possible input MSAs) was trained to regress contact maps from a sparse linear combination of the symmetrized and APC-corrected row attention heads (see \qnameref{subsec:MSA-Tr_attn}). We applied these inference techniques, normally used to predict structural contacts, on our synthetic MSAs generated without and with phylogeny (see above). As proxies for structural contacts, we used the pairs of sites with top coupling scores in the Potts models used to generate the MSAs. Indeed, when presented with our synthetic MSAs generated at equilibrium, DCA methods for fitting Potts models should recover the ranks of these coupling scores well. Hence, their performance in this task provide a meaningful baseline against which performance when a phylogeny was used to generate the data, as well as MSA Transformer's performance, can be measured. As a DCA method to infer these coupling scores, we used plmDCA~\cite{Ekeberg13,Ekeberg14} as implemented in the \texttt{PlmDCA} Julia package (\url{https://github.com/pagnani/PlmDCA}, version 0.4.1), which is the state-of-the-art DCA method for contact inference. We fitted one plmDCA model per synthetic MSA, using default hyperparameters throughout; these include, in particular, regularization strengths set at $\lambda = 10^{-2}$ for both fields and couplings, and automatic estimation of the phylogenetic cutoff $\delta$ in \cref{eq:Meff}. We verified that these settings led to good inference of structural contacts on the original full MSAs by comparing them to the PDB structures in \cref{tab:MSA} -- see \cref{fig:contact_prediction_plmDCA}. For each synthetic MSA, we computed coupling scores $E_{ij}$ for all pairs of sites. While Potts models need to be fitted on deep MSAs to achieve good contact prediction, MSA Transformer's memory requirements are considerable even at inference time, and the average depth of the MSAs used to train MSA Transformer was 1192~\cite{rao2021msa}. Concordantly, we could not run MSA Transformer on any of the synthetic MSAs in their entirety. Instead, we subsampled each synthetic MSA 10 times, by selecting each time a number $M_\mathrm{sub}$ of row indices uniformly at random, without replacement. We used $M_\mathrm{sub} \approx 380$ for family PF13354 due to its greater length, and $M_\mathrm{sub} \approx 500$ for all other families. Then, we computed for each subsample a matrix of coupling scores using MSA Transformer's row attention heads and the estimated contact probabilities from the aforementioned logistic regression. Finally, we averaged the resulting 10 matrices to obtain a single matrix of coupling scores. We used a similar strategy (and the same randomly sampled row indices) to infer structural contact scores from the natural MSAs -- see \cref{fig:contact_prediction_MSA_Transformer}. Consistently with findings in Ref.~\cite{rao2021msa}, MSA Transformer generally performs better than plmDCA (\cref{fig:contact_prediction_plmDCA}) at contact inference. \section*{Data availability} All datasets used in our work (namely, the natural MSAs and PDB structures described in \qnameref{subsec:datasets} and listed in \cref{tab:MSA}, as well as the corresponding synthetic MSAs generated for the analysis in \qnameref{subsec:methods_phylogeny}) are available at \url{https://zenodo.org/record/7096792}. \section*{Code availability} Our code is available at \url{https://zenodo.org/record/7096792}. \bibliographystyle{naturemag}
e69942bcf6fab945b169333de77b960cc4ec6313
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{sec:intro} Spoofing attacks and countermeasures for automatic speaker verification (ASV) have aroused keen interests in academia and the industry. While ASV systems aim to verify the identity of target speakers, spoofing attacks attempt to manipulate the verification results using various technologies, leading to dramatic performance degradation \cite{wu2015asvspoof, kinnunen2017asvspoof, todisco2019asvspoof, yamagishi2021asvspoof, wang2021comparative}. In order to ensure the robustness and security of ASV systems, CM is a necessary technique to detect and defend spoofing attacks. The vulnerability of ASV systems was revealed in \cite{wu2015asvspoof, kinnunen2017asvspoof, todisco2019asvspoof, yamagishi2021asvspoof}, under speech synthesis and voice conversion (VC) attacks. Currently, various techniques have been proposed to perform effective attacks, including audio replay \cite{wu2014study}, adversarial noise \cite{kreuk2018fooling, das2020attacker}, more advanced text-to-speech (TTS) and VC models \cite{de2010evaluation, wu2014voice, kons2013voice}. In addition, many works have been done to investigate state-of-the-art CM strategies. The current solutions leverage end-to-end deep neural networks (DNNs) \cite{monteiro2019development, monteiro2020generalized}, trying to distinguish artifacts and unnatural cues of spoofing speech from bona fide speech. And thanks to a series of challenges and datasets \cite{wu2015asvspoof, kinnunen2017asvspoof, todisco2019asvspoof, yamagishi2021asvspoof}, many novel techniques were introduced to achieve promising CM performances \cite{monteiro2019development, monteiro2020generalized,zhang2021one, wu2022partial,chen2020generalization, jung2021aasist,li2021replay, tak2021graph, jung2019replay,shim2020integrated,jung2020study,shim2019self, tak2022automatic,tak2021end,kamble2018effectiveness,tak2020spoofing,tak2018novel}. However, previous works only take the stand-alone CM models into account. Recently, a spoofing aware speaker verification (SASV) challenge \cite{jung2022sasv} was proposed as a special session in ISCA INTERSPEECH 2022. This challenge aims to facilitate the research of integrated CM and ASV models, arguing that jointly optimizing CM and ASV models will lead to better performance. To measure the performance of integrated models, a SASV-EER was proposed in this challenge as a primary metric, which is a variant of classic equal error rate (EER). Under this metric, the test utterances in trials belong to one of three types: impostors, target speakers, and spoofing attacks. In further, the SASV-EER can be subsetted into SV-EER (impostors vs. targets) and SPF-EER (targets vs. spoof). The former is for evaluating speaker verification performance, and the latter is for evaluating anti-spoofing performance. In this way, this metric expects the model can accept target speakers and reject any alternatives, including the impostors and spoofing attacks. This metric is a straightforward assessment for integrated SASV systems. This paper described our submitted system for the SASV Challenge 2022. In order to take advantage of existing well-designed models in CM and ASV areas, we proposed a novel multi-model and multi-scale fusion framework. Compared with purely scoring fusion and embedding fusion methods, this framework utilizes embeddings from CM models in the first-level fusion, propagating CM embeddings into a CM block to obtain a CM score. In the second-level fusion, the CM score and ASV scores directly from ASV systems will be concatenated into a prediction block for the final decision. In contrast to our previous work \cite{wu2022sasv} that only simply concatenates the embeddings from different CM models, we considered the potentials of pooling strategies in terms of feature aggregation, and investigated various pooling methods \cite{you2019multi, snyder2018x, zhu2018self, okabe2018attentive} when fusing embeddings across different CM models. Based on the proposed fusion framework, we presented the fusion strategies of a series of state-of-the-art CM and ASV models with different pooling strategies to boost the fusion results. As a result, the best single fusion system has achieved the SASV-EER of 0.97\% on the evaluation set. Then by ensembling the top-5 fusion systems, the final SASV-EER reached 0.89\% on the evaluation set, while this number in the best baseline system from the SASV challenge is 6.37\%. \begin{figure*}[ht] \centering \centerline{\includegraphics[width=1.0\linewidth]{figures/method.png}} \caption{The proposed multi-model \& multi-level fusion framework.} \label{fig:method} \end{figure*} \section{Background} \subsection{SASV strategies} Given the enrollment utterance $x_{e}$ and the testing utterance $x_{t}$, spoofing-aware speaker verification (SASV) systems aim at telling $y_{t} = 1$ if $x_{t}$ comes from the same speaker as $x_{e}$, or $y_{t} = 0$ if $x_{t}$ comes from another speaker or $x_{t}$ is a spoofing attack. There are two typical strategies for constructing a SASV system: multi-task learning strategy and fusion-based strategy. The multi-task learning strategy trains the models jointly with both speaker verification and anti-spoofing objectives, which is intuitive to be adopted. The two objectives share the same backbone and thus the features and embeddings, while each objective has its own predicting head and loss function. It is worth noting that speaker verification and anti-spoofing objectives are contradictory in some respects. The former drives the model to erase device and environment information to more robustly identify speakers; in contrast, the latter prompts the model to capture device and environment traces, then tells forged spoofing from authentic utterances \cite{shim2020integrated}. Alternatively, the fusion-based strategy has the potential to reach better SASV performance leveraging state-of-the-art CM and ASV models trained on large-scale datasets. Considering this superiority, we propose our solutions for the SASV challenge based on a novel multi-model and multi-level fusion strategy. \subsection{Baseline systems} The challenge organizer provides two baseline systems. Each system is based upon ECAPA-TDNN model \cite{desplanques2020ecapa} as the ASV subsystem and AASIST model \cite{jung2021aasist} as the CM subsystem. The key difference between the two systems is how they fuse ASV and CM subsystem - Baseline1 adopts the score-level fusion, while Baseline2 adopts the embedding-level fusion. \section{Method} \begin{figure*}[ht] \centering \subfigure[ECAPA-TDNN]{ \centering \includegraphics[width=0.32\linewidth]{figures/experiments/ecapa_sv_test.pdf} } \subfigure[AASIST]{ \centering \includegraphics[width=0.32\linewidth]{figures/experiments/aas_cm_test.pdf} } \subfigure[Proposed top-5 ensemble system]{ \centering \includegraphics[width=0.32\linewidth]{figures/experiments/fusion-sap-768.pdf} } \centering \caption{The histogram plots of the output scores predicted by ASV, CM, and the proposed top-5 ensemble system. Other proposed system variants also have similar histogram shapes as (c).} \label{fig:hist} \end{figure*} Although achieving acceptable performances, baseline systems' fusion strategies are relatively simple and naive. Baseline1's score-level fusion does not guarantee that the ASV score and the CM score belong to a unified space and an identical magnitude. Baseline2 crudely concatenates three embeddings and throws the product into a DNN, lacking fine-grained fusion. These inadequacies motivate us to explore further possibilities of fusion strategies in the SASV task. In this paper, we proposed a multi-model and multi-level fusion strategy. In terms of the width, it employs multiple pre-trained ASV and CM models as plug-and-play components, where users can expand or shrink the scale of the model according to their needs. In terms of the depth of this strategy, it fuses CM embeddings to calculate a score in the first-level fusion, which is then integrated with the ASV models' outputs, and yields the final prediction in the second-level fusion. \subsection{Overall structure} The overall framework is shown in Figure \ref{fig:method}, where $x_{e}$ and $x_{t}$ are the input enrollment and testing utterances, respectively; \textit{ASV-1}, \textit{ASV-2}, ..., \textit{ASV-m} denote $m$ pre-trained ASV models; \textit{CM-1}, \textit{CM-2}, ..., \textit{CM-n} denote $n$ pre-trained CM models. Given a trial $\{x_{e}, x_{t}\}$, a series of cosine scores $\{s_{sv}^1, s_{sv}^2, \ldots, s_{sv}^m\}$ are derived from $m$ ASV models. Given the testing utterance $x_{t}$, a series of CM embeddings $\{h^{1}, h^{1}, \ldots, h^{n}\}$ are extracted through $n$ CM models. Next comes the first level of fusion, where the $n$ embeddings are integrated into a $h_{cm}$ by concatenation or a pooling method. Our previous work \cite{wu2022sasv} investigated the capacity of concatenation for SASV. In this work, we further extend the potential of concatenation by making the CM block in Figure \ref{fig:method} deeper, and we also adopt pooling methods to further improve the fusion performance. Further, $h_{cm}$ goes through a CM Block to better digest fused embeddings and then a 2-dimension countermeasure score $s_{cm}$ is predicted. With $s_{cm}$ and $\{s_{sv}^1, s_{sv}^2, \ldots, s_{sv}^m\}$ well prepared, they are concatenated and fed into the Predictor to yield the final prediction $\hat{y_t}$, where the second-level fusion is performed. \subsection{Strategies in the first-level fusion} For the first-level fusion, we attempt concatenation \cite{wu2022sasv} or one of the four kinds of pooling methods to synthesize $h_{cm}$ separately, and have conducted extensive experiments accordingly. Suppose $\bm{H}=\{h^{1}, h^{1}, \ldots, h^{n}\}$, and the length of all the CM embeddings are projected into a same length $d_h$ by feed forward layers before performing concatenation or pooling. The four candidate pooling methods are Temporal Average Pooling (TAP) \cite{you2019multi}, Temporal Statistics Pooling (TSP) \cite{snyder2018x}, Self-attentive Pooling (SAP) \cite{zhu2018self}, and Attentive Statistics Pooling (ASP) \cite{okabe2018attentive}. TAP is to calculate the mean value along the channels to obtain the $h_{cm}$. TSP calculates channel-wise mean and standard deviation, then concatenates the mean vector and standard deviation vector together as $h_{cm}$. In SAP, the self-attention mechanism takes $\bm{H}$ as input and outputs an annotation matrix $\bm{A}$: \begin{equation} \bm{A} = softmax(tanh(\bm{H}^T\bm{W}_1)\bm{W}_2) \label{eq:SAP-weight} \end{equation} where $\bm{W}_1$ is a matrix of size $d_h\times d_a$; $\bm{W}_2$ is a matrix of size $d_a\times d_r$, and $d_r$ is a hyper-parameter that represents the number of attention heads; The $softmax(·)$ is performed column-wise. We set $d_r=1$, therefore $\bm{A}$ degenerates into an annotation vector. Weighted by $\bm{A}$, $h_{cm}$ is calculated as the weighted mean: \begin{equation} h_{cm} =\Tilde{\mu} = \bm{HA} \label{eq:SAP-mean} \end{equation} For ASP, not only it calculate a attention-weighted mean as SAP do, but also it calculate a attention-weighted standard deviation: \begin{equation} \Tilde{\sigma} =\sqrt{\sum_{i=1}^{n}{\alpha^i h^i\odot h^i }-\Tilde{\mu}\odot\Tilde{\mu}} \label{eq:ASP-sigma} \end{equation} where $\alpha^i$denotes the $i^{th}$ element of the annotation vector $\bm{A}$, $\odot$ represents the Hadamard product. By concatenating $\Tilde{\mu}$ and $\Tilde{\sigma}$, $h_{cm}$ is derived. After one of the above pooling methods or concatenation, derived $h_{cm}$ goes through CM Block, which is a multi-layer perceptron, and generates a two-dimension score reflecting the possibilities the testing utterances is the target or not. \subsection{Loss function} The ASV and CM models parameters are well pre-trained and thus frozen. The learnable modules include CM Block and the Predictor, which are multi-layer perceptrons. To prompt the model to learn to distinguish the target trials from other trials, we use the cross-entropy loss on $s_{cm}$ output by CM Block and $\hat{y}_{t}$ output by the Predictor respectively. \section{Experiments} \label{sec:exp} \subsection{Experimental setup} In the SASV Challenge 2022 \cite{jung2022sasv}, participants are restricted to utilise ASVspoof 2019 \cite{wang2020asvspoof} and VoxCeleb2 \cite{chung2018voxceleb2} datasets for training the anti-spoofing and ASV model, respectively. Three EERs, namely SV-EER, SPF-EER and SASV-EER are measured as the evaluation metrics, and SASV-EER is the main metric in the Challenge. For the ASV models, we use Resnet34 \cite{he2016deep}, ECAPA-TDNN \cite{desplanques2020ecapa} and MFA-Conformer \cite{zhang2022conformer}. For the countermeasure models, we use AASIST \cite{jung2021aasist}, AASIST-L, and RawGAT-ST \cite{tak2021end}, where AASIST-L is a light version of AASIST. The fusion model in Figure~\ref{fig:method} is trained by Adam optimizer with an initial learning rate of 0.0001. We set the batch size as 32, and the epoch number as 40. \begin{table*}[ht] \centering \renewcommand\arraystretch{1.0} \setlength\tabcolsep{12pt} \caption{Performance of all systems on the ASVspoof 2019 development and evaluation sets.} \label{tab:all-eer} \begin{tabular}{lccccccc} \hline \hline & \multirow{2}{*}{\textbf{System}} & \multicolumn{2}{c}{\textbf{SV-EER}} & \multicolumn{2}{c}{\textbf{SPF-EER}} & \multicolumn{2}{c}{\textbf{SASV-EER}} \\ & & Dev & Eval & Dev & Eval & Dev & Eval \\ \hline (A) & ECAPA-TDNN & 1.64 & 1.86 & 20.28 & 30.75 & 17.37 & 23.84 \\ \hline (B) & AASIST & 46.01 & 49.24 & 0.07 & 0.67 & 15.86 & 24.38 \\ \hline (C1) & Baseline1 \cite{jung2022sasv} & 32.88 & 35.32 & 0.06 & 0.67 & 13.07 & 19.31 \\ (C2) & Baseline2 \cite{jung2022sasv} & 12.87 & 11.48 & 0.13 & 0.78 & 4.85 & 6.37 \\ \hline (D) & MFA-Conformer + AASIST & 1.48 & 1.47 & 0.20 & 1.08 & 0.88 & 1.35 \\ \hline (E1) & SV-ALL + AASIST & 1.42 & 1.30 & 0.27 & 1.61 & 0.81 & 1.41 \\ (E2) & SV-ALL + AASIST-L & 1.42 & 1.33 & 0.47 & 3.99 & 0.88 & 2.95 \\ (E3) & SV-ALL + RawGAT-ST & 1.82 & 1.64 & 0.40 & 0.82 & 1.28 & 1.39 \\ \hline (F1) & MFA-Conformer + CM-ALL-CAT-256 & 1.91 & 1.66 & 0.20 & 0.64 & 1.01 & 1.30 \\ (F2) & ECAPA-TDNN + CM-ALL-CAT-256 & 1.39 & 1.73 & 0.20 & 0.74 & 0.81 & 1.40 \\ (F3) & Resnet34 + CM-ALL-CAT-256 & 1.28 & 1.12 & 0.26 & 1.43 & 0.74 & 1.32 \\ \hline (G1) & SV-ALL + CM-ALL-CAT-256 & 1.27 & 1.20 & 0.20 & 1.15 & 0.81 & 1.17 \\ (G2) & SV-ALL + CM-ALL-CAT-512 & 1.35 & 1.15 & 0.20 & 1.12 & 0.74 & 1.14 \\ (G3) & SV-ALL + CM-ALL-CAT-768 & 1.34 & 1.12 & 0.20 & 0.99 & 0.81 & \textbf{1.08} \\ (G4) & SV-ALL + CM-ALL-CAT-1024 & 1.28 & 1.21 & 0.20 & 0.83 & 0.74 & \textbf{1.08} \\ (G5) & SV-ALL + CM-ALL-CAT-2048 & 1.35 & 1.10 & 0.23 & 1.41 & 0.74 & 1.31 \\ \hline (H1) & SV-ALL + CM-ALL-TAP-768 & 1.35 & 0.99 & 0.2 & 1.10 & 0.61 & \textbf{1.02} \\ (H2) & SV-ALL + CM-ALL-TSP-768 & 1.21 & 1.12 & 0.20 & 1.47 & 0.74 & 1.31 \\ (H3) & SV-ALL + CM-ALL-SAP-768 & 1.15 & 1.04 & 0.17 & 0.93 & 0.54 & \textbf{0.99} \\ (H4) & SV-ALL + CM-ALL-ASP-768 & 1.18 & 1.37 & 0.15 & 1.58 & 0.67 & 1.51 \\ (H5) & SV-ALL + CM-ALL-TAP-1024 & 1.28 & 1.15 & 0.13 & 0.56 & 0.61 & \textbf{0.97} \\ (H6) & SV-ALL + CM-ALL-TSP-1024 & 1.11 & 1.12 & 0.20 & 1.77 & 0.61 & 1.43 \\ (H7) & SV-ALL + CM-ALL-SAP-1024 & 1.15 & 1.16 & 0.20 & 1.45 & 0.61 & 1.28 \\ (H8) & SV-ALL + CM-ALL-ASP-1024 & 1.51 & 1.68 & 0.40 & 1.01 & 1.08 & 1.49 \\ \hline (I1) & Top-5 Ensemble & 1.08 & 1.01 & 0.20 & 0.71 & 0.67 & \textbf{0.89} \\ \hline \hline \end{tabular} \end{table*} \subsection{Experimental results and analysis} As the requirements by SASV Challenge 2022, we evaluated systems on ASVspoof 2019 development and evaluation sets and reported SA-EER, SPF-EER and SASV EER, shown in Table \ref{tab:all-eer}. A and B denote systems using pure ASV or CM. We omit other systems using only single ASV or CM due to space limitation, yet they are with the same trend. C1-C2 denote two baselines provided by the Challenge organizer. D-H8 are variants based on the proposed fusion strategy. D denote the fusion systems using only one ASV model and one CM model, e.g., 'ECAPA-TDNN + AASIST' denotes the fusion of ECAPA-TDNN as the ASV model, and AASIST as the CM model. Other systems using only one ASV and CM models are with the same trend. E1-E3 denote systems fusing all three ASV models with one CM model. Note that D-E3 ignore the first-level fusion. F1-F3 denote systems fusing one ASV model and all three CM models. G1-H8 represent systems incorporating all three ASV models and all three CM models, but with different first-level fusion strategies and different sizes of CM Block. For example, 'SV-ALL + CM-ALL-CAT-768' denotes its first-level fusion uses concatenation (abbreviated as 'CAT' in the table), and fused $h_{cm}$ is projected to 768 dimensions in CM Block's first layer. I1 is the ensemble system involving the top-5 best evaluation set SASV-EER systems in A-H8. Figure \ref{fig:method} illustrates the histogram plots of three typical systems: (a) ECAPA-TDNN, a SOTA ASV system; (b) AASIST, a SOTA CM system; (c) Proposed top-5 ensemble system. \subsubsection{Single-objective systems} \textit{Only using speaker verification models.} ECAPA-TDNN performed well on the speaker verification sub-task and achieved 1.86\%, 1.38\% and 1.08\% SV-EERs on the evaluation set, respectively. However, they perform unacceptably on the anti-spoofing sub-task, yielding 30.75\%, 30.22\%, 29.76\% SPF-EER. Spoiled by the spoofing attacks, it is unpractical to perform SASV tasks using only the ASV models. Take ECAPA-TDNN model as an example, as shown in Figure \ref{fig:hist} (a), the pure ASV model can separate target and non-target trials while can hardly distinguish spoofing trials from genuine trials. This phenomenon is predictable because the objective of speaker verification models tends to erase the in-congruent device and environment information to more robustly identify speakers. However, these real-world traces should have helped to defend against spoofing attacks. \textit{Only using anti-spoofing models.} In contrast, AASIST, the state-of-the-art CM model, can significantly discriminate spoofing utterances, but randomly guess on the speaker identification sub-task, mainly because of their speaker-unrelated objectives. They achieve SPF-EERs of 0.67\%, 0.84\%, 0.96\% on anti-spoofing, while yielding SV-EERs close to 50\% for speaker verification. This phenomenon can also be observed in Figure \ref{fig:hist} (b), where the target and non-target trials' distribution are almost totally overlapped. \subsubsection{Baseline systems} Compared to the above single-objective models, two baseline systems reveal superiority in the SASV challenge. Among them, Baseline2 achieves a SASV-EER of 8.75\% on the evaluation set, which is better than Baseline1's 19.15\%. We argue that the reason is that the simple score-level fusion used in Baseline1 does not guarantee that ASV and CM scores belong to a unified space with a consistent magnitude. As shown in Figure \ref{fig:hist}, the ASV score ranges from -1 to 1, while the CM score ranges from -20 to 15. Straightforward addition will make the ASV score submerged by the CM score. In comparison, Baseline2 uses a trainable deep neural network to digest ASV and CM embeddings better, which can contribute to distinguishing the target from non-target and spoofing trials. However, the performance of Baseline2 on the speaker verification sub-task is still not satisfactory, which motivates us to propose the multi-model and multi-level fusion strategy. \subsubsection{Proposed fusion systems} The proposed strategy fuses three SOTA ASV models and three SOTA CM models. With different settings, variety of variant fusion systems (D-H8) are elaborately designed, and an additional ensemble system (I1) is constructed by integrating the top-5 best evaluation set SASV-EER systems from A-H8. Table \ref{tab:all-eer} illustrates the performance of all systems, and G1 is the best result of our previous work \cite{wu2022sasv}. From Table \ref{tab:all-eer}, all the proposed systems outperform the baseline models with a large margin on the SASV-EER metrics, while retaining universally good performances on SV-EER and SPF-EER. The proposed models perform consistently well on the speaker verification task, and quite a few can reach or even surpass the performance of the SOTA ASV models. G1-H8 show better performance than D-F3 in general, benefiting from the more comprehensive model fusion. Using concatenation for the first-level fusion, we attempt different CM Block sizes. From G1 to G5, as we increase the size of the CM Block, the SASV-EER of the system decreases. Until adding a layer with an output dimension of 2048 to the bottom of the CM Block, the performance saturates. Since G3 and G4 have the best SASV-EER, we employ their CM Block settings and further explore the impact of replacing concatenation with different pooling methods. In H1-H8, under both CM block settings, TAP bring more benefits to the system than other methods. Both statistics pooling methods (TSP, ASP) are less effective than TAP, SAP, and concatenation. A possible reason is that we only compute the standard deviation for up to three CM embeddings, which is not stable during training. Rather than representing useful knowledge, the standard deviation seems to be more of a noise. We argue that if more CM models enroll, the system will benefit from statistics pooling methods, and we will leave it as future work. The best individual system is with SASV-EER as 0.97\%. Moreover, the top-5 ensemble system (I1) achieves a SASV-EER as low as 0.89\%, which is a 86\% relative improvement compared to Baseline2. Figure \ref{fig:hist} (c) shows that the distributions of the target, non-target and spoofing trials are well-separated, which verifies the effectiveness of the proposed method. \section{Conclusion} This work proposes a novel multi-model and multi-level fusion strategy to tackle the SASV task. The two-level fusion method can take advantage of the state-of-the-art ASV and CM models. As a result, the best single fusion system achieves the SASV-EER of 0.97\%. What's more, by ensembling the top-5 systems, the final SASV-EER reaches 0.89\% on the evaluation set, which is 86\% relative reduction compared to the best baseline, Baseline2, and 24\% relative reduction compared to our previous work \cite{wu2022sasv}. In the future work, we will introduce more CM models to investigate the potential of the proposed method. \input{main.bbl} \bibliographystyle{IEEEtran} \end{document}
39f183de875839be459100e00b44c650202fa125
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \label{SEC:intro} We consider the following Cauchy problem for the quadratic nonlinear Schr\"odinger equation (NLS) on the two-dimensional torus $\mathbb{T}^2 = (\mathbb{R} / \mathbb{Z})^2$: \begin{equation} \begin{cases} i \partial_t u + \Delta u = |u|^2 \\ u|_{t = 0} = u_0. \end{cases} \label{qNLS} \end{equation} \noindent Our main goal is to prove local well-posedness of \eqref{qNLS} in the low regularity setting. Over the last forty years, the Cauchy problems of NLS with various types of nonlinearities have been studied extensively. The following NLS with a gauge-invariant nonlinearity: \begin{equation} i \partial_t u + \Delta u = \pm |u|^{p-1} u \label{NLS} \end{equation} \noindent is the most well-known and well-studied example. In the case of the $d$-dimensional torus $\mathbb{T}^d = (\mathbb{R}/\mathbb{Z})^d$, Bourgain \cite{B93} introduced the Fourier restriction norm method (via the $X^{s, b}$-spaces) and proved local well-posedness of \eqref{NLS} in the low regularity setting. In particular, when $d = 2$, he proved the following $L^4$-Strichartz estimate (with a derivative loss): \begin{align} \| e^{it \Delta} f\|_{L^4([0, 1]; L^4(\mathbb{T}^2))} \lesssim \|f\|_{H^s} \label{Str1} \end{align} \noindent for any $s> 0$, which allowed him to prove local well-posedness of the cubic NLS, \eqref{NLS} with $p = 3$, in $H^s(\mathbb{T}^2)$, for any $s> 0$. We point out that the estimate \eqref{Str1} fails when $s = 0$ and the well-posedness issue of the cubic NLS in the critical space $L^2(\mathbb{T}^2)$ remains a challenging open problem; see \cite{B93, TTz, Kishi}. Let us now turn to the quadratic NLS \eqref{qNLS}. By interpolating \eqref{Str1} with the trivial $L^2$-bound, we obtain the $L^3$-Strichartz estimate with a derivative loss. Then by proceeding as in~\cite{B93}, we immediately obtain local well-posedness of \eqref{qNLS} in $H^s(\mathbb{T}^2)$ for any $s > 0$. Due to the derivative loss in the Strichartz estimate, however, its well-posedness in $L^2(\mathbb{T}^2)$ has remained open for the last thirty years. In this paper, we prove that \eqref{qNLS} is indeed locally well-posed in $L^2(\mathbb{T}^2)$. \begin{theorem}\label{THM:LWP} The quadratic NLS \eqref{qNLS} is locally well-posed in $L^2(\mathbb{T}^2)$. More precisely, given any $u_0 \in L^2(\mathbb{T}^2)$, there exists $T = T(\| u_0 \|_{L^2}) > 0$ and a unique solution $u \in C([-T, T]; L^2(\mathbb{T}^2))$ to \eqref{qNLS} with $u|_{t=0} = u_0$. \end{theorem} Our proof is based on the Fourier restriction norm method and, as such, the uniqueness holds only in (the local-in-time version of) the relevant $X^{s,b}$-space. A few remarks are in order. In \cite{Kishi3}, Kishimoto proved ill-posedness of \eqref{qNLS} in $H^s(\mathbb{T}^2)$ for $s < 0$ and thus Theorem \ref{THM:LWP} is sharp. See Remark \ref{REM:1} below. Theorem \ref{THM:LWP} is also sharp in the sense that local-in-time solutions constructed in Theorem \ref{THM:LWP} can not be in general extended globally in time. Indeed, the second author \cite{O1} proved a finite-time blowup result for \eqref{qNLS}. See also~\cite{FO}. This argument can be easily extended to $L^2(\mathbb{T}^2)$, yielding the following proposition. \begin{proposition} Let $s \geq 0$ and $u_0 \in H^s(\mathbb{T}^2)$. If the initial data $u_0$ satisfies \[ \Im \int_{\mathbb{T}^2} u_0 dx < 0 \quad \text{or} \quad \Re \int_{\mathbb{T}^2} u_0 dx \neq 0, \] then the forward maximal existence time $T^*$ of the solution $u$ to \eqref{qNLS} with $u|_{t = 0} = u_0$ is finite and we have $\liminf_{t \nearrow T^*} \| u (t) \|_{H^s} = \infty$. \end{proposition} See \cite{FO} on the lifespan of solutions to \eqref{qNLS}. We point out that, in the one-dimensional case, Fujiwara and Georgiev \cite{FG} recently proved the criterion for global existence. Consider the quadratic NLS \eqref{qNLS} on the one-dimensional torus $\mathbb{T}$. Then, there exists a global $L^2$-solution $u$ to \eqref{qNLS} on $\mathbb{T}$ if and only if $\Re u_0 = 0$ and $\Im u_0 = \mu$ for some $\mu \geq 0$. In particular, any global $L^2$-solution is necessarily constant in space. It would be of interest to investigate this issue in the two-dimensional case. As mentioned above, our proof of Theorem \ref{THM:LWP} is based on the Fourier restriction norm method. More precisely, Theorem \ref{THM:LWP} follows from a standard contraction argument, once we proof the following bilinear estimate. \begin{proposition}\label{PROP:bilin} Let $0 < T \leq 1$. Let $\delta_1 > \delta_2 > 0$ be sufficiently small. Then, for $s\ge 0 $, we have \begin{align} \| u \overline{v} \|_{X_T^{s,-\frac 12 + \delta_1}} \lesssim \| u \|_{X_T^{s, \frac 12 + \delta_2}} \| v \|_{X_T^{s, \frac 12 + \delta_2}}. \label{bilin1} \end{align} \end{proposition} Here, $X^{s, b}_T$ denotes the local-in-time version of the $X^{s, b}$-space. See Section \ref{SEC:2} for the definition. As mentioned above, the $L^3$-Strichartz comes with a derivative loss and hence can not be used directly to prove \eqref{bilin1}. We instead separate the proof into two cases: (i)~non-resonant interaction and (ii) nearly resonant interaction. In the non-resonant case, thanks to the gain of derivative via multilinear dispersion, we can make up for the loss of the derivative in the $L^3$-Strichartz estimate. In the nearly resonant case, we notice that the angle between the second incoming wave and the outgoing wave is almost perpendicular. This angular restriction allows us to prove the estimate without any derivative loss. See also \cite{Tao4, CKSTT08}. See Section~\ref{SEC:bilin} for details. We conclude this introduction by several remarks. \begin{remark}\label{REM:1} \rm (i) Unlike \cite{B93}, our argument does not rely on intricate number theoretic properties and thus Theorem \ref{THM:LWP} also holds on a general torus $\mathbb{T}^2_{\pmb{\alpha}} = (\mathbb{R}/\alpha_1 \mathbb{Z}) \times (\mathbb{R}/\alpha_2 \mathbb{Z}) $ for any ratio $\pmb{\alpha} = (\alpha_1, \alpha_2)$ with $\alpha_1, \alpha_2 > 0$. This is essentially due to the fact that the key bilinear Strichartz estimate and the counting lemma (see Lemmas \ref{LEM:bilin} and \ref{LEM:count} below) hold on a general flat torus (see Lemmas 2.5 and 2.9 in~\cite{Kish13}) and the $L^4$-Strichartz estimate in Lemma \ref{LEM:L4} also holds on a general torus with an $\varepsilon$ derivative loss (see Theorem 2.4 in \cite{BD15}). We also mention \cite{B07, CW, GOW, BD15, KV, DGG} for further discussions on the Strichartz estimates and well-posedness of NLS on irrational tori. \smallskip \noindent (ii) The bilinear estimate \eqref{bilin1} also holds for $u v$ and $\overline{u} \overline{v}$ in place of $u \overline{v}$ on the left-hand side. Indeed, for $\overline{u} \overline{v}$, Gr\"unrock \cite{Gr} proved the corresponding bilinear estimate for $s > - \frac 12$. As for $uv$, a slight modification of the proof of Proposition \ref{PROP:bilin} yields the corresponding bilinear estimate for $s \ge 0$. See Remark \ref{REM:bilin}. These bilinear estimates yield local well-posedness in the corresponding ranges. The quadratic NLS on $\mathbb{T}^2$ is critical in $H^{-1}(\mathbb{T}^2)$ with respect to the scaling symmetry. Nonetheless, Kishimoto \cite{Kishi3} proved ill-posedness of the quadratic NLS on $\mathbb{T}^2$ in $H^s(\mathbb{T}^2)$ for (a) $s < 0 $ with the nonlinearity $\mathcal{N}(u) = |u|^2$ and (b) $s \le -1$ with $\mathcal{N}(u) = u^2$ or $\overline{u}^2$. As mentioned above, the well-posedness theory of the quadratic NLS~\eqref{qNLS} with the nonlinearity $|u|^2$ is now complete. On the other hand, as for the nonlinearity $u^2$ or $\overline u^2$, there is still a gap between the well-posedness and ill-posedness regularities. \smallskip \noindent (iii) It is conjectured in \cite{B93} that, on $\mathbb{T}^2$, the $L^p$-Strichartz estimate holds without any derivative loss as long as $ p < 4$. At this point, the $L^p$-Strichartz estimate on $\mathbb{T}^2$ for $2< p < 4$ is known to hold with a slight loss of derivative and this conjecture remains open. By considering a multilinear version of the Strichartz estimate, however, we obtain the following tri-linear version of the $L^3$-Strichartz estimate without any derivative loss: \begin{align} \bigg|\int_0^1 \int_{\mathbb{T}^2} \prod_{j = 1}^3 \big(e^{it \Delta} \phi_j\big)^* dx dt \bigg| \lesssim \prod_{j = 1}^3 \|\phi_j \|_{L^2}, \label{tri1} \end{align} \noindent where $u^*$ denotes $ u$ or $\overline u$. The estimate \eqref{tri1} follows easily from the bilinear estimate \eqref{bilin1} (also for $uv$ and $\overline u \overline v$) and the duality. We point out that it is crucial that we have a product structure on the left-hand side of \eqref{tri1}. \smallskip \noindent (iv) Lastly, let us consider the following quadratic NLS on $\mathbb{T}^2$ with a gauge-invariant nonlinearity: \begin{equation} i \partial_t u + \Delta u = \pm |u| u . \label{NLS9} \end{equation} \noindent This equation is of particular interest in view of the mass and energy conservations. In particular, local well-posedness in $L^2(\mathbb{T}^2)$ together with the mass conservation would imply global well-posedness in the same space. When $s> 0$, local well-posedness of \eqref{NLS9} in $H^s(\mathbb{T}^2)$ easily follows from the $L^4$-Strichartz estimate~\eqref{Str1} (more precisely, Lemma \ref{LEM:L4} below). When $s = 0$, however, the non-algebraic nature of the nonlinearity makes the local well-posedness problem of \eqref{NLS9} in $L^2(\mathbb{T}^2)$ rather challenging. For example, the tri-linear estimate \eqref{tri1} is not useful to study \eqref{NLS9} and, moreover, multilinear analysis via the Fourier restriction norm method (such as that presented in this paper) is not applicable due to the presence of $|u|$. While there are well-posedness results \cite{OOP, Lee} on the periodic NLS with non-algebraic gauge-invariant nonlinearities, one would need a much more intricate argument to prove local well-posedness of \eqref{NLS9} in $L^2(\mathbb{T}^2)$. \end{remark} \section{Notations and preliminary lemmas} \label{SEC:2} \subsection{Notations} For a spacetime function $u$ defined on $\mathbb{R} \times \mathbb{T}^2$, we write $\mathcal{F}_{t,x} u$ or $\widehat u$ to denote the spacetime Fourier transform of $u$. In the following, we drop the inessential factor of $2\pi$. We also set $\jb{\,\cdot\,} = (1 + |\cdot|^2)^\frac{1}{2}$. Given a dyadic number $N \ge 1$, we let $P_N$ be the spatial frequency projector onto the frequencies \[ \mathfrak{P}_N := \big\{ (\tau, n)\in \mathbb{R}\times \mathbb{Z}^2 : \tfrac{N}{2} < |n| \leq N \big\}.\] Also, given a dyadic number $L \geq 1$, we define $Q_L$ to be the modulation projector onto the space-time frequencies \[\mathfrak{S}_L :=\big \{ (\tau, n)\in \mathbb{R}\times\mathbb{Z}^2: \tfrac{L}{2} < \big| \tau + |n|^2 \big| \leq L \big\}.\] For brevity, we also set $P_{N,L} = P_N Q_L$. In what follows, $N$ and $L$ (possibly with subscripts) always denote dyadic numbers $\geq 1$. We write $\overline{N}_{ij\cdots} := \max(N_i, N_j, \dots )$ and $\underline{N}_{ij\cdots} := \min ( N_i, N_j, \dots )$. We also write $N_{\text{max}} := \overline{N}_{012}$, $N_{\text{min}} := \underline{N}_{012}$, $L_{\text{max}} := \overline{L}_{012}$, $L_{\text{min}} := \underline{L}_{012}$, and $L_{\text{med}} := L_0 L_1 L_2 / L_{\text{min}} L_{\text{max}}$. We use $A \lesssim B$ to denote $A \leq CB$ for some constant $C > 0$, and we write $A \sim B$ to denote $A \lesssim B$ and $B \lesssim A$. We also write $A \ll B$ if $A \leq cB$ for some sufficiently small $c > 0$. We may use subscripts to denote dependence on external parameters; for example, $A\lesssim_{p, q} B$ means $A\le C(p, q) B$, where the constant $C(p, q)$ depends on parameters $p$ and $q$. In addition, we use $a+$ (and $a-$, respectively) to denote $a+\varepsilon$ (and $a-\varepsilon$, respectively) for arbitrarily small $\varepsilon > 0$. \subsection{Preliminary lemmas} In this subsection, we recall some useful lemmas. We first recall the following bilinear Strichartz estimate. For the proof, see Lemma 2.5 in~\cite{Kish13}. \begin{lemma}\label{LEM:bilin} Let $N_j, L_j \geq 1$, $j = 0,1,2$, be dyadic numbers. Suppose that $u_1, u_2 \in L^2(\mathbb{R} \times \mathbb{T}^2)$ satisfy \[ \textup{supp } \widehat{u_1} \subset \mathfrak{P}_{N_1} \cap \mathfrak{S}_{L_1} \quad\text{and}\quad \textup{supp } \widehat{u_2} \subset \mathfrak{P}_{N_2} \cap \mathfrak{S}_{L_2}. \] Then, we have \[ \| \mathcal{F}_{t, x}(u_1 \overline{u_2}) \|_{L_\tau^2 \ell_n^2(\mathfrak{P}_{N_0})} \lesssim \underline{L}_{12}^{\frac 12} \bigg( \frac{\overline{L}_{12}}{N_0} + 1 \bigg)^{\frac 12} N_{\textup{min}}^{\frac 12} \| u_1 \|_{L_{t,x}^2} \| u_2 \|_{L_{t,x}^2}. \] \end{lemma} We also recall the following counting lemma. For the proof, see Lemma 2.9\,(ii) in \cite{Kish13}, which was stated in general dimension $d \geq 2$ but we only need the $d = 2$ case. \begin{lemma}\label{LEM:count} Let $N \gg 1$, $N^{-1} \leq \mu, \nu \ll N$, $M \geq 0$, and set \[ D := \{ \xi = (\xi_1, \xi_2) \in \mathbb{R}^2: N \leq |\xi| \leq N + \mu, M \leq \xi_1 \leq M + \nu \}. \] Let $\mathcal{R}$ be an arbitrary rotation operator on $\mathbb{R}^2$. Moreover, with $e_1 = ( 1,0) \in \mathbb{R}^2$, set \[ K := \Big\{ \xi \in \mathbb{R}^2: \frac{\alpha}{2} \leq \angle(\xi, e_1) \leq 2\alpha \Big\},\] \noindent where $\angle(\xi, e_1) $ denotes the angle between $\xi$ and $e_1$. Suppose that \[ \bigg( \frac{\mu + \min\{\nu, 1\}}{N} \bigg)^{\frac 12 } \ll \alpha \leq \frac{\pi}{4}. \] Then, we have \[ |\mathbb{Z}^2 \cap \mathcal{R}(D \cap K)| \lesssim \max\{ \nu, 1 \} \big(\alpha^{-1}(\mu + \min\{ \nu, 1 \}) + 1\big). \] \end{lemma} \subsection{Fourier restriction norm method} In studying well-posedness of NLS on $\mathbb{T}^d$, Bourgain \cite{B93} introduced the Fourier restriction norm method (see also \cite{KM93}), utilizing the following $X^{s, b}$-spaces. Given $s, b \in \mathbb{R}$, we define the space $X^{s,b}(\mathbb{R} \times \mathbb{T}^2)$ to be the completion of functions that are $C^\infty$ in space and Schwartz in time with respect to the following norm: \begin{align} \| u \|_{X^{s,b}(\mathbb{R} \times \mathbb{T}^2)} := \big\| \jb{n}^s \jb{\tau + |n|^2}^b \widehat u(\tau, n) \big\|_{ L_\tau^2 \ell_n^2(\mathbb{R} \times \mathbb{Z}^2) }. \label{Xsb} \end{align} \noindent For $T > 0$, we define the space $X_T^{s,b}$ to be the restriction of the $X^{s, b}$-space onto the time interval $[-T, T]$ via the norm: \begin{equation} \| u \|_{X_T^{s,b}} := \inf \big\{ \| v \|_{X^{s,b}}: v|_{[-T, T]} = u \big\}. \label{XT} \end{equation} \noindent Note that $X^{s, b}_T$ is complete. Given any $s \in \mathbb{R}$ and $b > \frac 12$, we have $X_T^{s,b} \subset C([-T, T]; H^s(\mathbb{T}^2))$. We now recall the following linear estimates. See \cite{B93, GTV, Tao}. \begin{lemma}\label{LEM:Xlin} Let $s \in \mathbb{R}$ and $0 < T \leq 1$. \smallskip \noindent \textup{(i)} For any $b \in \mathbb{R}$, we have \[ \| e^{it\Delta} \phi \|_{X_T^{s,b}} \lesssim_b \| \phi \|_{H^s}. \] \smallskip \noindent \textup{(ii)} Let $-\frac 12 < b' \leq 0 \leq b \leq b'+1$. Then, we have \[ \bigg\| \int_0^t e^{i(t-t')\Delta} F(t') dt' \bigg\|_{X_T^{s,b}} \lesssim_{b,b'} T^{1-b+b'} \| F \|_{X_T^{s,b'}}. \] \end{lemma} Lastly, we record the following $L^4$-Strichartz estimate on $\mathbb{T}^2$. \begin{lemma}\label{LEM:L4} Let $s > 0$ and $b > \frac 12$. Then, we have \begin{align} \| u \|_{L_{t,x}^4([0,1] \times \mathbb{T}^2)} \lesssim_{s, b} \| u \|_{X^{s, b}}. \label{L42} \end{align} \end{lemma} For the proof, see \cite{B93, B95}. We point out that the $L^4$-Strichartz estimate \eqref{L42} does not hold when $s=0$. See \cite{TTz}. As mentioned in the introduction, the $L^4$-Strichartz estimate \eqref{Str1} with an $\varepsilon$-loss of derivative holds on a general flat torus $\mathbb{T}^2_{\pmb{\alpha}} = (\mathbb{R}/\alpha_1 \mathbb{Z}) \times (\mathbb{R}/\alpha_2 \mathbb{Z}) $ for any ratio $\pmb{\alpha} = (\alpha_1, \alpha_2)$ with $\alpha_1, \alpha_2 > 0$; see Theorem~2.4 in \cite{BD15}. Then, the estimate \eqref{L42} on a general flat torus $\mathbb{T}^2_{\pmb{\alpha}}$ follows from a standard transference principle (see Lemma 2.9 in \cite{Tao}). \section{Proof of Proposition \ref{PROP:bilin}} \label{SEC:bilin} In this section, we present the proof of Proposition~\ref{PROP:bilin}. By the triangle inequality $\jb{n}^s \lesssim \jb{n_1}^s \jb{n_2}^s$ under $n = n_1 + n_2$ for $s \ge 0$, our goal is to prove the following bilinear estimate (with $s = 0$): \begin{align} \| u \overline{v} \|_{X_T^{0,-\frac 12 + \delta_1}} \lesssim \| u \|_{X_T^{0, \frac 12 + \delta_2}} \| v \|_{X_T^{0, \frac 12 + \delta_2}}, \label{bilin1a} \end{align} \noindent where $0 < T \leq 1$ and $\delta_1, \delta_2 > 0$ are sufficiently small, satisfying $\delta_2 < \delta_1 < 2\delta_2$. In view of the definitions \eqref{Xsb} and \eqref{XT} of the $X^{s, b}$-spaces, the bilinear estimate \eqref{bilin1a} follows once we prove \begin{equation} \begin{split} \bigg\| & \sum_{\substack{n_1\in \mathbb{Z}^2\\ n = n_1 - n_2}} \intt_{\tau = \tau_1 - \tau_2} \frac{\widehat u(\tau_1, n_1) \overline{\widehat v(\tau_2, n_2)}}{\jb{\tau_1 + |n_1|^2}^{\frac 12 + \delta_2} \jb{\tau_2 + |n_2|^2}^{\frac 12 + \delta_2} \jb{\tau + |n|^2}^{\frac 12 - \delta_1}} d\tau_1 \bigg\|_{L_\tau^2 \ell_n^2} \\ & \lesssim \| u \|_{L_{t,x}^2} \| v \|_{L_{t,x}^2}. \end{split} \label{bilin2} \end{equation} \noindent By duality, the estimate \eqref{bilin2} follows once we prove the following estimate:\ \begin{equation} \begin{split} \bigg| &\sum_{\substack{n, n_1\in \mathbb{Z}^2\\ n = n_1 - n_2}} \iintt_{\tau = \tau_1 - \tau_2} \frac{\widehat u (\tau_1, n_1) \overline{\widehat v (\tau_2, n_2) }\overline{\widehat w (\tau, n)}}{\jb{\tau_1 + |n_1|^2}^{\frac 12 + \delta_2} \jb{\tau_2 + |n_2|^2}^{\frac 12 + \delta_2} \jb{\tau + |n|^2}^{\frac 12 - \delta_1}} d\tau_1 d\tau \bigg| \\ & \lesssim \| u \|_{L_{t,x}^2} \| v \|_{L_{t,x}^2} \| w \|_{L_{t,x}^2}. \end{split} \label{bilin3} \end{equation} \noindent We first note that if $n = 0$, $n_1 = 0$, or $n_2 = 0$, then the estimate \eqref{bilin3} follows easily from the Cauchy-Schwarz inequality, provided that $\delta_1 > 0$ is sufficiently small. Hence, for the remaining of this section, we assume that $n \neq 0$, $n_1 \neq 0$, and $n_2 \neq 0$. Before proceeding further, we recall the following key algebraic relation: \begin{equation} (\tau + |n|^2) - (\tau_1 + |n_1|^2) + (\tau_2 + |n_2|^2) = -2 n \cdot n_2, \label{phase} \end{equation} \noindent where $n = n_1 - n_2$ and $\tau = \tau_1 - \tau_2$. The main difficulty in proving \eqref{bilin3} (namely, the bilinear estimate \eqref{bilin1} with $s = 0$) comes from the failure of the $L^4$-Strichartz estimate (without a derivative loss). In order to overcome this difficulty, we separately estimate the contributions coming from (i) non-resonant case: $|n \cdot n_2| \gtrsim |n|^\varepsilon |n_2|^\varepsilon$ and (ii) nearly resonant case: $|n \cdot n_2| \ll |n|^\varepsilon |n_2|^\varepsilon$ for some small $ \varepsilon > 0$. In the non-resonant case, we can use the multilinear dispersion to make up for the derivative loss in the $L^4$-Strichartz estimate (Lemma~\ref{LEM:L4}). In the nearly resonant case, by noting that the frequencies $n$ and $n_2$ are almost perpendicular, we make use of this angular restriction to prove a multilinear estimate without a derivative loss in the spirit of \cite{Tao4, CKSTT08}. \subsection{Non-resonant interaction} In this subsection, we consider the non-resonant case: \begin{align} |n \cdot n_2| \gtrsim |n|^\varepsilon |n_2|^\varepsilon \label{nr1} \end{align} \noindent for some small $\varepsilon > 0$ sufficiently small. From \eqref{phase} and \eqref{nr1}, we have \begin{align} \begin{split} \MAX :\! & = \max \big( \jb{\tau + |n|^2}, \jb{\tau_1 + |n_1|^2}, \jb{\tau_2 + |n_2|^2} \big)\\ & \gtrsim \jb{n \cdot n_2} \gtrsim \jb{n}^\varepsilon \jb{n_2}^\varepsilon. \end{split} \label{nr2} \end{align} We then consider the following three cases. In the following, we set $0 < \delta_1 < \frac 12 $. \medskip \noindent $\bullet$ \textbf{Case 1:} $\text{MAX} = \jb{\tau + |n|^2}$. In this case, we directly prove \eqref{bilin2}. Then, with $\varepsilon_1 = \frac \varepsilon 2(\frac 12 - \delta_1)> 0$, it follows from \eqref{nr2} that \begin{equation} \jb{n_1}^{\varepsilon_1} \jb{n_2}^{\varepsilon_1} = \jb{n+n_2}^{\varepsilon_1} \jb{n_2}^{\varepsilon_1} \lesssim \jb{n}^{2\varepsilon_1} \jb{n_2}^{2\varepsilon_1} \lesssim \jb{\tau + |n|^2}^{\frac 12 - \delta_1}. \label{tn0} \end{equation} \noindent Let $\widehat U(\tau_1, n_1) = \jb{n_1}^{-\varepsilon_1} \jb{\tau_1 + |n_1|^2}^{-\frac 12 - \delta_2} \widehat u(\tau_1, n_1)$ and $\widehat V(\tau_2, n_2) = \jb{n_2}^{-\varepsilon_1} \jb{\tau_2 + |n_2|^2}^{-\frac 12 - \delta_2} \widehat v(\tau_2, n_2)$. Then, by \eqref{tn0}, Plancherel's theorem, H\"older's inequality, and the $L^4$-Strichartz estimate (Lemma \ref{LEM:L4}), we have \begin{align*} \text{LHS of \eqref{bilin2}} &\lesssim \| U \overline V\|_{L^2_{t, x}} \leq \| U \|_{L^4_{t, x}}\| V\|_{L^4_{t, x}} \lesssim \|U\|_{X^{\varepsilon_1, \frac 12 + \delta_2}} \|V\|_{X^{\varepsilon_1, \frac 12 + \delta_2}}\\ &= \| u \|_{L_{t,x}^2} \| v \|_{L_{t,x}^2} \end{align*} \noindent for any $\delta_2 > 0$. \medskip \noindent $\bullet$ \textbf{Case 2:} $\text{MAX} = \jb{\tau_1 + |n_1|^2}$. In this case, we prove \eqref{bilin3}. With $\varepsilon_2 = \varepsilon(\frac 12 - \delta_1)> 0$, it follows from \eqref{nr2} that \begin{equation} \jb{n}^{\varepsilon_2} \jb{n_2}^{\varepsilon_2} \lesssim \jb{\tau_1 + |n_1|^2}^{\frac 12 - \delta_1}. \label{tn1} \end{equation} \noindent Then, letting $\widehat V(\tau_2, n_2) = \jb{n_2}^{-\varepsilon_2} \jb{\tau_2 + |n_2|^2}^{-\frac 12 - \delta_2} \widehat v(\tau_2, n_2)$ and $\widehat W(\tau, n) = \jb{n}^{-\varepsilon_2} \jb{\tau + |n|^2}^{-\frac 12 - \delta_2} \widehat w(\tau, n)$, it follows from the Cauchy-Schwarz inequality in $\tau_1$ and $n_1$, \eqref{tn1}, Plancherel's theorem, H\"older's inequality, and the $L^4$-Strichartz estimate (Lemma \ref{LEM:L4}) that \begin{align*} \text{LHS of \eqref{bilin3}} &\lesssim \|u\|_{L^2_{t, x}} \| V \|_{L^4_{t, x}}\|W\|_{L^4_{t, x}}\\ &\lesssim \|u\|_{L^2_{t, x}} \| V \|_{X^{\varepsilon_2, \frac 12 +\delta_2}} \|W\|_{X^{\varepsilon_2, \frac 12 +\delta_2}} \\ &= \| u \|_{L_{t,x}^2} \| v \|_{L_{t,x}^2} \| w \|_{L_{t,x}^2} \end{align*} \noindent for any $\delta_2 > 0$. \medskip \noindent $\bullet$ \textbf{Case 3:} $\text{MAX} = \jb{\tau_2 + |n_2|^2}$. This case follows from proceeding as in Case 2 and thus we omit details. \subsection{Resonant interaction} \label{SUBSEC:res} We now consider the resonant case $|n \cdot n_2| \ll |n|^\varepsilon |n_2|^\varepsilon$. With $\theta = \theta (n, n_2) = \frac{1}{|n|^{1-\varepsilon} |n_2|^{1-\varepsilon}}$, we rewrite this condition as \begin{align*} |n \cdot n_2| \ll \theta |n| |n_2|. \end{align*} \noindent In the following, we divide the argument into three subcases, depending on the sizes of $n$ and~$n_2$. \medskip \noindent $\bullet$ \textbf{Case 1:} $|n|^{\frac 12} \lesssim |n_2| \lesssim |n|^2$. In this case, we follow the idea from the proof of Proposition 10.1 in \cite{Tao4} (see also \cite{CKSTT08}). \smallskip \noindent $\circ$ \textbf{Subcase 1.a:} $|n| \sim |n_2|$. By applying the dyadic decompositions to the frequencies $n$ and $n_2$, we have \begin{equation} \begin{split} \text{LHS of } \eqref{bilin3} &\lesssim \sum_{\substack{N \sim N_2 \geq 1\\\text{dyadic}} } \bigg| \sum_{\substack{n, n_1\in \mathbb{Z}^2\\ n = n_1 - n_2}} \iintt_{\tau = \tau_1 - \tau_2} \mathbf 1_{|\cos \angle(n, n_2)| \ll \theta} \\ &\quad \times \frac{\widehat u (\tau_1, n_1) \overline{\widehat{P_{N_2}v} (\tau_2, n_2)} \overline{\widehat{P_N w} (\tau, n)}}{\jb{\tau_1 + |n_1|^2}^{\frac 12 + \delta_2} \jb{\tau_2 + |n_2|^2}^{\frac 12 + \delta_2} \jb{\tau + |n|^2}^{\frac 12 - \delta_1}} d\tau_1 d\tau \bigg|. \end{split} \label{bilin_a1} \end{equation} \noindent Note that when $|n| \sim |n_2| \sim N$, we have $\theta = \frac{1}{|n|^{1 - \varepsilon} |n_2|^{1 - \varepsilon}} \sim N^{-2 + 2 \varepsilon}$. We now restrict $n$ and $n_2$ to the following angular sectors: \begin{align} \begin{split} A_\ell : \!& = \big\{ n \in \mathbb{Z}^2: |n| \sim N, \, \arg(n) = \ell N^{-2 + 2 \varepsilon} + O(N^{-2 + 2 \varepsilon}) \big\}, \\ A_{\ell_2} :\!&= \big\{ n_2 \in \mathbb{Z}^2: |n_2| \sim N_2, \, \arg(n_2) = \ell_2 N^{-2 + 2 \varepsilon} + O(N^{-2 + 2 \varepsilon}) \big\}, \end{split} \label{A0} \end{align} \noindent where $\ell, \ell_2 \in I_N: = [1, 2\pi N^{2 - \varepsilon}] \cap \mathbb{Z}$. Since $|\cos \angle (n, n_2)| \ll \theta \sim N^{-2 + 2\varepsilon}$, we have $|\arg(n) - \arg(n_2)| = \frac{\pi}{2} + O(N^{-2 + 2\varepsilon})$ or $|\arg(n) - \arg(n_2)| = \frac{3\pi}{2} + O(N^{-2 + 2\varepsilon})$. This means that for each fixed $\ell$, there exists a set $L_2(\l)$ of size $O(1)$ such that $\mathbf 1_{A_\ell} (n)\cdot \mathbf 1_{A_{\ell_2}}(n_2)= 0$ unless $\l_2 \in L_2(\l)$. Continuing with the right-hand side of \eqref{bilin_a1}, we insert the angular restrictions \eqref{A0} and set \[ \widehat v_{N_2, \l_2}(\tau_2, n_2) = \mathbf 1_{A_{\ell_2}}(n_2) \cdot \widehat{P_{N_2}v} (\tau_2, n_2) \quad \text{and}\quad \widehat w_{N, \l} (\tau, n) = \mathbf 1_{A_\ell}(n) \cdot \widehat{P_N w} (\tau, n). \] \noindent Then, by applying the Cauchy-Schwarz inequality in $\tau_1$ and $n_1$, then in $\tau$ and $n$, and H\"older's inequality in $\tau_1$ and $n_1$, we obtain \begin{equation} \begin{split} \text{LHS of } \eqref{bilin3} &\lesssim \sum_{\substack{N \sim N_2 \ge 1\\\text{dyadic}}} \sum_{\ell \in I_N} \sum_{ \ell_2 \in L_2(\ell)} \bigg| \sum_{\substack{n, n_1\in \mathbb{Z}^2\\ n = n_1 - n_2}} \iintt_{\tau = \tau_1 - \tau_2} \mathbf 1_{|\cos \angle (n, n_2)| \ll N^{-2 + 2\varepsilon}} \\ &\quad \times \frac{ \widehat u (\tau_1, n_1) \overline{\widehat v_{N_2, \l_2} (\tau_2, n_2) } \overline{\widehat w_{N, \l} (\tau, n) }} {\jb{\tau_1 + |n_1|^2}^{\frac 12 + \delta_2} \jb{\tau_2 + |n_2|^2}^{\frac 12 + \delta_2} \jb{\tau + |n|^2}^{\frac 12 - \delta_1}} d\tau_1 d\tau \bigg| \\ &\leq \sum_{\substack{N \sim N_2 \ge 1\\\text{dyadic}}} \sum_{\ell \in I_N} \sum_{ \ell_2 \in L_2(\ell)} \| \widehat u \|_{L_{\tau_1}^2 \ell_{n_1}^2} \bigg\| \sum_{n\in \mathbb{Z}^2} \int \mathbf 1_{|\cos \angle (n, n_1 - n)| \ll N^{-2 + 2\varepsilon}} \\ &\quad \times \frac{ \widehat v_{N_2, \l_2} (\tau_1 - \tau , n_1- n) \widehat w_{N, \l} (\tau, n) }{ \jb{\tau_1 - \tau + |n_1 - n|^2}^{\frac 12 + \delta_2} } d\tau \bigg\|_{L_{\tau_1}^2 \ell_{n_1}^2} \\ &\leq \| u \|_{L_{t, x}^2} \sum_{\substack{N \sim N_2 \ge 1\\\text{dyadic}}} \sum_{\ell \in I_N} \sum_{ \ell_2 \in L_2(\ell)} \| \widehat v_{N_2, \l_2} \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| \widehat w_{N, \l}\|_{L_\tau^2 \ell_n^2} \\ &\quad \times \sup_{\tau_1, n_1} \bigg( \sum_n \int \frac{ \mathbf 1_{|\cos \angle (n, n_1 - n)| \ll N^{-2 + 2\varepsilon}} \mathbf 1_{A_{\ell_2}}(n_1 - n) \cdot \mathbf 1_{A_\ell}(n)}{\jb{\tau_1 - \tau + |n_1 - n|^2}^{1 + 2 \delta_2}} d\tau \bigg)^{\frac 12} \\ &\lesssim \| u \|_{L_{t, x}^2 } \sum_{\substack{N \sim N_2 \ge 1\\\text{dyadic}}} \sum_{\ell \in I_N} \sum_{ \ell_2 \in L_2(\ell)} \| \widehat v_{N_2, \l_2} \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| \widehat w_{N, \l}\|_{L_\tau^2 \ell_n^2}\\ & \quad \times \sup_{n_1, \l, \l_2} |\mathcal{A}_{N, \l, \l_2}(n_1)|^\frac 12 , \end{split} \label{bilin_a2} \end{equation} \noindent where $\mathcal{A}_{N, \l, \l_2}(n_1)$ is defined by \[ \mathcal{A}_{N, \l, \l_2}(n_1) = \big\{ n \in \mathbb{Z}^2: |\cos \angle (n, n_1 - n)| \ll N^{-2 + 2\varepsilon}, \, n \in A_\ell, \, n_1 - n \in A_{\ell_2}\big \}.\] In view of \eqref{A0}, for fixed $n_1 \in \mathbb{Z}^2$ and fixed $\ell, \ell_2\in I_N$, we note that any $n\in \mathcal{A}_{N, \l. \l_2}$ is contained in a rectangle with sides of length $\sim$ \[ |n| N^{-2 + 2\varepsilon} \sim N^{-1 + 2\varepsilon} \quad \text{and} \quad |n_1 - n| N^{-2 + 2\varepsilon} \sim N^{-1 + 2\varepsilon}. \] \noindent Hence, for $0 < \varepsilon < \frac 12$, we have \begin{align} \sup_{n_1, \l, \l_2} |\mathcal{A}_{N, \l, \l_2}(n_1)|\lesssim 1. \label{A2} \end{align} \noindent Therefore, by estimating \eqref{bilin_a2} with \eqref{A2}, the Cauchy-Schwarz inequality in $\ell$, and then in $N \sim N_2$ we obtain the desired inequality \eqref{bilin3}. \smallskip \noindent $\circ$ \textbf{Subcase 1.b:} $|n_2| \ll |n| \lesssim |n_2|^2$. Since $|n| \gg |n_2|$ and $n_1 = n + n_2$, we have $|n_1| \sim |n|$. Note that when $|n| \sim N \lesssim |n_2|^2$, we have $\theta = \frac{1}{|n|^{1 - \varepsilon} |n_2|^{1 - \varepsilon}} \lesssim N^{-\frac 32 + \frac 32 \varepsilon}$. We proceed as in Subcase 1.a by restricting $n$ and $n_2$ to the following angular sectors: \begin{align} \begin{split} B_\l : \! & = \big\{ n \in \mathbb{Z}^2: |n| \sim N, \arg(n) = \ell N^{-\frac 32 + \frac 32 \varepsilon} + O(N^{-\frac 32 + \frac 32 \varepsilon}) \big\}, \\ B_{\l_2} :\! & = \big\{ n_2 \in \mathbb{Z}^2: N^{\frac 12} \lesssim |n_2| \ll N, \arg(n_2) = \ell_2 N^{-\frac 32 + \frac 32 \varepsilon} + O(N^{-\frac 32 + \frac 32 \varepsilon}) \big\}, \end{split} \label{B0} \end{align} \noindent where $\ell, \ell_2 \in I_N': = [1, 2\pi N^{\frac 32 - \frac 32\varepsilon}] \cap \mathbb{Z}$. Under $|\cos \angle (n, n_2)| \ll N^{-\frac 32 + \frac 32 \varepsilon}$, we have $|\arg(n) - \arg(n_2)| = \frac{\pi}{2} + O(N^{-\frac 32 + \frac 32 \varepsilon})$ or $|\arg(n) - \arg(n_2)| = \frac{3\pi}{2} + O(N^{-\frac 32 + \frac 32 \varepsilon})$. Hence, for each fixed $\ell$, there exists a set $L_2'(\l)$ of size $O(1)$ such that $\mathbf 1_{B_\ell} (n)\cdot \mathbf 1_{B_{\ell_2}}(n_2)= 0$ unless $\l_2 \in L_2'(\l)$. With a slight abuse of notation, set \[ \widehat v_{N, \l_2}(\tau_2, n_2) = \mathbf 1_{B_{\ell_2}}(n_2) \cdot \widehat{v} (\tau_2, n_2) \quad \text{and}\quad \widehat w_{N, \l} (\tau, n) = \mathbf 1_{B_\ell}(n) \cdot \widehat{P_N w} (\tau, n). \] \noindent Then, by proceeding as in \eqref{bilin_a2}, i.e.~by applying the Cauchy-Schwarz inequality in $\tau_1$ and $n_1$, then in $\tau$ and $n$, and H\"older's inequality in $\tau_1$ and $n_1$, we obtain \begin{align*} \text{LHS of } \eqref{bilin3} &\lesssim \sum_{\substack{N \sim N_1\ge 1\\\text{dyadic}}} \sum_{\ell \in I_N'} \sum_{ \ell_2 \in L_2'(\ell)} \bigg| \sum_{\substack{n, n_1\in \mathbb{Z}^2\\ n = n_1 - n_2}} \iintt_{\tau = \tau_1 - \tau_2} \mathbf 1_{|\cos \angle (n, n_2)| \ll N^{-\frac 32 + \frac 32 \varepsilon}} \\ &\quad \times \frac{\widehat{P_{N_1} u} (\tau_1, n_1) \overline{\widehat v_{N, \l_2} (\tau_2, n_2)} \overline{\widehat w_{N, \l} (\tau, n)}}{\jb{\tau_1 + |n_1|^2}^{\frac 12 + \delta_2} \jb{\tau_2 + |n_2|^2}^{\frac 12 + \delta_2} \jb{\tau + |n|^2}^{\frac 12 - \delta_1}} d\tau_1 d\tau \bigg| \\ &\leq \sum_{\substack{N \sim N_1 \ge 1\\\text{dyadic}}} \sum_{\ell \in I_N'} \sum_{ \ell_2 \in L_2'(\ell)} \big\| \widehat{P_{N_1} u} \big\|_{L_{\tau_1}^2 \ell_{n_1}^2} \bigg\| \sum_{n \in \mathbb{Z}^2} \int \mathbf 1_{|\cos \angle (n, n_1 - n)| \ll N^{-\frac 32 + \frac 32 \varepsilon}} \\ &\quad \times \frac{\widehat v_{N, \l_2} (\tau_1 - \tau, n_1 - n)\widehat w_{N, \l}(\tau, n) }{\jb{\tau_1 - \tau + |n_1 - n|^2}^{\frac 12 + \delta_2}} d\tau \bigg\|_{L_{\tau_1}^2 \ell_{n_1}^2} \\ &\leq \sum_{\substack{N \sim N_1 \ge 1\\\text{dyadic}}} \sum_{\ell \in I_N'} \sum_{ \ell_2 \in L_2'(\ell)} \| \widehat{P_{N_1} u} \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| \widehat v \_{N, \l_2} \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| w_{N, \l} \|_{L_\tau^2 \ell_n^2} \\ &\quad \times \sup_{\tau_1, n_1} \bigg( \sum_n \int \frac{\mathbf 1_{|\cos \angle (n, n_1 - n)| \ll N^{-\frac 32 + \frac 32 \varepsilon}} \mathbf 1_{B_{\ell_2}} (n_1 - n)\cdot \mathbf 1_{B_\ell} (n)}{\jb{\tau_1 - \tau + |n_1 - n|^2}^{1 + 2 \delta_2}} d\tau \bigg)^{1/2} \\ &\lesssim \sum_{\substack{N \sim N_1 \ge 1\\\text{dyadic}}} \sum_{\ell \in I_N'} \sum_{ \ell_2 \in L_2'(\ell)} \| \widehat{P_{N_1} u} \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| \widehat v_{N, \l_2} \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| \widehat w_{N, \l_2} \|_{L_\tau^2 \ell_n^2} \\ & \quad \times \sup_{n_1} |\mathcal{B}_{N, \l, \l_2}(n_1)|^\frac 12, \end{align*} \noindent where $\mathcal{B}_{N, \l, \l_2}(n_1)$ is defined by \[ \mathcal{B}_{N, \l, \l_2}(n_1) = \big \{ n \in \mathbb{Z}^2: |\cos \angle (n, n_1 - n)| \ll N^{-\frac 32 + \frac 32 \varepsilon},, n \in B_\ell,, n_1 - n \in B_{\ell_2} \big\}. \] \noindent Then, the desired bound \eqref{bilin3} follows from the Cauchy-Schwarz inequality in $\ell$ and then in the Cauchy-Schwarz inequality in $N \sim N_1$, once we prove \begin{align} \sup_{n_1, \l, \l_2} |\mathcal{B}_{N, \l, \l_2}(n_1)|\lesssim 1. \label{B2} \end{align} In view of \eqref{B0}, for fixed $n_1 \in \mathbb{Z}^2$ and fixed $\ell, \ell_2\in I_N'$, we note that any $n\in \mathcal{B}_{N, \l. \l_2}$ is contained in a rectangle with sides of length $\sim$ \[ |n| N^{-\frac 32 + \frac 32 \varepsilon} \sim N^{-\frac 12 + \frac 32 \varepsilon} \quad \text{and} \quad |n_1 - n| N^{-\frac 32 + \frac 32 \varepsilon} \ll N^{-\frac 12 + \frac 32 \varepsilon}. \] \noindent Therefore, as long as $0 < \varepsilon < \frac 13$, there are at most $O(1)$ many $n'$s in $ \mathcal{B}_{N, \l. \l_2}$, yielding \eqref{B2}. \smallskip \noindent $\circ$ \textbf{Subcase 1.c:} $|n| \ll |n_2|\lesssim |n|^2$. \\ \indent This subcase follows from Subcase 1.b by switching the roles of $(\tau, n)$ and $(\tau_2, n_2)$ and thus we omit details. \medskip \noindent $\bullet$ \textbf{Case 2:} $|n|^2 \ll |n_2|$. We divide the argument into two subcases, depending on the sizes of $N_2$ and the largest modulation $L_{\textup{max}} = \max (L_0, L_1, L_2)$. \medskip \noindent $\circ$ \textbf{Subcase 2.a:} $L_{\textup{max}} \gtrsim N_2$ (high-modulation case). In this subcase, recalling the notations in Section \ref{SEC:2}, we dyadically decompose the spatial frequencies and modulations of $u$, $v$, and $w$ so that $\textup{supp } \widehat {P_{N_1, L_1} u} \subset \mathfrak{P}_{N_1} \cap \mathfrak{S}_{L_1}$, $\textup{supp } \widehat {P_{N_2, L_2} v } \subset \mathfrak{P}_{N_2} \cap \mathfrak{S}_{L_2}$, and $\textup{supp } \widehat{P_{N_0, L_0} w} \subset \mathfrak{P}_{N_0} \cap \mathfrak{S}_{L_0}$ for dyadic $N_j, L_j \geq 1$, $j = 0,1,2$. Note that we have $N_0^2 \ll N_2 \sim N_1$. Our main goal is to show the following lemma. \begin{lemma}\label{LEM:high} Let $N_j, L_j \geq 1$, $j = 0,1,2$, be dyadic numbers with $N_0^2 \ll N_2 \sim N_1$ and $L_{\textup{max}} \gtrsim N_2$. Suppose that $f, g, h \in L^2(\mathbb{R} \times \mathbb{Z}^2)$ are real-valued nonnegative functions such that \begin{align} \textup{supp } f \subset \mathfrak{P}_{N_1} \cap \mathfrak{S}_{L_1}, \quad \textup{supp } g \subset \mathfrak{P}_{N_2} \cap \mathfrak{S}_{L_2}, \quad \text{and} \quad \textup{supp } h \subset \mathfrak{P}_{N_0} \cap \mathfrak{S}_{L_0}. \label{high1} \end{align} Then, we have \begin{equation} \begin{split} \bigg| \sum_{\substack{n, n_1 \in \mathbb{Z}^2\\ n = n_1 - n_2}} &\iintt_{\tau = \tau_1 - \tau_2} f(\tau_1, n_1) g(\tau_2, n_2) h(\tau, n) d\tau d\tau_1 \bigg| \\ &\lesssim L_1^{\frac 12 +} L_2^{\frac 12 +} L_0^{\frac 14 +} N_2^{0-} \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| h \|_{L_\tau^2 \ell_n^2}. \end{split} \label{high} \end{equation} \end{lemma} We first present the proof of \eqref{bilin3} in this case by assuming Lemma \ref{LEM:high}. Under $N_0^2 \ll N_2 \sim N_1$ and $L_{\textup{max}} \gtrsim N_2$, by applying Lemma \ref{LEM:high}, we have \begin{align*} \text{LHS of \eqref{bilin3}} &\lesssim \sum_{\substack{ N_1, N_2, N_0\ge 1\\\text{dyadic}}} \sum_{\substack{L_1, L_2, L_0 \ge 1\\\text{dyadic}}} L_1^{-\frac 12 - \delta_2} L_2^{-\frac 12 - \delta_2} L_0^{-\frac 12 + \delta_1} \\ &\qquad \times L_1^{\frac 12 +} L_2^{\frac 12 +} L_0^{\frac 14 +} N_2^{0-} \| P_{N_1, L_1} u \|_{L_{t,x}^2} \| P_{N_2, L_2} v \|_{L_{t,x}^2} \| P_{N_0, L_0} w \|_{L_{t,x}^2} \\ &\leq \sum_{\substack{N_1, N_2, N_0\ge 1\\\text{dyadic}}} \sum_{\substack{ L_1, L_2, L_0\ge 1\\\text{dyadic}}} L_1^{0-} L_2^{0-} L_0^{0-} N_2^{0-} \| u \|_{L_{t,x}^2} \| v \|_{L_{t,x}^2} \| w \|_{L_{t,x}^2} \\ &\lesssim \| u \|_{L_{t,x}^2} \| v \|_{L_{t,x}^2} \| w \|_{L_{t,x}^2}, \end{align*} as desired. We now present the proof of Lemma \ref{LEM:high}. \begin{proof}[Proof of Lemma \ref{LEM:high}] By the Cauchy-Schwarz inequality in $\tau$ and $n$, Lemma \ref{LEM:bilin}, and the condition $L_{\textup{max}} \gtrsim N_2 \gg N_0^2$, we have \begin{align*} \text{LHS of \eqref{high}} &\lesssim \| h \|_{L_\tau^2 \ell_n^2} \underline{L}_{12}^{\frac 12} \bigg( \frac{\overline{L}_{12}}{N_0} + 1 \bigg)^{\frac 12} N_0^{\frac 12} \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \\ &\lesssim \big( L_1^{\frac 12} L_2^{\frac 12} + \underline{L}_{12}^{\frac 12} N_2^{\frac 14} \big) \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| h \|_{L_\tau^2 \ell_n^2} \\ &\lesssim L_1^{\frac 12 +} L_2^{\frac 12 +} L_0^{\frac 14 +} N_2^{0-} \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| h \|_{L_\tau^2 \ell_n^2}, \end{align*} \noindent yielding \eqref{high}. \end{proof} \medskip \noindent $\circ$ \textbf{Subcase 2.b:} $L_{\textup{max}} \ll N_2$ (low-modulation case). Our goal in this subcase is to show the following lemma. \begin{lemma}\label{LEM:low} Let $N_1, N_2, L_0, L_1, L_2 \geq 1$ be dyadic numbers with $N_1 \sim N_2$ and $L_{\textup{max}} \ll N_2$. Suppose that $f, g, h \in L^2(\mathbb{R} \times \mathbb{Z}^2)$ are real-valued nonnegative functions such that \begin{align*} &\textup{supp } f \subset \mathfrak{P}_{N_1} \cap \mathfrak{S}_{L_1}, \quad \textup{supp } g \subset \mathfrak{P}_{N_2} \cap \mathfrak{S}_{L_2}, \quad \text{and}\\ &\textup{supp } h \subset \{n \in \mathbb{Z}^2: 1 \leq |n|^2 \ll N_2 \} \cap \mathfrak{S}_{L_0}. \end{align*} Then, we have \begin{equation} \begin{split} \bigg| \sum_{\substack{n, n_1\in \mathbb{Z}^2\\ n = n_1 - n_2}} &\iintt_{\tau = \tau_1 - \tau_2} f(\tau_1, n_1) g(\tau_2, n_2) h(\tau, n) \cdot \mathbf 1_{|\cos \angle(n, n_2)| \ll \theta} \, d\tau d\tau_1 \bigg| \\ &\lesssim L_{\textup{med}}^{\frac 38} L_{\textup{max}}^{\frac 38} \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| h \|_{L_\tau^2 \ell_n^2}, \end{split} \label{low} \end{equation} where $\theta = \frac{1}{|n|^{1-\varepsilon} |n_2|^{1-\varepsilon}} \ll 1$. \end{lemma} We first assume Lemma \ref{LEM:low} and prove \eqref{bilin3}. Recall that $|n|^2 \ll |n_2|\sim |n_1|$ in this case. Then, by Lemma \ref{LEM:low} (with $\theta$ as above) and the Cauchy-Schwarz inequality in $N_1 \sim N_2$, we have \begin{align*} & \text{LHS of } \eqref{bilin3}\\ &\hphantom{X} \lesssim \sum_{\substack{N_1 \sim N_2\ge 1\\\text{dyadic}}} \sum_{\substack{ L_1, L_2, L_0\ge 1\\\text{dyadic}}} L_1^{-\frac 12 - \delta_2} L_2^{-\frac 12 - \delta_2} L_0^{-\frac 12 + \delta_1} \bigg| \sum_{\substack{n, n_1\in \mathbb{Z}^2\\ n = n_1 - n_2}} \iintt_{\tau = \tau_1 - \tau_2} \mathbf 1_{|\cos \angle (n, n_2)| \ll \theta} \\ &\hphantom{XXX} \times \mathbf 1_{|n|^2 \ll N_2} \widehat{P_{N_1, L_1} u} (\tau_1, n_1) \overline{\widehat{P_{N_2, L_2} v}} (\tau_2, n_2) \overline{\widehat{Q_{L_0} w}} (\tau, n) d\tau_1 d\tau \bigg| \\ &\hphantom{X} \lesssim \sum_{\substack{N_1 \sim N_2\ge 1\\\text{dyadic}}} \sum_{\substack{ L_1, L_, L_0\ge 1\\\text{dyadic}}} L_1^{0-} L_2^{0-} L_0^{0-} \big\| \widehat{P_{N_1, L_1} u} \big\|_{L_{\tau_1}^2 \ell_{n_1}^2} \big\| \widehat{P_{N_2, L_2} v} \big\|_{L_{\tau_2}^2 \ell_{n_2}^2} \big\| \widehat{Q_{L_0} w} \big\|_{L_\tau^2 \ell_n^2} \\ &\hphantom{X} \lesssim \| \widehat u \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| \widehat v \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| \widehat w \|_{L_\tau^2 \ell_n^2}, \end{align*} \noindent as desired. We now present the proof of Lemma \ref{LEM:low}, where we use the idea from the proofs of of Propositions 3.6 and 3.9 in \cite{Kish13}. \begin{proof}[Proof of Lemma \ref{LEM:low}] We first consider the case when $|n|\lesssim L_{\text{max}}$. In this case, we decompose the spatial frequencies of $h$ on the left-hand side of \eqref{low} into dyadic blocks $\{|n| \sim N_0\}$, where the dyadic number $N_0 \ge 1$ satisfies $N_0^2 \ll N_2$. For fixed $N_0$, we decompose the spatial frequencies of $f$ and $g$ into balls of radius $\sim N_0$, indexed by $J_1 \in \mathcal{J}_1$ and $J_2 \in \mathcal{J}_2$, respectively. With a slight abuse of notation, we also use $J_1$ and $J_2$ to denote the balls themselves. Note that for each fixed $J_1 \in \mathcal{J}_1$, the product $\mathbf 1_{J_1} (\tau_1, n_1)\cdot \mathbf 1_{J_2} (\tau_1 - \tau, n_1 - n)$ is nonzero for at most $O(1)$ many $J_2 \in \mathcal{J}_2$, and we denote the set of these indices $J_2$'s as $\mathcal{J}_2 (J_1)$. Noting that \[ \big| |n_1|^2 - |n_2|^2 \big| = \big| |n|^2 - (\tau + |n|^2) + (\tau_1 + |n_1|^2) - (\tau_2 + |n_2|^2) \big| \lesssim N_0^2 + L_{\textup{max}}, \] \noindent we have \begin{align} \big| |n_1| - |n_2| \big| \lesssim N_2^{-1} (N_0^2 + L_{\textup{max}}) \ll 1. \label{C1} \end{align} \noindent Given $j \in \mathbb{N}$, let $A_j = \{ ( \tau_1, n_1) : j < |n_1| \leq j+1 \}$ and $B_j = \{ ( \tau_2, n_2) : j < |n_2| \leq j + 1 \}$. In view of \eqref{C1}, we see that the product $\mathbf 1_{A_{j_1}} (\tau_1, n_1) \cdot \mathbf 1_{B_{j_2}} (\tau_2, n_2)$ is nonzero if and only if $|j_1 - j_2| \le 1$. Hence, by letting $f_{j_1, J_1}(\tau_1, n_1) = \mathbf 1_{A_{j_1} \cap J_1} (\tau_1, n_1)\cdot f(\tau_1, n_1)$ and $g_{j_2, J_2}(\tau_2, n_2) = \mathbf 1_{B_{j_2} \cap J_2} (\tau_2, n_2)\cdot g(\tau_2, n_2)$, we can estimate the left-hand side of \eqref{low} by \begin{align*} \sum_{\substack{N_0\ge 1\\ \text{dyadic}}} \sum_{\substack{J_1 \in \mathcal{J}_1 \\ J_2 \in \mathcal{J}_2 (J_1)}} \sum_{\substack{j_1, j_2\in \mathbb{N}\\ |j_1 - j_2| \le 1}} \bigg| \sum_{\substack{n, n_1 \in \mathbb{Z}^2\\ n = n_1 - n_2\\|n| \sim N_0}} & \iintt_{\tau = \tau_1 - \tau_2} f_{j_1, J_1} (\tau_1, n_1) g_{j_2, J_2} (\tau_2, n_2) \\ &\times h(\tau, n) \cdot \mathbf 1_{S_{\tau, n, j_1, j_2, J_1, J_2}}(\tau_1, n_1) d\tau d\tau_1 \bigg|, \end{align*} \noindent where the set $S_{\tau, n, j_1, j_2, J_1, J_2}$ is defined by \begin{align} \begin{split} S_{\tau, n, j_1, j_2, J_1, J_2} := \big\{ &(\tau_1, n_1) \in \mathbb{R} \times \mathbb{Z}^2: (\tau_1, n_1) \in \mathfrak{P}_{N_1} \cap \mathfrak{S}_{L_1} \cap A_{j_1}, \, n_1 \in J_1 \\ &(\tau_1 - \tau, n_1 - n) \in \mathfrak{P}_{N_2} \cap \mathfrak{S}_{L_2}\cap B_{j_2}, \, n_1 - n \in J_2, \\ & |\cos \angle (n, n_1 - n)| \ll \theta \big\}. \end{split} \label{C1a} \end{align} By the Cauchy-Schwarz inequality in $\tau_1$ and $n_1$, H\"older's inequality in $\tau$ and $n$, and H\"older's inequality in $j$, we then have \begin{align*} &\text{LHS of }\eqref{low} \\ &\leq \sum_{\substack{N_0\ge 1\\ \text{dyadic}}} \sum_{\substack{J_1 \in \mathcal{J}_1\\ J_2 \in \mathcal{J}_2 (J_1)}} \sum_{\substack{j_1, j_2\in \mathbb{N}\\ |j_1 - j_2| \le 1}} \sum_{n: |n| \sim N_0} \int \| \mathbf 1_{S_{\tau, n, j_1, j_2, J_1, J_2}}\|_{L^2_{\tau_1} \l^2_{n_1}}\\ &\qquad \times \| f_{j_1, J_1} (\tau_1, n_1) g_{j_2, J_2} (\tau_1 - \tau, n_1 - n)\|_{L^2_{\tau_1} \l^2_{n_1}} |h(\tau, n)| d\tau \\ &\leq \sum_{\substack{N_0\ge 1\\ \text{dyadic}}} \sum_{\substack{J_1 \in \mathcal{J}_1 \\ J_2 \in \mathcal{J}_2 (J_1)}} \sum_{\substack{j_1, j_2\in \mathbb{N}\\ |j_1 - j_2| \le 1}} \underline{L}_{12}^{\frac 12} \| f _{j_1, J_1} \|_{L_{\tau_1}^2 \l_{n_1}^2} \| g_{j_2, J_2} \|_{L_{\tau_2}^2 \l_{n_2}^2} \| h \|_{L_\tau^2 \l_n^2} \\ &\qquad \times \sup_{\substack{\tau, \tau_1, n\\ |n| \sim N_0}} \big|\widetilde S_{\tau, \tau_1, n, j_1, j_2, J_1, J_2}\big|^{\frac 12} \\ &\lesssim \sum_{\substack{N_0\ge 1\\ \text{dyadic}}} \sum_{\substack{J_1 \in \mathcal{J}_1 \\ J_2 \in \mathcal{J}_2 (J_1)}} \underline{L}_{12}^{\frac 12} \| \mathbf 1_{J_1}\cdot f \|_{L_{\tau_1}^2 \l_{n_1}^2} \| \mathbf 1_{J_2} \cdot g\|_{L_{\tau_2}^2 \l_{n_2}^2} \| h \|_{L_\tau^2 \l_n^2} \\ &\qquad \times \sup_{\substack{\tau, \tau_1, n, j_1, j_2\\ |n| \sim N_0}} \big|\widetilde S_{\tau, \tau_1, n, j_1, j_2, J_1, J_2}\big|^{\frac 12} , \end{align*} \noindent where the set $\widetilde S_{\tau, \tau_1, n, j_1, j_2, J_1, J_2}$ is defined by \begin{align} \widetilde S_{\tau, \tau_1, n, j_1, j_2, J_1, J_2} := &\big\{ n_1 \in \mathbb{Z}^2: (\tau_1, n_1) \in S_{\tau, n, j_1, j_2, J_1, J_2} \big\}. \label{C1b} \end{align} We claim that the following bound holds: \begin{align} \sup_{\substack{J_1 \in \mathcal{J}_1\\J_2 \in \mathcal{J}_2(J_1)}} \sup_{\tau, \tau_1, n, j: |n| \sim N_0} \big| \widetilde S_{\tau, \tau_1, n, j_1, j_2, J_1, J_2}\big| \lesssim \min\bigg( N_0, \frac{L_{\textup{max}}}{N_0} \bigg). \label{C2} \end{align} \noindent For now, let us assume \eqref{C2}. Note that the right-hand side of \eqref{C2} is bounded by $L_{\max}^\frac{1}{2}$. Then, by applying the Cauchy-Schwarz inequality in $J_1 \in \mathcal{J}_1$ and summing over dyadic $N_0 \geq 1$ together with \eqref{C2}, we obtain the desired bound \eqref{low}. It remains to prove \eqref{C2}. For $n_1 \in \widetilde S_{\tau, \tau_1, n, j_1, j_2, J_1, J_2}$, it follows from \eqref{C1b} with \eqref{C1a} that \[ \tau_1 \in \big( - |n_1|^2 + [-C L_1, C L_1] \big) \cap \big( \tau - |n_1 - n|^2 + [-C L_2, C L_2] \big), \] for some constant $C > 0$. Since this intersection of the two sets is nonempty, we must have $\big| -|n_1|^2 - (\tau - |n_1 - n|^2) \big| = O(\overline{L}_{12})$, which in turn implies \begin{align} n_1 \cdot \frac{n}{|n|} = -\frac{\tau}{2|n|} + \frac{|n|}{2} + O\bigg( \frac{\overline{L}_{12}}{N_0} \bigg). \label{C3} \end{align} \noindent On the other hand, for $n_1 \in \widetilde S_{\tau, \tau_1, n, j_1, j_2, J_1, J_2}$, we also have $n_1 \in J_1$ where $J_1$ is a ball of radius $\sim N_0$. Hence, together with \eqref{C3}, we see that the component of $n_1$ which is parallel to $n$ is restricted to an interval of length $\sim \min(N_0, L_{\text{max}} / N_0)$. Furthermore, we have \begin{align*} \begin{split} |\cos \angle (n_1, n)| & = \frac{|n_1 \cdot n|}{|n_1| | n|} \leq \frac{|n|}{|n_1|} + \frac{|(n_1 - n)\cdot n|}{|n_1||n|}\\ & \leq \frac{|n|}{|n_1|} + |\cos \angle (n_1 - n, n)| \frac{|n_1 - n|}{|n_1|} \ll \frac{|n|}{|n_1|} + \frac{|n_1 - n|^\varepsilon}{|n|^{1-\varepsilon} |n_1|} \ll 1, \end{split} \end{align*} \noindent since $|n_1|\sim |n_1 - n|\gg |n|^2$. Hence, by Lemma \ref{LEM:count} with $\mu = 1$, $\nu \sim \min(N_0, L_{\textup{max}} / N_0)$, and $\alpha = \frac \pi 4$, we obtain \eqref{C2}. The case $L_{\text{max}} \ll |n|$ is similar and much simpler. We apply the same steps as in the previous case ($L_{\max}\gtrsim |n|$), except that we do not need to decompose the spatial frequencies of $n$ into dyadic piece or to localize $n_1$ and $n_2$ on balls of smaller radii. In this case, we apply Lemma \ref{LEM:count} with $\nu \sim 1$ to obtain the desired bound. \end{proof} \medskip \noindent $\bullet$ \textbf{Case 3:} $|n_2|^2 \ll |n|$. This case is similar to Case 2, so we will be brief here. For the low-modulation case (i.e.~$L_{\text{max}} \ll N_0$), the same argument works by switching the roles of $(\tau, n)$ and $(\tau_2, n_2)$. For the high-modulation case (i.e.~$L_{\text{max}} \gtrsim N_0$), we need to ensure that on the right-hand side of \eqref{high} in Lemma \ref{LEM:high}, the power of $L_0$ is less than $\frac 12$ (so that simply switching the roles of $(\tau, n)$ and $(\tau_2, n_2)$ does not work). With $f$, $g$, and $h$ as in the statement of Lemma~\ref{LEM:high}, when $N_2^2 \ll N_0 \sim N_1$ and $L_{\text{max}} \gtrsim N_0$, we use the Cauchy-Schwarz inequality in $\tau$ and $n$ and apply Lemma \ref{LEM:bilin} to obtain \begin{align*} \text{LHS of } \eqref{high} &\lesssim \| h \|_{L_\tau^2 \ell_n^2} \underline{L}_{12}^{\frac 12} \bigg( \frac{\overline{L}_{12}}{N_0} + 1 \bigg)^{\frac 12 } N_2^{\frac 12} \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \\ &\lesssim \big( L_1^{\frac 12} L_2^{\frac 12} + \underline{L}_{12}^{\frac 12} N_0^{\frac 14} \big) \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| h \|_{L_\tau^2 \ell_n^2} \\ &\lesssim \big( L_1^{\frac 12} L_2^{\frac 12} L_{\text{max}}^{0+} + \underline{L}_{12}^{\frac 12} L_{\text{max}}^{\frac 14 +} \big) N_0^{0-} \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| h \|_{L_\tau^2 \ell_n^2}, \end{align*} \noindent which suffices for our purpose. \begin{remark}\label{REM:bilin} \rm The bilinear estimate \eqref{bilin1} in Proposition \ref{PROP:bilin} also holds if we replace $u \overline{v}$ by $uv$. In fact, a slight modification of the argument allows us to show \begin{equation} \| u v \|_{X_T^{0,-\frac 12 + \delta_1}} \lesssim \| u \|_{X_T^{0, \frac 12 + \delta_2}} \| v \|_{X_T^{0, \frac 12 + \delta_2}}, \label{bilin_uv} \end{equation} \noindent where $0 < T \leq 1$ and $\delta_1 > \delta_2 > 0$ are sufficiently small. Note that, in this case, by denoting $n_1$, $n_2$, and $n$ as the frequency of $u$, $v$, and the duality term $w$, respectively. we have $n = n_1 + n_2$ and $\tau = \tau_1 + \tau_2$ so that \[ (\tau + |n|^2) - (\tau_1 + |n_1|^2) - (\tau_2 + |n_2|^2) = 2n_1 \cdot n_2. \] \noindent Hence, we need to perform case-by-case analysis, depending on the interaction between $n_1$ and $n_2$. The proof of \eqref{bilin_uv} follows essentially as in the proof of \eqref{bilin1} except for Lemma \ref{LEM:high}. With $f$, $g$, and $h$ as in the statement of Lemma \ref{LEM:high}, when $N_1^2 \ll N_2 \sim N_0$ and $L_{\text{max}} \gtrsim N_2$, the Cauchy-Schwarz inequality in $\tau_2$ and $n_2$ and Lemma \ref{LEM:bilin} yield \begin{equation} \begin{split} \bigg| \sum_{\substack{n, n_1\in \mathbb{Z}^2\\ n = n_1 + n_2}} & \iintt_{\tau = \tau_1 + \tau_2} f(\tau_1, n_1) g(\tau_2, n_2) h(\tau, n) d\tau d\tau_1 \bigg| \\ &\lesssim \big( L_0^{\frac 12} L_1^{\frac 12} N_2^{-\frac 14} + \underline{L}_{01}^{\frac 12} N_2^{\frac 14} \big) \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| h \|_{L_\tau^2 \ell_n^2}. \end{split} \label{uv1} \end{equation} \noindent In order to repeat the argument in Subcase 2.a in the proof of Proposition \ref{PROP:bilin}, we need the power of $L_0$ to be less than $\frac 12$, especially when $L_{\text{max}} = L_0$. Namely, the bound \eqref{uv1} can not be used directly as it is. By H\"older's inequality in $\tau$ and $n$, Young's inequality, and H\"older's inequality with \eqref{high1}, we obtain \begin{equation} \begin{split} \bigg| \sum_{\substack{n, n_1\in \mathbb{Z}^2\\ n = n_1 + n_2}} & \iintt_{\tau = \tau_1 + \tau_2} f(\tau_1, n_1) g(\tau_2, n_2) h(\tau, n) d\tau d\tau_1 \bigg| \\ &\lesssim \| f \|_{\ell_{n_1}^2 L_{\tau_1}^{\frac 8 7}} \| g \|_{\ell_{n_2}^1 L_{\tau_2}^2} \| h \|_{\ell_n^2 L_{\tau}^{\frac 85}} \\ &\lesssim L_0^{\frac 18} L_1^{\frac 38} N_2 \| f \|_{L_{\tau_1}^2 \ell_{n_1}^2} \| g \|_{L_{\tau_2}^2 \ell_{n_2}^2} \| h \|_{L_\tau^2 \ell_n^2}. \end{split} \label{uv2} \end{equation} \noindent Then, by interpolating \eqref{uv1} and \eqref{uv2}, we obtain the desired inequality. A similar inequality also holds when $N_2^2 \ll N_1 \sim N_0$ and $L_{\text{max}} \gtrsim N_1$ by switching the roles of $(\tau_1, n_1)$ and $(\tau_2, n_2)$. \end{remark} \section{Local well-posedness of the quadratic NLS} \label{SEC:LWP} In this section, we present the proof of Theorem \ref{THM:LWP}, i.e. local well-posedness of the quadratic NLS \eqref{qNLS} in $L^2(\mathbb{T}^2)$. By writing \eqref{qNLS} in the following Duhamel formulation, we have \begin{equation} u(t) = \Gamma(u) := e^{it\Delta} u_0 - i \int_0^t e^{i(t-t')\Delta} |u|^2(t') dt'. \label{Duh} \end{equation} \noindent Let $\varepsilon > 0$ be sufficiently small. Then, by \eqref{Duh}, Lemma \ref{LEM:Xlin}, and Proposition \ref{PROP:bilin}, we have \begin{align*} \| \Gamma(u) \|_{X_T^{0, \frac 12 + \varepsilon}} &\leq \| e^{it\Delta} u_0 \|_{X_T^{0, \frac 12 + \varepsilon}} + \bigg\| \int_0^t e^{i(t-t')\Delta} u(t') \overline{u}(t') dt' \bigg\|_{X_T^{0, \frac 12 + \varepsilon}} \\ &\lesssim \| u_0 \|_{L^2} + T^{\varepsilon }\| u \overline{u} \|_{X^{0, -\frac 12 + 2 \varepsilon}} \\ &\lesssim \| u_0 \|_{L^2} + T^{\varepsilon } \| u \|_{X_T^{0, \frac 12 + \varepsilon}}^2. \end{align*} \noindent Similarly, we obtain the following difference estimate: \begin{align*} \| \Gamma(u) - \Gamma(v) \|_{X_T^{0, \frac 12 + \varepsilon}} \lesssim T^{ \varepsilon}\Big( \| u \|_{X_T^{0, \frac 12 + \varepsilon}} + \| v \|_{X_T^{0, \frac 12 + \varepsilon}} \Big) \| u-v \|_{X_T^{0, \frac 12 + \varepsilon}} . \end{align*} \noindent Therefore, by choosing $T = T(\| u_0 \|_{L^2}) > 0$ sufficiently small, we conclude that $\Gamma$ is a contraction on the ball $B_R \subset X^{0, \frac 12 + \varepsilon}_T$ of radius $R \sim \| u_0 \|_{L^2}$. This proves Theorem~\ref{THM:LWP}. \begin{ackno}\rm R.L.~and T.O.~were supported by the European Research Council (grant no.~864138 ``SingStochDispDyn''). They are also grateful to the anonymous referee for the helpful comments. \end{ackno}
e69f5abbce1b912e9c8f79cc50a16658cad5d652
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
adc83b19e793491b1c6ea0fd8b46cd9f32e592fc
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} \noindent The classical linear-time / branching-time spectrum~\cite{Glabbeek90} organizes a plethora of notions of behavioural equivalence on labelled transition systems at various levels of granularity ranging from (strong) bisimilarity to trace equivalence. Similar spectra appear in other system types, e.g.~on probabilistic systems, again ranging from branching-time equivalence such as probabilistic bisimilarity to linear-time ones such as probabilistic trace equivalence~\cite{JouSmolka90}. While the variation in system types (nondeterministic, probabilistic, etc.) is captured within the framework of \emph{universal coalgebra}~\cite{Rutten00}, the variation in the granularity of equivalence, which we shall generally refer to as the \emph{semantics} of systems, has been tackled, in coalgebraic generality, in a variety of approaches~\cite{HJS07,KR15,JSS15,JLR18}. One setting that manages to accommodate large portions of the linear-time / branching-time spectrum, notably including also intermediate equivalences such as ready similarity, is based on \emph{graded monads}~\cite{MPS15,DMS19,FMS21a}. An important role in the theoretical and algorithmic treatment of a behavioural equivalence is classically played by equivalence games~\cite{Glabbeek90,Stirling99}, e.g.~in partial-order techniques~\cite{hnw:por-bisimulation-checking} or in on-the-fly equivalence checking~\cite{h:bisim-verif-journal}. In the present work, we contribute to \emph{graded semantics} in the sense indicated above by showing that, under mild conditions, we can extract from a given graded monad a Spoiler-Duplicator game~\cite{Stirling99} that characterizes the respective equivalence, i.e.~ensures that two states are equivalent under the semantics iff Duplicator wins the game. As the name suggests, graded monads provide an \emph{algebraic} view on system equivalence; they correspond to \emph{grad\-ed theories}, i.e.~algebraic theories equipped with a notion of \emph{depth} on their operations. It has been noticed early on~\cite{MPS15} that many desirable properties of a semantics depend on this theory being \emph{depth-1}, i.e.~having only equations between terms that are uniformly of depth~1. Standard examples include distribution of actions over non-deterministic choice (trace semantics) or monotonicity of actions w.r.t.~the choice ordering (similarity)~\cite{DMS19}. Put simply, our generic equivalence game plays out an equational proof in a depth-1 equational theory in a somewhat nontraditional manner: Duplicator starts a round by playing a set of equational assumptions she claims to hold at the level of successors of the present state, and Spoiler then challenges one of these assumptions. In many concrete cases, the game can be rearranged in a straightforward manner to let Spoiler move first as usual; in this view, the equational claims of Duplicator roughly correspond to a short-term strategy determining the responses she commits to playing after Spoiler's next move. In particular, the game instantiates, after such rearrangement, to the standard pebble game for bisimilarity. We analyse additional cases, including similarity and trace equivalence, in more detail. In the latter case, several natural variants of the game arise by suitably restricting strategies played by Duplicator. It turns out that the game is morally played on a form of pre-determinization of the given coalgebra, which lives in the Eilenberg-Moore category of the zero-th level of the graded monad, and as such generalizes a determinization construction that applies in certain instances of coalgebraic language semantics of automata~\cite{JSS15}. Under suitable conditions on the graded monad, this pre-determinization indeed functions as an actual determinization, i.e.~it turns the graded semantics into standard coalgebraic behavioural equivalence for a functor that we construct on the Eilenberg-Moore category. This construction simultaneously generalizes, for instance, the standard determinization of serial labelled transition systems for trace equivalence and the identification of similarity as behavioural equivalence for a suitable functor on posets~\cite{KKV12} (specialized to join semilattices). While graded semantics has so far been constrained to apply only to finite-depth equivalences (finite-depth bisimilarity, finite trace equivalence, etc.), we obtain, under the mentioned conditions on the graded monad, a new notion of infinite-depth equivalence induced by a graded semantics, namely via the (pre-)determinization. It turns out the natural infinite version of our equivalence game captures precisely this infinite-depth equivalence. This entails a fixpoint characterization of graded semantics on finite systems, giving rise to perspectives for a generic algorithmic treatment. \paragraph{Related Work.} Game characterizations of process equivalences are an established theme in concurrency theory; they tend to be systematic but not generic~\cite{Glabbeek90,CD08}. Work on games for spectra of quantitative equivalences is positioned similarly~\cite{FLT11,fl:quantitative-spectrum-journal}. The idea of developing \mbox{(bi)}simulation games in coalgebraic generality goes back to work on branching-time simulations based on relators~\cite{Baltag00}. There is recent highly general work, conducted in a fibrational setting, on so-called codensity games for various notions of bisimilarity~\cite{kkhkh:codensity-games}. The emphasis in this work is on generality w.r.t.~the measure of bisimilarity, covering, e.g.~two-valued equivalences, metrics, pre-orders, and topologies, while, viewed through the lens of spectra of equivalences, the focus remains on branching time. The style of the codensity game is inspired by modal logic, in the spirit of coalgebraic Kantorovich liftings~\cite{BaldanEA18,WildSchroder20}; Spoiler plays predicates thought of as arguments of modalities. Work focused more specifically on games for Kantorovich-style coalgebraic behavioural equivalence and behavioural metrics~\cite{km:bisim-games-logics-metric} similarly concentrates on the branching-time case. A related game-theoretic characterization is implicit in work on $\Lambda$-(bi)similarity~\cite{GorinSchroder13}, also effectively limited to branching-time. Comonadic game semantics~\cite{ADW17, AS18, CD21} proceeds in the opposite way compared to the mentioned work and ours: It takes existing games as the point of departure, and then aims to develop categorical models. Graded semantics was developed in a line of work mentioned above~\cite{MPS15,DMS19,FMS21a}. The underlying notion of graded monad stems from algebro-geometric work~\cite{Smirnov08} and was introduced into computer science (in substantially higher generality) in work on the semantics of effects~\cite{Katsumata14}. Our pre-determinization construction relates to work on coalgebras over algebras~\cite{BK11}. \paragraph*{Organization.} We discuss preliminaries on categories, coalgebras, graded monads, and games in \cref{sec:prelims}. We recall the key notions of graded algebra and canonical graded algebra in~\cref{sec:algebras}, and graded semantics in~\cref{sec:semantics}. We introduce our pre-determinization construction in \cref{sec:determinization}, and finite behavioural equivalence games in \cref{S:games}. In \cref{sec:infinte-depth}, we consider the infinite version of the game, relating it to behavioural equivalence on the pre-determinization. We finally consider specific cases in detail in~\cref{sec:cases}. \section{Preliminaries}\label{sec:prelims} We assume basic familiarity with category theory~\cite{AHS90}. We will review the necessary background on coalgebra~\cite{Rutten00}, graded monads~\cite{Smirnov08,MPS15}, and the standard bisimilarity game~\cite{Stirling99}. \paragraph*{The category of sets.} Unless explicitly mentioned otherwise, we will work in the category $\mathbf{Set}$ of sets and functions (or \emph{maps}), which is both complete and cocomplete. We fix a terminal object $1=\{\star\}$ and use $!_{X}$ (or just $!$ if confusion is unlikely) for the unique map $X\to 1$. In the subsequent sections, we will mostly draw examples from (slight modifications of) the following (endo-)functors on $\mathbf{Set}$. The \emph{powerset functor} $\pow$ sends each set $X$ to its set of subsets $\pow X$, and acts on a map $f\colon X\to Y$ by taking direct images, i.e.~$\pow f(S):= f[S]$ for $S\in\pow X$. We write $\pow_{\mathsf f}$ for the \emph{finitary powerset functor} which sends each set to its set of finite subsets; the action of $\pow_{\mathsf f}$ on maps is again given by taking direct images. Similarly, $\pow^+$ denotes the non-empty powerset functor ($\pow^+(X)=\{Y\in\pow(X)\mid Y\neq\emptyset\}$), and $\pow_{\mathsf f}^+$ its finitary subfunctor ($\pow_{\mathsf f}^+(X)=\{Y\in\pow_{\mathsf f}(X)\mid Y\neq\emptyset\}$). We write $\CalD X$ for the set of \emph{distributions} on a set $X$: maps $\mu\colon X\to [0,1]$ such that $\sum_{x\in X}\mu(x)=1$. A distribution $\mu$ is \emph{finitely supported} if the set $\{x\in X~|~\mu(x)\neq 0\}$ is finite. The set of finitely supported distributions on $X$ is denoted $\CalD_f X$. The assignment $X\mapsto\CalD X$ is the object-part of a functor: given $f\colon X\to Y$, the map $\CalD f\colon\CalD X\to \CalD Y$ assigns to a distribution $\mu\in\CalD X$ the \emph{image} distribution $\CalD f(\mu)\colon Y\to [0, 1]$ defined by $\CalD f(\mu)(y)=\sum_{x\in X\mid f(x)=y} \mu(x)$. Then, $\CalD f(\mu)$ is finitely supported if $\mu$ is, so $\CalD_f$ is functorial as well. \takeout{ We will also consider the \emph{contravariant powerset functor} $\Q\colon\mathbf{Set}\to\mathbf{Set}^{op}$, which acts on sets according to $\pow$, i.e.~$\Q(X):= \pow X$, but sends a map $f\colon X\to Y$ to the \emph{inverse image map} $\Q f\colon\pow Y\to \pow X$ defined by $S\mapsto f^{-1}[S]$. The composite functor $\CalN:=(\mathbf{Set}\xra{\Q}\mathbf{Set}^{op}\xra{\Q^{op}}\mathbf{Set})$ is called the \emph{neighborhood functor}. Explicitly, $\CalN$ is the endofunctor on $\mathbf{Set}$ which sends a set $X$ to the set $\pow(\pow X)$ of all \emph{neighborhoods} of~$X$, and it sends a map $f\colon X\to Y$ to the map $\CalN f\colon\CalN X\to \CalN Y$ defined by the assignment $\mathscr S\mapsto\{S\in \pow Y~|~f^{-1}[S]\in \mathscr S\}$. \takeout{ We will also work with the \emph{(finitely supported) distribution functor} $\CalD\colon\mathbf{Set}\to\mathbf{Set}$ is the functor which sends a set $X$ to the set of \emph{(finitely supported) probability distributions on $X$}. That is, $\CalD X$ consists of all maps $\varphi\colon X\to [0,1]$ (where $[0,1]$ denotes the real unit interval) such that \[ \sum_{x\in X}\varphi(x) = 1 \] and such that the \emph{support} $\Support(\varphi):=\{x\in X\mid\varphi(x)\ne 0\}$ is finite. It is well known (and easy to see) that each $\varphi\in\CalD X$ is equivalently presented as the formal convex sum \[ \sum_{x\in\Support(\varphi)} \varphi(x)\cdot x. \] In this notation, the action $\CalD f\colon \CalD X\to\CalD Y$ on a map $f\colon X\to Y$ is conveniently described via the assignment $\sum_{i\leq k}r_i\cdot x_i \mapsto \sum_{i\leq k} r_i\cdot f(x_i).$ \noindent \paragraph*{Coalgebra.} We will review the basic definitions and results of \emph{universal coalgebra}~\cite{Rutten00}, a categorical framework for the uniform treatment of a variety of reactive system types. \begin{defn} For an endofunctor $G\colon\CatC\to\CatC$ on a category $\CatC$, a \emph{$G$-coalgebra} (or just \emph{coalgebra}) is a pair $(X, \gamma)$ consisting of an object $X$ in $\CatC$ and a morphism $\gamma\colon X\to GX$. A \emph{(coalgebra) morphism} from $(X, \gamma)$ to a coalgebra $(Y, \delta)$ is a morphism $h\colon X\to Y$ such that $\delta\cdot h = Fh\cdot\gamma$. \end{defn} \noindent Thus, for $\CatC = \mathbf{Set}$, a coalgebra consists of a set $X$ of \emph{states} and a map $\gamma\colon X\to GX$, which we view as a transition structure that assigns to each state $x\in X$ a structured collection $\gamma(x)\in GX$ of \emph{successors} in $X$. \begin{expl}\label{E:coalg} We describe some examples of functors on $\mathbf{Set}$ and their coalgebras for consideration in the subsequent. Fix a finite set $\A$ of \emph{actions}. \begin{enumerate} \item\label{E:coalg:1} Coalgebras for the functor $G=\pow(\A\times -)$ are just \emph{$\A$-labelled transition systems (LTS)}: Given such a coalgebra $(X, \gamma)$, we can view the elements $(a, y)\in\gamma(x)$ as the $a$-successors of~$x$. We call $(X, \gamma)$ \emph{finitely branching} (resp.~\emph{serial} if~$\gamma(x)$ is finite (resp.~non-empty) for all~$x\in X$. Finitely branching (resp.~serial) LTS are coalgebras for the functor $G=\pow_{\mathsf f}(\A\times -)$ (resp. $\pow^+(\A\times -)$). \takeout{ \item A coalgebra for the neighborhood functor $\CalN$ is a \emph{neighborhood frame}~\cite{HKP09}: a map $\nu\colon X\to \CalN X$ assigning each state $x\in X$ to its set of \emph{neighbourhoods} $\nu(x)\in\CalN X$.% \smnote{I wouldn't write $\pow(\pow X)$; this gives the wrong impression that $\N$ is the double covariant powerset functor.} A morphism of neighborhood frames (also: \emph{bounded morphism}) from $(X, \nu)$ to $(X', \nu')$ is a map $f\colon X\to X'$ such that for all $x\in X$: $f^{-1}[V]\in\nu(x)$ iff $V\in\nu'(f(x))$ for all $V\in\pow X'$. \item A coalgebra $(X,\gamma)$ for the functor $G=\CalD(\A\times -)$ is a \emph{(generative) probabilistic transition system} (PTS): The transition structure~$\gamma$ assigns to each state $x\in X$ a distribution $\gamma(x)$ on pairs $(a,y)\in\A\times X$. We think of $\gamma(x)(a, y)$ as the probability of executing an $a$-transition to state~$y$ while sitting in state~$x$. A PTS $(X, \gamma)$ is \emph{finitely branching} if $\gamma(x)$ is finitely supported for all $x\in X$; then, finitely branching PTS are coalgebras for $\CalD_f(\A\times -)$. \end{enumerate} \end{expl} Given coalgebras $(X, \gamma)$ and $(Y, \delta)$ for an endofunctor $G$ on $\mathbf{Set}$, states $x\in X$ and $y\in Y$ are \emph{$G$-behaviourally equivalent} if there exist coalgebra morphisms \[ (X,\gamma) \xra{f} (Z,\zeta) \xla{g} (Y,\delta) \] such that $f(x)= g(y)$. Behavioural equivalence can be approximated via the (initial $\omega$-segment of the) \emph{final chain} $(G^n1)_{n\in\omega}$, where $G^n$ denotes $n$-fold application of $G$. The \emph{canonical cone} of a coalgebra $(X, \gamma)$ is then the family of maps $\gamma_n\colon X\to G^n1$ defined inductively for $n\in\omega$ by \begin{align*} \gamma_0 &= \big(X\xra{!} 1\big), \text{and} \\ \gamma_{n+1} &= \big(X \xra{\gamma} GX \xra{G\gamma_n} GG^n 1 = G^{n+1}1\big). \end{align*} States $x, y\in X$ are \emph{finite-depth behaviourally equivalent} if $\gamma_n(x)= \gamma_n(y)$ for all $n \in \omega$. \begin{rem}\label{rem:finite-depth} It follows from results of Worrell~\cite{Worrell05} that behavioural equivalence and finite-depth behavioural equivalence coincide for finitary functors on $\mathbf{Set}$, where a functor $G$ on $\mathbf{Set}$ is \emph{finitary} if it preserves filtered colimits. Equivalently, for every set $X$ and each $x \in GX$ there exists a finite subset $Y \subseteq X$ such that $x = Gi[GY]$, where $i\colon Y \hookrightarrow X$ is the inclusion map~\cite[Cor.~3.3]{amsw19-1}. \end{rem} \paragraph*{Bisimilarity games.} We briefly recapitulate the classical \emph{bisimilarity game}, a two-player graph game between the players Duplicator (D) and Spoiler (S); player~D tries to show that two given states are bisimilar, while~S tries to refute this. \emph{Configurations} of the game are pairs $(x, y)\in X\times X$ of states in a LTS $(X, \gamma)$. The game proceeds in rounds, starting from the \emph{initial configuration}, which is just the contested pair of states. In each round, starting from a configuration $(x, y)$,~S picks one of the sides, say,~$x$, and then selects an action $a\in\A$ and an $a$-successor~$x'$ of~$x$; player~D then selects a corresponding successor on the other side, in this case an $a$-successor~$y'$ of~$y$. The game then reaches the new configuration $(x', y')$. If a player gets stuck, the play is \emph{winning} for their opponent, whereas any infinite play is winning for~D. It is well known (e.g.~\cite{Stirling99}) that~D has a winning strategy in the bisimilarity game at a configuration $(x, y)$ iff $(x, y)$ is a pair of bisimilar states. Moreover, for finitely branching LTS, an equivalent formulation may be given in terms of the \emph{$n$-round bisimilarity game}: the rules of the $n$-round game are the same as those above, only now~D wins as soon as at most~$n$ rounds have been played. In fact, a configuration $(x, y)$ is a bisimilar pair precisely if~D has a winning strategy in the $n$-round bisimilarity game for all $n\in\omega$. We mention just one obvious variation of this game that characterizes a different spot on the linear-time/branching-time spectrum: The \emph{mutual-simulation game} is set up just like the bisimulation game, except that~S may only choose his side once, in the first round, and then has to move on that side in all subsequent rounds (in the bisimulation game, he can switch sides in every round if he desires). It is easily checked that states~$x,y$ are mutually similar iff~S wins the position $(x,y)$ in the mutual-simulation game. We will see that both these games (and many others) are obtained as instances of our generic notion of graded equivalence game. \paragraph*{Graded monads.} We now review some background material on graded monads \cite{Smirnov08, MPS15}: \begin{defn}\label{D:gradedmonad} A \emph{graded monad} $\M$ on a category $\CatC$ is a triple $(M, \eta, \mu)$ where $M$ is a family of functors $M_n\colon\CatC\to\CatC$ on $\CatC$ ($n\in\omega$), $\eta\colon \mathsf{id} \to M_0$ is a natural transformation (the \emph{unit}), and $\mu$ is a family of natural transformations% \begin{equation} \mu^{n,k}\colon M_nM_k\to M_{n+k} \tag{$n,k\in\omega$} \end{equation} (the \emph{multiplication}) such that the following diagrams commute for all $n,m,k\in\omega$: \begin{equation}\label{diagram:unitlaw} \begin{tikzcd}[column sep=40] & M_n \arrow[ld, "M_n\eta"'] \arrow[rd, "\eta M_n"] \arrow[d, "\Id"] \\ M_nM_0 \arrow[r, "{\mu^{n,0}}"] & M_n & M_0M_n \arrow[l, "{\mu^{0,n}}"'] \end{tikzcd} \end{equation} \begin{equation}\label{diagram:associativelaw} \begin{tikzcd}[column sep = 60] M_nM_kM_m \arrow[r, "{M_n\mu^{k,m}}"] \arrow[d, "{\mu^{n,k}M_m}"'] & M_{n}M_{k+m} \arrow[d, "{\mu^{n,k+m}}"] \\ M_{n+k}M_m \arrow[r, "{\mu^{n+k,m}}"] & M_{n+k+m} \end{tikzcd} \end{equation} We refer to~\eqref{diagram:unitlaw} and~\eqref{diagram:associativelaw} as the \emph{unit} and \emph{associative} laws of $\M$, respectively. We call $\M$ \emph{finitary} if all of the functors $M_n\colon\CatC\to\CatC$ are finitary. \end{defn} \noindent The above notion of graded monad is due to Smirnov \cite{Smirnov08}. Katsumata~\cite{Katsumata14}, Fujii et al.~\cite{FKM16}, and Mellies~\cite{Mellies17} consider a more general notion of graded (or \emph{parametrized}) monad given as a lax monoidal action of a monoidal category $\Mon$ (representing the system of grades) on a category $\CatC$. Graded monads in the above sense are recovered by taking~$\Mon$ to be the (discrete category induced by the) monoid $(\N, +, 0)$. The graded monad laws imply that the triple $(M_0, \eta, \mu^{0,0})$ is a (plain) monad on the base category $\CatC$; we use this freely without further mention. \begin{expl}\label{E:graded-monad} We review some salient constructions~\cite{MPS15} of graded monads on $\mathbf{Set}$ for later use. \begin{enumerate} \item\label{E:graded-monad:1} Every endofunctor $G$ on $\mathbf{Set}$ induces a graded monad~$\M_G$ with underlying endofunctors $M_n:= G^n$ (the $n$-fold composite of~$G$ with itself); the unit $\eta_X\colon X\to G^0X= X$ and multiplication $\mu_X^{n,k}\colon G^nG^kX\to G^{n+k}X$ are all identity maps. We will later see that~$\M_G$ captures (finite-depth) $G$-behavioural equivalence. \item\label{item:graded-kleisli} Let $(T, \eta, \mu)$ be a monad on $\mathbf{Set}$, let $F$ be an endofunctor on $\mathbf{Set}$, and let $\lambda\colon FT\to TF$ be a natural transformation such that \[ \lambda\cdot F\eta=\eta F \qquad\text{and}\qquad \lambda \cdot F\mu = \mu F \cdot T\lambda \cdot \lambda T \] (i.e.~$\lambda$ is a distributive law of the functor~$F$ over the monad~$T$). For each $n\in\omega$, let $\lambda^n\colon F^nT\to TF^n$ denote the natural transformation defined inductively by \[ \lambda^0:= \mathsf{id}_T; \qquad \lambda^{n+1}:= \lambda^n F\cdot F^n\lambda. \] We obtain a graded monad with $M_n:= TF^n$, unit $\eta$, and components $\mu^{n,k}$ of the multiplication given as the composites \[ TF^nTF^k\xra{T\lambda^n F^k} TTF^nF^k = TTF^{n+k}\xra{ \mu F^{n+k}} TF^{n+k}. \] Such graded monads relate strongly to Kleisli-style coalgebraic trace semantics~\cite{HJS07}. \item\label{item:T-traces} We obtain (by instance of the example above) a graded monad $\M_T(\A)$ with $M_n= T(\A^n\times -)$ for every monad $T$ on $\mathbf{Set}$ and every set~$\A$. Thus, $\M_T$ is a graded monad for traces under effects specified by~$T$; e.g.~for $T=\CalD$, we will see that $\M_T(\A)$ captures probabilistic trace equivalence on PTS. \item\label{E:graded-monad:4}Similarly, given a monad $T$, an endofunctor $F$, both on the same category $\CatC$, and a distributive law $\lambda\colon TF \to FT$ of~$T$ over $F$, we obtain a graded monad with $M_n := F^nT$, unit and multiplication given analogously as in item~\ref{item:graded-kleisli} above (see~\cite[Ex.~5.2.6]{MPS15}). Such graded monads relate strongly to Eilenberg-Moore-style coalgebraic language semantics~\cite{bms13} \end{enumerate} \end{expl} Graded variants of Kleisli triples have been introduced and proved equivalent to graded monads (in a more general setting) by Katsumata~\cite{Katsumata14}: \begin{notn}\label{N:star} We will employ the \emph{graded Kleisli star} notation: for $n\in\omega$ and a morphism $f\colon X\to M_k Y$, we write% \begin{equation}\label{Eqn:Kleisli-star} f^*_n:= \big(M_nX\xra{M_nf} M_nM_k\xra{\mu^{n,k}}M_{n+k}Y\big). \end{equation} In this way, we obtain a morphism satisfying the following graded variants~\cite[Def.~2.3]{Katsumata14} of the usual laws of the Kleisli star operation for ordinary monads: for every $m\in\omega$ and morphisms $f\colon X\to M_nY$ and $g\colon Y\to M_kZ$ we have:% \begin{align} f^*_0\cdot\eta_X &= f, \label{item:star-2} \\ (\eta_X)^*_n &= \mathsf{id}_{M_n X}, \label{item:start-3}\\ (g^*_{n}\cdot f)^*_m &= g^*_{m+n}\cdot f_m^*. \label{item:star-1} \end{align} \end{notn} \paragraph*{Graded theories.} Graded theories, in a generalized form in which arities of operations are not restricted to be finite, have been proved equivalent to graded monads on $\mathbf{Set}$~\cite{MPS15} (the finitary case was implicitly covered already by Smirnov~\cite{Smirnov08}). We work primarily with the finitary theories below; we consider infinitary variants of such theories only when considering infinite-depth equivalences (\cref{sec:infinte-depth}). \begin{defn}\label{def:theory} \begin{enumerate} \item A \emph{graded signature} is a set $\Sigma$ of \emph{operations} $f$ equipped with a finite \emph{arity} $\mathsf{ar}(f) \in \omega$ and a finite \emph{depth} $d(f)\in\omega.$ An operation of arity 0 is called a \emph{constant}. \item Let $X$ be a set of \emph{variables} and let $n\in\omega$. The set $\Termsarg{\Sigma, n}(X)$ of \emph{$\Sigma$-terms of uniform depth $n$ with variables in $X$} is defined inductively as follows: every variable $x\in X$ is a term of uniform depth $0$ and, for $f\in\Sigma$ and $t_1,\dots, t_{\mathsf{ar}(f)}\in\Termsarg{\Sigma, k}(X)$, $f(t_1,\dots, t_{\mathsf{ar}(f)})$ is a $\Sigma$-term of uniform depth $k+ d(f)$. In particular, a constant $c$ has uniform depth $k$ for all $k\geq d(c)$. \item A \emph{graded $\Sigma$-theory} is a set $\E$ of \emph{uniform-depth equations}: pairs $(s, t)$, written `$s=t$', such that $s,t\in\Termsarg{\Sigma, n}(X)$ for some $n\in\omega$; % we say that $(s, t)$ is \emph{depth-$n$}. A theory is \emph{depth-$n$} if all of its equations and operations have depth at most $n$. \end{enumerate} \end{defn} \begin{notn}\label{N:substitution} A \emph{uniform-depth substitution} is a map $\sigma\colon X\to\Termsarg{\Sigma, k}(Y)$, where $k\in\omega$ and $X, Y$ are sets. Then $\sigma$ extends to a family of maps $\bar{\sigma}_n\colon\Termsarg{\Sigma, n}(X)\to\Termsarg{\Sigma, k+n}(Y)$ ($n\in\omega$) defined recursively by \[ \bar{\sigma}_n(f(t_1,\dots, t_{\mathsf{ar}(f)})) = f(\bar{\sigma}_m(t_1),\dots, \bar{\sigma}_m(t_{\mathsf{ar}(f)})), \] where $t_i\in\Termsarg{\Sigma, m}$ and $d(f)+m = n$. For a term $t\in T_{\Sigma, k}(X)$, we also write $t\sigma:= \bar{\sigma}_n(t)$ when confusion is unlikely. \end{notn} \noindent Given a graded theory $\T=(\Sigma, \E)$, we have essentially the standard notion of equational derivation (sound and complete over graded algebras, cf.\ \cref{sec:algebras}), restricted to uniform-depth equations. Specifically, the system includes the expected rules for reflexivity, symmetry, transitivity, and congruence, and moreover allows substituted introduction of axioms: If $s=t$ is in~$\E$ and~$\sigma$ is a uniform-depth substitution, then derive the (uniform-depth) equation $s\sigma=t\sigma$. (A substitution rule that more generally allows uniform-depth substitution into derived equations is then admissible.) For a set~$Z$ of uniform-depth equations, we write \begin{equation*} Z\vdash s=t \end{equation*} if the uniform-depth equation $s=t$ is derivable from equations in~$Z$ in this system; note that unlike the equational axioms in~$\E$, the equations in~$Z$ cannot be substituted into in such a derivation (they constitute assumptions on the variables occurring in~$s,t$). We then see that~$\T$ induces a graded monad~$\M_{\T}$ with $M_nX$ being the quotient of $\Termsarg{\Sigma, n}(X)$ modulo derivable equality under $\E$; the unit and multiplication of $\M_{\T}$ are given by the inclusion of variables as depth-0 terms and the collapsing of layered terms, respectively. Conversely, every graded monad arises from a graded theory in this way~\cite{MPS15}. We will restrict attention to graded monads presented by depth-$1$ graded theories: \begin{defn} A \emph{presentation} of a graded monad $\M$ is a graded theory $\T$ such that $\M\cong\M_{\T}$, in the above notation. A graded monad is \emph{depth-1} if it has a depth-$1$ presentation. \end{defn} \begin{expl}\label{E:graded-theory} Fix a set $\A$ of actions. We describe \mbox{depth-$1$} graded theories associated (via the induced behavioural equivalence, \cref{sec:semantics}) to standard process equivalences on LTS and PTS~\cite{DMS19}. \begin{enumerate} \item\label{item:jsl-a} The graded theory $\JSL(\A)$ of \emph{$\A$-labelled join semilattices} has as depth-1 operations all formal sums \[ \textstyle\sum_{i=1}^na_i(-), \quad \text{for \mbox{$n\ge 0$} and $a_1,\dots,a_n\in\A$} \] (and no depth-$0$ operations); we write~$0$ for the empty formal sum. The axioms of $\JSL(\A)$ consist of all depth-1 equations $\sum_{i=1}^na_i(x_i) = \sum_{j=1}^m b_j(y_j)$ (where the~$x_i$ and~$y_j$ are variables, not necessarily distinct) such that $\{(a_i, x_i)~|~1\le i\leq n\}=\{(b_j, y_j)~|~1\le j\leq m\}$. The graded monad induced by $\JSL(\A)$ is $\M_G$ for $G=\pow_{\mathsf f}(\A\times(-))$ (cf.~\cref{E:graded-monad}.\ref{E:graded-monad:1}). \item\label{item:pt-a} The \emph{graded theory of probabilistic traces}, $\mathsf{PT}(\A)$, has a depth-0 convex sum operation \[ \textstyle\sum^n_{i = 1} p_i\cdot(-) \quad \text{for all $p_1, \ldots, p_n \in [0,1]$ such that $\sum^n_{i=1} p_i = 1$} \] and unary depth-1 operations $a(-)$ for all actions $a\in\A$. As depth-0 equations, we take the usual equational axiomatisation of convex algebras, which is given by the equation $\sum^n_{i = 1}\delta_{ij}\cdot x_j = x_i$ (where $\delta_{ij}$ denotes the Kronecker delta function) and all instances of the equation scheme \[ \sum^n_{i = n} p_i\cdot \sum^m_{j=1} q_{ij}\cdot x_j = \sum_{j=1}^m \Big(\sum^{n}_{i=1}p_iq_{ij}\Big)\cdot x_j. \] We further impose depth-1 equations stating that actions distribute over convex sums: \[ a\Big(\sum_{i=1}^np_i\cdot x_i\Big) = \sum_{i=1}^n p_i\cdot a(x_i). \] The theory $\mathsf{PT}(\A)$ presents~$\M_{\CalD_f}(\A)$, where $\CalD_f$ is the finitely supported distribution monad (cf.~\cref{E:graded-monad}.\ref{item:T-traces}). \item\label{item:traces-a} We mention two variations on the graded theory above. First, the \emph{graded theory of (non-deterministic) traces} presenting $\M_{\pow_{\mathsf f}}(\A)$ has depth-0 operations~$+$,~$0$ and equations for join-semilattices with bottom, and unary depth-1 operations~$a$ for $a\in\A$ as in \ref{item:jsl-a} above; the depth-1 equations now state that actions distribute over joins and preserve bottom. Second, the \emph{graded theory of serial (non-deterministic) traces} arises by omitting~$0$ and associated axioms from the graded theory of traces, and yields a presentation of $\M_{\pow_{\mathsf f}^+}(\A)$. \item\label{item:simulation-a} The \emph{graded theory of simulation} has the same signature and depth-0 equations as the graded theory of traces, along with depth-1 equations stating that actions are monotone: \[ a(x+y) + a(x) = a(x+y). \] The theory of simulation equivalence then yields a presentation of the graded monad with $M_nX$ defined inductively along with a partial ordering as follows: We take \mbox{$M_0X = \pow_{\mathsf f}(X)$} ordered by set inclusion. We equip $\A\times M_nX$ with the product ordering of the discrete order on $\A$ and the given ordering on $M_nX$. Then $M_{n+1}X = \pow_{\mathsf f}^{\downarrow}(\A\times M_nX)$ is the set of downwards-closed finite subsets of $\A\times M_nX$. \end{enumerate} \end{expl} In the following lemma, an \emph{epi-transformation} is a natural transformation $\alpha$ whose components $\alpha_X$ are surjective maps. \begin{notheorembrackets} \begin{lem}[{\cite{MPS15}}]\label{L:depth-1} A graded monad $\M$ on $\mathbf{Set}$ is \emph{depth-1} if and only if all $\mu^{1,n}$ are epi-transformations and the following is object-wise a coequalizer diagram in the category of Eilenberg-Moore algebras for the monad $M_0$ for all $n\in\omega$: \begin{equation} \begin{tikzcd}[column sep = 35]\label{Diagram:depth1} M_1M_0M_n \arrow[r, "M_1\mu^{0,n}", shift left] \arrow[r, "\mu^{1,0}M_n"', shift right] & M_1M_n \arrow[r, "\mu^{1,n}"] & M_{1+n}. \end{tikzcd} \end{equation} \end{lem} \end{notheorembrackets} \section{Graded Behavioural Equivalences}\label{sec:semantics} We next recall the notion of a graded semantics~\cite{MPS15} on coalgebras for an endofunctor on $\mathbf{Set}$; we illustrate several instantiations of subsequent interest. \begin{defn}[Graded semantics] A \emph{(depth-1) graded semantics} for an endofunctor $G\colon\mathbf{Set}\to\mathbf{Set}$ is a pair $(\alpha, \M)$ consisting of a (depth-1) graded monad $\M$ on $\mathbf{Set}$ and a natural transformation $\alpha\colon G\to M_1$ . \end{defn} \noindent Given a $G$-coalgebra $(X,\gamma)$, the graded semantics $(\alpha, \M)$ induces a sequence of maps $\gamma^{(n)}\colon X\to M_n1$ inductively defined by \begin{align*} \gamma^{(0)} &:= (X\xra{\eta_X}M_0X\xra{M_0!}M_01); \\ \gamma^{(n+1)} &:= (X\xra{\alpha_X\cdot\gamma} M_1X \xra{M_1\gamma^{(n)}} M_1M_n 1 \xra{\mu^{1,n}_1} M_{1+n}1) \end{align*} (or, using the graded Kleisli star, $\gamma^{(n+1)} = (\gamma^{(n)})^*_1\cdot\alpha_X\cdot\gamma$). We call $\gamma^{(n)}(x)\in M_n1$ the \emph{$n$-step $(\alpha, \M)$-behaviour} of $x\in X$. \begin{defn}[Graded behavioural equivalence] States ${x\in X, y\in Y}$ in $G$-coalgebras $(X, \gamma)$ and $(Y, \delta)$ are \emph{depth-n behaviourally equivalent} under $(\alpha, \M)$ if ${\gamma^{(n)}(x) = \delta^{(n)}(y)}$, and \emph{$(\alpha, \M)$-behaviourally equivalent} if $\gamma^{(n)}(x) = \delta^{(n)}(y)$ for all $n\in\omega$. We refer to $(\alpha,\M)$-behavioural equivalence as a \emph{graded behavioural equivalence} or just a \emph{graded equivalence}. \end{defn} \begin{expl}\label{E:semantics} We recall~~\cite[Section 4]{DMS19} several graded equivalences, restricting primarily to LTS and PTS. \begin{enumerate} \item\label{item:sem-beh} For an endofunctor $G$ on $\mathbf{Set}$, finite-depth $G$-behavioural equivalence arises as the graded equivalence with $\M = \M_G$ and $\alpha = \mathsf{id}$, where $\M_G$ is the graded monad of \cref{E:graded-monad}.\ref{E:graded-monad:1}. By~\cref{rem:finite-depth}, it follows that $(\mathsf{id}, \M_G)$ captures full coalgebraic bisimilarity in case $G$ is finitary. \item\label{item:sem-trace} Let $(X, \gamma)$ be an LTS, let ${x\in X}$, and let ${w\in\A^*}$ be a finite word over $\A$. We write $x\xra{w} y$ if the state $y$ can be reached on a path whose labels form the word $w$. A \emph{finite trace} at $x\in X$ is a word $w\in\A^*$ such that $x\xra{w} y$ for some $y\in X$; the set of finite traces at $x$ is denoted $\tau(x)$. States $x,y\in X$ are trace equivalent if $\tau(x)=\tau(y)$. Trace equivalence on finitely branching LTS is captured by the graded equivalence induced by $\M=\M_{\pow_{\mathsf f}}(\A)$ (cf.~\cref{E:graded-monad}.\ref{item:T-traces}), again with $\alpha=\mathsf{id}$; replacing $\pow_{\mathsf f}$ with $\pow^+$ (or with $\pow_{\mathsf f}^+$) yields trace equivalence on serial (and finitely branching) LTS. \item\label{item:sem-prob} Probabilistic trace equivalence on PTS is the graded equivalence induced by $\M=\M_{\CalD_f}(\A)$ (cf.~\cref{E:graded-monad}.\ref{item:T-traces}) and $\alpha = \mathsf{id}$: The maps~$\gamma^{(k)}$ equip states with distributions on length-$k$ action words, and the induced equivalence identifies states $x$ and $y$ whenever these distributions coincide at~$x$ and~$y$ for all~$k$. \item\label{item:sem-sim} Simulation equivalence on LTS can also be construed as a graded equivalence by taking $\M$ to be the graded monad described in \cref{E:graded-theory}.\ref{item:simulation-a}, and \begin{eqnarray*} \alpha_X\colon\pow_{\mathsf f}(\A\times X) & \to & \pow^{\downarrow}_f(\A\times\pow_{\mathsf f} X) \\ S\ & \mapsto & {\downarrow}\{(a,\{x\})\mid (a,x)\in S\} \end{eqnarray*} where $\downarrow$ takes downsets. \end{enumerate} \end{expl} \begin{rem} It follows from the depth-1 presentations described in~\cref{E:graded-theory} that the graded semantics mentioned in \cref{E:semantics} are depth-1. \end{rem} \section{Graded Algebras}\label{sec:algebras} Graded monads come equipped with graded analogues of both the Eilenberg-Moore and Kleisli constructions for ordinary monads. In particular, we have a notion of \emph{graded algebra}~\cite{FKM16, MPS15}: \begin{defn}[Graded algebra]\label{D:gradedalgebra} Let $k\in\omega$ and let $\M$ be a graded monad on a category $\CatC$. An \emph{$M_k$-algebra} $A$ consists of a family of $\CatC$-objects $(A_n)_{n\leq k}$ (the \emph{carriers}) and a family of $\CatC$-morphisms% \begin{equation} a^{n,m}\colon M_nA_m\to A_{n+m} \tag{$n+m\le k$} \end{equation} (the \emph{structure}) such that $a^{0,n}\cdot\eta_{A_n} = \mathsf{id}_{A_n}$ ($n\leq k$) and \begin{equation}\label{Diagram:gradedalgebralaw} \begin{tikzcd}[column sep = 35] M_nM_mA_r \arrow[d, "\mu^{n,m}"'] \arrow[r, "M_na^{m,r}"] & M_nA_{m+r} \arrow[d, "a^{n,m+r}"] \\ M_{n+m}A_{r} \arrow[r, "a^{n+m,r}"] & A_{n+m+r} \end{tikzcd} \end{equation} for all $n,m,r\in\omega$ such that $n+m+r\leq k$. The \emph{i-part} of an $M_k$-algebra $A$ is the $M_0$-algebra $(A_i, a^{0,i})$. A \emph{homomorphism} from $A$ to an $M_k$-algebra $B$ is a family of $\CatC$-morphisms $h_n\colon A_n\to B_n$ ($n\leq k$) such that \[ h_{n+m} \cdot a^{n,m} = b^{n,m}\cdot M_nh_m \quad\text{for all $n,m\in\omega$ s.th.~$n+m\le k$.} \] We write $\Alg_k(\M)$ for the category of $M_k$-algebras and their homomorphisms. We define \emph{$M_{\omega}$-algebras} (and their homomorphisms) similarly, by allowing the indices $n,m,r$ to range over $\omega$. \end{defn} \begin{rem} The above notion of $M_{\omega}$-algebra corresponds with the concept of graded Eilenberg-Moore algebras introduced by Fujii et al.~\cite{FKM16}. Intuitively, $M_{\omega}$-algebras are devices for interpreting terms of unbounded uniform depth. We understand $M_k$-algebras~\cite{MPS15} as a refinement of $M_{\omega}$-algebras which allows the interpretation of terms of uniform depth \emph{at most~$k$}. Thus, $M_k$-algebras serve as a formalism for specifying properties of states exhibited in \emph{$k$ steps}. For example, $M_1$-algebras are used to interpret one-step modalities of characteristic logics for graded semantics~\cite{DMS19,FMS21a}. Moreover, for a depth-1 graded monad, its $M_\omega$-algebras may be understood as compatible chains of $M_1$-algebras~\cite{MPS15}, and a depth-1 graded monad can be reconstructed from its $M_1$-algebras. % \end{rem} \noindent We will be chiefly interested in $M_0$- and $M_1$-algebras: \begin{expl} Let $\M$ be a graded monad on $\mathbf{Set}$. \begin{enumerate} \item An $M_0$-algebra is just an Eilenberg-Moore algebra for the monad $(M_0, \eta, \mu^{0,0})$. It follows that $\Alg_0(\M)$ is complete and cocomplete, in particular has coequalizers. \item An $M_1$-algebra is a pair $((A_0, a^{0,0}), (A_1, a^{0,1}))$ of $M_0$-algebras -- often we just write the carriers $A_i$ to also denote the algebras, by abuse of notation -- equipped with a \emph{main structure map} $a^{1,0}\colon M_1A_0\to A_1$ satisfying two instances of~\eqref{Diagram:gradedalgebralaw}. One instance states that $a^{1,0}$ is an $M_0$-algebra homomorphism from $(M_1A_0, \mu^{0,1}_A)$ to $(A_1, a^{0,1})$ (\emph{homomorphy}); the other expresses that $a^{1,0}\cdot \mu^{1,0}= a^{1,0}\cdot M_1a^{0,0}$ (\emph{coequalization}): \begin{equation}\label{Diagram:coequalization} \begin{tikzcd}[column sep = 35] M_1M_0A_0 \arrow[r, "\mu^{1,0}", shift left] \arrow[r, "M_1a^{0,0}"', shift right] & M_1A_0 \arrow[r, "a^{1,0}"] & A_1. \end{tikzcd} \end{equation} \end{enumerate} \end{expl} \begin{rem} The free $M_n$-algebra on a set~$X$ is formed in the expected way, in particular has carriers~$M_0X,\dots,M_nX$, see~\cite[Prop.~6.3]{MPS15}. \end{rem} \paragraph*{Canonical algebras.} We are going to review the basic definitions and results on \emph{canonical $M_1$-algebras}~\cite{DMS19}. Fix a graded monad $\M$ on $\mathbf{Set}$. We write $(-)_i\colon\Alg_1(\M)\to\Alg_0(\M)$, $i = 0,1$, for the functor which sends an $M_1$-algebra $A$ to its $i$-part $A_i$ and sends a homomorphism $h\colon A\to B$ to $h_i\colon A_i\to B_i$. \begin{defn}\label{D:canonical} An $M_1$-algebra~$A$ is \emph{canonical} if it is free over its $0$-part with respect to $(-)_0\colon\Alg_1(\M)\to\Alg_0(\M)$. \end{defn} \begin{rem}\label{rem:canonical} The universal property of a canonical algebra~$A$ is the following: for every $M_1$-algebra $B$ and every $M_0$-algebra homomorphism $h\colon A_0\to B_0$, there exists a unique $M_1$-algebra homomorphism $h^\#\colon A\to B$ such that $(h^{\#})_0 = h_0$. \end{rem} \begin{notheorembrackets} \begin{lem}[{\cite[Lem.~5.3]{DMS19}}]\label{L:canonical-algebra} An $M_1$-algebra $A$ is canonical if and only if (\ref{Diagram:coequalization}) is a coequalizer in $\Alg_0(\M)$. \end{lem} \end{notheorembrackets} \begin{expl}\label{E:canonical} Let $X$ be a set and let $\M$ be a depth-1 graded monad on $\mathbf{Set}.$ For each ${k\in\omega}$, we may view $M_kX$ as an $M_0$-algebra with structure $\mu^{0,k}$. For the $M_1$-algebra $(M_kX, M_{k+1}X)$ (with main structure map $\mu^{1,k}$), the instance of Diagram~(\ref{Diagram:coequalization}) required by~\cref{L:canonical-algebra} is a coequalizer by~\cref{L:depth-1}; that is, $(M_kX, M_{k+1}X, \mu^{1,k})$ is canonical. \end{expl} \section{Pre-Determinization in Eilenberg-Moore}\label{sec:determinization} We describe a generic notion of pre-determinization (the terminology will be explained in \cref{rem:determinization}) for coalgebras of an endofunctor $G$ on $\mathbf{Set}$ with respect to a given depth-1 graded semantics $(\alpha,\M)$, generalizing the Eilenberg-Moore-style coalgebraic determinization construction by Silva et al.~\cite{BBSR13}. The behavioural equivalence game introduced in the next section will effectively be played on the pre-determinization of the given coalgebra. We will occasionally gloss over issues of finite branching in the examples. We first note that every $M_0$-algebra $A$ extends (uniquely) to a canonical $M_1$-algebra $EA$ (with $0$-part $A$), whose $1$-part and main structure are obtained by taking the coequalizer of the pair of morphisms in \eqref{Diagram:coequalization} (canonicity then follows by~\cref{L:canonical-algebra}). This construction forms the object part of a functor $\Alg_0(\M)\to\Alg_1(\M)$ which sends a homomorphism $h\colon A\to B$ to its unique extension $Eh:=h^\sharp\colon EA\to EB$ (cf.~\cref{rem:canonical}). We write $\mybar{0.8}{2pt}{M}_1$ for the endofunctor on $\Alg_0(\M)$ given by \begin{equation}\label{eq:barM} \mybar{0.8}{2pt}{M}_1:= (\Alg_0(\M)\xra{E}\Alg_1(\M)\xra{(-)_1}\Alg_0(\M)), \end{equation} where $(-)_1$ is the functor taking $1$-parts. Thus, for an $M_0$-algebra~$A_0$, $\mybar{0.8}{2pt}{M}_1(A_0)$ is the vertex of the coequalizer \eqref{Diagram:coequalization}. By \cref{E:canonical}, we have \begin{equation} \label{eq:barM-can} \mybar{0.8}{2pt}{M}_1(M_kX,\mu^{0,k}_X)=(M_{k+1}X,\mu^{0,k+1}_X) \end{equation} for every set~$X$ and every $k\in\omega$. In particular, \begin{equation}\label{Eq:determinization} U\mybar{0.8}{2pt}{M}_1 F = M_1 \end{equation} where $F\dashv U\colon \Alg_0(\M) \to \mathbf{Set}$ is the canonical adjunction of the Eilenberg-Moore category of~$M_0$ -- that is,~$U$ is the forgetful functor, and~$F$ takes free $M_0$-algebras, so $FX=(M_0X,\mu^{00}_X)$. For an $M_1$-coalgebra $f\colon X\to M_1X=U\mybar{0.8}{2pt}{M}_1 FX$, we therefore obtain a homomorphism $f^\#\colon FX\to\mybar{0.8}{2pt}{M}_1 FX$ (in $\Alg_0(\M)$) via adjoint transposition. This leads to the following pre-determinization construction: \begin{defn}\label{D:determinization} Let $(\alpha, \M)$ be a depth-1 graded semantics on $G$-coalgebras. The \emph{pre-determinization} of a $G$-coalgebra $(X, \gamma)$ under $(\alpha, \M)$ is the $\mybar{0.8}{2pt}{M}_1$-co\-al\-gebra \begin{equation}\label{eq:det} (\alpha_X\cdot\gamma)^\#\colon FX\to \mybar{0.8}{2pt}{M}_1 FX. \end{equation} \end{defn} \begin{rem}\label{rem:determinization} \begin{enumerate} \item\label{item:predet-det} We call this construction a \emph{pre-}de\-ter\-mi\-ni\-zat\-ion because it will serve as a \emph{determinization} -- in the expected sense that the underlying graded equivalence transforms into behavioural equivalence on the determinization -- only under additional conditions. Notice that given a $G$-coalgebra $(X,\gamma)$, (finite-depth) behavioural equivalence on the $\mybar{0.8}{2pt}{M}_1$-coalgebra $(\alpha_X\cdot\gamma)^*_0$ is given by the canonical cone into the final chain \begin{equation*} 1 \xla{!} \mybar{0.8}{2pt}{M}_1 1 \xla{\overbar M_1 !} \mybar{0.8}{2pt}{M}_1^{2}1 \xla{\overbar M_1^2 !} \cdots \end{equation*} while graded behavioural equivalence on $(X,\gamma)$ is given by the maps $\gamma^{(k)}$ into the sequence $M_01,M_11,M_21,\dots$, equivalently given as homomorphisms $(\gamma^{(k)})^*_0\colon FX\to(M_k1,\mu^{0,k}_1)$, whose domains can, by~\eqref{eq:barM-can}, be written as the sequence \begin{equation*} F1,\quad \mybar{0.8}{2pt}{M}_1 1,\quad \mybar{0.8}{2pt}{M}_1^21,\quad \ldots \end{equation*} of $M_0$-algebras. The two sequences coincide in case $M_01=1$, and indeed one easily verifies that in this case, finite-depth behavioural equivalence on $\mybar{0.8}{2pt}{M}_1$-coalgebras coincides with $(\alpha,\M)$-behavioural equivalence. For instance, this holds in the case of probabilistic trace equivalence (\cref{E:semantics}.\ref{item:sem-prob}), where $M_0=\CalD$, so $M_01=1$. In the case of trace equivalence (\cref{E:semantics}.\ref{item:sem-trace}), $M_01=1$ can be ensured by restricting to serial labelled transition systems, which, as noted in \cref{E:coalg}.\ref{E:coalg:1}, are coalgebras for $\pow^+(\A\times -)$ with~$\pow^+$ denoting non-empty powerset, so that in the corresponding variant of the graded monad for trace semantics, we have $M_0=\pow^+$ and hence $M_01=1$. On the other hand, the condition $M_01=1$ fails for trace equivalence of unrestricted systems where we have~\mbox{$M_0=\pow$,} which in fact constitutes a radical example where behavioural equivalence on the pre-determization is strictly coarser than the given graded equivalence. In this case, since the actions preserve the bottom~$0$, we in fact have~$\mybar{0.8}{2pt}{M}_1 1=1$: it follows that \emph{all} states in $\mybar{0.8}{2pt}{M}_1$-coalgebras are behaviourally equivalent (as the unique coalgebra structure on~$1$ is final). \item Using~\eqref{Eq:determinization}, we see that the underlying map of the pre-determinization of a coalgebra $(X,\gamma)$ is $(\alpha_X \cdot \gamma)^*_0 \colon M_0X \to M_1 X = U_0\mybar{0.8}{2pt}{M}_1 F_0 X$ (written using graded Kleisli star as per~\cref{N:star}). Indeed, one easily shows that $(\alpha_X \cdot\gamma)^*_0$ is an $M_0$-algebra morphism $(M_0 X, \mu^{0,0}_X)\to\mybar{0.8}{2pt}{M}_1 (M_0X,\mu^{0,0}_X)=(M_1X,\mu^{0,1}_X)$ satisfying $(\alpha_X \cdot \gamma)^*_0 \cdot \eta_X = \alpha_X \cdot \gamma$. Thus, it is the adjoint transpose in~\eqref{eq:det}. \item As indicated above, pre-de\-ter\-mi\-ni\-za\-tion captures the Eilenberg-Moore style generalized determinization by Silva et al.~\cite{BBSR13} as an instance. Indeed, for a monad $T$ and an endofunctor $F$, both on the category $\CatC$, one considers a coalgebra $\gamma\colon X \to FTX$. Assuming that $FTX$ carries the structure of an Eilenberg-Moore algebra for $T$ (e.g.~because the functor~$F$ lifts to the category of Eilenberg-Moore algebras for $T$), one obtains an $F$-coalgebra $\gamma^\sharp\colon TX \to FTX$ by taking the unique homomorphic extension of $\gamma$. Among the concrete instances of this construction are the well-known powerset construction of non-deterministic automata (take $T = \pow$ and $F = 2 \times (-)^A$), the non-determinization of alternating automata and that of Markov decision processes~\cite{JSS15}. To view this as an instance of pre-de\-ter\-mi\-ni\-za\-tion, take the graded monad with $M_n = F^nT$ (\cref{E:graded-monad}.\ref{E:graded-monad:4}), let $G = FT$, and let $\alpha = \mathsf{id}_{FT}$. Using~\eqref{Eq:determinization}, we see that $(\alpha_X \cdot \gamma)^\#$ in~\eqref{eq:det} is the generalized determinization $\gamma^\sharp$ above. \item We emphasize that the construction applies completely universally; e.g.~we obtain as one instance a `determinization' of serial labelled transition systems modulo similarity, which transforms a coalgebra $X\to\pow^+(\A\times X)$ into an $\mybar{0.8}{2pt}{M}_1$-coalgebra $\pow^+(X)\to\pow^{\downarrow}(\A\times \pow^+(X))$ (\cref{E:graded-theory}.\ref{item:simulation-a}); instantiating the observations in item~\ref{item:predet-det}, we obtain that finite-depth behavioural equivalence of $\mybar{0.8}{2pt}{M}_1$-coalgebras (see \cref{expl:barM} for the description of~$\mybar{0.8}{2pt}{M}_1$) coincides with finite-depth mutual similarity. \end{enumerate} \end{rem} \begin{expl}\label{expl:barM} We give a description of the functor~$\mybar{0.8}{2pt}{M}_1$ on $M_0$-algebras constructed above in some of the running examples. \begin{enumerate}[wide] \item For graded monads of the form $\M_G$, which capture finite-depth behavioural equivalence (\cref{E:graded-monad}.\ref{E:graded-monad:1}), we have $M_0=\Id$, so $M_0$-algebras are just sets, and under this correspondence, $\mybar{0.8}{2pt}{M}_1$ is the original functor~$G$. \item\label{item:mono-traces} Trace semantics of LTS (\cref{E:graded-theory}.\ref{item:traces-a}): Distribution of actions over the join semilattice operations ensures that depth-1 terms over a join semilattice~$X$ can be normalized to sums of the form $\sum_{a\in \A}a(x_a)$, with $x_a\in X$ (possibly $x_a=0$). It follows that $\mybar{0.8}{2pt}{M}_1$ is simply given by $\mybar{0.8}{2pt}{M}_1 X=X^\A$ ($\A$-th power, where~$\A$ is the finite set of labels). Other forms of trace semantics are treated similarly. \item In the graded theory for simulation (\cref{E:graded-theory}.\ref{item:simulation-a}), the description of the induced graded monad~\cite{DMS19} extends analogously to~$\mybar{0.8}{2pt}{M}_1$, yielding that $\mybar{0.8}{2pt}{M}_1 B$ is the join semilattice of finitely generated downwards closed subsets of $\A\times B$ where, again,~$\A$ carries the discrete ordering. \end{enumerate} \end{expl} \begin{rem} The assignment $\M \mapsto \mybar{0.8}{2pt}{M}_1$ exhibits the category $\mathscr{K}$ of depth-1 graded monads whose $0$-part is the monad $(M_0, \eta, \mu^{0,0})$ as a coreflective subcategory (up to isomorphism) of the category $\Fun(\mathbf{Set}^{M_0})$ of all endofunctors on the Eilenberg-Moore category of that monad. Indeed, given an endofunctor $H$ on $\mathbf{Set}^{M_0}$ we form the $6$-tuple $(M_0, UHF, \eta, \mu^{0,0}, \mu^{0,1},\mu^{1,0}),$ where the latter two natural transformations arise from the counit $\varepsilon\colon FU \to \Id$ of the canonical adjunction $F\dashv U\colon\Alg_0(\M_0)\to\mathbf{Set}$: \begin{align*} \mu^{0,1} &= (M_0UHF = UFUHF \xra{U\varepsilon HF} UHF\big);\\ \mu^{1,0} &= (UHFM_0 = UHFUF \xra{UHF\varepsilon F} UHF\big). \end{align*} It is not difficult to check that this data satisfies all applicable instances of the graded monad laws. Hence, it specifies a depth-1 graded monad $R(H)$~\cite[Thm.~3.7]{DMS19}; this assignment is the object part of a functor $R\colon\Fun(\mathbf{Set}^{M_0})\to\mathscr{K}$. In the other direction, we have for each depth-1 graded monad $\M$ with $0$-part $M_0$ the endofunctor $I(\M) = \mybar{0.8}{2pt}{M}_1$. By~\eqref{Eq:determinization}, we have $RI(\M) = \M$. Now, given a depth-1 graded monad $\M$ and an endofunctor $H$ on $\mathbf{Set}^{M_0}$, consider $\mybar{0.8}{2pt}{M}_1 = IR(H)$ (so that $M_1 = UHF$). We obtain for every algebra $(A,a)$ in $\mathbf{Set}^{M_0}$ a homomorphism $c_{(A,a)}\colon \mybar{0.8}{2pt}{M}_1 (A,a) \to H(A,a)$ by using the coequalizer defining $\mybar{0.8}{2pt}{M}_1(A,a)$ (cf.~\cref{L:canonical-algebra}): \[ \begin{tikzcd} M_1M_0 A \ar[yshift=2]{r}{\mu^{0,1}_A} \ar[yshift=-2]{r}[swap]{M_1a} & M_1A=HFA \ar[->>]{r} \ar{rd}{Ha} & \mybar{0.8}{2pt}{M}_1 (A,a) \ar[dashed]{d}{c_{(A,a)}} \\ && H(A,a) \end{tikzcd} \] Note that $M_1M_0A$ is the carrier of the Eilenberg-Moore algebra $HFA = H(M_0A, \mu^{0,0}_A)$ and similarly for the middle object (in both cases we have omitted the algebra structures given by $\mu^{0,1}_{M_0 A}$ and $\mu^{0,1}_A$ coming from the graded monad $I(H)$). It is easy to see that the homomorphism $Ha$ merges the parallel pair, and therefore we obtain the dashed morphism such that the triangle commutes, yielding the components of a natural transformation $c\colon \mybar{0.8}{2pt}{M}_1 \to H$ which is couniversal: for each depth-1 graded monad $\mathbb N$ whose $0$-part is $M_0$ and each natural transformation $h\colon \mybar{0.8}{2pt}{M}_1 \to H$, there is a unique natural transformation $m_1\colon N_1 \to M_1 = UHF$ such that $m = (id_{M_0}, m_1)$ is a morphism of graded monads from $\mathbb N$ to~$\M$ and $c \cdot I(m) = h$. This shows that $I \dashv R$. \end{rem} \section{Behavioural Equivalence Games}\label{S:games} Let $\CalS = (\alpha, \M)$ be a depth-1 graded semantics for an endofunctor $G$ on $\mathbf{Set}$. We are going to describe a game for playing out depth-$n$ behavioural equivalence under $\CalS$-semantics on states in $G$-coalgebras. We first give a description of the game in the syntactic language of graded equational reasoning, and then present a more abstract categorical definition. Given a coalgebra $(X,\gamma)$, we will see the states in~$X$ as variables, and the map $\alpha_X\cdot\gamma$ as assigning to each variable~$x$ a depth-1 term over~$X$; we can regard this assignment as a (uniform-depth) substitution~$\sigma$. A configuration of the game is a pair of depth-0 terms over~$X$; to play out the equivalence of states $x,y\in X$, the game is started from the initial configuration $(x,y)$. Each round of the game then proceeds in two steps: First, Duplicator plays a set~$Z$ of equalities between depth-0 terms over~$X$ that she claims to hold under the semantics. This move is admissible in the configuration $(s,t)$ if~$Z\vdash s\sigma=t\sigma$. Then, Spoiler challenges one of the equalities claimed by Duplicator, i.e.~picks an element~$(s',t')\in Z$, which then becomes the next configuration. Any player who cannot move, loses. After~$n$ rounds have been played, reaching the final configuration $(s,t)$, Duplicator wins if $s\theta =t\theta$ is a valid equality, where~$\theta$ is a substitution that identifies all variables. We refer to this last check as \emph{calling the bluff}. Thus, the game plays out an equational proof between terms obtained by unfolding depth-0 terms according to~$\sigma$, cutting off after~$n$ steps. We introduce some technical notation to capture the notion of admissibility of~$Z$ abstractly: \begin{notn}\label{N:admissible} Let $Z\subseteq M_0X\times M_0X$ be a relation, and let $c_Z\colon M_0X\to C_Z$ be the coequalizer in $\Alg_0(\M)$ of the homomorphisms $ \ell_0^*, r_0^*\colon M_0Z\to M_0X $ given by applying the Kleisli star~\eqref{Eqn:Kleisli-star} to the projections $\ell, r\colon Z\to M_0X$. We define a homomorphism $\mybar{0.7}{1.75pt}{Z}\colon M_0X\to M_1C_Z$ in $\Alg_0(\M)$ by \begin{equation}\label{eq:barZ} \mybar{0.7}{1.75pt}{Z} = \big(M_0X\xra{(\alpha_X\cdot\gamma)^*_0} M_1X = \mybar{0.8}{2pt}{M}_1 M_0X \xra{\overbar M_1 c_Z} \mybar{0.8}{2pt}{M}_1 C_Z\big) \end{equation} (omitting algebra structures, and again using the Kleisli star). \end{notn} \begin{rem}\label{R:coeq} Using designators as in \cref{N:admissible}, we note: \begin{enumerate} \item\label{R:coeq:1}\label{R:coeq:2} By the universal property of $\eta_Z\colon Z \to M_0Z$, an $M_0$-algebra homomorphism $h\colon M_0X \to A$ merges $\ell, r$ iff it merges $\ell^*_0, r^*_0$. This implies that the coequalizer $M_0X \xra{c_Z}C_Z$ quotients the free $M_0$-algebra $M_0X$ by the congruence generated by~$Z$. Also, it follows that in case~$Z$ is already an $M_0$-algebra and $\ell, r\colon Z \to M_0X$ are $M_0$-algebra homomorphisms (e.g.~when $Z$ is a congruence), one may take $c_Z\colon M_0X \to C_Z$ to be the coequalizer of $\ell, r$. \item\label{item:barZ} The map $\mybar{0.7}{1.75pt}{Z}\colon M_0X\to\mybar{0.8}{2pt}{M}_1 C_Z$ associated to the relation $Z$ on $M_0X$ may be understood as follows. As per the discussion above, we view the states of the coalgebra $(X,\gamma)$ as variables, and the map $X\xra{\gamma} GX\xra{\alpha_X} M_1X$ as a substitution mapping a state $x \in X$ to the equivalence class of depth-1 terms encoding the successor structure $\gamma(x)$. The second factor $\mybar{0.8}{2pt}{M}_1 c_Z$ in~\eqref{eq:barZ} then essentially applies the relations given by the closure of $Z$ under congruence w.r.t.~depth-0 operations, embodied in~$c_Z$ as per~\ref{R:coeq:1}, under depth-1 operations in (equivalence classes of) of depth-1 terms in $M_1X$; to sum up, $\mybar{0.8}{2pt}{M}_1 c_Z$ merges a pair of equivalence classes $[t], [t']$ iff $Z\vdash t=t'$ in a depth-1 theory presenting $\M$ (in notation as per \cref{sec:prelims}). \end{enumerate} \end{rem} \begin{defn}\label{def:game} For $n\in\omega$, the \emph{$n$-round $\CalS$-behavioural equivalence game} $\CalG_n(\gamma)$ on a $G$-coalgebra $(X, \gamma)$ is played by Duplicator (D) and Spoiler (S). \emph{Configurations} of the game are pairs $(s,t)\in M_0(X)\times M_0(X)$. Starting from an \emph{initial configuration} designated as needed, the game is played for~$n$ rounds. Each round proceeds in two steps, from the current configuration~$(s,t)$: First, D chooses a relation $Z\subseteq M_0X\times M_0X$ such that $\mybar{0.7}{1.75pt}{Z}(s) = \mybar{0.7}{1.75pt}{Z}(t)$ (for~$\mybar{0.7}{1.75pt}{Z}$ as per \cref{N:admissible}). Then,~S picks an element~$(s',t') \in Z$, which becomes the next configuration. Any player who cannot move at his turn, loses. After~$n$ rounds have been played,~D wins if $M_0!(s_n) = M_0!(t_n)$; otherwise,~S wins. \end{defn} \begin{rem} By the description of~$\mybar{0.7}{1.75pt}{Z}$ given in \cref{R:coeq}.\ref{item:barZ}, the categorical definition of the game corresponds to the algebraic one given in the lead-in discussion. The final check whether $M_0!(s_n)=M_0!(t_n)$ corresponds to what we termed \emph{calling the bluff}. The apparent difference between playing either on depth-0 terms or on elements of~$M_0X$, i.e.~depth-0 terms modulo derivable equality, is absorbed by equational reasoning from~$Z$, which may incorporate also the application of depth-0 equations. \end{rem} \begin{rem} A pair of states coming from different coalgebras $(X,\gamma)$ and $(Y,\delta)$ can be treated by considering those states as elements of the coproduct of the two coalgebras: \[ X+Y \xra{\gamma + \delta} GX + GY \xra{[G\mathsf{inl}, G\mathsf{inr}]} G(X+Y), \] where $X \xra{\mathsf{inl}} X+Y \xla{\mathsf{inr}} Y$ denote the coproduct injections. There is an evident variant of the game played on two different coalgebras $(X,\gamma)$, $(Y,\delta)$, where moves of~D are subsets of $M_0X\times M_0Y$. However, completeness of this version depends on additional assumptions on~$\M$, to be clarified in future work. For instance, if we instantiate the graded monad for traces with effects specified by~$T$ (\cref{E:graded-monad}.\ref{item:T-traces}) to~$T$ being the free real vector space monad, and a state~$x\in X$ has successor structure $2\cdot x'-2\cdot x''$, then~D can support equivalence between~$x$ and a deadlock~$y\in Y$ (with successor structure~$0$) by claiming that $x'=x''$, but not by any equality between terms over~$X$ with terms over~$Y$. That is, in this instance, the variant of the game where~D plays relations on $M_0X\times M_0Y$ is not complete. \end{rem} \noindent Soundness and completeness of the game with respect to $\CalS$-behavioural equivalence is stated as follows. \begin{thm}\label{T:sound-complete} Let $(\alpha, \M)$ be a depth-1 graded semantics for a functor~$G$ such that $\mybar{0.8}{2pt}{M}_1$ preserves monomorphisms, and let $(X, \gamma)$ be a $G$-coalgebra. Then, for all $n\in\omega$,~D wins $(s, t)$ in $\CalG_n(\gamma)$ if and only if $(\gamma^{(n)})^*_0(s) = (\gamma^{(n)})^*_0(t)$. \end{thm} \begin{cor} States $x,y$ in a $G$-coalgebra $(X, \gamma)$ are $\CalS$-behaviourally equivalent if and only if~D wins $(\eta(x), \eta(y))$ for all $n\in\omega$. \end{cor} \begin{rem}\label{rem:monos} In algebraic terms, the condition that~$\mybar{0.8}{2pt}{M}_1$ preserves monomorphisms amounts to the following: In the derivation of an equality of depth-1 terms~$s,t$ over~$X$ from depth-0 relations over~$X$ (i.e.~from a presentation of an $M_0$-algebra by relations on generators~$X$), if~$X$ is included in a larger set~$Y$ of variables with relations that conservatively extend those on~$X$, i.e.~do not imply additional relations on~$X$, then it does not matter whether the derivation is conducted over~$X$ or more liberally over~$Y$. Intuitively, this property is needed because not all possible $n$-step behaviours, i.e.~elements of~$Y=M_n1$, are realized by states in a given coalgebra on~$X$. Preservation of monos by~$\mybar{0.8}{2pt}{M}_1$ is automatic for graded monads of the form $\M_G$ (\cref{E:graded-monad}.\ref{E:graded-monad:1}), since $M_0=\Id$ in this case. In the other running examples, preservation of monos is by the respective descriptions of~$\mybar{0.8}{2pt}{M}_1$ given in \cref{expl:barM}. \end{rem} \begin{expl}\label{expl:bisim-instance} We take a brief look at the instance of the generic game for the case of bisimilarity on finitely branching LTS (more extensive examples are in \cref{sec:cases}), i.e.~we consider the depth-1 graded semantics $(\mathsf{id}, \M_G)$ for the functor $G=\pow_{\mathsf f}(\A\times(-))$. In this case, $M_0=\Id$, so when playing on a coalgebra $(X,\gamma)$,~D plays relations~$Z\subseteq X\times X$. If the successor structures of states~$x,y$ are represented by depth-1 terms $\sum_{i}a_i(x_i)$ and $\sum_j b_j(y_j)$, respectively, in the theory $\JSL(\A)$ (\cref{E:graded-theory}.\ref{item:jsl-a}), then~D is allowed to play~$Z$ iff the equality $\sum_{i}a_i(x_i)=\sum_j b_j(y_j)$ is entailed by~$Z$ in $\JSL(\A)$. This, in turn, holds iff for each~$i$, there is~$j$ such that $a_i=b_j$ and $(x_i,y_j)\in Z$, and symmetrically. Thus~$Z$ may be seen as a pre-announced non-deterministic winning strategy for~D in the usual bisimilarity game where~S moves first (\cref{sec:prelims}):~D announces that if~S moves from, say,~$x$ to~$x_i$, then she will respond with some~$y_j$ such that $a_i=b_j$ and $(x_i,y_j)\in Z$. \end{expl} \section{Infinite-depth behavioural equivalence}\label{sec:infinte-depth} \sloppypar \noindent We have seen in \cref{sec:determinization} that in case \mbox{$M_01=1$}, $(\alpha, \M)$-behavioural equivalence on~$G$-coalgebras coincides, via a determization construction, with finite-depth behavioural equivalence on $\mybar{0.8}{2pt}{M}_1$-coalgebras for a functor $\mybar{0.8}{2pt}{M}_1$ on $M_0$-algebras constructed from~$\M$. If~$G$ is finitary, then finite-depth behavioural equivalence coincides with full behavioural equivalence~(\cref{rem:finite-depth}), but in general, finite-depth behavioural equivalence is strictly coarser. Previous treatments of graded semantics stopped at this point, in the sense that for non-finitary functors (which describe infinitely branching systems), they did not offer a handle on infinite-depth equivalences such as full bisimilarity or infinite-trace equivalence. In case $M_01=1$, a candidate for a notion of infinite-depth equivalence induced by a graded semantics arises via full behavioural equivalence of $\mybar{0.8}{2pt}{M}_1$-coalgebras. We fix this notion explicitly: \begin{defn} States $x,y$ in a $G$-coalgebra $(X,\gamma)$ are \emph{in\-fin\-ite-depth $(\alpha,\M$)-behaviourally equivalent} if~$\eta(x)$ and~$\eta(y)$ are behaviourally equivalent in the pre-det\-er\-min\-i\-za\-tion of~$(X,\gamma)$ as described in \cref{S:games}. \end{defn} \noindent We hasten to re-emphasize that this notion in general only makes sense in case $M_01=1$. We proceed to show that infinite-depth equivalence is in fact captured by an infinite variant of the behavioural equivalence game of \cref{S:games}. Since infinite depth-equivalences differ from finite-depth ones only in settings with infinite branching, we do not assume in this section that~$G$ or~$\M$ are finitary, and correspondingly work with generalized graded theories where operations may have infinite arities~\cite{MPS15}; we assume arities to be cardinal numbers. We continue to be interested only in depth-1 graded monads and theories, and we fix such a graded monad~$\M$ and associated graded theory for the rest of this section. The notion of derivation is essentially the same as in the finitary case, the most notable difference being that the congruence rule is now infinitary, as it has one premise for each argument position of a given possibly infinitary operator. We do not impose any cardinal bound on the arity of operations; if all operations have arity less than~$\kappa$ for a regular cardinal~$\kappa$, then we say that the monad is \emph{$\kappa$-ary}. \begin{rem}\label{R:final-coalg} One can show using tools from the theory of locally presentable categories that $\mybar{0.8}{2pt}{M}_1$ has a final coalgebra if~$\M$ is $\kappa$-ary in the above sense. To see this, first note that $\Alg_0(\M)$ is locally $\kappa$-presentable if $M_0$ is $\kappa$-accessible~\cite[Remark~2.78]{AR94}. Using a somewhat similar argument one can prove that $\Alg_1(\M)$ is also locally $\kappa$-presentable. Moreover, the functor $\mybar{0.8}{2pt}{M}_1$ is $\kappa$-accessible, being the composite~\eqref{eq:barM} of the left adjoint $E\colon \Alg_0(\M) \to \Alg_1(\M)$ (which preserves all colimits) and the $1$-part functor $(-)_1\colon \Alg_1(\M) \to \Alg_0(\M)$, which preserves $\kappa$-filtered colimits since those are formed componentwise. It follows that $\mybar{0.8}{2pt}{M}_1$ has a final coalgebra~\cite[Exercise~2j]{AR94}. Alternatively, existence of a final $\mybar{0.8}{2pt}{M}_1$-coalgebra will follow from \cref{thm:fin-coalg} below. % \end{rem} \noindent Like before, we \emph{assume that $\mybar{0.8}{2pt}{M}_1$ preserves monomorphisms}. \begin{expl} We continue to use largely the same example theories as in \cref{E:graded-theory}, except that we allow operations to be infinitary. For instance, the \emph{graded theory of complete join semilattices over~$\A$} has as depth-1 operations all formal sums $\sum_{i\in I}a_i(-)$ where~$I$ is now some (possibly infinite) index set; the axioms are then given in the same way as in \cref{E:graded-theory}.\ref{item:jsl-a}, and all depth-1 equations \[ \textstyle \sum_{i\in I}a_i(x) = \sum_{j\in J} b_j(y) \] such that $\{(a_i, x_i)\mid i\in I\}=\{(b_j, y_j)\mid j\in J\}$. This theory presents the graded monad~$\M_G$ for $G=\pow(\A\times(-))$. \end{expl} \noindent The infinite game may then be seen as defining a notion of derivable equality on infinite-depth terms by playing out a non-standard, infinite-depth equational proof; we will make this view explicit further below. In a less explicitly syntactic version, the game is defined as follows. \begin{defn}[Infinite behavioural equivalence game] The \emph{infinite $(\alpha,\M$)-behavioural equivalence game} $\CalG_\infty(\gamma)$ on a $G$-coalgebra~$(X,\gamma)$ is played by Spoiler~(S) and Duplicator~(D) in the same way as the finite behavioural equivalence game (\cref{def:game}) except that the game continues forever unless one of the players cannot move. Any player who cannot move, loses. Infinite matches are won by~D. \end{defn} \noindent As indicated above, this game captures infinite-depth $(\alpha,\M)$-behavioural equivalence (under the running assumption that~$\mybar{0.8}{2pt}{M}_1$ preserves monomorphisms): \begin{thm}\label{thm:infinite-depth-games} Given a $G$-coalgebra~$(X,\gamma)$, two states~$s,t$ in the pre-determinization of~$\gamma$ are behaviourally equivalent iff D wins the infinite $(\alpha,\M$)-behavioural equivalence game $\CalG_\infty(\gamma)$ from the initial configuration $(s,t)$. \end{thm} \begin{cor} Two states $x,y$ in a $G$-coalgebra $(X,\gamma)$ are infinite-depth $(\alpha,\M)$-behaviourally equivalent iff D wins the infinite $(\alpha,\M$)-behavioural equivalence game $\CalG_\infty(\gamma)$ from the initial configuration $(\eta(x),\eta(y))$. \end{cor} \begin{rem} Like infinite-depth $(\alpha,\M)$-behavioural equivalence, the infinite $(\alpha,\M$)-behavioural equivalence game is sensible only in case $M_01=1$. For instance, as noted in \cref{sec:determinization}, in the graded monad for trace semantics (\cref{E:graded-theory}.\ref{item:pt-a}), which does not satisfy this condition, behavioural equivalence of $\mybar{0.8}{2pt}{M}_1$-coalgebras is trivial. In terms of the game,~D wins every position in $\CalG_\infty(\gamma)$ by playing $Z=\{(t,0)\mid t\in M_0X\}$ -- since the actions preserve the bottom element~$0$, this is always an admissible move. In the terminology introduced at the beginning of \cref{S:games}, the reason that~D wins in this way is that in the infinite game, her bluff is never called ($M_0!(t)$ will in general not equal $M_0!(0)=0$). However, see \cref{expl:inf-depth}.\ref{item:inf-trace} below. \end{rem} \begin{expl}\label{expl:inf-depth} \begin{enumerate} \item\label{item:inf-trace} As noted in \cref{rem:determinization}.\ref{item:predet-det}, the graded monad for trace semantics can be modified to satisfy the condition~$M_01=1$ by restricting to serial labelled transition systems. In this case, infinite-depth $(\alpha,\M)$-behavioural equivalence is precisely infinite trace equivalence, and captured by the corresponding instance of the infinite behavioural equivalence game. \item In the case of graded monads $\M_G$ (\cref{E:graded-monad}.\ref{E:graded-monad:1}), which so far were used to capture finite-depth behavioural equivalence in the standard (branching-time) sense, we have $M_0=\Id$; in particular, $M_01=1$. In this case, the infinite-depth behavioural equivalence game instantiates to a game that characterizes full behavioural equivalence of $G$-coalgebras. Effectively, a winning strategy of~D in the infinite game~$\CalG_\infty(\gamma)$ on a $G$-coalgebra $(X,\gamma)$ amounts to a relation~$R\subseteq X\times X$ (the positions of~D actually reachable when~D follows her winning strategy) that is a \emph{precongruence} on~$(X,\gamma)$~\cite{AczelMendler89}. \end{enumerate} \end{expl} \begin{rem}[Fixpoint computation] Via its game characterization (\cref{thm:infinite-depth-games}), infinite-depth $(\alpha,\M)$-behavioural equivalence can be cast as a greatest fixpoint, specifically of the monotone function~$F$ on $\pow(M_0X\times M_0X)$ given by \begin{equation*} F(Z)=\{(s,t)\in M_0X\times M_0X\mid \mybar{0.7}{1.75pt}{Z}(s)=\mybar{0.7}{1.75pt}{Z}(t)\}. \end{equation*} If~$M_0$ preserves finite sets, then this fixpoint can be computed on a finite coalgebra $(X,\gamma)$ by fixpoint iteration; since $F(Z)$ is clearly always an equivalence relation, the iteration converges after at most $|M_0X|$ steps, e.g.~in exponentially many steps in case $M_0=\pow$. In case $M_0X$ is infinite (e.g.~if $M_0=\CalD$), then one will need to work with finite representations of subspaces of~$M_0X\times M_0X$. We leave a more careful analysis of the algorithmics and complexity of solving infinite $(\alpha,\M)$-behavioural equivalence games to future work. We do note that on finite coalgebras, we may assume w.l.o.g.~that both the coalgebra functor~$G$ and graded monad~$\M$ are finitary, as we can replace them with their finitary parts if needed (e.g.~the powerset functor $\pow$ and the finite powerset functor~$\pow_{\mathsf f}$ have essentially the same finite coalgebras). If additionally~$M_01=1$, then~$(\alpha,\M)$-behavioural equivalence coincides with infinite-depth $(\alpha,\M)$-behavioural equivalence, so that we obtain also an algorithmic treatment of $(\alpha,\M)$-behavioural equivalence. By comparison, such a treatment is not immediate from the finite version of the game, in which the number of rounds is effectively chosen by Spoiler in the beginning. \end{rem} \noindent Assume from now on that $\M$ is $\kappa$-ary. We note that in this case, we can describe the final $\mybar{0.8}{2pt}{M}_1$-coalgebra in terms of a syntactic variant of the infinite game that is played on infinite-depth terms, defined as follows. \begin{defn}[Infinite-depth terms] Recall that we are assuming a graded signature~$\Sigma$ with operations of arity less than~$\kappa$. A \emph{(uniform) infinite-depth \mbox{($\Sigma$-)}term} is an infinite tree with ordered branching where each node is labelled with an operation~$f\in\Sigma$, and then has as many children as given by the arity of~$f$; when there is no danger of confusion, we will conflate nodes with (occurrences of) operations. We require moreover that every infinite path in the tree contains infinitely many depth-1 operations (finite full paths necessarily end in constants). We write $\Termsarg{\Sigma,\infty}$ for the set of infinite-depth $\Sigma$-terms. By cutting off at the top-most depth-1 operations, we obtain for every $t\in\Termsarg{\Sigma,\infty}$ a \emph{top-level decomposition} $t=t_1\sigma$ into a depth-1 term $t_1\in\Termsarg{\Sigma,1}(X)$, for some set~$X$, and a substitution $\sigma\colon X\to\Termsarg{\Sigma,\infty}$. \end{defn} \begin{defn} The \emph{syntactic infinite $(\alpha,\M$)-behavioural equivalence game} $\CalG^\mathsf{syn}_\infty$ is played by~S and~D. Configurations of the game are pairs $(s,t)$ of infinite-depth $\Sigma$-terms. For such $(s,t)$, we can assume, by the running assumption that~$\mybar{0.8}{2pt}{M}_1$ preserves monomorphisms, that the top level decompositions $s=s_1\sigma$, $t=t_1\sigma$ are such that $s_1,t_1\in\Termsarg{\Sigma,1}(X)$, $\sigma\colon X\to\Termsarg{\Sigma,\infty}$ for the same~$X,\sigma$. Starting from a designated initial configuration, the game proceeds in rounds. In each round, starting from a current such configuration~$(s,t)$,~D first chooses a relation~$Z\subseteq\Termsarg{\Sigma,0}(X)\times\Termsarg{\Sigma,0}(X)$ such that $Z\vdash s_1 = t_1$ in the graded theory that presents~$\M$ (cf.~\cref{sec:prelims}). \mbox{Then, S} selects an element $(u,v)\in Z$, upon which the game reaches the new configuration $(u\sigma,v\sigma)$. The game proceeds forever unless a player cannot move. Again, any player who cannot move, loses, and infinite matches are won by~D. We write $s\sim_{\mathcal{G}} t$ if~D wins~$\CalG^\mathsf{syn}_\infty$ from position $(s,t)$. \end{defn} \noindent We construct an $\mybar{0.8}{2pt}{M}_1$-coalgebra on the set \( U=\Termsarg{\Sigma,\infty}/{\sim_{\mathcal{G}}} \) of infinite-depth terms modulo the winning region of~D as follows. We make~$U$ into an $M_0$-algebra by letting depth-0 operations act by term formation. We then define the coalgebra structure~$\zeta\colon U \to \mybar{0.8}{2pt}{M}_1 U$ by \( \zeta(q(t_1\sigma)) = \mybar{0.8}{2pt}{M}_1((q\cdot\sigma)^*_0)([t_1]) \) (using Kleisli star as per \cref{N:star}) where $t_1\sigma$ is a top-level decomposition of an infinite-depth term, with $t_1\in\Termsarg{\Sigma,1}(X)$; \[ [-]\colon \Termsarg{\Sigma,1}(X)\to M_1X=\mybar{0.8}{2pt}{M}_1 M_0 X \quad\text{and}\quad q\colon \Termsarg{\Sigma,\infty}\to U \] denote canonical quotient maps. These data are well-defined.% \begin{thm}\label{thm:fin-coalg} The coalgebra $(U,\zeta)$ is final.% \end{thm} \section{Case studies}\label{sec:cases} We have already seen (\cref{expl:bisim-instance}) how the standard bisimilation game arises as an instance of our generic game. We elaborate on some further examples. % \takeout{\subsection{Trace equivalence} In this subsection, we illustrate the admissible moves of Duplicator in concrete terms and, subsequently, establishing the game-theoretic characterisation of trace equivalence. \bknote{Example~2.9 does not talk about trace equivalence, we should explain the connection better.} To this end, consider an LTS $\gamma\colon X\to\pow_{\mathsf f}(\A\times X)$ and recall the depth-1 graded monad attributed to trace equivalence from \cite{MPS15}. \takeout{In particular, $\Sigma=\{\bot,\vee\} \cup \{a.\_ \mid a\in \A\}$ with action prefixing as the only depth-1 operation; $\E$ has all the axioms of join semilattice and the following depth-1 equations. \[ a.\bot = \bot \qquad a.(x\vee y) = a.x \vee a.y \]} \takeout{We begin by stating the coequaliser $C_Z,c_Z$ for a given relation $Z$ (cf.\thinspace Notation~\ref{N:admissible}) in more concrete terms. Define $Z' \subseteq M_1 X \times M_1 X$ as follows: \[ t \mathrel {Z'} t' \iff \exists_{s\in M_1 Z}\ l_1^*s =t \land r_1^*s=t'. \] Then the object $C_Z$ is given by the quotient set $M_1X/ Z''$, where $Z''$ is the least equivalence which is closed with respect to all the depth-0 operations and which includes $Z'$. In short, we say that $Z''$ is the \emph{congruence closure} of $Z'$. \begin{propn} The object $C_Z$ together with its quotient map $c_Z$ indeed forms the coequaliser of the arrows $l_1^*,r_1^*$. \end{propn}} \begin{expl} Consider the following process terms (defined in a fragment of CCS signature): \[ p_1\equiv a.p_1',\ p_2\equiv a.p_2' + b.p_2'',\ p_3\equiv b.p_3', \] where $p_1',p_2',p_2'',p_3'$ are all inaction (i.e.~the constant $\0$) and $\equiv$ denotes the syntactic equality. Clearly we find that the set $s=\{p_1,p_2\}$ and $t=\{p_2,p_3\}$ are trace equivalent. In particular, $s,t$ have the same traces of length 1, which we argue next through our game. Duplicator plays the relation $Z$ viewed as a set of equations between $M_0$-terms: \[ Z = \{p_1' + p_2' = p_2',\ p_3' + p_2'' = p_2'' \}. \] We claim that the relation $Z$ is admissible at position $(s,t)$ because the $M_1$-terms $(\alpha\cdot\gamma)^\# s=a.p_1' + a.p_2' + b.p_2''$ and $(\alpha\cdot\gamma)^\# t=a.p_2' + b.p_2'' + b.p_3'$ are related in the congruence closure $Z''$ of $Z'$. To establish this first observe that \[ (a.p_1' + a.p_2') \mathrel {Z'} a.p_2'\ \text{and}\ b.p_2''\mathrel {Z'} (b.p_3' + b.p_2''). \] Clearly $(\alpha\cdot\gamma)^\# s\mathrel {Z''} (\alpha\cdot\gamma)^\# t$. Now Spoiler can pick either of the two equations in $Z$. Moreover, both pairs $(\{p_1',p_2'\},\{p_2'\})$ and $(\{p_3',p_2''\},\{p_2''\})$ are mapped to a common point (the singleton containing empty trace) by $M_1!$; thus, resulting in two 1-round matches both won by Duplicator. \end{expl} \begin{propn} Every $M_1$-term $t$ is derivably equivalent to a term of the form $\bigvee_{a}a.t_a$, where $t_a$ is some $M_0$-term. \end{propn} \begin{propn} Suppose the normal form of $M_1$-terms $(\alpha\cdot\gamma)^*_0\Box$ is $\bigvee_{a} a.\Box_a$ (for $\Box\in\{s,t\}$). Then a relation $Z$ on $M_0X$ satisfying the following conditions for each action $a$ is admissible at $(s,t)$. \begin{enumerate} \item $\forall_{x\in s_a}\exists_{t'}\ t'\subseteq t_a \land \left((t',x\vee t') \in Z \lor (x\vee t',t')\in Z \right)$, and \item $\forall_{y\in t_a}\exists_{s'}\ s'\subseteq s_a \land \left((s',y\vee s') \in Z \lor (y\vee s',s')\in Z\right)$. \end{enumerate} \end{propn} \begin{proof} To show admissibility of $Z$ at $(s,t)$, it suffices to show that $\T+Z \vdash s_a=t_a$. Condition 1 ensures that \[ \T+Z \vdash s_a \lor t_a = \bigvee_{x\in s_a} x \vee t_a = t_a. \] Likewise Condition 2 ensures that $\T+Z \vdash s_a \lor t_a = s_a$. Thus, $\T +Z \vdash s_a=t_a$. \end{proof} A natural question to ask is whether there exists an algorithm to determine whether $s,t$\hbnote{I changed $U,V$ to $s,t$ inline with the notation in Definition~\ref{def:game}.} are in the congruence closure of $Z$. In fact there are algorithms to do this for the powerset monad $\pow_{\mathsf f}$ \cite{bp:checking-nfa-equiv} and for certain semiring monads \cite{bkk:up-to-weighted}. The idea behind those algorithms is to obtain rewriting rules from the pairs of $Z$ and two elements are in the congruence closure iff they can be rewritten to the same normal form.} \paragraph*{Simulation equivalence.} We illustrate how the infinite $(\alpha,\M$)-behavioural equivalence game can be used to characterise simulation equivalence~\cite{Glabbeek90} on serial LTS. We have described the graded theory of simulation in~\cref{E:semantics}.\ref{item:sem-sim}. Recall that it requires actions to be monotone, via the depth-1 equation \( a(x + y) = a(x+ y) + a(x). \) When trying to show that depth-1 terms $\sum_{i\in I}a_i(t_i)$ and $\sum_{j\in J}b_j(s_k)$ are \mbox{equal, D} may exploit that over join semilattices, inequalities can be expressed as equalities ($x\le y$ iff $x+y=y$), and instead endeavour to show inequalities in both directions. By the monotonicity of actions, $\sum_{i\in I}a_i(t_i)\le \sum_{j\in J}b_j(s_k)$ is implied by~D claiming, for each~$i$, that $t_i\le s_j$ for some~$j$ such that $a_i=b_j$; symmetrically for $\ge$ (and by the description of the relevant graded monad as per \cref{E:graded-theory}.\ref{item:simulation-a}, this proof principle is complete). Once~S challenges either a claim of the form $t_i\le s_j$ or one of the form $t_i\ge s_j$, the direction of inequalities is fixed for the rest of the game; this corresponds to the well-known phenomenon that in the standard pebble game for similarity,~S cannot switch sides after the first move. Like for bisimilarity (\cref{expl:bisim-instance}), the game can be modified to let~S move first:~S first picks, say, one of the terms~$t_i$, and~D responds with an~$s_j$ such that~$a_i=b_j$, for which she claims $t_i\le s_j$. Overall, the game is played on positions in $\pow^+(X)\times\pow^+(X)$, but if started on two states~$x,y$ of the given labelled transition systems, i.e.~in a position of the form $(\{x\},\{y\})$, the game forever remains in positions where both components are singletons, and thus is effectively played on pairs of states. Summing up, we recover exactly the usual pebble game for mutual similarity. Variants such as complete, failure, or ready simulation are captured by minor modifications of the graded semantics~\cite{DMS19}. \paragraph*{T-structured trace equivalence.} Fix a set $\A$ and a finitary monad $T$ on $\mathbf{Set}$. We are going to consider the $(\mathsf{id}, \M_T(\A))$-behavioural equivalence game on coalgebras for the functor $T(\A\times -)$ (cf.~\cref{E:graded-monad}.\ref{item:T-traces}). \begin{notn} Fix a presentation $(\Sigma', E')$ of $T$ (i.e.~an equational theory in the sense of universal algebra). We generalize the graded trace theory described in \cref{E:graded-theory}.\ref{item:traces-a} to a graded theory $\T=(\Sigma,\E)$ for $\M_T(\A)$ as follows: $(\Sigma', E')$ forms the depth-0 part of $\T$ and, at depth-1, $\T$ has unary actions $a(-)$ which distribute over all operations $f\in \Sigma'$: \[ a(f(s_1,\cdots,s_{\mathsf{ar}(f)}))= f(a (s_1),\cdots,a(s_{\mathsf{ar}(f)})) \] The arising theory $\T$ presents $\M_T(\A)$. \end{notn} \noindent Recall from~\cref{R:coeq}.\ref{R:coeq:1} that since, in this setting, $M_0=T$, a legal move for~D in position $(s,t)\in TX\times TX$ is a relation $Z$ on $TX$ such that equality of the respective successors~$(\alpha_X\cdot \gamma)^*_0(s)$ and $(\alpha_X\cdot \gamma)^*_0(t)$, viewed as (equivalence classes of) depth-1 terms, is derivable in the theory $\T$ under assumptions~$Z$. \begin{rem} A natural question is whether there exist algorithms for deciding if a pair $(\alpha_X\cdot \gamma)^*_0(s),(\alpha_X\cdot \gamma)^*_0(t)$ sits in the congruence closure of $Z$. In fact, there are algorithms to check congruence closure of depth-0 terms for the powerset monad $T=\pow_{\mathsf f}$~\cite{bp:checking-nfa-equiv} and for certain semiring monads~\cite{bkk:up-to-weighted}. The idea behind those algorithms is to obtain rewrite rules from pairs in $Z$, and two elements are in the congruence closure if and only if they can be rewritten to the same \emph{normal form}. Applying depth-1 equations to normal forms could potentially yield a method to check automatically whether a given pair of $M_1$-terms lies in the congruence closure of $Z$. \end{rem} \paragraph*{Finite-trace equivalence.} More concretely, we examine the behavioural equivalence game for trace equivalence on finitely branching LTS (i.e. $(\mathsf{id}, \M_{\pow_{\mathsf f}}(\A))$-semantics as per~\cref{E:semantics}.\ref{item:sem-trace}). \begin{expl} Consider the following process terms representing a coalgebra $\gamma$ (in a fragment of CCS): \[ p_1\equiv a.p_1'; \quad p_2\equiv a.p_2' + b.p_2''; \quad p_3\equiv b.p_3', \] where $p_1',p_2',p_2'',p_3'$ are deadlocked. It is easy to see that $s=\{p_1,p_2\}$ and $t=\{p_2,p_3\}$ are trace equivalent: In particular, $s,t$ have the same traces of length 1. We show that~D has a winning strategy in the 1-round $(\mathsf{id}, \M_{\pow_{\mathsf f}}(\A))$-behavioural equivalence game at $(s,t)$. Indeed, the relation \( Z := \{p_1' + p_2' = p_2',\ p_3' + p_2'' = p_2'' \}, \) is admissible at~$(s, t)$: We must show that equality of $(\alpha\cdot\gamma)^\#(s)=a(p_1') + a(p_2') + b(p_2'')$ and~$(\alpha\cdot\gamma)^\#(t)=a(p_2') + b(p_2'') + b(p_3')$ is entailed by~$Z$. To see this, note that \[ Z\vdash a(p_1') + a(p_2') = a(p_2')\ \text{ and }\ Z\vdash b(p_2'') = b(p_3') + b(p_2''). \] Moreover, the pairs $(\{p_1',p_2'\},\{p_2'\})$ and~$(\{p_3',p_2''\},\{p_2''\})$ are both identified by~$M_0!$ (all terms are mapped to $\{\epsilon\}$ when $1=\{\epsilon\}$). That is,~$Z$ is a winning move for~D. \end{expl} \noindent In general, admissible moves of~D can be described via a normalisation of depth-1 terms as follows: \begin{propn}\label{prop:trace-nf} In $\M_{\pow_{\mathsf f}}(\A)$, every depth-1 term is derivably equal to one of the form $\sum_{a\in \A}a (t_{a})$, with depth-0 terms (i.e.~finite, possibly empty, sets)~$t_{a}$. Over serial LTS (i.e.~$T=\pow_{\mathsf f}^+$), every depth-1 term has a normal form of the shape $\sum_{a\in B}a (t_{a})$ with $B\in\pow_{\mathsf f}^+\A$ (where the~$t_a$ are now finite and non-empty). \end{propn} \begin{propn}\label{prop:WStratTrace} Let $\rho=\sum_{a\in\A} a(\rho_a)$ be depth-1 terms over~$X$ in normal form, for $\rho\in\{s,t\}$. Then a relation $Z\subseteq \pow_{\mathsf f} X\times\pow_{\mathsf f} X$ is a legal move of D in position $(s,t)$ iff the following conditions hold for all $a\in\A$, in the notation of~\cref{prop:trace-nf}: \begin{enumerate} \item $\forall x\in s_{a}.\ \exists {t'}(t'\subseteq t_{a} \land Z\vdash x\leq t')$ \item $\forall {y\in t_{a}}.\ \exists {s'}(s'\subseteq s_{a} \land Z\vdash y\leq s')$ \end{enumerate} where, again, $s\leq t$ abbreviates $s+ t=t$. Over serial LTS (i.e.~$T=\pow_{\mathsf f}^+$), and for normal forms $\rho=\sum_{a\in B_\rho} a(\rho_a)$, a relation $Z\subseteq \pow_{\mathsf f}^+X \times \pow_{\mathsf f}^+X$ is a legal move of D in position~$(s,t)$ iff~$B_s=B_t$ and the above conditions hold for all~$a\in B_s$. \end{propn} \noindent To explain terminology, we note at this point that by the above, in particular $Z=\{(x,0)\mid x\in X\}\cup\{(0,y)\mid y\in X\}$ is always admissible. Playing~$Z$,~D is able to move in every round, bluffing her way through the game; but this strategy does not win in general, as her bluff is called at the end (cf.~\cref{S:games}). More reasonable strategies work as follows. On the one hand,~D can restrict herself to playing the bisimulation relation on the determinised transition system because the term $s'$ (resp. $t'$) can be taken to be exactly $s_a$ (resp. $t_a$) in Condition~2 (resp. Condition~1). This form of the game may be recast as follows. Each round consists just of~S playing some~$a\in\A$ (or $a\in B_s$ in the serial case), moving to $(s_a,t_a)$ regardless of any choice by~D. In the non-serial case, the game runs until the bluff is called after the last round. In the serial case, D wins if either all rounds are played or as soon as~$B_s=B_t=\emptyset$, and~S wins as soon as $B_s\neq B_t$. On the other hand, D may choose to play in a more fine-grained manner, playing one inequality $x\le t'$ for every $x\in s_a$ and one inequality $s'\ge y$ for every $y\in t_a$. Like in the case of simulation, the direction of inequalities remains fixed after~S challenges one of them, and the game can be rearranged to let~S move first, picking, say, $x\in s_a$ (or symmetrically), which~D answers with $t'\subseteq t_a$, reaching the new position $x\le t'$. The game thus proceeds like the simulation game, except that~D is allowed to play sets of states. \paragraph*{Probabilistic traces} These are treated similarly as traces in non-deterministic LTS: Every depth-1 term can be normalized into one of the form $ \sum_{\A} p_a\cdot a(t_a)$, where $\sum_{\A}p_a=1$ and the~$t_a$ are depth-0 terms. To show equality of two such normal forms $\sum_{a\in\A} p_a\cdot a(t_a)$ and $\sum_{a\in\A} q_a\cdot a(s_a)$ (arising as successors of the current configuration),~D needs to have $p_a=q_a$, and then claim~$t_a=s_a$, for all $a\in\A$. Thus, the game can be rearranged to proceed like the first version of the trace game described above:~S selects~$a\in\A$, and wins if~$p_a\neq q_a$ (and the game then reaches the next configuration~$(t_a,s_a)$ without intervention by~D). \paragraph*{Failure equivalence.} Let $\gamma\colon X \to \pow_{\mathsf f}(\A \times X)$ be an LTS. A tuple $(w,B)\in \A^* \times \pow_{\mathsf f}(\A)$ is a \emph{failure pair} of a state $x$ if there is a $w$-path from $x$ to a state $x'\in X$ such that $x'$ \emph{fails} to perform some action $b\in B$ (the \emph{failure set}). Two states are failure equivalent iff they have the same set of failure pairs. The \emph{graded theory of failure semantics}~\cite{DMS19} extends the graded theory of traces by de\-pth-1 constants~$A$ for each~$A\in\pow_f(\A)$ (failure sets) and depth-1 equations~$A+ (A\cup B) = A$ for each~$A,B\in\pow_f(\A)$ (failure sets are downwards closed). The resulting graded monad~\cite{DMS19} has~$M_0X=\pow_{\mathsf f} X$ and~${M_1X=\pow_{\mathsf f}^\downarrow(\A\times X + \pow_{\mathsf f} \A)}$, where~$\pow_{\mathsf f} \A$ is ordered by inclusion,~$\A\times X$ carries the discrete order, and $\pow_{\mathsf f}^\downarrow$ denotes the finitary downwards-closed powerset. It is clear that $\mybar{0.8}{2pt}{M}_1$ still preserves monos since we have only expanded the theory of traces by constants. The game in general is then described similarly as the one for plain traces above; the key difference is that now~S is able to challenge whether a pair of failure sets are matched up to downwards closure. \begin{expl} Consider the following process terms with $\A=\{a,b,c\}$: $ p_1\equiv a.\mathbf 0,\ p_2\equiv a.\mathbf 0+b.\mathbf 0,\ p_3\equiv b.\mathbf 0. $ Clearly, the states $s=\{p_1,p_2,p_3\}$ and $t=\{p_1,p_3\}$ in the pre-determinized system are failure equivalent. To reason this through our game $\CalG_\infty(\gamma)$, Duplicator starts with the relation $Z=\{(\mathbf 0,\mathbf 0)\}$. From~$Z$, we derive \begin{align*} (\alpha_X\cdot \gamma)^*_0 s &= a(\mathbf 0) + b(\mathbf 0) + {\downarrow}\{b,c\} + {\downarrow}\{c\} + {\downarrow}\{a,c\} \\ &= a(\mathbf 0) + b(\mathbf 0) + {\downarrow}\{b,c\} + {\downarrow}\{c\} + {\downarrow}\{c\} + {\downarrow}\{a,c\} \\ &= a(\mathbf 0) + b(\mathbf 0) + {\downarrow}\{b,c\} + {\downarrow}\{a,c\} =(\alpha_X\cdot \gamma)^*_0 t. \end{align*} Thus $Z$ is admissible at $(s,t)$ and the game position advances to $(\mathbf 0,\mathbf 0)$ from where Duplicator has a winning strategy. \end{expl} \section{Conclusions and Future Work} \noindent We have shown how to extract characteristic games for a given graded behavioural equivalence, such as similarity, trace equivalence, or probablistic trace equivalence, from the underlying graded monad, effectively letting Spoiler and Duplicator play out an equational proof. The method requires only fairly mild assumptions on the graded monad; specifically, the extension of the first level of the graded monad to algebras for the zero-th level needs to preserve monomorphisms. This condition is not completely for free but appears to be unproblematic in typical application scenarios. In case the zero-th level of the graded monad preserves the terminal object (i.e.~the singleton set), it turns out that the induced graded behavioural equivalence can be recast as standard coalgebraic behavioural equivalence in a category of Eilenberg-Moore algebras, and is then characterized by an infinite version of the generic equivalence game. A promising direction for future work is to develop the generic algorithmics and complexity theory of the infinite equivalence game, which has computational content via the implied fixpoint characterization. Moreover, we will extend the framework to cover further notions of process comparison such as behavioural preorders~\cite{FMS21a} and, via a graded version of quantitative algebra~\cite{MPP16}, behavioural metrics.
29b00d95cbbf8b7ecddde5854c71ad74ca212322
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Evaluation}\label{sec:evaluation} \begin{table}[t] \centering \begin{tabular}{|c|c|c|c|} \hline Model & \shortstack{Accuracy\\ on clean} & \shortstack{backdoor \\success rate} & \shortstack{Discriminator \\Detection Rate}\\ \hline Non-Trojaned model & {\pmb{$99.3\%$}} & - & $100\%$ \\ \hline Trojaned model & $91.92\%$ & $81.06\%$ & $96.3\%$\\ \hline \shortstack{ Trojaned model with\\ Knowledge Distillation} & $98.74\%$ & $87.39\%$ & $99.40\%$\\ \hline Our approach & $90.21\%$ & \pmb{$96.82$} & \pmb{$0.0\%$}\\ \hline \end{tabular} \caption{Comparison of models: non-Trojaned, Trojaned trained with hard labels, Trojaned trained using only knowledge distillation, and Trojaned trained using knowledge distillation and max-min optimization (\textbf{ours}). Non-Trojaned models have the highest accuracy on inputs without a trigger (clean). Our approach results in the highest success rate for a multi-targeted backdoor attack, and completely bypasses a discriminator that aims to distinguish between outputs from a Trojaned and a non-Trojaned model ($0.0\%$ in last row).} \label{tab:accuracy} \end{table} This section introduces our simulation setup and then explains results of our empirical evaluations. \subsection{Simulation Setup} We use the MNIST dataset~\cite{lecun1998mnist} to evaluate Algorithms \ref{alg:KD} and \ref{alg:minmax}. This dataset contains $60000$ images of hand-written digits ($\{0,1,\cdots,,9\}$), of which $50k$ are used for training and $10k$ for testing, and each image is of size $28 \times 28$. A square of size $4\times4$ at an arbitrary location in the image is used as the trigger (shown in Figure~\ref{fig:mnist}). In order to learn a multi-target backdoor, we select a random subset of images from the training data that have been stamped with the trigger. Let $i$ denote the true class of the input that is stamped with the trigger, and $C$ denote the total number of classes ($C=10$ for MNIST). Then, these inputs are labeled according to $g(i):=(i+1) \mod C$. We use the recently proposed MTND defense~\cite{xu2021detecting} as a benchmark. MTND learns a discriminator that takes the output of a target model to return a `score'. If this score exceeds a pre-defined threshold, the model is identified as Trojaned, and is identified as non-Trojaned otherwise. The DNNs used to learn a classifier for the MNIST dataset consists of two convolutional layers, each constaining $5$ kernels, and channel sizes of $16$ and $32$ respectively. This is followed by maxpooling and fully connected layers of size $512$. For learning the discriminator, similar to~\cite{xu2021detecting}, we use a network with one (fully connected) hidden layer of size $20$. \begin{figure} \begin{tabular}{c c c c c} \includegraphics[scale=1.8]{Figs/img_4_TrueClass_0_Pred_1.png} & \includegraphics[scale=1.8]{Figs/img_3_TrueClass_1_Pred_2.png}& \includegraphics[scale=1.8]{Figs/img_2_TrueClass_2_Pred_3.png}& \includegraphics[scale=1.8]{Figs/img_33_TrueClass_3_Pred_4.png}& \includegraphics[scale=1.8]{Figs/img_7_TrueClass_4_Pred_5.png}\\ (0,1) & (1,2) & (2,3) & (3,4) & (4,5) \\ \includegraphics[scale=1.8]{Figs/img_9_TrueClass_5_Pred_6.png} & \includegraphics[scale=1.8]{Figs/img_12_TrueClass_6_Pred_7.png}& \includegraphics[scale=1.8]{Figs/img_1_TrueClass_7_Pred_8.png}& \includegraphics[scale=1.8]{Figs/img_62_TrueClass_8_Pred_9.png}& \includegraphics[scale=1.8]{Figs/img_10_TrueClass_9_Pred_0.png}\\ (5,6) & (6,7) & (7,8) & (8,9) & (9,0) \\ \end{tabular} \caption{The MNIST dataset that contains 10 classes, corresponding to the 10 digits. Each image is stamped with the trigger at a random location (yellow square). The caption below each image shows (\emph{predicted label from non-Trojaned model}, \emph{predicted label from our Trojaned model}). The non-Trojaned model predicts the image labels correctly.} \label{fig:mnist} \end{figure} \begin{figure}[t] \centering \includegraphics[scale=0.5]{Figs/result.png} \caption{Detection rates of the discriminator for a non-Trojaned model (red) and our Trojaned model (green) during 30 rounds of Algorithm \ref{alg:minmax}. The discriminator is not able to optimize its hyper-parameters to detect both non-Trojaned model and our Trojaned model beyond $20$ rounds.} \label{fig:detectionrate} \end{figure} \subsection{Experiment Results} To demonstrate the limitations of existing defense mechanisms against backdoor attacks, we train the following models: (i) Trojaned, with multi-target backdoor using knowledge distillation and min-max optimization (\textbf{Our Trojaned Model}), (ii) Trojaned, with multi-target backdoor using only hard labels (\textbf{Traditional Trojaned Model}), and (iii) non-Trojaned, (\textbf{Non-Trojaned Model}). Table~\ref{tab:accuracy} indicates the accuracy of these three models on clean inputs (i.e., images that are not stamped with a trigger), success rates of a multi-target backdoor attack, and detection rates of a discriminator. The non-Trojaned model has the highest accuracy on clean inputs, since backdoor attacks decrease the accuracy of the models. Knowledge distillation is seen to improve the accuracy of Trojaned models on clean samples and success rates of a backdoor attack, but a Trojaned model trained using knowledge distillation alone can be detected by a discriminator with $99.4\%$ accuracy. When knowledge distillation is combined with min-max optimization, we see that the accuracy on clean inputs is reduced, but the success rate of the backdoor attack is higher. At the same time, the discriminator is not able to distinguish between outputs from a Trojaned and a non-Trojaned model ($0.0 \% $ in righmost column of last row). This demonstrates that the state-of-the-art MTND defense can be bypassed. Figure~\ref{fig:detectionrate} shows detection rates of the discriminator during different rounds of Algorithm \ref{alg:minmax}. The discriminator was not able to achieve a high detection rate on both Trojaned and non-Trojaned models when min-max optimization was deployed for more than 20 rounds. \begin{figure} \centering \includegraphics[scale=0.5]{Figs/auc2.png} \caption{The ROC curve for different threshold values of the discriminator. There is no threshold that simultaneously returns low false positive and high true positive rates for detecting our Trojaned model. In comparison, for traditional Trojaned models, a very small threshold returns a low false positive rate and high true positive rate simultaneously.} \label{fig:auc} \end{figure} To evaluate the impact of the (pre-defined) threshold values associated with the discriminator on the detection rate, we plot and receiver operating characteristic (ROC) curve that compares the true positive rate (TPR) versus false positive rate (FPR) at different classification thresholds: \begin{equation*} TPR:= \frac{TP}{TP+FN}, \:\:\: FPR:= \frac{TP}{TP+FN} \end{equation*} where $TP$ denotes the number of Trojaned models that are correctly identified as Trojaned and $FN$ is the number of non-Trojaned models that are incorrectly identified as Trojaned by the discriminator. The discriminator returns a score for each input. Inputs with a score exceeding a pre-defined threshold will be assigned to class $s=1$ (Trojaned). Figure~\ref{fig:auc} demonstrates that for any value of the threshold, the discriminator is not able to simultaneously return low $FPR$ and high $TPR$ for Trojaned models trained using our approach. However, for a traditional Trojaned model, the discriminator is able to simultaneously return a low $FPR$ and high $TPR$ for small threshold values. We also computed the area under the ROC curve (AUC) to measure the quality of the discriminator's predictions, independent of the chosen threshold value. The AUC is a number in the range $[0,1]$, and a model with an accuracy of $100 \%$ has $AUC=1$. We determined that our Trojaned model had $AUC = 0.495$, while the traditional Trojaned model had $AUC = 0.994$. These AUC values indicate that our two-step approach results in a discriminator performance in distinguishing between outputs from a Trojaned and non-Trojaned model that is as good as a `coin-toss' guess (i.e., selecting one of two possibilities, with probability $0.5$). \section{Introduction} The recent advances in cost-effective storage and computing has resulted in the wide use of deep neural networks (DNN) across multiple data-intensive applications such as face-recognition~\cite{taigman2014deepface}, mobile networks~\cite{zhang2019deep}, computer games~\cite{mnih2015human}, and healthcare~\cite{esteva2019guide}. The large amounts of data and extensive computing resources required to train these deep networks has made online machine learning (ML) platforms~\cite{AWS, BigML, Caffe} increasingly popular. However, these platforms only provide access to input-output information from the models, and not parameters of the models themselves. This is termed \emph{black-box access}. Recent research~\cite{gu2019badnets} has demonstrated that online ML models can be trained in a manner so that the presence of a specific perturbation, called a \emph{trigger}, in the input will result in an output that is different from the correct or desired output. At the same time, outputs of the model for clean inputs- i.e., inputs without trigger- is not affected. This can result in severe consequences when such platforms are used in safety-critical cyber and cyber-physical systems~\cite{ullah2019cyber}. The insertion of a trigger into inputs to a model is called a \emph{backdoor attack} and the model that misclassifies such inputs is termed \emph{Trojaned}. Backdoor attacks can have severe implications in safety-critical cyber and cyber-physical systems where only the outputs of a model are available. For example, autonomous navigation systems that depend on DNNs for decision making using reinforcement learning models have been shown to be vulnerable to backdoor attacks~\cite{panagiota2020trojdrl}. DNN models have also been used for traffic sign detection, and these models can be trained to identify the signs correctly, but results in an incorrect output when the sign has a trigger~\cite{gu2019badnets} (e.g., a `stop' sign with a small sticker on it is identified as a `speed-limit' sign). Such threats necessitate the development of defense mechanisms. However, most defenses assume that hyper-parameters of the model are available~\cite{liu2018fine,yoshida2020disabling,li2021neural,kolouri2020universal} or that a pre-processing module can be added to the target model~\cite{liu2017neural}. These may not be practical for applications where only outputs of the model are available and users cannot control inputs provided to the model. A defense mechanism against backdoor attacks called meta-neural Trojan detection (MTND) was proposed in~\cite{xu2021detecting}. This method leverages an insight that the distribution of outputs from a Trojaned model might be different to those from a non-Trojaned model, even though both models have similar accuracies. MTND learns a discriminator (a classifier with two outputs, YES or NO) using outputs from a Trojaned and a non-Trojaned model as training data, in order to distinguish between the models. This approach was shown to identify Trojaned models with $>96\%$ accuracy, when only black-box access to them was available~\cite{xu2021detecting}. Despite the current success of MTND, examples can be constructed that demonstrate some of its limitations \begin{figure*} \centering \includegraphics[width=0.64\textwidth]{Figs/Scheme.png} \caption{Schematic of our two-step methodology. \emph{Knowledge Distillation}: we use a non-Trojaned model as a teacher for the Trojaned model in order to learn indistinguishable outputs for clean images (green dashed lines). \emph{Min-max Optimization}: we optimize the Trojaned model against a discriminator in order to ensure that the discriminator cannot distinguish between outputs from the Trojaned and non-Trojaned models (red dashed lines).} \label{fig:scheme} \end{figure*} % In this paper, we identify a new class of backdoor attack called {\it multi-target backdoor attack}. Unlike existing single-target trigger backdoors, a trigger from a multi-target backdoor attack can cause misclassification to different output labels depending on the true class of the input. Specifically, we demonstrate that a model can be trained so that its output is a function of the true class of the input and the presence of a trigger in that input. We also propose a two-step methodology to bypass the MTND defense mechanism. Figure~\ref{fig:scheme} demonstrates our approach: (i) we use a non-Trojaned model as a \emph{teacher} for the Trojaned model (\textbf{Knowledge Distillation}), then (ii) we use min-max optimization between a discriminator and Trojaned model to ensure that the discriminator is not able to distinguish between outputs from a Trojaned and a non-Trojaned model (\textbf{Min-max Optimization}). We make the following contributions: \begin{itemize} \item We introduce a new class of \emph{multi-target backdoor attacks}. Such an attack has the property that a single trigger can result in misclassification to different output labels, based on true input label. \item We design two algorithms- a training procedure that combines knowledge distillation (Algorithm 1) and min - max optimization (Algorithm 2) to reduce the accuracy of a defense mechanism designed to distinguish between Trojaned and non-Trojaned models. \item We evaluate the trained Trojaned model from the previous step by examining the effect of a multi-target backdoor attack on a state-of-the-art meta-neural Trojan defense (MTND). Our empirical evaluations demonstrate that our training procedure is able to bypass the MTND defense $100\%$ of the time. \end{itemize} The remainder of this paper is organized as follows: Section \ref{sec:preliminaries} presents a tutorial introduction to DNNs with backdoors and describes our system model. An overview of related literature on backdoor attacks in deep learning and state-of-the-art defense mechanisms is provided in Section \ref{sec:relatedwork}. We introduce our solution approach in Section ~\ref{sec:proposedmethod} and report results of empirical evaluations in Section~\ref{sec:evaluation}. Section \ref{sec:discussion} discusses methods to extend our solution to a broader class of problems, and Section \ref{sec:conclusion} concludes the paper. \section{Preliminaries}~\label{sec:preliminaries} This section provides a brief introduction to classification using deep neural networks, and single-target backdoor attacks using a \emph{set of poisoned inputs}. Finally, we introduce the system model that we use for our algorithms. \subsection{Deep Neural Networks} Deep Neural Network (DNN) classifiers are trained to predict the most relevant class among $C$ possible classes for a given input. The output of a DNN is called a \emph{logit}, which gives a weight to each class, $z:=[z^1,\cdots, z^C]$. The output of the model is fed to the softmax function to generate a probability vector where each element $i$ is the conditional probability of class $i$ for a given input $x$. The softmax function is defined as: \begin{equation}\label{eq:softmax} p(z^i,T) = \frac{\exp{z^i/T}}{\sum_j^C \exp{z^j/T}}, \end{equation} where $T$ is a temperature parameter (typically $=1$). A DNN classifier is a function $z:=F(x;\theta)$, where $x\in[0,1]^{d}$ is an input and $\theta$ represents hyperparameters of the DNN. We will write $p(z,T)$ to denote the probability vector determined through the softmax function. In order to train the DNN (i.e., determine values of $\theta$), we minimize the difference between the output of softmax function $p(F(x_k;\theta),T=1)$, and the true class of the input, $y^*_k$ for a sample $x_k$. This is quantified by a loss function $\mathcal{L}(p, y^*)$, and parameters $\theta$ are iteratively updated using stochastic gradient descent as: \begin{equation}\label{eq:LCE} {\theta}^{t+1}\gets \theta^t -\alpha \frac{1}{|\mathcal{D}|}\sum_k \frac{\partial}{\partial \theta} \mathcal{L}(p(F(x_k;\theta)),y_k^*) \end{equation} where $\mathcal{D}$, $F$, $\alpha$ and $\mathcal{L}$ are training set, DNN's function with hyper-parameter $\theta$, a positive coefficient and loss function respectively One way of introducing a backdoor into the model is through poisoning the training set with a set of inputs stamped with a pre-defined trigger and labeled with the desired output~\cite{liu2020reflection,li2020rethinking}. The trigger has a single-target \text{i.e., } any input with trigger causes the model to return a specific output. In order for a model to return multiple target classes, we will require one trigger per target class to be inserted into the input. Let $\mathcal{D}=\{(x_1,y_1),(x_2,y_2),\cdots, (x_N,y_N) \}$ be the original training set (a set of clean samples) and $\mathcal{D'}=\{ (x_{1}',y^d), (x_{2}',y^d),\cdots, (x_{n}',y^d)\}$ ($n \ll N$) be a set of perturbed samples. Suppose each sample in $\mathcal{D'}$ is perturbed using a pre-defined trigger as: \begin{align*} x_{ij}'= m_{ij}*\Delta + (1-m_{ij}) x_{ij} \:\:\text{i.e., }\:\: i\in [1,W],\:\: j\in [1,H] \end{align*} where $\Delta$ is the perturbation that we term a Trojan trigger and $m$ is a mask that indicates the location where the perturbation is applied. In this paper, we assume that each sample is an image of resolution $W\times H$. The trained Trojaned model on both clean and poisoned datasets would return a desired output in the presence of a specific trigger in the input while keeping the accuracy unchanged for clean samples. \subsection{Our System Model} In this paper, we assume that the Trojaned model is trained by an adversary who does not share the hyper-parameters of her model. The Trojaned model can be shared through an ML platform or can be a built-in model in a smart device. Therefore, only the outputs of the model are available to users/defenders for any given input. This is termed \emph{black-box access}. The defender aims to learn a discriminator (a classifier with two classes of YES/NO) to determine whether a model is Trojaned or not. The defender can learn several non-Trojaned and Trojaned models locally and use their outputs to train the discriminator (See Figure~\ref{fig:scheme}). We also assume the defender and adversary have access to the same training sets to train their local models. Given an arbitrary set of inputs that is provided to both a Trojaned and non-Trojaned model, the discriminator uses the outputs from these two models to learn a (binary) classifier. After training, the discriminator is used to evaluate an unknown model, to determine whether it is Trojaned or not. Our contribution in this paper is the design of a methodology to demonstrate that such a discriminator can be fooled (i.e., cannot say whether a model is Trojaned with probability $>0.5$). \section{Solution Approach} \label{sec:proposedmethod} Backdoor attacks aim to preserve the accuracy of a model on inputs without a trigger (clean samples) while misclassifying inputs that are stamped with a trigger. We denote the (Trojan) trigger by $\Delta$. Different from existing backdoor attacks that result in the model producing a single, unique target class for inputs with a trigger, we propose a new class of \emph{multi-target backdoor attacks}. A multi-target backdoor attack can result in a model producing a different output based on the true class of the input that contains a trigger. Consequently, an adversary can trigger a desired output by selecting a sample from the corresponding source class. In order to train a multi-target backdoor, an adversary poisons the training input set with a new set of samples perturbed with the trigger, and labeled using a map-function: \begin{align*} \mathcal{D'}&=\{(x_{i_1}+m\Delta,g(y_{i_1}^*)), (x_{i_2}+m\Delta,g(y_{i_2}^*)),\\&\qquad \cdots, (x_{i_n}+m\Delta,g(y_{i_n}^*))\}, \end{align*} where $\Delta, m, g(\cdot)$ are the trigger, a mask which denotes where the trigger is deployed, and a function that maps a source class to target class (that is, $g(i) = j, i, j \in \{1,2,\dots C\}, i \neq j$) respectively. However, a backdoor attack can result in output distributions (i.e., probabilities that the output belongs to a specific class) from a Trojaned model being different to that from a non-Trojaned model, even though both models will have similar accuracy on clean samples. Our objective is to demonstrate the limitations of defense mechanisms that seek to distinguish between outputs from a Trojaned model and a non-Trojaned model can be bypassed. To this end, we seek to learn a Trojaned model that has an output distribution on clean samples which is similar to that from a non-Trojaned model. The two-stage setup that we use is shown in Figure~\ref{fig:LearningScheme}. We first learn such a Trojaned model using a non-Trojaned model as a teacher. Then, we maximize the indistinguishability between outputs of the two models by solving a min-max optimization problem. The remainder of this section explains these steps in detail. \begin{figure} \centering \includegraphics[width = 0.5 \textwidth]{Figs/LearningSteps.png} \caption{Two steps of our learning procedure. In the first step (left chart), we use a non-Trojaned model as a teacher for the Trojaned model. Then in the second step (right chart), we update the weights of model to fool the discriminator.} \label{fig:LearningScheme} \end{figure} \subsection{Using a non-Trojaned Model as Teacher} The process of transferring knowledge from a `teacher' model that has high accuracy to a smaller `student' model is called \emph{knowledge distillation}~\cite{hinton2015distilling}. Unlike `hard' labels which assign a sample to exactly one class with probability $1$, `soft' labels assign a probability distribution over output classes. The non-zero probabilities provide information about inter-class similarities. Knowledge distillation improves accuracy of the student model using `soft' labels provided by the teacher. In order to ensure similarities in behaviors of a Trojaned model and a non-Trojaned model, we use the non-Trojaned as a teacher for the Trojaned model, and minimize the difference between their outputs for a given input. Let the DNNs that comprise the Trojaned model be parameterized by $\theta$, and those comprising the non-Trojaned model be parameterized by $\theta''$. Assume that $z_{T} = F_{T}(.;\theta)$ and $z_N = F(.;\theta'')$ denote the logits from the two models, and $C$ be the number of output classes. Knowledge distillation techniques minimize the distance between the outputs of teacher and student models for clean samples. The authors of~\cite{hinton2015distilling} established that when using gradient-based techniques and soft labels as an input to a loss function, the gradients were scaled by $1/T^2$. For e.g., when using the $L_2$-norm to measure the distance between the models' outputs, following Eqn (\ref{eq:softmax}) and assuming that logits are zero mean without loss of generality, the gradient of the loss function is \begin{align*} &\frac{\partial }{\partial z^i_{T}} 0.5(p(z_{N}, T)-p(z_{T}, T))^2 \\ &=\frac{1}{T} \frac{e^{z^i_{T}/T}}{\sum_j e^{z^j_{T}/T}} (\frac{e^{z^i_{N}/T}}{\sum_j e^{z^j_{N}/T}} - \frac{e^{z^i_{T}/T}}{\sum_j e^{z^j_{T}/T}}) \\ &\approx \frac{1}{T} \frac{1+z^i_{T}/T}{C+\sum_j z^j_{T}/T}(\frac{1+z^i_{N}/T}{C+\sum_j z^J_{N}/T}-\frac{1+z^i_{T}/T}{C+\sum_j z^j_{T}/T}) \\ &\approx \frac{1}{C^2T^2}z_T^i (z_N^i-z^i_{T} ) \end{align*} To compensate for the $1/T^2$ factor obtained in the above gradient-calculation, we will scale by $T^2$ when updating parameters $\theta$ of the DNN (see \emph{Line 12} of Algorithm 1). The gradients for other loss functions like the Kullback-Liebler (KL)-divergence, $\mathcal{L}_{KL}$, and cross-entropy loss, $\mathcal{L}_{CE}$ can be computed in a similar manner. The Kullback-Leibler divergence loss function quantifies the distance between the distributions of the outputs of two models and is defined as: \begin{equation} \begin{split} \mathcal{L}_{KL} (p(z_N, T), p(z_T,T))= p(z_N, T) \log \frac{p(z_N, T)}{p(z_T,T)} \end{split} \end{equation} Knowledge distillation techniques also train the Trojaned model on hard labels together with soft labels. The cross entropy loss function measures the difference between the the softmax of the logit of the training (Trojaned) model, denoted $T=1$, and the true label of the input as follows: \begin{equation} \begin{split} \mathcal{L}_{CE} (y^*, p(z_{T},T=1))&=-\sum_j y_j^* \log p_j(z_{T},T=1)\\ &= -\log p_i(z_{T},T=1) \end{split} \end{equation} where $y^*$ is the true class of the input and $p_i(z_T,1)$ is the $i^{th}$ element of the softmax function's output. Since a hard label ($y^*$) assigns an input to one class, all elements have value of $0$, except the $i^{th}$ element, which has a values of $1$ if the input belongs to class $i$. Algorithm~\ref{alg:KD} explains the knowledge distillation step in detail. \begin{algorithm} \caption{Knowledge Distillation}\label{alg:KD} \begin{algorithmic}[1] \Require $\mathcal{D}, \Delta, m, g(.), T^*, F_{N}, \alpha_1>0, \alpha_2>0$ \State $\mathcal{D'}\leftarrow \mathcal{D}$ \For {$j=1:n$} \State $(x,y)\leftarrow \text{random-selection}(\mathcal{D})$ \State $\mathcal{D'}\leftarrow \mathcal{D'} \cup (x+m\Delta, g(y))$ \EndFor \For {$i=1:itr$} \For {$(x^k,y^k) \in \mathcal{D}$} \State $z_{T} \gets F_{T}(x^k;\theta)$ \State $z_{N} \gets F_{N}(x^k;\theta'')$ \State $q_1 \gets p (z_{N}, T=T^*)$ \State $q_2 \gets p (z_{T}, T=T^*)$ \State $L_1 \leftarrow L_1+ T^2 \times \frac{\partial}{\partial \theta} \mathcal{L}_{KL}(q_1,q_2)$ \EndFor \For {$(x^k,y^k) \in \mathcal{D'}$} \State $z^k_{T} \gets F_{T}(x^k;\theta)$ \State $L_2\leftarrow L_2+ \times \frac{\partial}{\partial \theta} \mathcal{L}_{CE} (y^k, p(z_{T}, T=1)) $ \EndFor \State $\theta \gets \theta- \alpha_1 L_1 - \alpha_2 L_2 $ \EndFor \end{algorithmic} \end{algorithm} \subsection{Min-Max Optimization} We assume that a defender has access to only the outputs of a Trojaned model. This is termed \emph{black-box access}, and is a reasonable assumption when machine learning-enabled cyber and cyber-physical systems are deployed in the real world. In order to determine whether a model is Trojaned or not using only outputs of the model, the defender uses a \emph{discriminator}, $D$. The discriminator is a classifier with two classes- YES ($s=1$) and NO ($s=0$). Learning a discriminator (parameterized by $\phi$) involves taking a set of outputs of a model corresponding to a set of random inputs and assigning it to class $s=0$ if the model is non-Trojaned, and $s=1$ if it is Trojaned. We define $ \mathcal{\hat{D}}:=\cup_j \{(p(F_{N}(x_j;\theta''),T=1),0),(p(F_{T;\theta}(x_j),T=1),1) \}$, where $F_{N}(\cdot, \theta'')$ and $F_{T}(\cdot,\theta)$ are functions of non-Trojaned and Trojaned models parameterized by $\theta''$ and $\theta$, respectively. The discriminator minimizes a loss function derived from the cross-entropy loss $\mathcal{L}_{CE}$, given by: \begin{align} \mathcal{L}&=\frac{1}{2N'}\sum_{\substack{ (q,s)\in \mathcal{\hat{D}}\\ (q= p_{N},s=0) \:or (q= p_{T},s=1) }} \mathcal{L}_{CE}(D(q;\phi),s) \end{align} The objective of the adversary, on the other hand, is to ensure that the backdoor in the Trojaned model remains undetectable (i.e., fool the discriminator). Consequently, she updates hyperparameters of the Trojaned model in a manner that will maximize the loss of the discriminator: \begin{align} \max_\theta \min_{\phi} \mathcal{L}_{CE}(D(F(x;\theta);\phi),1) \end{align} Algorithm~\ref{alg:minmax} explains the min-max step in detail. In the $\min$ step, we first generate a set of arbitrary inputs (images, in our case that are generated from a $\mathcal{N}(\mu,\sigma)$ distribution) and provide them to both non-Trojaned and Trojaned models. The outputs from these models are used to train the discriminator. In the $\max$ step, we update parameters of the Trojaned model to maximize the loss of the discriminator by generating outputs that are similar to outputs of the non-Trojaned model for the arbitrarily generated inputs. In order to preserve accuracy of the model on any input (clean or triggered), we consider a set $\mathcal{D'}$ that contains both types of inputs, and minimize a cross-entropy loss (Lines 10-14). \begin{algorithm} \caption{Min-Max Optimization for Discriminator}\label{alg:minmax} \begin{algorithmic}[1] \Require $F_{N}(., \theta''), F_{T}(.;\theta), \mu, \sigma, \mathcal{D'}, \alpha_1, \alpha_2, \alpha_3>0$ \For {$i=1:itr$} \For {$i=1:N'$} \State $img\leftarrow \mathcal{N}(\mu,\sigma)$ \State $\mathcal{\hat{D}} \leftarrow \mathcal{\hat{D}} \cup \{p((F_{N}(img;\theta''), T=1),0)\}$ \State $\mathcal{\hat{D}} \leftarrow \mathcal{\hat{D}} \cup \{(p(F_{T}(img;\theta), T=1),1)\}$ \EndFor \State $L_1= \frac{1}{2N'}\sum_{(q,s)\in\mathcal{\hat{D}} } \frac{\partial}{\partial \phi} \mathcal{L}_{CE}(D(q;\phi),s)$ \State $\phi \gets \phi-\alpha_1 L_1$ \State $L_2= \frac{1}{N'} \sum_{x_i\sim \mathcal{N}(\mu,\sigma)} \frac{\partial}{\partial \theta} \mathcal{L}_{CE}( D( p(F_T(x;\theta));\phi),1) $ \For {$(x^k,y^k) \in \mathcal{D'}$} \State $z^k_{T} \gets F_{T}(x^k;\theta)$ \State $L_3=L_3+ \frac{\partial}{\partial \theta} \mathcal{L}_{CE} (y^k, p(z_{T}^k, T=1)) $ \EndFor \State $\theta \gets \theta- \alpha_1 L_1 +\alpha_2 L_2 -\alpha_3 L_3$ \EndFor \end{algorithmic} \end{algorithm} \section{conclusion}\label{sec:conclusion} This paper studied machine learning models that were vulnerable to backdoor attacks. Such a model is called a Trojaned model. We identified a limitation of a state-of-the-art defense mechanism that was designed to protect against backdoor attacks. We proposed a new class of multi-target backdoor attacks in which a single trigger could result in misclassification to more than one target class. We then designed a two-step procedure that used knowledge distillation and min-max optimization to ensure that outputs from a Trojaned model were indistinguishable to a non-Trojaned model. Through empirical evaluations, we demonstrated that our approach was able to completely bypass a state-of-the art defense mechanism, MTND. We demonstrated a reduction in detection accuracy of the discriminator of MTND from $>96\%$ without our method to $0\%$ when using our approach. We also discussed ways to extend our methodology to other classes of DNN models beyond those that use images, establish provable guarantees, and build better defenses. \section{Discussion}\label{sec:discussion} In this section, we identify how our approach can be extended to domains where inputs might not be images, and highlight some open questions and challenges that are promising future research directions. \subsubsection{Extension to other domains} Our solution approach focused on the setup where inputs to a DNN was images, and we showed that the state-of-the-art MTND defense~\cite{xu2021detecting} could be bypassed. Recent research has demonstrated that DNNs designed for other tasks such as text classification and generation~\cite{dai2019backdoor}, code completion~\cite{schuster2021you}, and decision making in reinforcement learning and cyber-physical systems~\cite{panagiota2020trojdrl} are also vulnerable to backdoor attacks. We believe that our solution methodology can be applied to domains where the inputs and outputs of a DNN are continuous valued such as speech~\cite{zhai2021backdoor} and deep reinforcement learning~\cite{mnih2015human}. We will evaluate our two-step approach on backdoor attacks carried out on these types of systems, and examine the limitations of defenses against backdoor attacks in settings where inputs to a DNN classifier are discrete-valued (e.g., text). \subsubsection{Provable Guarantees} The nested and inherently nonlinear structure of DNNs makes it challenging to explain the decision-making procedures for given input data~\cite{samek2017explainable}. This challenge also holds true when investigating the explainability of defense mechanisms and their limitations against backdoor attacks on DNNs. We believe that developing a principled approach that enables establishing provable guarantees on the accuracy of certain classes of DNNs- e.g., when the activation function is a rectified linear unit (ReLU)~\cite{arora2018understanding} will be a promising step in this direction. \subsubsection{Building Better Defenses} In this paper, the discriminator used outputs to an arbitrary set of image inputs to determine whether the model was Trojaned or not. An interesting question to answer is if the similarity between outputs from a Trojaned and non-Trojaned model can be characterized for any input that does not contain a trigger. Quantifying the change in the trigger/ trigger pattern that will result in a change in the decision of a Trojaned model compared to a non-Trojaned model is a possible solution approach. This will help learn and reason about the dynamics of the decision boundaries of DNN classifiers to enable building better defenses against backdoor attacks. \section{Related Work} \label{sec:relatedwork} This section summarizes recent literature on backdoor attacks and defense mechanisms against such attacks. A backdoor attack results in DNN models misclassifying inputs that contain a trigger~\cite{usenix2021blind}. An input containing a trigger can be viewed as an adversarial example~\cite{kurakin2017adversarial}, but there are differences in the ways in which an adversarial example attack and a backdoor attack are carried out. Adversarial examples are generated by learning a quantum of adversarial noise that needs to be added to an input in order to cause a pre-trained DNN model to misclassify the input~\cite{moosavi2016deepfool,kurakin2017adversarial,goodfellow2015explaining}. Backdoor attacks, in comparison, aim to influence weights of parameters of neural networks that describe the target model during the training phase either through poisoning the training data~\cite{usenix2021blind} or poisoning the weights themselves~\cite{dumford2020backdooring,rakin2020tbt}. Consequently, any input stamped with a pre-defined trigger will be able to cause the DNN to misclassify the input. Moreover, the trigger for a backdoor attack might be invisible~\cite{turner2019label, li2020invisible, liao2018backdoor} It has been demonstrated that adversarial example attacks and backdoor attacks can both be trained to be transferable~\cite{gu2019badnets,wang2020backdoor}. When access to a target model was not available, a black-box backdoor attack was proposed in~\cite{liu2017trojaning}. In this case, the adversary had to generate training samples, since the training dataset was not available. The vulnerability of DNN models to backdoor attacks have been examined in multiple applications. A class of semantic backdoor attacks was proposed in~\cite{bagdasaryan2020backdoor,usenix2021blind} for image and video models. In this case, the target label was determined based on features of the input- for e.g., inputs featuring green colored cars would result in the model misclassifying it as a bicycle. The authors of~\cite{usenix2021blind} and ~\cite{dai2019backdoor} designed backdoor attacks for code poisoning and natural language processing models respectively. Recently, an untargeted backdoor attack for deep reinforcement learning models was proposed in ~\cite{panagiota2020trojdrl}. Backdoor attacks have also been used to determine fidelity- specific examples include model watermarking~\cite{adi2018turning} and verifying that a request by a user to delete their data was actually carried out by a server~\cite{sommer2020towards}. % Backdoor attacks typically specify one target output class for each trigger. An \emph{N-to-one trigger} backdoor attack was proposed in~\cite{xue2020one}, where an adversary used a single trigger at a specific location, but with different intensities for each target. A procedure to train different models to output different target classes using the same trigger was demonstrated in~\cite{xiao2022multitarget}. The authors of~\cite{rajabi2020adversarial} introduced an input-based misclassification procedure by learning adversarial perturbations~\cite{moosavi2017universal} for pairs of target classes. Different from~\cite{rajabi2020adversarial} where one perturbation was required for each pair of classes, our methodology in this paper uses a single trigger that can cause misclassification to more than one target class. Defense mechanisms against backdoor attacks can focus on removing backdoors from Trojaned models~\cite{liu2018fine,yoshida2020disabling,li2021neural} or detecting/suppressing poisoned data during training~\cite{du2019robust,tran2018spectral,chen2018detecting}. Our focus in this paper is on a third type- defense mechanisms for pre-trained models, since we assume that the target model has already been trained, and that the user will only have `black-box' access to it. Pre-processing defense mechanisms deploy a module that will remove or reduce the impact of a trigger present in the input. For example, an auto-encoder was used as a pre-processor in~\cite{liu2017neural}. A generative adversarial network (GAN) was used to identify `influential' portions of an image/ video input in~\cite{selvaraju2017grad}. This approach was leveraged by~\cite{udeshi2019model} to use the dominant color of the image as a trigger-blocker. Style-transfer was used as a pre-processing module in~\cite{villarreal2020confoc} to mitigate the impact of trigger present in the input. Modifying the location of the trigger using spatial transformations was deployed as a defense mechanism in~\cite{li2020rethinking}. In contrast, post-training defense mechanisms aim to determine whether a given model is Trojaned or not, and then refuse to deploy a Tojaned model. The authors of~\cite{kolouri2020universal} proposed a technique based on learning adversarial perturbations~\cite{moosavi2017universal} to locate a trigger using an insight that triggers constrain the magnitude of the learned perturbation. Thus, the learning process would identify a model as Trojaned if the learned perturbation was below a threshold. An outlier detector was used in~\cite{huang2019neuroninspect} to explain outputs of a model and features extracted using a saliency map were used to identify if the model was Trojaned. A defense mechanism against backdoor attacks when working with limited amounts of data was proposed in~\cite{wang2020practical}. All the approaches described above require access to hyperparameters of the model. There is a relatively smaller body of work focused on designing defenses in the absence of such access. A mechanism called DeepInspect was proposed in~\cite{chen2019deepinspect}, which learned the probability distribution of triggers using a generative model. DeepImpact assumed that a trigger had fixed patterns with a constant-valued distribution. In comparison, we consider a trigger that can have an arbitrary location within the input, and can result in misclassification to more than one target class. The authors of~\cite{xu2021detecting} proposed meta neural Trojan detection (MTND). MTND used a discriminator which took a target model as input, and performed a binary classification on the output of the model to identify if it was Trojaned or not. We evaluate our methodology using MTND as a benchmark, since MTND does not make any assumptions about the trigger.
0e37fe6f3eda4bdcd1b76d19c87d271f71a90aed
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }
\section{Introduction} Interdisciplinary approaches are common in science and technology, and their importance in pedagogy cannot be overstated. Williams et al.~\cite{williams2003aren } analyse the reasons why many high school students do not find physics interesting and suggest that an interdisciplinary approach might enhance students' interests in physics. A new idea can be better appreciated by the students when they interpret it in terms of the known concepts bearing no apparent connections with the new topic. Apart from understanding concepts in a new light, it often leads to important milestones. For example, the discovery of the double helix structure of DNA required the knowledge of chemistry, molecular biology, and crystallography. This trend has been adopted in the pedagogy of physics curricula at the undergraduate level in recent decades. An example of this is `F=ma optics'~\cite{evans1986f} where many elements of geometrical optics were interpreted in terms of the concepts learned from Newtonian mechanics. This analogy was a glimpse of the deeper connection between classical mechanics and ray optics through the principle of stationary action~\cite{ goldstein2002classical}. Whereas in classical mechanics, this principle helps in understanding the dynamical evolution of a system, in geometrical optics it is used to analyse the spatial evolution of the light ray in a medium with a known refractive index. This approach culminated in a new discipline called Hamiltonian optics~\cite{buchdahl1993introduction, torre2005linear, dragoman2013quantum, lakshminarayanan2002lagrangian} and is not usually taught in undergraduate-level physics courses. The present author thinks that concrete examples of such interdisciplinary approaches could be very useful for the students. The analytical formulation of geometrical optics raises the question of whether it is possible to rediscover the quantum nature of light in an appropriate limit starting from this alternative approach to optics. In fact, the answer is affirmative: Gloge and Marcuse developed a quantum theory of light rays~\cite{gloge1969formal} based on Hamiltonian optics. This work finds the emergence of the quantum effects in the limit where the wavelength of light rays cannot be neglected and eventually derives the reduced wave equation (which they called the Klein Gordon equation of the quantum theory of light rays) whose solutions could represent the probability wave amplitudes of the light rays In the introductory level courses on optics, students learn about Huygen's principle~\cite{jenkins2018fundamentals}, to understand the propagation of light rays in a medium and Snell's law of light refraction between media with different refractive indices without any reference to the quantum description of light. With higher courses on electromagnetic theory, they also learn about the coefficient of reflection and transmission when light, an electromagnetic wave, falls at the interface of two media~\cite{hecht1998hecht}. A few unconventional approaches to refraction were illustrated in the pedagogical works, by (a) Drosdoff et al.~\cite{drosdoff2005snell} who treated photons as entities with well-defined energy and momenta, to prove Snell's law, (b) Evans et al.~\cite{evans1986f} who argued that the tangential component of the optical equivalent of mechanical velocity must be the same in two media. Another method has been demonstrated by Ghatak~\cite{lakshminarayanan2002lagrangian} who set the derivative of total optical path length to zero to arrive at Snell's law. The last example made use of Hamilton's principle of stationary action. It is not clear if these methods could develop to the point where one can obtain the coefficients of reflection and transmission. These different approaches do not use the quantum description of light rays, but we believe that the use of this description may bring pedagogic insight to these topics. In particular, we did not find any instance where the reduced wave equation of the light rays introduced in the formal quantum theory of light rays~\cite{gloge1969formal} was utilised to prove Snell's law or to obtain the coefficients of the light reflection or refraction. However, such a development would be pedagogically very appealing, because the solutions of this equation are very similar to the Huygen's wavelets. In this article, we will present an algebraic method to fill in this gap. The students do not need prior knowledge of Hamiltonian optics, but some familiarity with analytical mechanics and Schr$\rm{\ddot o}$dinger's equation is helpful. It is hoped that the present manuscript could be a valuable addition to the existing literature of physics pedagogy. We will start our discussion with a discussion on the known concepts and published materials in next section~\ref{Sec2} which provides a summary of Hamilton's formulation of geometrical optics and leads to the differential equation describing the spatial evolution of the light rays. Evans et al.~\cite{evans1986f} presented a clever parametrization that significantly reduces the degree of complexity of this ray equation. In the next section~\ref{ScWvEq}, we shall find that the reduced wave equation which was developed by Gloge et al.~\cite{gloge1969formal} nicely reflects the elements of the formulation~\cite{evans1986f}. Later in that section, the main results of this paper will be presented. It will be observed that this equation can be interpreted as a Schr$\rm{\ddot{o}}$dinger's equation with zero energy wavefunctions. Using a model of incidence of the light rays (represented by such wavefunctions) on a potential barrier in two dimensions, we will obtain Snell's law of refraction. We will see that this approach also leads to Fresnel's equations~\cite{hecht1998hecht} for the $s$-polarized light. We shall conclude with some discussion on the implication of this study. \section{Analytical formulation of optics}\label{Sec2} \subsection{Lagrangian formulation} Hamilton's principle of stationary action is introduced to the students in analytical mechanics courses. Action $S$ of a dynamical system is defined as the time integral of Lagrangian density $\mathcal{L}=\mathcal{L}(q,\dot{q},t)$:\\ \begin{equation}\label{Eq1} S=\int_{t_1}^{t_2}\mathcal{L}(q,\dot{q},t)\ dt \end{equation} Sticking to the usual convention, we shall call $\mathcal L$ the Lagrangian for its subsequent appearances. For the fixed time instants $t_1$ and $t_2$, the principle says that the system will dynamically evolve along a path, for which the action will be stationary to the first order. That is, the action will not change due to a slight variation of the path. This statement is mathematically expressed as: \begin{equation}\label{Eq2} \delta S=\delta \int_{t_1}^{t_2}\mathcal{L}(q,\dot{q},t)\ dt=0 \end{equation} The above principle leads to the Euler-Lagrange equation that governs the dynamical evolution of the system: \begin{equation}\label{Eq3} \frac{\partial\mathcal{L}}{\partial q} =\frac{d}{dt}\left(\frac{\partial\mathcal{L}}{\partial\dot{q}}\right) \end{equation} \subsection{Fermat's principle} In case of geometrical optics, the equivalent physical principle is the Fermat's principle which states that for fixed end points a ray of light will propagate along a trajectory along which the optical path length $\mathbb{L}=\int n\ ds$ is stationary. That means the variation in optical path length will not change to the first order: \begin{equation}\label{Eq4} \delta\mathbb{L}=\delta\int_{P_1}^{P_2} n\ ds=0 \end{equation} Euler-Lagrange variation of the principle (Eq.\eqref{Eq4}) leads to the differential ray equation governing the spatial evolution of the light rays: \begin{equation}\label{Eq5} \frac{\partial{n}}{\partial{\bf r}} =\frac{d}{ds}\left(n\frac{d{\bf r}}{ds}\right) \end{equation} This equation is non-linear and is difficult to solve when the refractive index $n$ varies spatially. \subsection{F=ma optics} Evans~\cite{evans1986f} showed that if Fermat's principle is expressed in terms of an independent variable $a$, defined by $n=\left|\frac {d{\bf r}}{da}\right|$, where $n$ denotes the refractive index and ${\bf r}$ denotes the position vector, then Eq.\eqref{Eq5} can be expressed as: \begin{equation}\label{Eq6} \frac{d^2{\bf r}}{da^2}=-\nabla^2\left(\frac{n^2}{2}\right) \end{equation} -where $a$ is a parameter. This equation has the well-known form of Newton's second law of motion, in terms of the parameter $a$. In this formulation, the quantity that is equivalent to force is proportional to the gradient of the square of the refractive index. This specialized coordinate is applicable to geometrical optics, in which mass, velocity, kinetic and potential energies do not have their standard units. This correspondence is shown below in table~\ref{T1}. \begin{table}[ht] \begin{center} \renewcommand{\arraystretch}{1.5} \begin{tabular}{||c | c | c||} \hline & Definitions in classical mechanics & Equivalent quantities in geometrical optics\\\hline Position & ${\bf r}(t)$ & ${\bf r}(a)$ \\\hline time & t & a \\\hline velocity & $\frac{d{\bf r}}{dt}\equiv{\bf{\dot r}}$ & $\frac{d{\bf r}}{da}\equiv{\bf r}'$ \\\hline potential energy& $U({\bf r})$ & $-\frac{n^2({\bf r})}{2}$ \\\hline mass & $m$ & $1$ \\\hline kinetic energy & $T=\frac{m}{2}\left|\frac{d{\bf r}}{dt}\right|^2$ & $\frac{1}{2}\left|\frac{d{\bf r}}{da}\right|^2$ \\\hline total energy & $\frac{m}{2}\left|\frac{d{\bf r}}{dt}\right|^2+U({\bf r})$ & $\frac{1}{2}\left|\frac{d{\bf r}}{da}\right|^2-\frac{n^2}{2}=0$\\\hline \end{tabular} \end{center} \caption{Mechanical view of optics}\label{T1} \end{table} From table~\ref{T1}, we find that the optical equivalent of potential energy is a quadratic function of refractive index and the equivalent of total energy (Hamiltonian) is 0. \subsection{Hamiltonian optics} A similar formulation of the problem is possible in terms of the optical Hamiltonian, expressed as a function of $(x, y, z)$, and their conjugate momenta $p_x$, $p_y$ and $p_z$. Here we take $b$ as a stepping parameter along the ray. Then, the expression for optical Lagrangian becomes: \begin{equation}\label{Eq7} L(x,y,z,x',y',z',b)=n(x,y,z)\sqrt{x'^2+y'^2+z'^2} \end{equation} -where $x'=\frac{dx}{db}$ etc. The conjugate momenta are defined as: \begin{align}\label{Eq8} p_x=\frac{\partial L}{\partial x'}=n\frac{x'}{\sqrt{x'^2+y'^2+z'^2}}=n\frac{dx}{ds}=n_x\nonumber\\ p_y=\frac{\partial L}{\partial y'}=n\frac{y'}{\sqrt{x'^2+y'^2+z'^2}}=n\frac{dy}{ds}=n_y\nonumber\\ p_z=\frac{\partial L}{\partial z'}=n\frac{z'}{\sqrt{x'^2+y'^2+z'^2}}=n\frac{dz}{ds}=n_z, \end{align} where $(n_x,n_y,n_z)$ denote the components of refractive index vector ${\bf n}=(n_x,n_y,n_z)$. The Hamiltonian, constructed by Legendre transformation, can be evaluated to be equal to zero\footnotemark[1]: \begin{equation}\label{Eq9} H(x,y,z,p_x,p_y,p_z,b)=x' p_x+y' p_y +z' p_z - L=0 \end{equation} \footnotetext[1]{We comment that if $z$ coordinate were taken as the independent variable, instead of $b$, then we would have the momenta $p_x$ and $p_y$, conjugate to the coordinates $x(z)$ and $y(z)$. In that case, Hamiltonian would be expressed as: $H=-\sqrt{n^2-p_x^2-p_y^2}$}. \subsubsection{Quantum description of light rays} From the ray view of light, one can make the transition to the quantum description of light by treating momenta by appropriate linear differential operators: $p_x\rightarrow\hat{p}_x\equiv{-i\frac {\lambda}{2\pi}\frac{\partial}{\partial x}}$ etc. These act upon wavefunctions $\psi$ that represent light rays via the eigenvalue equations: \begin{equation}\label{Eq9a} \hat{p}_x\psi=n_x\psi{\hspace{1.0cm}}\implies{\hspace{1.0cm}\hat{p}^2_x\psi=n_x^2\psi} \end{equation} Repeating this exercise for all three components, and summing up the squared equations, we find the reduced wave equation: \begin{equation}\label{Eq9b} {\mkern0.75mu\mathchar '26\mkern -9.75mu\lambda}^2\nabla^2\psi+n^2\psi=0 \end{equation} Quantum effect manifests in the limit ${\mkern0.75mu\mathchar '26\mkern -9.75mu\lambda}\not\rightarrow 0$, and geometrical optics emerges in the limit when ${\mkern0.75mu\mathchar '26\mkern -9.75mu\lambda} \rightarrow 0$. Gloge et al.~\cite{gloge1969formal} used $z$ as the stepping parameter to arrive at this equation. On the other hand, we chose $b$ as the stepping parameter to show the internal consistency with the formulation presented in `F=ma' optics. We note that the so-called `quantum' description of light rays is equivalent to the scalar wave description of light, usually taught at the undergraduate level as wave optics. \subsection{Scalar wave description} The electromagnetic theory asserts that light is a travelling transverse electromagnetic wave in which the electric field ${ \vec E}({\bf r},t)$ and the magnetic field ${\vec B}({\bf r},t)$ are coupled in the form of a pulse (see section 3.2 of~\cite{hecht1998hecht}). The spatio-temporal variation of the electric field in a region devoid of source electric charge and current can be expressed by the vector wave equation: \begin{equation}\label{Eq9c} \nabla^2{\vec E}-\frac{1}{v^2}\frac{\partial^2\vec{E}}{\partial t^2}=0, \end{equation} where $v$ denotes the speed of light in the medium of propagation. Each component of the electric field vector $E_i\equiv(E_x, E_y, E_z)$ denotes a pulse that satisfies the scalar wave equation: \begin{equation}\label{Eq9d} \nabla^2{E_i}-\frac{1}{v^2}\frac{\partial^2{E_i}}{\partial t^2}=0 \end{equation} If we assume that the electric pulse $E_i({\bf r},t)$ can be expressed as a product of spatial part $u(\bf r)$ and temporal part $T(t)$, then using the separation of the variables technique, we can deduce the differential equation for the spatial part of the light wave: \begin{equation}\label{Eq9e} \nabla^2 u({\bf r})+k^2u({\bf r})=0 \end{equation} -where $k$ is a constant representing the wavenumber. This equation is called the reduced wave equation or the Helmholtz equation. One can also express this equation in the form: \begin{equation}\label{Eq10} {\mkern0.75mu\mathchar '26\mkern -9.75mu\lambda}^2\nabla^2 u({\bf r})+n^2u({\bf r})=0, \end{equation} where $n$ represents the refractive index of the medium and ${\mkern0.75mu\mathchar '26\mkern -9.75mu\lambda}=\frac{\lambda}{2\pi}$ is the reduced wavelength of light waves in this medium. Clearly, Eq.\eqref{Eq9b} and Eq.\eqref{Eq10} are identical, and thus $\psi$ -representing a ray of light, and $u$ -representing a pulse of the electric field, must be intimately related. \section{Reduced wave equation as Schr$\rm{\ddot{o}}$dinger's equation}\label{ScWvEq} We note that Eq.\eqref{Eq9b} can also be expressed as: \begin{equation}\label{Eq11} -\frac{{\mkern0.75mu\mathchar '26\mkern -9.75mu\lambda}^2}{2\times 1}\nabla^2 \psi - \frac{n^2}{2} \psi = 0\cdot \psi \end{equation} Comparing Eq.\eqref{Eq11} with the generic form of the time independent Schr$\rm{\ddot{o}}$dinger's equation and with the terms in table~\ref{T1}, we observe that the optical equivalent of the Hamiltonian for light rays is $0$ and the optical equivalent of the potential energy is $-\frac{n^2}{2}$. Of course, the dimension of the Hamiltonian (in Eq.\eqref{Eq9}) is not of energy. Gloge et al.~\cite{gloge1969formal} (1969) could not identify Eq.\eqref{Eq10} as a Schr$\rm{\ddot{o}}$dinger's equation for the light rays\footnotemark[2], \footnotetext[2]{In fact, they derived an approximate form of Schr$\rm{\ddot{o}}$dinger's equation in the paraxial approximation where the wavefunctions are non-zero energy states.} since they could not identify the `mass term' for light rays as 1, `total energy' as $0$ and the `potential energy term' as $-\frac{n^2}{2}$, that were accomplished by the authors of `F=ma optics' in 1986. \subsection{Connection with Huygen's wavelets and phasors} The elementary eigensolutions\footnotemark[3] of Eq.\eqref{Eq9b} in a homogeneous medium are given by~\cite{torre2005linear} (a) plane waves $\left(e^{i{\bf k}\cdot{\bf r}}\right)$, and (b) spherical waves $\left(\frac{\lambda}{r}e^{i{\bf k}\cdot{\bf r}}\right)$, for $r>\lambda$. In a typical wave optics experiment taught in the undergraduate physics curriculum, \footnotetext[3]{One can construct the general travelling wave solutions of the wave equation~\eqref{Eq9d} by superposing the incoming and outgoing waves. In one and three dimensions, the general solution can be expressed as $E_x(x,t)=f(x+vt)+g(x-vt)$, and $E_r(r,t)=\frac{F}{r}(r+vt)+\frac{G}{r}(r-vt)$, respectively.} one shines an aperture (or a slit) of dimension $a$ with monochromatic light of wavelength $\lambda$, and a screen is placed on the opposite side, at a distance $L$ from the aperture, to observe possible diffraction patterns. Assuming that the monochromatic light incident on the aperture can be assumed to be plane waves, the Fresnel number of the optical setup can be defined as~\cite{hecht1998hecht}: \begin{equation} \mathcal{F}=\frac{1}{L}\left(\frac{a^2}{\lambda}\right) \end{equation} If the observation screen is close enough to the aperture, in a way such that $\mathcal F\gtrsim1$, then one is working in the near field limit. In this case, it is convenient to use the spherical wave basis to describe the near field diffraction. However, if it is far away, such that $\mathcal{F}<<1$, then one is working in the far field limit. In this limit, one can use the plane wave solution, as locally spherical wavefronts behave as plane waves. \begin{figure}[ht] \centering \hspace{-1.0 cm} \begin{subfigure}{.50\textwidth} \centering \captionsetup{justification=centering} \includegraphics[height=5.0 cm, width= 5.5 cm]{SphericalEnvelop.pdf} \caption{} \label{fig0a} \end{subfigure} \hspace{-1.0 cm} \begin{subfigure}{.15\textwidth} \centering \captionsetup{justification=centering} \includegraphics[height=5.5 cm, width= 3.0 cm]{PlaneEnvelop.pdf} \caption{} \label{fig0b} \end{subfigure} \hspace{0.5 cm} \begin{subfigure}{.35\textwidth} \centering \captionsetup{justification=centering} \includegraphics[height=3.0 cm, width= 5.0 cm]{FarField.pdf} \caption{} \label{fig0c} \end{subfigure} \caption{Propagation of (a) a spherical wave, and (b) a plane wave. The wavefronts at $t+\Delta t$ are envelops of spherical wavelets generated from the wavefronts at $t$. (c) In far the field limit, the spherical wavefronts locally behave as the plane waves. Mathematical functions of these envelops are solutions of Eq.\eqref{Eq9b}.} \label{fig0} \end{figure} These wavefronts may indeed be considered as the envelopes of Huygen's wavelets, generated from the wavefront at a previous step of light propagation. In the far field limit, these wavelets are just the plane waves and can be expressed as: $\psi =Ae^{i{\bf k}\cdot{\bf r}}$ where $A$ is a complex constant (the initial phase for the monochromatic wave is assumed to have been absorbed within $A$). As such, there is no problem with the complex wavefunction, but this cannot represent a real-valued pulse of the electric field. The electric field pulse can be written as $u=Re\left[Ae^{i{\bf k} \cdot{\bf r}}\right]$. These pulses are referred to as phasors, due to the phase contained in the exponent (note that ${\bf k} \cdot{\bf r}$ is a phase). This observation can also be taken as a justification for taking the electric field pulse $u$ of Eq.\eqref{Eq10} as a complex quantity, commonly practised to simplify calculations. The phasor addition of the waves is utilised in the derivation of the intensity patterns of many interference and diffraction experiments~\cite{halliday2010physics}. \subsection{Particle (or light ray) incident on potential barrier} \label{Sec3} The discussion in the previous section~\ref{ScWvEq} throws light on the scalar wave nature of the optical field. Specifically, we found that the zero energy wavefunctions of light rays satisfy Schr$\rm{\ddot o}$dinger's equation. Therefore, it might be possible to derive Snell's law of geometrical optics. To check this, we begin with the problem of a particle or a ray of light of energy $E$, in the region with potential $V_0$ at $x<0$, incident obliquely on a potential barrier $V_1$ at $x\ge0$\footnotemark[4]. We represent this particle (or ray of light) by the wavefunction $\psi$. In the context of geometrical optics, such a potential barrier arises due to the difference of the refractive indices of the two media, as shown in the following figure~\ref{fig1}. \footnotetext[4]{The energy and momentum of a ray of light are understood in the sense of table~\ref{T1}.} \begin{figure}[ht] \centering \begin{subfigure}{.45\textwidth} \centering \captionsetup{justification=centering} \includegraphics[height=5.0 cm, width= 7.5 cm]{Oblique1c.pdf} \caption{} \label{fig1a} \end{subfigure} \hspace{0.0 cm} \begin{subfigure}{.45\textwidth} \centering \captionsetup{justification=centering} \includegraphics[height=5.0 cm, width= 7.5 cm]{Oblique2c.pdf} \caption{} \label{fig1b} \end{subfigure} \caption{(a) Particle (or ray of light) of energy $E$ in the region with potential $V_0$ is incident on a different potential barrier $V_1$ obliquely at an angle $\theta_0$. We assume $E>V_0, V_1$.} \label{fig1} \end{figure} Due to the presence of the potential $V_0$ at $x<0$, the momentum of the particle (or a ray of light) represented by the wavefunction $\psi$ is: $k_0=\sqrt{\frac{2m(E-V_0 )}{\hbar^2}}$. At $x>0$, the momentum of the transmitted particle (or the light ray) is: $k_1=\sqrt{\frac{2m(E- V_1)}{\hbar^2}}$. The reflected component of the original wavefunction continues to be in the region of potential $V_0$, and has a momentum eigenvalue $k_0$ (with the sign of the $x$ component is reversed). \subsection{Understanding of reflection and refraction} Since $|{k_0}_x|$ and ${k_0}_y$ for the incident and reflected wavefunctions are the same, the angle of incidence must be equal to the angle of reflection. The translation invariance of the problem in the $Y$ direction demands: \begin{equation}\label{Eq12} {k_0}_y={k_1}_y\\ \implies k_0\sin\theta_0=k_1\sin\theta_1 \end{equation} Using the above expressions of momenta, we find: \begin{equation}\label{Eq13} \sqrt{E-V_0}\sin\theta_0=\sqrt{E-V_1}\sin\theta_1 \end{equation} At this point, we exploit the identifications made in the context of `F=ma Optics' and Eq.\eqref{Eq11}, that the total `energy' of the light rays is $0$, and the `potential energy' of light rays in a medium with refractive index $n$ is $-\frac{n^2}{2}$. Replacing these in Eq.\eqref{Eq13}, we find that it reduces to \begin{equation}\label{Eq14} n_0\sin\theta_0=n_1\sin\theta_1 \end{equation} which is Snell's law, established from the scalar wave description of light in a purely algebraic manner. Students who are unfamiliar with Hamiltonian optics, but have a basic idea of Schr$\rm{\ddot o}$dinger's equation, can fathom this derivation. \subsection{Estimation of coefficient of reflection}\label{REFL} From figure~\ref{fig1}, the total wavefunction at $x<0$ is given as: \begin{equation}\label{Eq15} \psi_0(x,y)=e^{i{k_0}_xx+i{k_0}_yy}+\includegraphics{scriptr} e^{-i{k_0}_xx+i{k_0}_yy} \end{equation} Where $\includegraphics{scriptr}$ denotes the amplitude of reflection back into the region of space with potential $V_0$. On the other hand, the wavefunction at $x>0$ can be written as: \begin{equation}\label{Eq16} \psi_1(x,y)=\mathcalligra{t}\, e^{i{k_1}_xx+i{k_1}_yy}=\mathcalligra{t}\, e^{i{k_1}_xx+i{k_0}_yy} \end{equation} -where $\mathcalligra{t}\,$ denotes the transmission amplitude and ${k_0}_y={k_1}_y$. The boundary conditions at $x=0$ are given by:\\ (a) $\psi_0(x=0)=\psi_1(x=0)$ and \\ (b) $\left(\frac{\partial\psi_0}{\partial x}\right)_{x=0}=\left(\frac{\partial\psi_1}{\partial x}\right)_{x=0}$.\\ The first condition yields: \begin{align}\label{Eq17} e^{i{k_0}_yy}+\includegraphics{scriptr}\cdot e^{i{k_0}_yy} &= \mathcalligra{t}\, e^{i{k_0}_yy}\nonumber\\ \implies1+\includegraphics{scriptr} &= \mathcalligra{t}\, \end{align} The second condition implies: \begin{align}\label{Eq18} i{k_0}_xe^{i{k_0}_yy}-\includegraphics{scriptr}\cdot i{k_0}_xe^{i{k_0}_yy} &= \mathcalligra{t}\, i{k_1}_xe^{i{k_0}_yy}\nonumber\\ \implies{{k_0}_x - \includegraphics{scriptr}\cdot{k_0}_x = \mathcalligra{t}\,{k_1}_x} \end{align} From Eq.\eqref{Eq17} and Eq.\eqref{Eq18}, we can show that the reflection coefficient ($R=||\includegraphics{scriptr}||^2$) can be expressed as: \begin{align}\label{Eq19} R = \left|\left|\frac{{k_0}_x-{k_1}_x}{{k_0}_x+{k_1}_x}\right|\right|^2 \end{align} In Eq.\eqref{Eq19}, ${k_0}_x=k_0\cos\theta_0=\sqrt{E-V}\cos \theta_0$ etc. Hence, \begin{align}\label{Eq20} R &= \left|\left|\frac{k_0\cos\theta_0 - k_1\cos\theta_1}{k_0\cos\theta_0 + k_1\cos\theta_1}\right|\right|^2 =\left|\left|\frac{\sqrt{E-V_0}\cos\theta_0 - \sqrt{E-V_1}\cos\theta_1}{\sqrt{E-V_0}\cos\theta_0 + \sqrt{E-V_1}\cos\theta_1}\right|\right|^2 \end{align} Let us now see the implication of this discussion in the context of geometrical optics. If we take $E=0$ and $V_j=-\frac{n_j^2}{2}$ in accordance with our understanding of refraction, the quantity $R$ can be written as: \begin{equation}\label{Eq21} R =\left|\left|\frac{n_0\cos\theta_0 - n_1\cos\theta_1} {n_0\cos\theta_0 + n_1\cos\theta_1}\right|\right|^2 =\left|\left|\frac{n_0\cos\theta_0 - \sqrt{n_1^2-n_0^2\sin^2\theta_0}}{n_0\cos\theta_0 + \sqrt{n_1^2-n_0^2\sin^2\theta_0}}\right|\right|^2 \end{equation} As expected, $R\rightarrow1$, when the incident angle $\theta_0\rightarrow90^o$, or if the condition for the total internal reflection $n_0\sin\theta_0= n_1$ is satisfied. We notice that Eq.\eqref{Eq21} is the same as Fresnel's equation of the coefficient of reflection for $s$-polarized light. The polarization of light in terms of electromagnetic theory is depicted in the following figure~\ref{fig2}. \begin{figure}[ht] \centering \begin{subfigure}{.45\textwidth} \centering \captionsetup{justification=centering} \includegraphics[height=5.5 cm, width= 8.0 cm]{sPolarizedLight.pdf} \caption{} \label{fig2a} \end{subfigure} \hspace{0.5 cm} \begin{subfigure}{.45\textwidth} \centering \captionsetup{justification=centering} \includegraphics[height=5.5 cm, width= 8.0 cm]{pPolarizedLight.pdf} \caption{} \label{fig2b} \end{subfigure} \caption{Description of polarization of light in the context of incidence of light rays at the interface between two media with refractive indices $n_0$ and $n_1$; (a) $s-$polarized light: Electric field perpendicular to the plane of incidence, and (b) $p-$polarized light: Electric field in the plane of incidence.} \label{fig2} \end{figure} This is expected, of course; but a curious student may wonder if there is a way to find the corresponding expression for $p$-polarized light. In fact, this formulation does not seem to lead to that expression. This must be the result of an incomplete description of the polarization of the light that is inherent in the ray picture. Gloge et al.~\cite{gloge1969formal} write ``we cannot expect that the total content of Maxwell's equations can be restored by our quantization concept, since the ray picture does not contain any information about the photon spin''. \section{Implication for physics pedagogy} Commonly, the physics curriculum at the undergraduate level does not have significant interdisciplinary elements. However, this approach often brings out useful pedagogical insights. In this paper, we showed this using an example of a very well-known concept of optics. Along this journey, we used preliminary concepts of analytical mechanics, quantum mechanics, physical optics, and the electromagnetic theory; and it was rewarding in identifying the connection between the classical and quantum description of the light rays; in finding the relation between the plane wave solutions of the reduced wave equation, and the phasors; and in deducing the reflection coefficient. Even the inability to derive the reflection coefficient for the $p$-polarized light was pedagogically insightful because the ray picture does not have the connotation of polarization of light. This exercise hints towards the notion that the different topics are connected within themselves in a unique way. It is hoped that this article will help in the instruction of physics. \bibliographystyle{unsrt}
73bd2b33fe688c643e2e23b5a20ff2cd68406b00
{ "file_path": "/home/ubuntu/dolma-v1_7/arxiv-0000.json.gz" }